@pioneer-platform/zapper-client 8.3.11 → 8.3.12

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 +30 -5
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -107,7 +107,7 @@ module.exports = {
107
107
  };
108
108
  var get_account_history = function (address) {
109
109
  return __awaiter(this, void 0, void 0, function () {
110
- var tag, endpoint, encodedKey_1, httpLink, authLink, client, query, variables, response, e_1;
110
+ var tag, endpoint, encodedKey_1, httpLink, authLink, client, query, variables, response, cleanResponse, e_1;
111
111
  return __generator(this, function (_a) {
112
112
  switch (_a.label) {
113
113
  case 0:
@@ -131,7 +131,7 @@ var get_account_history = function (address) {
131
131
  link: authLink.concat(httpLink),
132
132
  cache: new InMemoryCache(),
133
133
  });
134
- query = gql(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n query ($addresses: [Address!], $realtimeInterpretation: Boolean, $isSigner: Boolean) {\n accountsTimeline(addresses: $addresses, realtimeInterpretation: $realtimeInterpretation, isSigner: $isSigner) {\n edges {\n node {\n transaction {\n fromUser {\n address\n displayName {\n value\n }\n }\n toUser {\n displayName {\n value\n }\n }\n }\n interpretation {\n processedDescription\n }\n app {\n name\n imgUrl\n }\n network\n timestamp\n }\n }\n }\n }\n "], ["\n query ($addresses: [Address!], $realtimeInterpretation: Boolean, $isSigner: Boolean) {\n accountsTimeline(addresses: $addresses, realtimeInterpretation: $realtimeInterpretation, isSigner: $isSigner) {\n edges {\n node {\n transaction {\n fromUser {\n address\n displayName {\n value\n }\n }\n toUser {\n displayName {\n value\n }\n }\n }\n interpretation {\n processedDescription\n }\n app {\n name\n imgUrl\n }\n network\n timestamp\n }\n }\n }\n }\n "])));
134
+ query = gql(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n query ($addresses: [Address!], $realtimeInterpretation: Boolean, $isSigner: Boolean) {\n accountsTimeline(addresses: $addresses, realtimeInterpretation: $realtimeInterpretation, isSigner: $isSigner) {\n edges {\n node {\n transaction {\n hash\n fromUser {\n address\n displayName {\n value\n }\n }\n toUser {\n address\n displayName {\n value\n }\n }\n input\n value\n gasPrice\n gas\n }\n interpretation {\n processedDescription\n }\n app {\n name\n imgUrl\n }\n network\n timestamp\n similarEventCount\n }\n }\n }\n }\n "], ["\n query ($addresses: [Address!], $realtimeInterpretation: Boolean, $isSigner: Boolean) {\n accountsTimeline(addresses: $addresses, realtimeInterpretation: $realtimeInterpretation, isSigner: $isSigner) {\n edges {\n node {\n transaction {\n hash\n fromUser {\n address\n displayName {\n value\n }\n }\n toUser {\n address\n displayName {\n value\n }\n }\n input\n value\n gasPrice\n gas\n }\n interpretation {\n processedDescription\n }\n app {\n name\n imgUrl\n }\n network\n timestamp\n similarEventCount\n }\n }\n }\n }\n "])));
135
135
  variables = {
136
136
  addresses: [address],
137
137
  realtimeInterpretation: true,
@@ -140,9 +140,34 @@ var get_account_history = function (address) {
140
140
  return [4 /*yield*/, client.query({ query: query, variables: variables })];
141
141
  case 2:
142
142
  response = _a.sent();
143
- console.log("response:", response.data);
144
- console.log("response:", response.data.accountsTimeline.edges);
145
- return [2 /*return*/, response.data.accountsTimeline.edges];
143
+ cleanResponse = response.data.accountsTimeline.edges.map(function (edge) {
144
+ var _a = edge.node, _b = _a.transaction, hash = _b.hash, fromUser = _b.fromUser, toUser = _b.toUser, input = _b.input, value = _b.value, gasPrice = _b.gasPrice, gas = _b.gas, processedDescription = _a.interpretation.processedDescription, app = _a.app, network = _a.network, timestamp = _a.timestamp, similarEventCount = _a.similarEventCount;
145
+ return {
146
+ txid: hash,
147
+ from: {
148
+ address: fromUser.address,
149
+ displayName: fromUser.displayName.value,
150
+ },
151
+ to: toUser ? {
152
+ address: toUser.address,
153
+ displayName: toUser.displayName.value,
154
+ } : null,
155
+ description: processedDescription,
156
+ app: app ? {
157
+ name: app.name,
158
+ imgUrl: app.imgUrl,
159
+ } : null,
160
+ network: network,
161
+ timestamp: new Date(timestamp).toISOString(),
162
+ input: input,
163
+ value: value,
164
+ gasPrice: gasPrice,
165
+ gas: gas,
166
+ similarEventCount: similarEventCount
167
+ };
168
+ });
169
+ console.log("Cleaned response:", cleanResponse);
170
+ return [2 /*return*/, cleanResponse];
146
171
  case 3:
147
172
  e_1 = _a.sent();
148
173
  console.error(tag, "Error: ", e_1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pioneer-platform/zapper-client",
3
- "version": "8.3.11",
3
+ "version": "8.3.12",
4
4
  "main": "./lib/index.js",
5
5
  "types": "./lib/index.d.ts",
6
6
  "dependencies": {