File tree Expand file tree Collapse file tree 4 files changed +14
-5
lines changed
Expand file tree Collapse file tree 4 files changed +14
-5
lines changed Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ function printHeading(msg) {
5353printHeading (' Try out NodeAPI' );
5454// NodeAPI is the wrapper for RESTful APIs
5555const api = jv .NodeAPI .new (host);
56- // GET /blocks/last
56+ // GET /blocks/height
5757console .log (await api .blocks .getHeight ());
5858// GET /node/version
5959console .log (await api .node .getVersion ());
Original file line number Diff line number Diff line change 11{
22 "name" : " @virtualeconomy/js-vsys" ,
3- "version" : " 0.2.2 " ,
3+ "version" : " 0.2.3 " ,
44 "description" : " The official JavaScript SDK for VSYS APIs" ,
55 "keywords" : [
66 " vsys" ,
Original file line number Diff line number Diff line change @@ -150,12 +150,11 @@ export class Account {
150150 NOTE that the token ID from the system contract is not supported due to the pre-defined & built-in nature
151151 of system contract.
152152 * @param {string } tokId - The token ID.
153- * @returns {md.VSYS } The account's effective balance.
153+ * @returns {md.Token } The account's balance of the given token .
154154 */
155155 async getTokBal ( tokId ) {
156- const tc = await tcf . fromTokId ( new md . TokenID ( tokId ) , this . chain ) ;
157156 const resp = await this . api . ctrt . getTokBal ( this . addr . data , tokId ) ;
158- return new md . Token ( resp . balance , await tc . getUnit ( ) ) ;
157+ return md . Token . fromNumber ( resp . balance , resp . unity ) ;
159158 }
160159
161160 /**
Original file line number Diff line number Diff line change @@ -202,6 +202,16 @@ class Transactions extends APIGrp {
202202 async getInfo ( txId ) {
203203 return await this . get ( `/info/${ txId } ` ) ;
204204 }
205+
206+ /**
207+ * getTxList gets the list of transactions involving the given address.
208+ * @param {string } addr - The wallet address or contract address.
209+ * @param {number } limit - The number of records to be returned.
210+ * @returns {object } The response.
211+ */
212+ async getTxList ( addr , limit ) {
213+ return await this . get ( `/address/${ addr } /limit/${ limit } ` ) ;
214+ }
205215}
206216
207217/** Node is the class for API group 'node' */
You can’t perform that action at this time.
0 commit comments