@pioneer-platform/pioneer-sdk 8.1.42 → 8.1.46

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.
Files changed (2) hide show
  1. package/lib/index.js +28 -19
  2. package/package.json +2 -2
package/lib/index.js CHANGED
@@ -81,7 +81,7 @@ var SDK = /** @class */ (function () {
81
81
  this.nfts = [];
82
82
  this.init = function (blockchains) {
83
83
  return __awaiter(this, void 0, void 0, function () {
84
- var tag, i, blockchain, _a, userInfo, e_1;
84
+ var tag, i, blockchain, _a, userInfo, i, walletInfo, j, pubkey, k, balance, e_1;
85
85
  return __generator(this, function (_b) {
86
86
  switch (_b.label) {
87
87
  case 0:
@@ -121,23 +121,25 @@ var SDK = /** @class */ (function () {
121
121
  userInfo = userInfo.data;
122
122
  log.info(tag, "userInfo: ", userInfo);
123
123
  //for each wallet
124
- // if(userInfo.walletDescriptions){
125
- // for(let i = 0; userInfo.walletDescriptions.length; i++){
126
- // let walletInfo = userInfo.walletDescriptions[i]
127
- // for(let j =0; j < walletInfo.pubkeys.length; j++){
128
- // let pubkey = walletInfo.pubkeys[j]
129
- // pubkey.context = walletInfo.context
130
- // this.pubkeys.push(pubkey)
131
- // for(let k = 0; k < pubkey.balances.length; k++){
132
- // let balance:any = pubkey.balances[k]
133
- // //add wallet context
134
- // balance.context = walletInfo.context
135
- // balance.pubkey = pubkey.pubkey
136
- // this.balances.push(balance)
137
- // }
138
- // }
139
- // }
140
- // }
124
+ if (userInfo.walletDescriptions) {
125
+ for (i = 0; userInfo.walletDescriptions.length; i++) {
126
+ walletInfo = userInfo.walletDescriptions[i];
127
+ if (walletInfo && walletInfo.pubkeys) {
128
+ for (j = 0; j < walletInfo.pubkeys.length; j++) {
129
+ pubkey = walletInfo.pubkeys[j];
130
+ pubkey.context = walletInfo.context;
131
+ this.pubkeys.push(pubkey);
132
+ for (k = 0; k < pubkey.balances.length; k++) {
133
+ balance = pubkey.balances[k];
134
+ //add wallet context
135
+ balance.context = walletInfo.context;
136
+ balance.pubkey = pubkey.pubkey;
137
+ this.balances.push(balance);
138
+ }
139
+ }
140
+ }
141
+ }
142
+ }
141
143
  if (!this.username)
142
144
  this.username = userInfo.username;
143
145
  this.wallets = userInfo.wallets;
@@ -588,6 +590,13 @@ var SDK = /** @class */ (function () {
588
590
  //add wallet context
589
591
  balance_1.context = walletInfo.context;
590
592
  balance_1.pubkey = pubkey.pubkey;
593
+ //force to webspec
594
+ balance_1.address = pubkey.pubkey;
595
+ balance_1.name = pubkey.pubkey;
596
+ balance_1.chainId = 1;
597
+ balance_1.decimals = 18;
598
+ if (balance_1.marketData && balance_1.marketData.image)
599
+ balance_1.logoURI = balance_1.marketData.image;
591
600
  this.balances.push(balance_1);
592
601
  }
593
602
  }
@@ -605,7 +614,7 @@ var SDK = /** @class */ (function () {
605
614
  case 4:
606
615
  result = _a.sent();
607
616
  result = result.data;
608
- log.debug(tag, "result: ", result);
617
+ log.info(tag, "result: ", result);
609
618
  if (result.wallets) {
610
619
  this.contexts = result.wallets;
611
620
  log.debug(tag, "result: ", result);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pioneer-platform/pioneer-sdk",
3
- "version": "8.1.42",
3
+ "version": "8.1.46",
4
4
  "main": "./lib/index.js",
5
5
  "types": "./lib/index.d.ts",
6
6
  "scripts": {
@@ -41,5 +41,5 @@
41
41
  "ts-jest": "^25.4.0",
42
42
  "typescript": "^3.9.9"
43
43
  },
44
- "gitHead": "54c5830a9aebf63dc437dd0cdd4bd3ea3edb253f"
44
+ "gitHead": "d0e74ea447175d6d7e9697793093f9155f0dab38"
45
45
  }