ton.js
v0.1.37
Published
TON Lite client implementation in Node.js (using libtonlibjson)
Downloads
25
Readme
TypeScript wrapper of native libtonlibjson library. [indev]
import { TONClient, TONAddress } from './index';
let client = new TONClient();
client.on('connect', async function () {
let account = await client.getAccount("EQCMVuNax7q7hhDmaoRqaQpPjELKXasf8CG6NUbhxAFgDr8Y");
let transactions = await client.getTransactions(account.address, account.lastTransaction);
let seqno = await client.runMethod(account.address, "seqno");
});
client.getAccount("EQCMVuNax7q7hhDmaoRqaQpPjELKXasf8CG6NUbhxAFgDr8Y")
{
address: TONAddress {
bounceable: false,
testnet: true,
workchain: 0,
address: <Buffer@0x10380bb2a 8c 56 e3 5a c7 ba bb 86 10 e6 6a 84 6a 69 0a 4f 8c 42 ca 5d ab 1f f0 21 ba 35 46 e1 c4 01 60 0e>
},
balance: 41972983244,
code: Cell {
special: false,
index: 768,
len: 768,
data: <Buffer@0x10380bbc8 ff 00 20 dd 20 82 01 4c 97 ba 97 30 ed 44 d0 d7 0b 1f e0 a4 f2 60 83 08 d7 18 20 d3 1f d3 1f d3 1f f8 23 13 bb f2 63 ed 44 d0 d3 1f d3 1f d3 ff d1 51 ... >,
refs: []
},
data: Cell {
special: false,
index: 320,
len: 320,
data: <Buffer@0x10380bc88 00 00 00 31 29 a9 a3 17 a5 8c c3 4e 6f 98 91 61 15 c6 f4 0f 62 e4 b7 8e cc b5 1f da 18 81 fc 8a de 38 f7 fa 84 a5 48 f1 00 00 00 00 00 00 00 00 00 00 ... >,
refs: []
},
lastTransaction: {
lt: 3283354000003,
hash: <Buffer@0x10380bd08 15 d2 d1 d2 cd f5 69 3c 6a c1 64 7d 77 bf bd 4a 67 ee 7a b5 b9 eb a1 cb 6b e2 83 ed a3 4a 07 ca>
},
block: {
workchain: -1,
shard: '-9223372036854775808',
seqno: 2450354,
root_hash: <Buffer@0x10380bd28 21 e9 bf 89 f5 7b 54 b4 ba b1 c5 36 ec db bd 51 97 38 71 b9 49 9e d4 d9 12 81 39 00 4b 68 38 18>,
file_hash: <Buffer@0x10380bd48 92 9b 2c 18 89 d8 34 44 7c e0 a6 02 9f 70 7d 60 aa 58 b5 50 63 bd dc 36 68 ab 07 61 ac 3a a9 18>
},
sync: 2020-02-26T20:33:00.000Z
}
import { Cell } from './boc';
let data = Buffer.from(`b5ee9c724102...14d3e`, 'hex');
console.log(Cell.deserialize(data).toString());
x[292]{6010c8c3e4dc10d1165af7c6d5a552d5455a1ee784f5080b7640440daed9df5c00000001c_}
x[80]{4c6f636174696f6e3a20}
x[4]{2_}
x[4]{2_}
x[68]{beb9dcc702ad29ebb_}
x[1016]{626f64792c2068746d6c2c2068656164207b0a202020206261636b67726f756e643a20234641464146413b0a202020206d617267696e3a20303b0a2020202070616464696e673a20303b0a20202020666f6e742d66616d696c793a2027496e746572272c2027526f626f746f272c20275365676f65205549272c2073616e73}
x[1016]{2d73657269663b0a7d0a0a626f6479203e20646976207b0a2020202077696474683a203930253b0a202020206d61782d77696474683a2038303070783b0a202020206d617267696e3a2030206175746f3b0a2020202070616464696e673a20322520303b0a7d0a0a2e6465736d6f73207b0a2020202077696474683a203130}
x[824]{30253b0a7d0a0a68312c2068322c2070207b0a202020206d617267696e3a2034707820303b0a7d0a0a7370616e2e636f6465207b0a20202020666f6e742d66616d696c793a206d6f6e6f73706163653b0a20202020666f6e742d73697a653a20313235253b0a7d}
x[156]{be5f12ef5fadb1acc65ed2dcc8caf05cd0e8dad_}
x[72]{bf39fa6f645c0ecf0a}
x[1016]{3c21444f43545950452068746d6c3e0a3c68746d6c3e0a0a3c686561643e0a202020203c6d65746120636861727365743d227574662d38223e0a202020203c6d657461206e616d653d2276696577706f72742220636f6e74656e743d2277696474683d6465766963652d77696474682c20696e697469616c2d7363616c653d}
x[1016]{31223e0a202020203c7469746c653e746f6e7765622e736974653c2f7469746c653e0a202020203c6c696e6b2072656c3d227374796c6573686565742220747970653d22746578742f6373732220687265663d2268747470733a2f2f72736d732e6d652f696e7465722f696e7465722e637373223e0a202020203c6c696e6b}
x[1016]{2072656c3d227374796c6573686565742220747970653d22746578742f6373732220687265663d226d61696e2e637373223e0a3c2f686561643e0a0a3c626f64793e0a202020203c6469763e0a20202020202020203c68313e544f4e205765623c2f68313e3c693e4d616465206279203c6120687265663d2268747470733a}
x[1016]{2f2f742e6d652f646b617261757368223e40646b6172617573683c2f613e2c207370656369616c20666f72203c6120687265663d2268747470733a2f2f742e6d652f636f6e746573742f313339223e326e64207374616765206f6620626c6f636b636861696e20636f6e746573743c2f613e2e3c2f693e0a20202020202020}
x[1016]{203c62723e0a20202020202020203c62723e0a20202020202020203c703e54686973203c6120687265663d2268747470733a2f2f746f6e7765622e736974652f223e776562736974653c2f613e206973206120706f7274616c20746f20544f4e2057656221204e6f726d616c6c792c2069742073686f756c64206265206120}
x[1016]{6e65772062726f777365722028617320544f522042726f77736572292c2077686963682077696c6c2073656e64207265717565737473206469726563746c7920746f2074686520544f4e2c206275742c206f6276696f75736c7920746f207361792c207468617420697420697320717569746520696d706f737369626c6520}
x[1016]{28616e642073656e73656c6573732920746f206d616b6520697420696e2074776f207765656b732e3c2f703e0a20202020202020203c703e5468697320544f4e20576562206973206d7920766973696f6e20686f772063616e20696e7465726e6574206c6f6f6b206c696b6520696e20626c6f636b636861696e2e3c2f703e}
x[1016]{0a20202020202020203c62723e0a20202020202020203c68323e5768793f3c2f68323e0a20202020202020203c703e3c623e4265636175736520492063616e213c2f623e3c2f703e0a20202020202020203c703e57656c6c2c206261736963616c6c792c2049206a7573742074686f756768743a2077686174206966204920}
x[1016]{73686f756c646e27742070617920746f2063656e7472616c697a656420686f73742073657276657220746f2068617665206f776e207765627369746520616e642074727920746f2075706c6f616420776562736974657320746f2074686520544f4e2e2049206861766520666163656420736f6d65206c696d69746174696f}
x[1016]{6e732c20746865206d61696e206f66207468656d2069732065787465726e616c206d6573736167652073697a65206c696d6974202836344b42292c207768656e20492077616e74656420746f2073656e6420746f6f20687567652066696c65732e3c2f703e0a20202020202020203c703e49206b6e6f772c20746861742069}
x[1016]{7420697320626520612073747570696420696465612c20616e642069742069732073656e73656c65737320746f20226d616b65206f776e2046616365626f6f6b20696e20626c6f636b636861696e222e20486f77657665722c20776879206e6f743f203a443c2f703e0a20202020202020203c62723e0a2020202020202020}
x[1016]{3c68323e486f7720646f6573207468617420776f726b3f3c2f68323e0a20202020202020203c703e4261736963616c6c792c207765627369746520696e20544f4e20576562206973206120736d6172742d636f6e74726163742c207468617420686173206275696c74207769746820737570706f7274206f66203c61206872}
x[1016]{65663d22237374616e64617264223e6d79207374616e646172643c2f613e2e20446576656c6f70657273206172652077656c636f6d6520746f206d616b65206f776e20696d706c656d656e746174696f6e73206f66207765627369746520736d6172742d636f6e74726163742e3c2f703e0a20202020202020203c703e496e}
x[1016]{206d7920696d706c656d656e746174696f6e2c20757365722073686f756c642067656e65726174652066696c6573797374656d2066696c652028226261672d6f662d63656c6c73222066696c65732c20636f6e7461696e696e67207765627369746520636f6e74656e74292e3c2f703e0a20202020202020203c703e416674}
x[1016]{657220746861742c20796f752077696c6c2073656520616e2061646472657373206f6620796f75722066757475726520776562736974652e2053656e64204772616d7320746f2074686973206164647265737320616e642073656e642065787465726e616c206d65737361676520746f2074686520544f4e2e3c2f703e0a20}
x[1016]{202020202020203c703e5468656e20796f752063616e207769746e65737320796f757220776562736974652061742068747470733a2f2f746f6e7765622e736974652f266c743b616464726573732667743b3c2f703e0a20202020202020203c62723e0a20202020202020203c68312069643d227374616e64617264223e54}
x[1016]{4f4e20576562205374616e646172643c2f68313e0a20202020202020203c703e3c693e492077696c6c207265706561743a207468697320697320756e6f6666696369616c207374616e646172642c206d616465206279206d7973656c66207370656369616c6c7920666f7220636f6e746573743c2f693e3c2f703e0a202020}
x[1016]{20202020203c703e54686973207374616e6461726420646573637269626573206f6e6c7920617070656172616e6365206f6620726571756573747320616e6420726573706f6e736573206f66206765742d6d6574686f64732e20576865726520616e6420686f7720746f2073746f7265207765627369746520636f6e74656e}
x[1016]{7420697320757020746f20736d6172742d636f6e747261637420646576656c6f7065722e3c2f703e0a20202020202020203c703e536f2c20746f207265717565737420474554206d6574686f642028504f535420616e64206f7468657273206172656e27742063757272656e746c7920737570706f72746564292066726f6d}
x[1016]{206365727461696e20544f4e2057656220736974652c20796f752073686f756c6420646f776e6c6f616420616c6c2069747320636f646520616e6420646174612e20416e642072756e2054564d2077697468206365727461696e20706172616d65746572732e2028696e206c6974652d636c69656e7420796f752063616e20}
x[1016]{646f207468617420717569636b6c7920627920646f696e67206072756e6d6574686f6420266c743b616464726573732667743b202e2e2e706172616d65746572732e2e2e60293c2f703e0a20202020202020203c703e546861742773207768792c20696620796f752068617665206d756c7469706c6520706167657320696e}
x[1016]{20796f757220776562736974652c2069742069732062657474657220746f2073746f7265207468656d20617420646966666572656e7420636f6e7472616374732c206265636175736520757365722073686f756c6420646f776e6c6f616420616c6c20796f757220646174612c20646573706974652077686963682066696c}
x[1016]{652068652f7368652077616e74732e3c2f703e0a20202020202020203c62723e0a20202020202020203c703e546f206e6f7420636f6e667573652c2074686973207374616e646172642069732073696d696c617220746f20776861742048545450206c6f6f6b73206c696b65206e6f773a3c2f703e0a20202020202020203c}
x[1016]{703e5265717565737420617070656172616e63653a3c2f703e0a20202020202020203c703e3c7370616e20636c6173733d27636f6465273e72756e6d6574686f6420266c743b616464726573732667743b2067657420222f223c2f7370616e3e20e2809420474554202f3c2f703e0a20202020202020203c703e3c7370616e}
x[1016]{20636c6173733d27636f6465273e72756e6d6574686f6420266c743b616464726573732667743b2067657420222f696e6465782e68746d6c223c2f7370616e3e20e2809420474554202f696e6465782e68746d6c3c2f703e0a20202020202020203c703e4e6f726d616c6c792c2074686520726f6f7420697320222f222c20}
x[1016]{736f20696620796f75206861766520696e6465782e68746d6c2066696c652c20646f206e6f7420666f7267657420746f2061646420726564697265637420746f2069742066726f6d2074686520726f6f742e3c2f703e0a20202020202020203c62723e0a20202020202020203c703e526573706f6e73652061707065617261}
x[1016]{6e63653a3c2f703e0a20202020202020203c703e3c7370616e20636c6173733d27636f6465273e5b2032303020286e756c6c292043537b2e2e2e7d205d3c2f7370616e3e20e28094207475706c652077697468203320656c656d656e74733a2073746174757320636f64652c20686561646572732c20636f6e74656e743c2f}
x[1016]{703e0a20202020202020203c703e3c7370616e20636c6173733d27636f6465273e5b203330312043537b2e2e2e7d20286e756c6c29205d3c2f7370616e3e20e2809420697420636f756c64206265206120726564697265637420283330312073746174757320636f646529202864657374696e6174696f6e2073686f756c64}
x[1016]{206265207772697474656e20696e20686561646572732c20666f72206578616d706c652c20224c6f636174696f6e3a202f22293c2f703e0a20202020202020203c703e3c7370616e20636c6173733d27636f6465273e5b203230302043537b2e2e2e7d205d3c2f7370616e3e20e28094207475706c65207769746820322065}
x[1016]{6c656d656e74733a2073746174757320636f64652c20636f6e74656e743c2f703e0a20202020202020203c703e3c7370616e20636c6173733d27636f6465273e5b2034303420286e756c6c29205d3c2f7370616e3e20e28094206f6f70732c2066696c65206e6f7420666f756e64213c2f703e0a20202020202020203c703e}
x[1016]{3c7370616e20636c6173733d27636f6465273e5b20343034205d3c2f7370616e3e20e2809420746869732073686f756c6420616c736f20626520737570706f727465643c2f703e0a20202020202020203c62723e0a20202020202020203c703e4974206973206e6f74206e656365737361727920746f2061646420436f6e74}
x[1016]{656e742d54797065206865616465722c207768656e20616c6c206d6f6465726e2077656273697465732063616e207265636f676e697a652069742e204275742c20796f752063616e2061646420697420616e797761792e3c2f703e0a20202020202020203c703e3c7370616e20636c6173733d27636f6465273e43537b2e2e}
x[1016]{2e7d3c2f7370616e3e20697320612063656c6c20736c6963652e20416e642c206173207765206b6e6f772c2054564d2043656c6c20636f756c64206265206f6e6c79203130323320626974206c6f6e6720616e6420636f6e7461696e20757020746f2034207265666572656e63657320746f206f746865722063656c6c732e}
x[1016]{3c2f703e0a20202020202020203c703e536f2c20746f20726573706f6e736520736f6d657468696e67206d6f72652c207468616e203132372062797465732c2077652073686f756c64206275696c6420612074726565213c2f703e0a20202020202020203c62723e0a20202020202020203c703e3c623e513a205472656520}
x[1016]{697320746f6f20636f6d706c6963617465642c20686f772061626f7574206a757374206d616b696e67206f6e65207374726169676874206c696e65206f662063656c6c733f3c2f623e3c2f703e0a20202020202020203c703e492074726965642c206275742069742077696c6c206e6f7420776f726b206f6e206875676520}
x[1016]{66696c65733a2074686572652069732061206c696d697420746f2063656c6c732064657074682e203a2f3c2f703e0a20202020202020203c703e496620796f75722066696c65206973206c657373207468616e20666577206b696c6f62797465732c2069742077696c6c20776f726b2e3c2f703e0a20202020202020203c62}
x[1016]{723e0a0a20202020202020203c703e3c623e4275696c64696e6720616e642070617273696e672074686520747265652e3c2f623e3c2f703e0a20202020202020203c703e5468697320697320612064656d6f6e7374726174696f6e206f66207472656520617070656172616e636520616e642063656c6c732072656164696e}
x[1016]{67206f726465723a3c2f703e0a3c7072653e0a20202020202020202020202020202020202020202020202020205b305d0a2020202020202020202c2d2d2d2d2d2d2d2d2d2d2b2d2d2d2d2d2d5e2d2d2d2d2d2d2d2b2d2d2d2d2d2d2d2d2d2d2d2c0a20202020202020205b315d202020202020205b32325d20202020202020}
x[1016]{202020205b34335d20202020202020205b36345d0a20202020202020202f20202020202020202020207c20202020202020202020202020207c2020202020202020202020205c0a202020202020202f2020202020202020202020207c20202020202020202020202020207c202020202020202020202020205c0a5b322c2037}
x[1016]{2c2031322c31375d205b32332c32382c33332c33385d20205b34342c34392c35342c35395d205b36352c37302c37352c38305d0a207c20207c20207c20207c202020207c20207c20207c20207c20202020207c20207c20207c20207c202020207c20207c20207c20207c0a205f5f205f5f205f5f205f5f2020205f5f205f5f}
x[1016]{205f5f205f5f202020205f5f205f5f205f5f205f5f2020205f5f205f5f205f5f205f5f0a5b33205d38205d31335d31385d205b32345d32395d33345d33395d20205b34355d35305d35355d36305d205b36365d37315d37365d38315d0a5b34205d39205d31345d31395d205b32355d33305d33355d34305d20205b34365d35}
x[1016]{315d35365d36315d205b36375d37325d37375d38325d0a5b35205d31305d31355d32305d205b32365d33315d33365d34315d20205b34375d35325d35375d36325d205b36385d37335d37385d38335d0a5b36205d31315d31365d32315d205b32375d33325d33375d34325d20205b34385d35335d35385d36335d205b36395d}
x[1016]{37345d37395d38345d0a2b2d2d2b2d2d2b2d2d2b2d2d2b202b2d2d2b2d2d2b2d2d2b2d2d2b20202b2d2d2b2d2d2b2d2d2b2d2d2b202b2d2d2b2d2d2b2d2d2b2d2d2b0a7c7c7c7c7c7c7c7c7c7c7c7c7c207c7c7c7c7c7c7c7c7c7c7c7c7c20207c7c7c7c7c7c7c7c7c7c7c7c7c207c7c7c7c7c7c7c7c7c7c7c7c7c0a202020}
x[1016]{2020202020202020202020202020202e2e2e206d6f72652063656c6c73202e2e2e0a0a5b695d202d2063656c6c20776974682031323720627974657320286f72206c6573732920646174613c2f7072653e0a09093c703e496e206d7920696d706c656d656e746174696f6e2c2063656c6c20636f6e7461696e73206f6e6c79}
x[1016]{2031323720627974657320616e642037206c617374206269746573206172652069676e6f7265642e204d617962652c20696e206675747572652c20746861742077696c6c2062652066697865642e3c2f703e0a20202020202020203c62723e0a20202020202020203c68322069643d226964656173223e49646561733c2f68}
x[1016]{323e0a20202020202020203c703e417320796f75206861766520616c726561647920726561642c2074686973207374616e6461726420646573637269626573206f6e6c79206765742d6d6574686f6473206f6620736d61727420636f6e747261637420616e6420646f65736e27742073617920686f7720746f2073746f7265}
x[1016]{207765627369746520636f6e74656e742e205468617420676976657320757320616e206162696c69747920746f206d616b6520612064796e616d696320636f6e74656e742120536d6172742d636f6e74726163742068617320736f6d6520646174612c207468617420636f756c64206265207573656420666f72206d616b69}
x[1016]{6e672064796e616d696320776562736974653a3c2f703e0a20202020202020203c756c3e0a2020202020202020093c6c693e736d6172742d636f6e74726163742063616e2073617665206c697374206f66206c617374207472616e73616374696f6e7320616e642073686f77207468656d206f6e20485454502d6c696b6520}
x[1016]{6765742d6d6574686f640a2020202020202020093c756c3e0a202020202020202009093c6c693e3c693e696465613a3c2f693e207765627369746520616772656761746f72206163636570747320616c6c207472616e73616374696f6e732066726f6d206f7468657220776562736974657320616e642073686f7720746865}
x[1016]{6d20617420746865206d61696e20706167652e3c2f6c693e0a202020202020202009093c6c693e3c693e696465613a3c2f693e20616e6f6e796d6f757320666f72756d2c2077686572652065766572796f6e652063616e2073656e642061206d65737361676520287472616e73616374696f6e2920746f2061207765627369}
x[1016]{746520616e642069742077696c6c2073686f7720697420617420746865206d61696e20706167653c2f6c693e0a2020202020202020093c2f756c3e0a2020202020202020093c2f6c693e0a2020202020202020093c6c693e756e69782074696d657374616d703c2f6c693e0a2020202020202020093c6c693e72616e646f6d}
x[1016]{3c2f6c693e0a2020202020202020093c6c693e6772616d73206c656674206f6e20776562736974652773206163636f756e743c2f6c693e0a2020202020202020093c6c693e6f7468657220696e666f2066726f6d203c7370616e20636c6173733d27636f6465273e63373c2f7370616e3e3c2f6c693e0a2020202020202020}
x[1016]{202020203c6c693e2e2e2e3c2f6c693e0a2020202020202020202020203c6c693e6d616b6520646563656e7472616c697a656420646e732e2e2e3c2f6c693e0a20202020202020203c2f756c3e0a20202020202020203c62723e0a20202020202020203c68322069643d22686f77746f223e486f7720746f20686f73742061}
x[1016]{207765627369746520696e20544f4e205765623f3c2f68323e0a20202020202020203c703e596f75206e6565642061202a6e69782073797374656d2e3c2f703e0a20202020202020203c703e312e20436f6d70696c65206c6974652d636c69656e7420616e6420666966742c20617320646573637269626564203c61206872}
x[1016]{65663d2268747470733a2f2f746573742e746f6e2e6f72672f524541444d452e747874223e686572653c2f613e2e3c2f703e0a20202020202020203c703e4d616b6520737572652c207468617420464946545041544820697320636f6e6669677572656420616e64206669667420697320617661696c61626c6520676c6f62}
x[1016]{616c6c792e3c2f703e0a20202020202020203c703e322e20446f776e6c6f6164203c6120687265663d2268747470733a2f2f6769746875622e636f6d2f646b6172617573682f746f6e2d776562223e6d79207265706f7369746f72793c2f613e2e3c2f703e0a20202020202020203c703e332e2052756e203c7370616e2063}
x[1016]{6c6173733d27636f6465273e62617368206e65772e7368202f706174682f746f2f796f75722f776562736974652f20266c743b6e616d652d626173652d6f662d66696c65732667743b3c2f7370616e3e3c2f703e0a20202020202020203c703e466f72206578616d706c652c203c7370616e20636c6173733d27636f646527}
x[1016]{3e62617368206e65772e7368207e2f746f6e7765622e7369746520746f6e7765623c2f7370616e3e3c2f703e0a20202020202020203c703e596f752073686f756c64207769746e65737320686f772066696c657320617265206265696e672070757420696e20226261672d6f662d63656c6c73222066696c652e3c2f703e0a}
x[1016]{20202020202020203c703e41742074686520656e642c2069742077696c6c2067656e657261746520616e2065787465726e616c206d65737361676520616e642073686f7720796f752061207072696365206f66207765627369746520686f6c64696e672e3c2f703e0a20202020202020203c703e342e205472616e73666572}
x[1016]{206e6565646564204772616d7320746f2074686520616464726573732e3c2f703e0a20202020202020203c703e352e2053656e642065787465726e616c206d65737361676520286073656e6466696c6520266c743b66696c65626173652667743b2d71756572792e626f636020696e206c6974652d636c69656e74292e3c2f}
x[1016]{703e0a20202020202020203c62723e0a20202020202020203c212d2d68322069643d227072696365223e57686174277320746865207072696365206f662061207765627369746520686f7374696e673f3c2f68323e0a20202020202020203c703e4920747269656420746f206d616b65206368617274206f66207468656f72}
x[1016]{65746963616c2070726963652c20627574206974206973206661722066726f6d207265616c6974792c20646f206e6f742062656c696576652069742e203a5c3c2f703e0a20202020202020203c62723e0a20202020202020203c696672616d65207372633d2268747470733a2f2f7777772e6465736d6f732e636f6d2f6361}
x[1016]{6c63756c61746f722f7833396a357076656d723f656d6265642220636c6173733d226465736d6f7322206865696768743d22353030707822207374796c653d22626f726465723a2031707820736f6c6964202363636322206672616d65626f726465723d303e3c2f696672616d652d2d3e0a20202020202020203c62723e0a}
x[216]{202020203c2f6469763e0a3c2f626f64793e0a0a3c2f68746d6c3e}