@pioneer-platform/ripple-network 8.1.37 → 8.1.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.d.ts CHANGED
@@ -22,4 +22,4 @@ declare let client: {
22
22
  /**********************************
23
23
  // Lib
24
24
  //**********************************/
25
- declare let get_balance: (address: string) => Promise<number>;
25
+ declare let get_balance: (address: string) => Promise<any>;
package/lib/index.js CHANGED
@@ -89,7 +89,8 @@ module.exports = {
89
89
  return __generator(this, function (_a) {
90
90
  switch (_a.label) {
91
91
  case 0:
92
- client = new xrpl.Client("wss://s.altnet.rippletest.net:51233");
92
+ // client = new xrpl.Client("wss://s.altnet.rippletest.net:51233")
93
+ client = new xrpl.Client("wss://xrplcluster.com/");
93
94
  return [4 /*yield*/, client.connect()];
94
95
  case 1:
95
96
  _a.sent();
@@ -420,13 +421,19 @@ var get_balance = function (address) {
420
421
  output = 0;
421
422
  return [4 /*yield*/, client.request({
422
423
  "command": "account_info",
423
- "account": "rPT1Sjq2YGrBMTttX4GZHjKu9dyfzbpAYe",
424
+ "account": address,
424
425
  "ledger_index": "validated"
425
426
  })];
426
427
  case 2:
427
428
  response = _a.sent();
428
429
  console.log(response);
429
- return [2 /*return*/, output];
430
+ console.log(response.result);
431
+ console.log(response.result.account_data);
432
+ console.log(response.result.account_data.Account);
433
+ console.log(response.result.account_data.Balance);
434
+ console.log(response.result.account_data.Balance / 1000000);
435
+ response.result.account_data.Balance = parseFloat(response.result.account_data.Balance) / 1000000;
436
+ return [2 /*return*/, response.result.account_data.Balance];
430
437
  case 3:
431
438
  e_1 = _a.sent();
432
439
  log.error(tag, "e: ", e_1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pioneer-platform/ripple-network",
3
- "version": "8.1.37",
3
+ "version": "8.1.39",
4
4
  "main": "./lib/index.js",
5
5
  "types": "./lib/index.d.ts",
6
6
  "scripts": {