Bitcoin Forum
May 03, 2024, 01:35:14 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [XMR] moneronjs.js nodejs rcp wallet library  (Read 1015 times)
netmonk (OP)
Full Member
***
Offline Offline

Activity: 219
Merit: 100


View Profile WWW
March 12, 2015, 05:28:18 PM
 #1

Hello everybody,

I started since few day to write a node.js library wich primary goal is to provide an npm package (once reached v1.0), to manage a Monero wallet through RPC command.

The official repository is available on github : https://github.com/netmonk/moneronjs

Here is some exemple of what is possible so far with this library :
Code:
==========================================================================
this is a wallet rpc interface test
{ ip: '127.0.0.1', port: '8082', openalias: '' }
==========================================================================
let's try to get a cyphered payment_id with value 0004567890,230999909,tototi
0daf93d7aa034c5eb3edf8a407cce862da97e31ec9ab9bf6e48e3d9d3f9a0cea
14261750172430004567890230999909
==========================================================================
let's try to decypher payment_id 0daf93d7aa034f56b0eefaa90ccce862da97e31ec9ab9bf6e48e3d9d3f9a0cea with password tototi
14261750172430004567890230999909
==========================================================================
let's try to get a random payment_id
result:  15e5d2659a6849996e9e1b90a1be987d9ec2b55060ead52e4a62e06d64c14f4e
==========================================================================
lets try to get the address of the wallet
9ymfWxswcc124mmQxhDZMcHhuK1dE4V5U9R4SGqtGh8PJFbYnzh49XDNvs66KzkGL3XRF4nUGi1QM3upi8FL9wCoQnWuvxS
==========================================================================
lets try to get balance of the wallet
total balance: 20989989259259260
unlocked balance: 20989989259259260
==========================================================================
let's try to get payment by id : d9ed4ef9e7d80f71f90d419152720177db3df9975f52a50f0172276224214b1b
{ payments:
   [ { amount: 500000000000000,
       block_height: 246826,
       payment_id: 'd9ed4ef9e7d80f71f90d419152720177db3df9975f52a50f0172276224214b1b',
       tx_hash: '525da69980018ce9fe29d3dd1ecfa2692bf7c8b709fc80e16515f7e123608517',
       unlock_time: 0 },
     { amount: 500000000000000,
       block_height: 246827,
       payment_id: 'd9ed4ef9e7d80f71f90d419152720177db3df9975f52a50f0172276224214b1b',
       tx_hash: '067fda5c9a095f2eabb20abc98f6c3886109559e2ae66030569516c95c23f36d',
       unlock_time: 0 } ] }
==========================================================================
Listing of TX Spend
{ transfers:
   [ { amount: 700000000000000,
       global_index: 47,
       spent: true,
       tx_hash: '<5f51c96daeebeaeb2bf0ab20ce546c627432d3e70bb0bbfa20c7ee7ea5735bb5>',
       tx_size: 23426 },
     { amount: 740740740,
       global_index: 20,
       spent: true,
       tx_hash: '<5d481fa6e12d65f9cd31f39f5f0c444406bfc38091d8d6631749b96a9280fffb>',
       tx_size: 18759 } ] }
==========================================================================
this is a wallet rpc interface test
{ ip: '127.0.0.1', port: '8082', openalias: '' }
==========================================================================
let's try to get a cyphered payment_id with value 0004567890,230999909,tototi
0daf93d7aa034c5eb3edf8a407cce862da97e31ec9ab9bf6e48e3d9d3f9a0cea
14261750172430004567890230999909
==========================================================================
let's try to decypher payment_id 0daf93d7aa034f56b0eefaa90ccce862da97e31ec9ab9bf6e48e3d9d3f9a0cea with password tototi
14261750172430004567890230999909
==========================================================================
let's try to get a random payment_id
result:  15e5d2659a6849996e9e1b90a1be987d9ec2b55060ead52e4a62e06d64c14f4e
==========================================================================
lets try to get the address of the wallet
9ymfWxswcc124mmQxhDZMcHhuK1dE4V5U9R4SGqtGh8PJFbYnzh49XDNvs66KzkGL3XRF4nUGi1QM3upi8FL9wCoQnWuvxS
==========================================================================
let's try to get payment by id : 0000000000000000000000000000000000000000000000000000000000000000
{ payments:
   [ { amount: 740740740740740,
       block_height: 242618,
       payment_id: '0000000000000000000000000000000000000000000000000000000000000000',
       tx_hash: '1bd812f9b7fdbb74d77556349ff94f8afa7c4133d15f661b1df0ff5f362d9ef9',
       unlock_time: 0 },
     { amount: 740740740740740,
       block_height: 242619,
       payment_id: '0000000000000000000000000000000000000000000000000000000000000000',
       tx_hash: '55d32f943bc8ba6cf7c5c7811b86639f51de574a46a72eb5f6795406cd440e7b',
       unlock_time: 0 },
     { amount: 740740740740740,
       block_height: 242620,
       payment_id: '0000000000000000000000000000000000000000000000000000000000000000',
       tx_hash: 'c1baea69c78eb4e3e251d7c7ef79db78dc0290b9e4e85ccc00c0cd97cd7f45d2',
       unlock_time: 0 },
     { amount: 740740740740740,
       block_height: 242621,
       payment_id: '0000000000000000000000000000000000000000000000000000000000000000',
       tx_hash: '229308aeb769e73b2f2e0c4722b4e859353d6dbfb5bdb362e6613da1905e4351',
       unlock_time: 0 },
     { amount: 740740740740760,
       block_height: 242622,
       payment_id: '0000000000000000000000000000000000000000000000000000000000000000',
       tx_hash: '1566dd59ec994c77d98071f93bb86b6c8606afaba9c071395b61718255815c6d',
       unlock_time: 0 },
     { amount: 740740740740740,
       block_height: 242623,
       payment_id: '0000000000000000000000000000000000000000000000000000000000000000',
       tx_hash: 'f99b9d721f4f74e5701ad4562822602c2afb27e1d8fc9a3089aaae9afa3c3c55',
       unlock_time: 0 },
     { amount: 740740740740740,
       block_height: 242624,
       payment_id: '0000000000000000000000000000000000000000000000000000000000000000',
       tx_hash: 'cf21a8cf895c2d9dc6e7f4826db04501e1492083f55dfcc045fc1cf5557bc9d4',
       unlock_time: 0 },
     { amount: 740740740740740,
       block_height: 242625,
       payment_id: '0000000000000000000000000000000000000000000000000000000000000000',
       tx_hash: '7ba7017782a0fa8b394eb19b4f426817955abacb4b66f27a4e61bfc52368db60',
       unlock_time: 0 },
     { amount: 740740740740740,
       block_height: 242626,
       payment_id: '0000000000000000000000000000000000000000000000000000000000000000',
       tx_hash: 'a1809dde5add1c2bfccb6537bfd162f11cdb0bb23428f8d62a20c84727149f95',
       unlock_time: 0 },
     { amount: 740740740740740,
       block_height: 242627,
       payment_id: '0000000000000000000000000000000000000000000000000000000000000000',
       tx_hash: '42f841e2ca8e437a2b15566aae8288e44f170e2711a86934c92a25f472569538',
       unlock_time: 0 },
     { amount: 740740740740740,
       block_height: 242628,
       payment_id: '0000000000000000000000000000000000000000000000000000000000000000',
       tx_hash: '5ec4f2ff7907bc04ba6130d00e50709cfd5d59209f553ce60c3135927e7d3c13',
       unlock_time: 0 },
     { amount: 740740740740740,
       block_height: 242629,
       payment_id: '0000000000000000000000000000000000000000000000000000000000000000',
       tx_hash: '193202710ceae4ed55e6111d6c99c9b88785a6c3585d04221a071408a2278275',
       unlock_time: 0 },
     { amount: 740740740740740,
       block_height: 242630,
       payment_id: '0000000000000000000000000000000000000000000000000000000000000000',
       tx_hash: '543d732ac3b229e2f679e4afadf63f3c26a5a702a634fb7deef675eb992ec469',
       unlock_time: 0 },
     { amount: 740740740740740,
       block_height: 242631,
       payment_id: '0000000000000000000000000000000000000000000000000000000000000000',
       tx_hash: 'b248ef5ca0d24e73a03cf5480b32fc908672bd8fb38cf7423132aa32b94eab65',
       unlock_time: 0 },
     { amount: 740740740740740,
       block_height: 242632,
       payment_id: '0000000000000000000000000000000000000000000000000000000000000000',
       tx_hash: '96c0af1acb2c7102fea4569eaedc792b837a36de1735119fdf0736dc1f8b7233',
       unlock_time: 0 },
     { amount: 740740740740740,
       block_height: 242633,
       payment_id: '0000000000000000000000000000000000000000000000000000000000000000',
       tx_hash: 'aa4ac0429d7339cb935c6224b77644cf91d98cac9a4d48a329fb0ae3b8b165fa',
       unlock_time: 0 },
     { amount: 740740740740740,
       block_height: 242634,
       payment_id: '0000000000000000000000000000000000000000000000000000000000000000',
       tx_hash: 'c3c133133cc97650799d94200049c5db714958fc2a296bc13476670afb10cc68',
       unlock_time: 0 },
     { amount: 740740740740740,
       block_height: 242635,
       payment_id: '0000000000000000000000000000000000000000000000000000000000000000',
       tx_hash: '8f5cb74a416b14fbf0b1e549810c555286720a0db53df0b58876b44ee4f1cba8',
       unlock_time: 0 },
     { amount: 740740740740740,
       block_height: 242636,
       payment_id: '0000000000000000000000000000000000000000000000000000000000000000',
       tx_hash: '8acf3d1a7ab51d853cd20b3debf1bebb437ee87109bb159eef2e2a6691006133',
       unlock_time: 0 },
     { amount: 740740740740740,
       block_height: 242637,
       payment_id: '0000000000000000000000000000000000000000000000000000000000000000',
       tx_hash: 'd290dcc8553f586a9a8e12465c5e580071da7e2ba5ba8410b9710bd1e00f426e',
       unlock_time: 0 },
     { amount: 740740740740740,
       block_height: 242638,
       payment_id: '0000000000000000000000000000000000000000000000000000000000000000',
       tx_hash: '5f51c96daeebeaeb2bf0ab20ce546c627432d3e70bb0bbfa20c7ee7ea5735bb5',
       unlock_time: 0 },
     { amount: 740740740740740,
       block_height: 242639,
       payment_id: '0000000000000000000000000000000000000000000000000000000000000000',
       tx_hash: '5d481fa6e12d65f9cd31f39f5f0c444406bfc38091d8d6631749b96a9280fffb',
       unlock_time: 0 },
     { amount: 740740740740740,
       block_height: 242640,
       payment_id: '0000000000000000000000000000000000000000000000000000000000000000',
       tx_hash: 'db4574fb81d6c33fa0ebd04123836d2ca6ab9516aff725fe038934e1bc3f7676',
       unlock_time: 0 },
     { amount: 740740740740740,
       block_height: 242641,
       payment_id: '0000000000000000000000000000000000000000000000000000000000000000',
       tx_hash: '506efbe5f6c2ea3da1c84a81444be0a347dcc4f4f9822515d7329bce14818c4b',
       unlock_time: 0 },
     { amount: 740740740740740,
       block_height: 242642,
       payment_id: '0000000000000000000000000000000000000000000000000000000000000000',
       tx_hash: 'c8ef591010a67e44c6effbb7aecfe253c1b3bd35a27e4f859ea44e78a2ab03c0',
       unlock_time: 0 },
     { amount: 740740740740740,
       block_height: 242643,
       payment_id: '0000000000000000000000000000000000000000000000000000000000000000',
       tx_hash: '55123fd423bc994f96412eaac4352b94cd4561134d8b034e4056756172d799f0',
       unlock_time: 0 },
     { amount: 740740740740740,
       block_height: 242644,
       payment_id: '0000000000000000000000000000000000000000000000000000000000000000',
       tx_hash: '4602addb1b4c1616964bc35be44c4196cecfd4473970d76efc25d5dc9669246c',
       unlock_time: 0 } ] }
==========================================================================
Listing of TX UnSpend
{ transfers:
   [ { amount: 740740740,
       global_index: 0,
       spent: false,
       tx_hash: '<1bd812f9b7fdbb74d77556349ff94f8afa7c4133d15f661b1df0ff5f362d9ef9>',
       tx_size: 17859 },
     { amount: 40000000000,
       global_index: 12707,
       spent: false,
       tx_hash: '<1bd812f9b7fdbb74d77556349ff94f8afa7c4133d15f661b1df0ff5f362d9ef9>',
       tx_size: 17859 },
     { amount: 700000000000,
       global_index: 20532,
       spent: false,
       tx_hash: '<1bd812f9b7fdbb74d77556349ff94f8afa7c4133d15f661b1df0ff5f362d9ef9>',
       tx_size: 17859 },
     { amount: 40000000000000,
       global_index: 45,
       spent: false,
       tx_hash: '<1bd812f9b7fdbb74d77556349ff94f8afa7c4133d15f661b1df0ff5f362d9ef9>',
       tx_size: 17859 },
     { amount: 700000000000000,
       global_index: 27,
       spent: false,
       tx_hash: '<1bd812f9b7fdbb74d77556349ff94f8afa7c4133d15f661b1df0ff5f362d9ef9>',
       tx_size: 17859 },
     { amount: 740740740,
       global_index: 1,
       spent: false,
       tx_hash: '<55d32f943bc8ba6cf7c5c7811b86639f51de574a46a72eb5f6795406cd440e7b>',
       tx_size: 19666 },
     { amount: 40000000000,
       global_index: 12708,
       spent: false,
       tx_hash: '<55d32f943bc8ba6cf7c5c7811b86639f51de574a46a72eb5f6795406cd440e7b>',
       tx_size: 19666 },
     { amount: 700000000000,
       global_index: 20533,
       spent: false,
       tx_hash: '<55d32f943bc8ba6cf7c5c7811b86639f51de574a46a72eb5f6795406cd440e7b>',
       tx_size: 19666 },
     { amount: 40000000000000,
       global_index: 46,
       spent: false,
       tx_hash: '<55d32f943bc8ba6cf7c5c7811b86639f51de574a46a72eb5f6795406cd440e7b>',
       tx_size: 19666 },
     { amount: 700000000000000,
       global_index: 28,
       spent: false,
       tx_hash: '<55d32f943bc8ba6cf7c5c7811b86639f51de574a46a72eb5f6795406cd440e7b>',
       tx_size: 19666 },
     { amount: 740740740,
       global_index: 2,
       spent: false,
       tx_hash: '<c1baea69c78eb4e3e251d7c7ef79db78dc0290b9e4e85ccc00c0cd97cd7f45d2>',
       tx_size: 19923 },
     { amount: 40000000000,
       global_index: 12710,
       spent: false,
       tx_hash: '<c1baea69c78eb4e3e251d7c7ef79db78dc0290b9e4e85ccc00c0cd97cd7f45d2>',
       tx_size: 19923 },
     { amount: 700000000000,
       global_index: 20534,
       spent: false,
       tx_hash: '<c1baea69c78eb4e3e251d7c7ef79db78dc0290b9e4e85ccc00c0cd97cd7f45d2>',
       tx_size: 19923 },
     { amount: 40000000000000,
       global_index: 47,
       spent: false,
       tx_hash: '<c1baea69c78eb4e3e251d7c7ef79db78dc0290b9e4e85ccc00c0cd97cd7f45d2>',
       tx_size: 19923 },
     { amount: 700000000000000,
       global_index: 29,
       spent: false,
       tx_hash: '<c1baea69c78eb4e3e251d7c7ef79db78dc0290b9e4e85ccc00c0cd97cd7f45d2>',
       tx_size: 19923 },
     { amount: 740740740,
       global_index: 3,
       spent: false,
       tx_hash: '<229308aeb769e73b2f2e0c4722b4e859353d6dbfb5bdb362e6613da1905e4351>',
       tx_size: 18762 },
     { amount: 40000000000,
       global_index: 12711,
       spent: false,
       tx_hash: '<229308aeb769e73b2f2e0c4722b4e859353d6dbfb5bdb362e6613da1905e4351>',
       tx_size: 18762 },
     { amount: 700000000000,
       global_index: 20535,
       spent: false,
       tx_hash: '<229308aeb769e73b2f2e0c4722b4e859353d6dbfb5bdb362e6613da1905e4351>',
       tx_size: 18762 },
     { amount: 40000000000000,
       global_index: 48,
       spent: false,
       tx_hash: '<229308aeb769e73b2f2e0c4722b4e859353d6dbfb5bdb362e6613da1905e4351>',
       tx_size: 18762 },
     { amount: 700000000000000,
       global_index: 30,
       spent: false,
       tx_hash: '<229308aeb769e73b2f2e0c4722b4e859353d6dbfb5bdb362e6613da1905e4351>',
       tx_size: 18762 },
     { amount: 740740760,
       global_index: 0,
       spent: false,
       tx_hash: '<1566dd59ec994c77d98071f93bb86b6c8606afaba9c071395b61718255815c6d>',
       tx_size: 19386 },
     { amount: 40000000000,
       global_index: 12712,
       spent: false,
       tx_hash: '<1566dd59ec994c77d98071f93bb86b6c8606afaba9c071395b61718255815c6d>',
       tx_size: 19386 },
     { amount: 700000000000,
       global_index: 20536,
       spent: false,
       tx_hash: '<1566dd59ec994c77d98071f93bb86b6c8606afaba9c071395b61718255815c6d>',
       tx_size: 19386 },
     { amount: 40000000000000,
       global_index: 49,
       spent: false,
       tx_hash: '<1566dd59ec994c77d98071f93bb86b6c8606afaba9c071395b61718255815c6d>',
       tx_size: 19386 },
     { amount: 700000000000000,
       global_index: 31,
       spent: false,
       tx_hash: '<1566dd59ec994c77d98071f93bb86b6c8606afaba9c071395b61718255815c6d>',
       tx_size: 19386 },
     { amount: 740740740,
       global_index: 4,
       spent: false,
       tx_hash: '<f99b9d721f4f74e5701ad4562822602c2afb27e1d8fc9a3089aaae9afa3c3c55>',
       tx_size: 20237 },
     { amount: 40000000000,
       global_index: 12713,
       spent: false,
       tx_hash: '<f99b9d721f4f74e5701ad4562822602c2afb27e1d8fc9a3089aaae9afa3c3c55>',
       tx_size: 20237 },
     { amount: 700000000000,
       global_index: 20538,
       spent: false,
       tx_hash: '<f99b9d721f4f74e5701ad4562822602c2afb27e1d8fc9a3089aaae9afa3c3c55>',
       tx_size: 20237 },
     { amount: 40000000000000,
       global_index: 50,
       spent: false,
       tx_hash: '<f99b9d721f4f74e5701ad4562822602c2afb27e1d8fc9a3089aaae9afa3c3c55>',
       tx_size: 20237 },
     { amount: 700000000000000,
       global_index: 32,
       spent: false,
       tx_hash: '<f99b9d721f4f74e5701ad4562822602c2afb27e1d8fc9a3089aaae9afa3c3c55>',
       tx_size: 20237 },
     { amount: 740740740,
       global_index: 5,
       spent: false,
       tx_hash: '<cf21a8cf895c2d9dc6e7f4826db04501e1492083f55dfcc045fc1cf5557bc9d4>',
       tx_size: 17803 },
     { amount: 40000000000,
       global_index: 12714,
       spent: false,
       tx_hash: '<cf21a8cf895c2d9dc6e7f4826db04501e1492083f55dfcc045fc1cf5557bc9d4>',
       tx_size: 17803 },
     { amount: 700000000000,
       global_index: 20539,
       spent: false,
       tx_hash: '<cf21a8cf895c2d9dc6e7f4826db04501e1492083f55dfcc045fc1cf5557bc9d4>',
       tx_size: 17803 },
     { amount: 40000000000000,
       global_index: 51,
       spent: false,
       tx_hash: '<cf21a8cf895c2d9dc6e7f4826db04501e1492083f55dfcc045fc1cf5557bc9d4>',
       tx_size: 17803 },
     { amount: 700000000000000,
       global_index: 33,
       spent: false,
       tx_hash: '<cf21a8cf895c2d9dc6e7f4826db04501e1492083f55dfcc045fc1cf5557bc9d4>',
       tx_size: 17803 },
     { amount: 740740740,
       global_index: 6,
       spent: false,
       tx_hash: '<7ba7017782a0fa8b394eb19b4f426817955abacb4b66f27a4e61bfc52368db60>',
       tx_size: 19395 },
     { amount: 40000000000,
       global_index: 12715,
       spent: false,
       tx_hash: '<7ba7017782a0fa8b394eb19b4f426817955abacb4b66f27a4e61bfc52368db60>',
       tx_size: 19395 },
     { amount: 700000000000,
       global_index: 20540,
       spent: false,
       tx_hash: '<7ba7017782a0fa8b394eb19b4f426817955abacb4b66f27a4e61bfc52368db60>',
       tx_size: 19395 },
     { amount: 40000000000000,
       global_index: 52,
       spent: false,
       tx_hash: '<7ba7017782a0fa8b394eb19b4f426817955abacb4b66f27a4e61bfc52368db60>',
       tx_size: 19395 },
     { amount: 700000000000000,
       global_index: 34,
       spent: false,
       tx_hash: '<7ba7017782a0fa8b394eb19b4f426817955abacb4b66f27a4e61bfc52368db60>',
       tx_size: 19395 },
     { amount: 740740740,
       global_index: 7,
       spent: false,
       tx_hash: '<a1809dde5add1c2bfccb6537bfd162f11cdb0bb23428f8d62a20c84727149f95>',
       tx_size: 18813 },
     { amount: 40000000000,
       global_index: 12716,
       spent: false,
       tx_hash: '<a1809dde5add1c2bfccb6537bfd162f11cdb0bb23428f8d62a20c84727149f95>',
       tx_size: 18813 },
     { amount: 700000000000,
       global_index: 20542,
       spent: false,
       tx_hash: '<a1809dde5add1c2bfccb6537bfd162f11cdb0bb23428f8d62a20c84727149f95>',
       tx_size: 18813 },
     { amount: 40000000000000,
       global_index: 53,
       spent: false,
       tx_hash: '<a1809dde5add1c2bfccb6537bfd162f11cdb0bb23428f8d62a20c84727149f95>',
       tx_size: 18813 },
     { amount: 700000000000000,
       global_index: 35,
       spent: false,
       tx_hash: '<a1809dde5add1c2bfccb6537bfd162f11cdb0bb23428f8d62a20c84727149f95>',
       tx_size: 18813 },
     { amount: 740740740,
       global_index: 8,
       spent: false,
       tx_hash: '<42f841e2ca8e437a2b15566aae8288e44f170e2711a86934c92a25f472569538>',
       tx_size: 18354 },
     { amount: 40000000000,
       global_index: 12717,
       spent: false,
       tx_hash: '<42f841e2ca8e437a2b15566aae8288e44f170e2711a86934c92a25f472569538>',
       tx_size: 18354 },
     { amount: 700000000000,
       global_index: 20543,
       spent: false,
       tx_hash: '<42f841e2ca8e437a2b15566aae8288e44f170e2711a86934c92a25f472569538>',
       tx_size: 18354 },
     { amount: 40000000000000,
       global_index: 54,
       spent: false,
       tx_hash: '<42f841e2ca8e437a2b15566aae8288e44f170e2711a86934c92a25f472569538>',
       tx_size: 18354 },
     { amount: 700000000000000,
       global_index: 36,
       spent: false,
       tx_hash: '<42f841e2ca8e437a2b15566aae8288e44f170e2711a86934c92a25f472569538>',
       tx_size: 18354 },
     { amount: 740740740,
       global_index: 9,
       spent: false,
       tx_hash: '<5ec4f2ff7907bc04ba6130d00e50709cfd5d59209f553ce60c3135927e7d3c13>',
       tx_size: 17796 },
     { amount: 40000000000,
       global_index: 12718,
       spent: false,
       tx_hash: '<5ec4f2ff7907bc04ba6130d00e50709cfd5d59209f553ce60c3135927e7d3c13>',
       tx_size: 17796 },
     { amount: 700000000000,
       global_index: 20544,
       spent: false,
       tx_hash: '<5ec4f2ff7907bc04ba6130d00e50709cfd5d59209f553ce60c3135927e7d3c13>',
       tx_size: 17796 },
     { amount: 40000000000000,
       global_index: 55,
       spent: false,
       tx_hash: '<5ec4f2ff7907bc04ba6130d00e50709cfd5d59209f553ce60c3135927e7d3c13>',
       tx_size: 17796 },
     { amount: 700000000000000,
       global_index: 37,
       spent: false,
       tx_hash: '<5ec4f2ff7907bc04ba6130d00e50709cfd5d59209f553ce60c3135927e7d3c13>',
       tx_size: 17796 },
     { amount: 740740740,
       global_index: 10,
       spent: false,
       tx_hash: '<193202710ceae4ed55e6111d6c99c9b88785a6c3585d04221a071408a2278275>',
       tx_size: 21046 },
     { amount: 40000000000,
       global_index: 12720,
       spent: false,
       tx_hash: '<193202710ceae4ed55e6111d6c99c9b88785a6c3585d04221a071408a2278275>',
       tx_size: 21046 },
     { amount: 700000000000,
       global_index: 20545,
       spent: false,
       tx_hash: '<193202710ceae4ed55e6111d6c99c9b88785a6c3585d04221a071408a2278275>',
       tx_size: 21046 },
     { amount: 40000000000000,
       global_index: 56,
       spent: false,
       tx_hash: '<193202710ceae4ed55e6111d6c99c9b88785a6c3585d04221a071408a2278275>',
       tx_size: 21046 },
     { amount: 700000000000000,
       global_index: 38,
       spent: false,
       tx_hash: '<193202710ceae4ed55e6111d6c99c9b88785a6c3585d04221a071408a2278275>',
       tx_size: 21046 },
     { amount: 740740740,
       global_index: 11,
       spent: false,
       tx_hash: '<543d732ac3b229e2f679e4afadf63f3c26a5a702a634fb7deef675eb992ec469>',
       tx_size: 18216 },
     { amount: 40000000000,
       global_index: 12721,
       spent: false,
       tx_hash: '<543d732ac3b229e2f679e4afadf63f3c26a5a702a634fb7deef675eb992ec469>',
       tx_size: 18216 },
     { amount: 700000000000,
       global_index: 20547,
       spent: false,
       tx_hash: '<543d732ac3b229e2f679e4afadf63f3c26a5a702a634fb7deef675eb992ec469>',
       tx_size: 18216 },
     { amount: 40000000000000,
       global_index: 57,
       spent: false,
       tx_hash: '<543d732ac3b229e2f679e4afadf63f3c26a5a702a634fb7deef675eb992ec469>',
       tx_size: 18216 },
     { amount: 700000000000000,
       global_index: 39,
       spent: false,
       tx_hash: '<543d732ac3b229e2f679e4afadf63f3c26a5a702a634fb7deef675eb992ec469>',
       tx_size: 18216 },
     { amount: 740740740,
       global_index: 12,
       spent: false,
       tx_hash: '<b248ef5ca0d24e73a03cf5480b32fc908672bd8fb38cf7423132aa32b94eab65>',
       tx_size: 19192 },
     { amount: 40000000000,
       global_index: 12722,
       spent: false,
       tx_hash: '<b248ef5ca0d24e73a03cf5480b32fc908672bd8fb38cf7423132aa32b94eab65>',
       tx_size: 19192 },
     { amount: 700000000000,
       global_index: 20548,
       spent: false,
       tx_hash: '<b248ef5ca0d24e73a03cf5480b32fc908672bd8fb38cf7423132aa32b94eab65>',
       tx_size: 19192 },
     { amount: 40000000000000,
       global_index: 58,
       spent: false,
       tx_hash: '<b248ef5ca0d24e73a03cf5480b32fc908672bd8fb38cf7423132aa32b94eab65>',
       tx_size: 19192 },
     { amount: 700000000000000,
       global_index: 40,
       spent: false,
       tx_hash: '<b248ef5ca0d24e73a03cf5480b32fc908672bd8fb38cf7423132aa32b94eab65>',
       tx_size: 19192 },
     { amount: 740740740,
       global_index: 13,
       spent: false,
       tx_hash: '<96c0af1acb2c7102fea4569eaedc792b837a36de1735119fdf0736dc1f8b7233>',
       tx_size: 20145 },
     { amount: 40000000000,
       global_index: 12723,
       spent: false,
       tx_hash: '<96c0af1acb2c7102fea4569eaedc792b837a36de1735119fdf0736dc1f8b7233>',
       tx_size: 20145 },
     { amount: 700000000000,
       global_index: 20549,
       spent: false,
       tx_hash: '<96c0af1acb2c7102fea4569eaedc792b837a36de1735119fdf0736dc1f8b7233>',
       tx_size: 20145 },
     { amount: 40000000000000,
       global_index: 59,
       spent: false,
       tx_hash: '<96c0af1acb2c7102fea4569eaedc792b837a36de1735119fdf0736dc1f8b7233>',
       tx_size: 20145 },
     { amount: 700000000000000,
       global_index: 41,
       spent: false,
       tx_hash: '<96c0af1acb2c7102fea4569eaedc792b837a36de1735119fdf0736dc1f8b7233>',
       tx_size: 20145 },
     { amount: 740740740,
       global_index: 14,
       spent: false,
       tx_hash: '<aa4ac0429d7339cb935c6224b77644cf91d98cac9a4d48a329fb0ae3b8b165fa>',
       tx_size: 19186 },
     { amount: 40000000000,
       global_index: 12725,
       spent: false,
       tx_hash: '<aa4ac0429d7339cb935c6224b77644cf91d98cac9a4d48a329fb0ae3b8b165fa>',
       tx_size: 19186 },
     { amount: 700000000000,
       global_index: 20550,
       spent: false,
       tx_hash: '<aa4ac0429d7339cb935c6224b77644cf91d98cac9a4d48a329fb0ae3b8b165fa>',
       tx_size: 19186 },
     { amount: 40000000000000,
       global_index: 60,
       spent: false,
       tx_hash: '<aa4ac0429d7339cb935c6224b77644cf91d98cac9a4d48a329fb0ae3b8b165fa>',
       tx_size: 19186 },
     { amount: 700000000000000,
       global_index: 42,
       spent: false,
       tx_hash: '<aa4ac0429d7339cb935c6224b77644cf91d98cac9a4d48a329fb0ae3b8b165fa>',
       tx_size: 19186 },
     { amount: 740740740,
       global_index: 15,
       spent: false,
       tx_hash: '<c3c133133cc97650799d94200049c5db714958fc2a296bc13476670afb10cc68>',
       tx_size: 19918 },
     { amount: 40000000000,
       global_index: 12726,
       spent: false,
       tx_hash: '<c3c133133cc97650799d94200049c5db714958fc2a296bc13476670afb10cc68>',
       tx_size: 19918 },
     { amount: 700000000000,
       global_index: 20551,
       spent: false,
       tx_hash: '<c3c133133cc97650799d94200049c5db714958fc2a296bc13476670afb10cc68>',
       tx_size: 19918 },
     { amount: 40000000000000,
       global_index: 61,
       spent: false,
       tx_hash: '<c3c133133cc97650799d94200049c5db714958fc2a296bc13476670afb10cc68>',
       tx_size: 19918 },
     { amount: 700000000000000,
       global_index: 43,
       spent: false,
       tx_hash: '<c3c133133cc97650799d94200049c5db714958fc2a296bc13476670afb10cc68>',
       tx_size: 19918 },
     { amount: 740740740,
       global_index: 16,
       spent: false,
       tx_hash: '<8f5cb74a416b14fbf0b1e549810c555286720a0db53df0b58876b44ee4f1cba8>',
       tx_size: 18965 },
     { amount: 40000000000,
       global_index: 12727,
       spent: false,
       tx_hash: '<8f5cb74a416b14fbf0b1e549810c555286720a0db53df0b58876b44ee4f1cba8>',
       tx_size: 18965 },
     { amount: 700000000000,
       global_index: 20552,
       spent: false,
       tx_hash: '<8f5cb74a416b14fbf0b1e549810c555286720a0db53df0b58876b44ee4f1cba8>',
       tx_size: 18965 },
     { amount: 40000000000000,
       global_index: 62,
       spent: false,
       tx_hash: '<8f5cb74a416b14fbf0b1e549810c555286720a0db53df0b58876b44ee4f1cba8>',
       tx_size: 18965 },
     { amount: 700000000000000,
       global_index: 44,
       spent: false,
       tx_hash: '<8f5cb74a416b14fbf0b1e549810c555286720a0db53df0b58876b44ee4f1cba8>',
       tx_size: 18965 },
     { amount: 740740740,
       global_index: 17,
       spent: false,
       tx_hash: '<8acf3d1a7ab51d853cd20b3debf1bebb437ee87109bb159eef2e2a6691006133>',
       tx_size: 19252 },
     { amount: 40000000000,
       global_index: 12728,
       spent: false,
       tx_hash: '<8acf3d1a7ab51d853cd20b3debf1bebb437ee87109bb159eef2e2a6691006133>',
       tx_size: 19252 },
     { amount: 700000000000,
       global_index: 20553,
       spent: false,
       tx_hash: '<8acf3d1a7ab51d853cd20b3debf1bebb437ee87109bb159eef2e2a6691006133>',
       tx_size: 19252 },
     { amount: 40000000000000,
       global_index: 63,
       spent: false,
       tx_hash: '<8acf3d1a7ab51d853cd20b3debf1bebb437ee87109bb159eef2e2a6691006133>',
       tx_size: 19252 },
     { amount: 700000000000000,
       global_index: 45,
       spent: false,
       tx_hash: '<8acf3d1a7ab51d853cd20b3debf1bebb437ee87109bb159eef2e2a6691006133>',
       tx_size: 19252 },
     { amount: 740740740,
       global_index: 18,
       spent: false,
       tx_hash: '<d290dcc8553f586a9a8e12465c5e580071da7e2ba5ba8410b9710bd1e00f426e>',
       tx_size: 17707 },
     { amount: 40000000000,
       global_index: 12729,
       spent: false,
       tx_hash: '<d290dcc8553f586a9a8e12465c5e580071da7e2ba5ba8410b9710bd1e00f426e>',
       tx_size: 17707 },
     { amount: 700000000000,
       global_index: 20554,
       spent: false,
       tx_hash: '<d290dcc8553f586a9a8e12465c5e580071da7e2ba5ba8410b9710bd1e00f426e>',
       tx_size: 17707 },
     { amount: 40000000000000,
       global_index: 64,
       spent: false,
       tx_hash: '<d290dcc8553f586a9a8e12465c5e580071da7e2ba5ba8410b9710bd1e00f426e>',
       tx_size: 17707 },
     { amount: 700000000000000,
       global_index: 46,
       spent: false,
       tx_hash: '<d290dcc8553f586a9a8e12465c5e580071da7e2ba5ba8410b9710bd1e00f426e>',
       tx_size: 17707 },
     { amount: 740740740,
       global_index: 19,
       spent: false,
       tx_hash: '<5f51c96daeebeaeb2bf0ab20ce546c627432d3e70bb0bbfa20c7ee7ea5735bb5>',
       tx_size: 23426 },
     { amount: 40000000000,
       global_index: 12730,
       spent: false,
       tx_hash: '<5f51c96daeebeaeb2bf0ab20ce546c627432d3e70bb0bbfa20c7ee7ea5735bb5>',
       tx_size: 23426 },
     { amount: 700000000000,
       global_index: 20556,
       spent: false,
       tx_hash: '<5f51c96daeebeaeb2bf0ab20ce546c627432d3e70bb0bbfa20c7ee7ea5735bb5>',
       tx_size: 23426 },
     { amount: 40000000000000,
       global_index: 65,
       spent: false,
       tx_hash: '<5f51c96daeebeaeb2bf0ab20ce546c627432d3e70bb0bbfa20c7ee7ea5735bb5>',
       tx_size: 23426 },
     { amount: 40000000000,
       global_index: 12731,
       spent: false,
       tx_hash: '<5d481fa6e12d65f9cd31f39f5f0c444406bfc38091d8d6631749b96a9280fffb>',
       tx_size: 18759 },
     { amount: 700000000000,
       global_index: 20557,
       spent: false,
       tx_hash: '<5d481fa6e12d65f9cd31f39f5f0c444406bfc38091d8d6631749b96a9280fffb>',
       tx_size: 18759 },
     { amount: 40000000000000,
       global_index: 66,
       spent: false,
       tx_hash: '<5d481fa6e12d65f9cd31f39f5f0c444406bfc38091d8d6631749b96a9280fffb>',
       tx_size: 18759 },
     { amount: 700000000000000,
       global_index: 48,
       spent: false,
       tx_hash: '<5d481fa6e12d65f9cd31f39f5f0c444406bfc38091d8d6631749b96a9280fffb>',
       tx_size: 18759 },
     { amount: 740740740,
       global_index: 21,
       spent: false,
       tx_hash: '<db4574fb81d6c33fa0ebd04123836d2ca6ab9516aff725fe038934e1bc3f7676>',
       tx_size: 16937 },
     { amount: 40000000000,
       global_index: 12732,
       spent: false,
       tx_hash: '<db4574fb81d6c33fa0ebd04123836d2ca6ab9516aff725fe038934e1bc3f7676>',
       tx_size: 16937 },
     { amount: 700000000000,
       global_index: 20558,
       spent: false,
       tx_hash: '<db4574fb81d6c33fa0ebd04123836d2ca6ab9516aff725fe038934e1bc3f7676>',
       tx_size: 16937 },
     { amount: 40000000000000,
       global_index: 67,
       spent: false,
       tx_hash: '<db4574fb81d6c33fa0ebd04123836d2ca6ab9516aff725fe038934e1bc3f7676>',
       tx_size: 16937 },
     { amount: 700000000000000,
       global_index: 49,
       spent: false,
       tx_hash: '<db4574fb81d6c33fa0ebd04123836d2ca6ab9516aff725fe038934e1bc3f7676>',
       tx_size: 16937 },
     { amount: 740740740,
       global_index: 22,
       spent: false,
       tx_hash: '<506efbe5f6c2ea3da1c84a81444be0a347dcc4f4f9822515d7329bce14818c4b>',
       tx_size: 19813 },
     { amount: 40000000000,
       global_index: 12733,
       spent: false,
       tx_hash: '<506efbe5f6c2ea3da1c84a81444be0a347dcc4f4f9822515d7329bce14818c4b>',
       tx_size: 19813 },
     { amount: 700000000000,
       global_index: 20559,
       spent: false,
       tx_hash: '<506efbe5f6c2ea3da1c84a81444be0a347dcc4f4f9822515d7329bce14818c4b>',
       tx_size: 19813 },
     { amount: 40000000000000,
       global_index: 68,
       spent: false,
       tx_hash: '<506efbe5f6c2ea3da1c84a81444be0a347dcc4f4f9822515d7329bce14818c4b>',
       tx_size: 19813 },
     { amount: 700000000000000,
       global_index: 50,
       spent: false,
       tx_hash: '<506efbe5f6c2ea3da1c84a81444be0a347dcc4f4f9822515d7329bce14818c4b>',
       tx_size: 19813 },
     { amount: 740740740,
       global_index: 23,
       spent: false,
       tx_hash: '<c8ef591010a67e44c6effbb7aecfe253c1b3bd35a27e4f859ea44e78a2ab03c0>',
       tx_size: 20011 },
     { amount: 40000000000,
       global_index: 12734,
       spent: false,
       tx_hash: '<c8ef591010a67e44c6effbb7aecfe253c1b3bd35a27e4f859ea44e78a2ab03c0>',
       tx_size: 20011 },
     { amount: 700000000000,
       global_index: 20560,
       spent: false,
       tx_hash: '<c8ef591010a67e44c6effbb7aecfe253c1b3bd35a27e4f859ea44e78a2ab03c0>',
       tx_size: 20011 },
     { amount: 40000000000000,
       global_index: 69,
       spent: false,
       tx_hash: '<c8ef591010a67e44c6effbb7aecfe253c1b3bd35a27e4f859ea44e78a2ab03c0>',
       tx_size: 20011 },
     { amount: 700000000000000,
       global_index: 51,
       spent: false,
       tx_hash: '<c8ef591010a67e44c6effbb7aecfe253c1b3bd35a27e4f859ea44e78a2ab03c0>',
       tx_size: 20011 },
     { amount: 740740740,
       global_index: 24,
       spent: false,
       tx_hash: '<55123fd423bc994f96412eaac4352b94cd4561134d8b034e4056756172d799f0>',
       tx_size: 18754 },
     { amount: 40000000000,
       global_index: 12735,
       spent: false,
       tx_hash: '<55123fd423bc994f96412eaac4352b94cd4561134d8b034e4056756172d799f0>',
       tx_size: 18754 },
     { amount: 700000000000,
       global_index: 20561,
       spent: false,
       tx_hash: '<55123fd423bc994f96412eaac4352b94cd4561134d8b034e4056756172d799f0>',
       tx_size: 18754 },
     { amount: 40000000000000,
       global_index: 70,
       spent: false,
       tx_hash: '<55123fd423bc994f96412eaac4352b94cd4561134d8b034e4056756172d799f0>',
       tx_size: 18754 },
     { amount: 700000000000000,
       global_index: 52,
       spent: false,
       tx_hash: '<55123fd423bc994f96412eaac4352b94cd4561134d8b034e4056756172d799f0>',
       tx_size: 18754 },
     { amount: 740740740,
       global_index: 25,
       spent: false,
       tx_hash: '<4602addb1b4c1616964bc35be44c4196cecfd4473970d76efc25d5dc9669246c>',
       tx_size: 19887 },
     { amount: 40000000000,
       global_index: 12736,
       spent: false,
       tx_hash: '<4602addb1b4c1616964bc35be44c4196cecfd4473970d76efc25d5dc9669246c>',
       tx_size: 19887 },
     { amount: 700000000000,
       global_index: 20562,
       spent: false,
       tx_hash: '<4602addb1b4c1616964bc35be44c4196cecfd4473970d76efc25d5dc9669246c>',
       tx_size: 19887 },
     { amount: 40000000000000,
       global_index: 71,
       spent: false,
       tx_hash: '<4602addb1b4c1616964bc35be44c4196cecfd4473970d76efc25d5dc9669246c>',
       tx_size: 19887 },
     { amount: 700000000000000,
       global_index: 53,
       spent: false,
       tx_hash: '<4602addb1b4c1616964bc35be44c4196cecfd4473970d76efc25d5dc9669246c>',
       tx_size: 19887 },
     { amount: 500000000000000,
       global_index: 8,
       spent: false,
       tx_hash: '<525da69980018ce9fe29d3dd1ecfa2692bf7c8b709fc80e16515f7e123608517>',
       tx_size: 13379 },
     { amount: 500000000000000,
       global_index: 9,
       spent: false,
       tx_hash: '<067fda5c9a095f2eabb20abc98f6c3886109559e2ae66030569516c95c23f36d>',
       tx_size: 12321 },
     { amount: 90000000000,
       global_index: 15017,
       spent: false,
       tx_hash: '<34166560ab1f136e74c2e51f565984cb54c445abb6d5d2e9e13209dbda3a3d08>',
       tx_size: 523 },
     { amount: 900000000000,
       global_index: 28014,
       spent: false,
       tx_hash: '<34166560ab1f136e74c2e51f565984cb54c445abb6d5d2e9e13209dbda3a3d08>',
       tx_size: 523 },
     { amount: 9000000000000,
       global_index: 180,
       spent: false,
       tx_hash: '<34166560ab1f136e74c2e51f565984cb54c445abb6d5d2e9e13209dbda3a3d08>',
       tx_size: 523 },
     { amount: 80000000000000,
       global_index: 20,
       spent: false,
       tx_hash: '<34166560ab1f136e74c2e51f565984cb54c445abb6d5d2e9e13209dbda3a3d08>',
       tx_size: 523 },
     { amount: 600000000000000,
       global_index: 13,
       spent: false,
       tx_hash: '<34166560ab1f136e74c2e51f565984cb54c445abb6d5d2e9e13209dbda3a3d08>',
       tx_size: 523 } ] }
==========================================================================
lets try to get balance of the wallet
total balance: 20989989259259260
unlocked balance: 20989989259259260
==========================================================================
let's try to get payment by id : d9ed4ef9e7d80f71f90d419152720177db3df9975f52a50f0172276224214b1b
{ payments:
   [ { amount: 500000000000000,
       block_height: 246826,
       payment_id: 'd9ed4ef9e7d80f71f90d419152720177db3df9975f52a50f0172276224214b1b',
       tx_hash: '525da69980018ce9fe29d3dd1ecfa2692bf7c8b709fc80e16515f7e123608517',
       unlock_time: 0 },
     { amount: 500000000000000,
       block_height: 246827,
       payment_id: 'd9ed4ef9e7d80f71f90d419152720177db3df9975f52a50f0172276224214b1b',
       tx_hash: '067fda5c9a095f2eabb20abc98f6c3886109559e2ae66030569516c95c23f36d',
       unlock_time: 0 } ] }
==========================================================================
Listing of TX Spend
{ transfers:
   [ { amount: 700000000000000,
       global_index: 47,
       spent: true,
       tx_hash: '<5f51c96daeebeaeb2bf0ab20ce546c627432d3e70bb0bbfa20c7ee7ea5735bb5>',
       tx_size: 23426 },
     { amount: 740740740,
       global_index: 20,
       spent: true,
       tx_hash: '<5d481fa6e12d65f9cd31f39f5f0c444406bfc38091d8d6631749b96a9280fffb>',
       tx_size: 18759 } ] }
==========================================================================
Listing of TX UnSpend
{ transfers:
   [ { amount: 740740740,
       global_index: 0,
       spent: false,
       tx_hash: '<1bd812f9b7fdbb74d77556349ff94f8afa7c4133d15f661b1df0ff5f362d9ef9>',
       tx_size: 17859 },
...

Any fix/improvement/comment are very welcome. Smiley
1714743314
Hero Member
*
Offline Offline

Posts: 1714743314

View Profile Personal Message (Offline)

Ignore
1714743314
Reply with quote  #2

1714743314
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714743314
Hero Member
*
Offline Offline

Posts: 1714743314

View Profile Personal Message (Offline)

Ignore
1714743314
Reply with quote  #2

1714743314
Report to moderator
1714743314
Hero Member
*
Offline Offline

Posts: 1714743314

View Profile Personal Message (Offline)

Ignore
1714743314
Reply with quote  #2

1714743314
Report to moderator
netmonk (OP)
Full Member
***
Offline Offline

Activity: 219
Merit: 100


View Profile WWW
March 12, 2015, 08:16:07 PM
 #2

And you also can explain us why you don't post this in the XMR main forum or thread ?

Marketing maybe ?

If moderator thinks it's the wrong place to post, they would move it to a more appropriate place.

thank you for your interesting feedback.
netmonk (OP)
Full Member
***
Offline Offline

Activity: 219
Merit: 100


View Profile WWW
March 12, 2015, 08:24:51 PM
 #3

I doubt that, because it is Monero XMR a Bitcoin partnership coin with known bitcoin supporters

So you will frustrated, which is not good on the long term.
I suggest you to have a walk and take advantage of the fresh air from outside !
Also having a sunbath can help you feeling better!

Cheers!

Btw: any comment/commit/suggestion are very welcome about this little piece of code !
netmonk (OP)
Full Member
***
Offline Offline

Activity: 219
Merit: 100


View Profile WWW
March 12, 2015, 08:45:37 PM
 #4

You are too suspicious dude, if you read my post history, you will now im involved in monero since almost begining, running a pool (which i closed last week) and supporting this currency since then.

So now that i have more time for myself (finished my mission to my last customer few weeks ago) i have time to dedicate to coding.

I decided to learn nodejs and to write something usefull to community.

So you see im not in any kind of war, fud, whatever suspicious mind can imagine, but simply trying to share work and knowledge.

Also this kind of project is improving faster with the help of community, feedbacking and participating to code.

So please excuse me, but the more i reply to you, the more you keep me away from this primary goal of my post.

EOT for you, unless you have code to share
onemorexmr
Sr. Member
****
Offline Offline

Activity: 252
Merit: 250



View Profile
March 12, 2015, 08:52:39 PM
 #5

thank you very much for this.
i'll definitely use this... checking it out atm

edit: what do you think about camelCase and jslint compliance? i could do it if you like

XMR || Monero || monerodice.net || xmr.to || mymonero.com || openalias.org || you think bitcoin is fungible? watch this
netmonk (OP)
Full Member
***
Offline Offline

Activity: 219
Merit: 100


View Profile WWW
March 12, 2015, 08:55:52 PM
 #6

thank you very much for this.
i'll definitely use this... checking it out atm

edit: what do you think about camelCase and jslint compliance? i could do it if you like

The next step is outgoing transfer ! may be next week, and i would like to implement a queue/worker architecture to validate incoming transfer.

So this way it will be fully ready to use in nodejs for accepting payment.

Bonus, i will study the qr code generation but there is no wallet accepting it currently.

edit1:
For camelcase, no problem (dont forget to update the doc and test.js also)
For jslint compliant, im not that fluent in JS, so up to you, i would be glad to learn by reading your commit Smiley
edit2:
Setup a testnet environment. If you need some coins on testnet, provide me an address here and i will send some Smiley
darlidada
Hero Member
*****
Offline Offline

Activity: 723
Merit: 503


View Profile
March 12, 2015, 08:58:50 PM
 #7

@netmonk, can you explain what it does? i'm sure there are plenty of people illiterate at programming that dont even understand what this is
onemorexmr
Sr. Member
****
Offline Offline

Activity: 252
Merit: 250



View Profile
March 12, 2015, 08:59:29 PM
 #8

thank you very much for this.
i'll definitely use this... checking it out atm

edit: what do you think about camelCase and jslint compliance? i could do it if you like

The next step is outgoing transfer ! may be next week, and i would like to implement a queue/worker architecture to validate incoming transfer.

So this way it will be fully ready to use in nodejs for accepting payment.

Bonus, i will study the qr code generation but there is no wallet accepting it currently.

here is a (VERY) simple example of an outgoing transfer..
https://github.com/flower1024/monero-faucet/blob/master/www.js

though i used curl instead of a direct httprequest (yours is better Wink )

but still: would you accept a commit from me which makes it jslint compatible (mainly adding spaces and such)?

XMR || Monero || monerodice.net || xmr.to || mymonero.com || openalias.org || you think bitcoin is fungible? watch this
netmonk (OP)
Full Member
***
Offline Offline

Activity: 219
Merit: 100


View Profile WWW
March 12, 2015, 09:03:07 PM
 #9

thank you very much for this.
i'll definitely use this... checking it out atm

edit: what do you think about camelCase and jslint compliance? i could do it if you like

The next step is outgoing transfer ! may be next week, and i would like to implement a queue/worker architecture to validate incoming transfer.

So this way it will be fully ready to use in nodejs for accepting payment.

Bonus, i will study the qr code generation but there is no wallet accepting it currently.

here is a (VERY) simple example of an outgoing transfer..
https://github.com/flower1024/monero-faucet/blob/master/www.js

though i used curl instead of a direct httprequest (yours is better Wink )

but still: would you accept a commit from me which makes it jslint compatible (mainly adding spaces and such)?

You know the process : fork and pull request ! (i will accept it Smiley
I will have a look to the www.js code
netmonk (OP)
Full Member
***
Offline Offline

Activity: 219
Merit: 100


View Profile WWW
March 12, 2015, 09:17:33 PM
 #10

@netmonk, can you explain what it does? i'm sure there are plenty of people illiterate at programming that dont even understand what this is


Of course i can.

Simplewallet has two mode of working :
- console interface in which user can interact through typing command.
- an RPC (Remote Process Communication) mode based on json command which can be used by third party software to interact with the simplewallet (all operation available).

So there are a few available commands like :
- getbalance ( get the balance of the wallet);
- getaddress (get the address of the wallet);
- transfer (which transfer a specified amount to a specified address)
and so on.

So this package is a library written in nodejs (javascript) providing a wallet object, and several methods which can be easily used in more general nodejs project.
The aim of this library is also to provide a complete payment acceptance system for merchant website using nodejs as backend.

One of the feature i liked to developped is the cyphered payment_id.
In Monero it is impossible to know from whom the transaction is coming without a payment_id which must be communicated between senders and receiver.

A payment_id is a 64 hexadecimal character strings which can be generated by the library either randomly without any embeded information, or being the result of a cyphering using AES-256-CTR with a password of a 32characters clear text.
I decided to implement a method which take as arguments :
- a UserId commonly a digit (10digits long)
- an amount (9 digits long like 25659 for 256.59, automatically zerofilled at generation)
and given that it will produce a 32 char string including a unix timestamp.

I just realise it's totally useless feature, but it was fun to do Smiley
Pages: [1]
  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!