Skip to content

Commit 65448d6

Browse files
authored
Merge pull request #81 from virtualeconomy/develop
release: v0.2.3
2 parents fd0160e + b54f82f commit 65448d6

File tree

4 files changed

+14
-5
lines changed

4 files changed

+14
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function printHeading(msg) {
5353
printHeading('Try out NodeAPI');
5454
// NodeAPI is the wrapper for RESTful APIs
5555
const api = jv.NodeAPI.new(host);
56-
// GET /blocks/last
56+
// GET /blocks/height
5757
console.log(await api.blocks.getHeight());
5858
// GET /node/version
5959
console.log(await api.node.getVersion());

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
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",

src/account.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff 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
/**

src/api.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff 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' */

0 commit comments

Comments
 (0)