wao 0.21.3 → 0.22.0

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.
@@ -1052,15 +1052,38 @@ var Adaptor = /*#__PURE__*/function () {
1052
1052
  return cu_get_result;
1053
1053
  }()
1054
1054
  }, {
1055
- key: "su_get_root",
1055
+ key: "cu_post_result",
1056
1056
  value: function () {
1057
- var _su_get_root = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee25(_ref9) {
1058
- var query, params, body, headers, method;
1057
+ var _cu_post_result = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee25() {
1058
+ var _args25 = arguments;
1059
1059
  return _regeneratorRuntime().wrap(function _callee25$(_context25) {
1060
1060
  while (1) switch (_context25.prev = _context25.next) {
1061
+ case 0:
1062
+ _context25.next = 2;
1063
+ return this.cu_get_result.apply(this, _args25);
1064
+ case 2:
1065
+ return _context25.abrupt("return", _context25.sent);
1066
+ case 3:
1067
+ case "end":
1068
+ return _context25.stop();
1069
+ }
1070
+ }, _callee25, this);
1071
+ }));
1072
+ function cu_post_result() {
1073
+ return _cu_post_result.apply(this, arguments);
1074
+ }
1075
+ return cu_post_result;
1076
+ }()
1077
+ }, {
1078
+ key: "su_get_root",
1079
+ value: function () {
1080
+ var _su_get_root = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee26(_ref9) {
1081
+ var query, params, body, headers, method;
1082
+ return _regeneratorRuntime().wrap(function _callee26$(_context26) {
1083
+ while (1) switch (_context26.prev = _context26.next) {
1061
1084
  case 0:
1062
1085
  query = _ref9.query, params = _ref9.params, body = _ref9.body, headers = _ref9.headers, method = _ref9.method;
1063
- return _context25.abrupt("return", {
1086
+ return _context26.abrupt("return", {
1064
1087
  json: {
1065
1088
  Unit: "Scheduler",
1066
1089
  Timestamp: Date.now(),
@@ -1070,9 +1093,9 @@ var Adaptor = /*#__PURE__*/function () {
1070
1093
  });
1071
1094
  case 2:
1072
1095
  case "end":
1073
- return _context25.stop();
1096
+ return _context26.stop();
1074
1097
  }
1075
- }, _callee25, this);
1098
+ }, _callee26, this);
1076
1099
  }));
1077
1100
  function su_get_root(_x26) {
1078
1101
  return _su_get_root.apply(this, arguments);
@@ -1082,13 +1105,13 @@ var Adaptor = /*#__PURE__*/function () {
1082
1105
  }, {
1083
1106
  key: "su_get_timestamp",
1084
1107
  value: function () {
1085
- var _su_get_timestamp = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee26(_ref10) {
1108
+ var _su_get_timestamp = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee27(_ref10) {
1086
1109
  var query, params, body, headers, method;
1087
- return _regeneratorRuntime().wrap(function _callee26$(_context26) {
1088
- while (1) switch (_context26.prev = _context26.next) {
1110
+ return _regeneratorRuntime().wrap(function _callee27$(_context27) {
1111
+ while (1) switch (_context27.prev = _context27.next) {
1089
1112
  case 0:
1090
1113
  query = _ref10.query, params = _ref10.params, body = _ref10.body, headers = _ref10.headers, method = _ref10.method;
1091
- return _context26.abrupt("return", {
1114
+ return _context27.abrupt("return", {
1092
1115
  json: {
1093
1116
  timestamp: Date.now(),
1094
1117
  block_height: this.mem.height
@@ -1096,9 +1119,9 @@ var Adaptor = /*#__PURE__*/function () {
1096
1119
  });
1097
1120
  case 2:
1098
1121
  case "end":
1099
- return _context26.stop();
1122
+ return _context27.stop();
1100
1123
  }
1101
- }, _callee26, this);
1124
+ }, _callee27, this);
1102
1125
  }));
1103
1126
  function su_get_timestamp(_x27) {
1104
1127
  return _su_get_timestamp.apply(this, arguments);
@@ -1108,34 +1131,34 @@ var Adaptor = /*#__PURE__*/function () {
1108
1131
  }, {
1109
1132
  key: "su_get_pid",
1110
1133
  value: function () {
1111
- var _su_get_pid = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee28(_ref11) {
1134
+ var _su_get_pid = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee29(_ref11) {
1112
1135
  var _this = this,
1113
1136
  _this$mem$env$pid$res2,
1114
1137
  _this$mem$env$pid3;
1115
1138
  var query, params, body, headers, method, pid, edges;
1116
- return _regeneratorRuntime().wrap(function _callee28$(_context28) {
1117
- while (1) switch (_context28.prev = _context28.next) {
1139
+ return _regeneratorRuntime().wrap(function _callee29$(_context29) {
1140
+ while (1) switch (_context29.prev = _context29.next) {
1118
1141
  case 0:
1119
1142
  query = _ref11.query, params = _ref11.params, body = _ref11.body, headers = _ref11.headers, method = _ref11.method;
1120
1143
  pid = params.pid;
1121
1144
  edges = (0, _ramda.map)(/*#__PURE__*/function () {
1122
- var _ref12 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee27(v) {
1145
+ var _ref12 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee28(v) {
1123
1146
  var _mtx$anchor, _tx$anchor;
1124
1147
  var tx, _tags, mid, mtx;
1125
- return _regeneratorRuntime().wrap(function _callee27$(_context27) {
1126
- while (1) switch (_context27.prev = _context27.next) {
1148
+ return _regeneratorRuntime().wrap(function _callee28$(_context28) {
1149
+ while (1) switch (_context28.prev = _context28.next) {
1127
1150
  case 0:
1128
- _context27.next = 2;
1151
+ _context28.next = 2;
1129
1152
  return _this.mem.getTx(v);
1130
1153
  case 2:
1131
- tx = _context27.sent;
1154
+ tx = _context28.sent;
1132
1155
  _tags = (0, _utils.tags)(v.tags);
1133
1156
  mid = _tags.Message;
1134
- _context27.next = 7;
1157
+ _context28.next = 7;
1135
1158
  return _this.mem.getTx(mid);
1136
1159
  case 7:
1137
- mtx = _context27.sent;
1138
- return _context27.abrupt("return", {
1160
+ mtx = _context28.sent;
1161
+ return _context28.abrupt("return", {
1139
1162
  cursor: v,
1140
1163
  node: {
1141
1164
  message: {
@@ -1159,15 +1182,15 @@ var Adaptor = /*#__PURE__*/function () {
1159
1182
  });
1160
1183
  case 9:
1161
1184
  case "end":
1162
- return _context27.stop();
1185
+ return _context28.stop();
1163
1186
  }
1164
- }, _callee27);
1187
+ }, _callee28);
1165
1188
  }));
1166
1189
  return function (_x29) {
1167
1190
  return _ref12.apply(this, arguments);
1168
1191
  };
1169
1192
  }())((0, _ramda.reverse)((_this$mem$env$pid$res2 = (_this$mem$env$pid3 = this.mem.env[pid]) === null || _this$mem$env$pid3 === void 0 ? void 0 : _this$mem$env$pid3.results) !== null && _this$mem$env$pid$res2 !== void 0 ? _this$mem$env$pid$res2 : [])); // need mod
1170
- return _context28.abrupt("return", {
1193
+ return _context29.abrupt("return", {
1171
1194
  json: {
1172
1195
  page_info: {
1173
1196
  has_next_page: false
@@ -1177,9 +1200,9 @@ var Adaptor = /*#__PURE__*/function () {
1177
1200
  });
1178
1201
  case 4:
1179
1202
  case "end":
1180
- return _context28.stop();
1203
+ return _context29.stop();
1181
1204
  }
1182
- }, _callee28, this);
1205
+ }, _callee29, this);
1183
1206
  }));
1184
1207
  function su_get_pid(_x28) {
1185
1208
  return _su_get_pid.apply(this, arguments);
@@ -1189,20 +1212,20 @@ var Adaptor = /*#__PURE__*/function () {
1189
1212
  }, {
1190
1213
  key: "mu_get_root",
1191
1214
  value: function () {
1192
- var _mu_get_root = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee29(_ref13) {
1215
+ var _mu_get_root = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee30(_ref13) {
1193
1216
  var query, params, body, headers, method;
1194
- return _regeneratorRuntime().wrap(function _callee29$(_context29) {
1195
- while (1) switch (_context29.prev = _context29.next) {
1217
+ return _regeneratorRuntime().wrap(function _callee30$(_context30) {
1218
+ while (1) switch (_context30.prev = _context30.next) {
1196
1219
  case 0:
1197
1220
  query = _ref13.query, params = _ref13.params, body = _ref13.body, headers = _ref13.headers, method = _ref13.method;
1198
- return _context29.abrupt("return", {
1221
+ return _context30.abrupt("return", {
1199
1222
  send: "ao messenger unit"
1200
1223
  });
1201
1224
  case 2:
1202
1225
  case "end":
1203
- return _context29.stop();
1226
+ return _context30.stop();
1204
1227
  }
1205
- }, _callee29);
1228
+ }, _callee30);
1206
1229
  }));
1207
1230
  function mu_get_root(_x30) {
1208
1231
  return _mu_get_root.apply(this, arguments);
@@ -1212,27 +1235,27 @@ var Adaptor = /*#__PURE__*/function () {
1212
1235
  }, {
1213
1236
  key: "mu_post_root",
1214
1237
  value: function () {
1215
- var _mu_post_root = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee30(_ref14) {
1238
+ var _mu_post_root = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee31(_ref14) {
1216
1239
  var query, params, body, headers, method, valid, type, item, _tags, err, res;
1217
- return _regeneratorRuntime().wrap(function _callee30$(_context30) {
1218
- while (1) switch (_context30.prev = _context30.next) {
1240
+ return _regeneratorRuntime().wrap(function _callee31$(_context31) {
1241
+ while (1) switch (_context31.prev = _context31.next) {
1219
1242
  case 0:
1220
1243
  query = _ref14.query, params = _ref14.params, body = _ref14.body, headers = _ref14.headers, method = _ref14.method;
1221
1244
  if (body.type === "Buffer" && Array.isArray(body.data)) {
1222
1245
  body = new Uint8Array(body.data);
1223
1246
  }
1224
1247
  valid = false; // todo: cannot verify node -> broser items
1225
- _context30.prev = 3;
1226
- _context30.next = 6;
1248
+ _context31.prev = 3;
1249
+ _context31.next = 6;
1227
1250
  return _arbundles.DataItem.verify(body);
1228
1251
  case 6:
1229
- valid = _context30.sent;
1230
- _context30.next = 12;
1252
+ valid = _context31.sent;
1253
+ _context31.next = 12;
1231
1254
  break;
1232
1255
  case 9:
1233
- _context30.prev = 9;
1234
- _context30.t0 = _context30["catch"](3);
1235
- console.log(_context30.t0);
1256
+ _context31.prev = 9;
1257
+ _context31.t0 = _context31["catch"](3);
1258
+ console.log(_context31.t0);
1236
1259
  case 12:
1237
1260
  type = null;
1238
1261
  item = null;
@@ -1240,55 +1263,55 @@ var Adaptor = /*#__PURE__*/function () {
1240
1263
  _tags = (0, _utils.tags)(item.tags);
1241
1264
  err = null;
1242
1265
  if (!(_tags.Type === "Process")) {
1243
- _context30.next = 24;
1266
+ _context31.next = 24;
1244
1267
  break;
1245
1268
  }
1246
- _context30.next = 20;
1269
+ _context31.next = 20;
1247
1270
  return this.spawn({
1248
1271
  item: item,
1249
1272
  module: _tags.Module,
1250
1273
  scheduler: _tags.Scheduler
1251
1274
  });
1252
1275
  case 20:
1253
- res = _context30.sent;
1276
+ res = _context31.sent;
1254
1277
  if (!res) err = "bad requrest";
1255
- _context30.next = 30;
1278
+ _context31.next = 30;
1256
1279
  break;
1257
1280
  case 24:
1258
1281
  if (!(_tags.Type === "Message")) {
1259
- _context30.next = 29;
1282
+ _context31.next = 29;
1260
1283
  break;
1261
1284
  }
1262
- _context30.next = 27;
1285
+ _context31.next = 27;
1263
1286
  return this.message({
1264
1287
  item: item,
1265
1288
  process: item.target
1266
1289
  });
1267
1290
  case 27:
1268
- _context30.next = 30;
1291
+ _context31.next = 30;
1269
1292
  break;
1270
1293
  case 29:
1271
1294
  err = true;
1272
1295
  case 30:
1273
1296
  if (!err) {
1274
- _context30.next = 34;
1297
+ _context31.next = 34;
1275
1298
  break;
1276
1299
  }
1277
- return _context30.abrupt("return", {
1300
+ return _context31.abrupt("return", {
1278
1301
  status: 400,
1279
1302
  error: err
1280
1303
  });
1281
1304
  case 34:
1282
- return _context30.abrupt("return", {
1305
+ return _context31.abrupt("return", {
1283
1306
  json: {
1284
1307
  id: item.id
1285
1308
  }
1286
1309
  });
1287
1310
  case 35:
1288
1311
  case "end":
1289
- return _context30.stop();
1312
+ return _context31.stop();
1290
1313
  }
1291
- }, _callee30, this, [[3, 9]]);
1314
+ }, _callee31, this, [[3, 9]]);
1292
1315
  }));
1293
1316
  function mu_post_root(_x31) {
1294
1317
  return _mu_post_root.apply(this, arguments);
@@ -1298,18 +1321,18 @@ var Adaptor = /*#__PURE__*/function () {
1298
1321
  }, {
1299
1322
  key: "mu_post_monitor",
1300
1323
  value: function () {
1301
- var _mu_post_monitor = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee31(_ref15) {
1324
+ var _mu_post_monitor = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee32(_ref15) {
1302
1325
  var query, params, body, headers, method;
1303
- return _regeneratorRuntime().wrap(function _callee31$(_context31) {
1304
- while (1) switch (_context31.prev = _context31.next) {
1326
+ return _regeneratorRuntime().wrap(function _callee32$(_context32) {
1327
+ while (1) switch (_context32.prev = _context32.next) {
1305
1328
  case 0:
1306
1329
  query = _ref15.query, params = _ref15.params, body = _ref15.body, headers = _ref15.headers, method = _ref15.method;
1307
- _context31.next = 3;
1330
+ _context32.next = 3;
1308
1331
  return this.monitor({
1309
1332
  process: params.pid
1310
1333
  });
1311
1334
  case 3:
1312
- return _context31.abrupt("return", {
1335
+ return _context32.abrupt("return", {
1313
1336
  json: {
1314
1337
  id: params.pid,
1315
1338
  messag: "cron monitored!"
@@ -1317,9 +1340,9 @@ var Adaptor = /*#__PURE__*/function () {
1317
1340
  });
1318
1341
  case 4:
1319
1342
  case "end":
1320
- return _context31.stop();
1343
+ return _context32.stop();
1321
1344
  }
1322
- }, _callee31, this);
1345
+ }, _callee32, this);
1323
1346
  }));
1324
1347
  function mu_post_monitor(_x32) {
1325
1348
  return _mu_post_monitor.apply(this, arguments);
@@ -1329,18 +1352,18 @@ var Adaptor = /*#__PURE__*/function () {
1329
1352
  }, {
1330
1353
  key: "mu_delete_monitor",
1331
1354
  value: function () {
1332
- var _mu_delete_monitor = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee32(_ref16) {
1355
+ var _mu_delete_monitor = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee33(_ref16) {
1333
1356
  var query, params, body, headers, method;
1334
- return _regeneratorRuntime().wrap(function _callee32$(_context32) {
1335
- while (1) switch (_context32.prev = _context32.next) {
1357
+ return _regeneratorRuntime().wrap(function _callee33$(_context33) {
1358
+ while (1) switch (_context33.prev = _context33.next) {
1336
1359
  case 0:
1337
1360
  query = _ref16.query, params = _ref16.params, body = _ref16.body, headers = _ref16.headers, method = _ref16.method;
1338
- _context32.next = 3;
1361
+ _context33.next = 3;
1339
1362
  return this.unmonitor({
1340
1363
  process: params.pid
1341
1364
  });
1342
1365
  case 3:
1343
- return _context32.abrupt("return", {
1366
+ return _context33.abrupt("return", {
1344
1367
  json: {
1345
1368
  id: params.pid,
1346
1369
  message: "cron deleted!"
@@ -1348,9 +1371,9 @@ var Adaptor = /*#__PURE__*/function () {
1348
1371
  });
1349
1372
  case 4:
1350
1373
  case "end":
1351
- return _context32.stop();
1374
+ return _context33.stop();
1352
1375
  }
1353
- }, _callee32, this);
1376
+ }, _callee33, this);
1354
1377
  }));
1355
1378
  function mu_delete_monitor(_x33) {
1356
1379
  return _mu_delete_monitor.apply(this, arguments);
@@ -1360,13 +1383,13 @@ var Adaptor = /*#__PURE__*/function () {
1360
1383
  }, {
1361
1384
  key: "ar_get_root",
1362
1385
  value: function () {
1363
- var _ar_get_root = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee33(_ref17) {
1386
+ var _ar_get_root = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee34(_ref17) {
1364
1387
  var query, params, body, headers, method;
1365
- return _regeneratorRuntime().wrap(function _callee33$(_context33) {
1366
- while (1) switch (_context33.prev = _context33.next) {
1388
+ return _regeneratorRuntime().wrap(function _callee34$(_context34) {
1389
+ while (1) switch (_context34.prev = _context34.next) {
1367
1390
  case 0:
1368
1391
  query = _ref17.query, params = _ref17.params, body = _ref17.body, headers = _ref17.headers, method = _ref17.method;
1369
- return _context33.abrupt("return", {
1392
+ return _context34.abrupt("return", {
1370
1393
  json: {
1371
1394
  version: 1,
1372
1395
  timestamp: Date.now(),
@@ -1377,9 +1400,9 @@ var Adaptor = /*#__PURE__*/function () {
1377
1400
  });
1378
1401
  case 2:
1379
1402
  case "end":
1380
- return _context33.stop();
1403
+ return _context34.stop();
1381
1404
  }
1382
- }, _callee33, this);
1405
+ }, _callee34, this);
1383
1406
  }));
1384
1407
  function ar_get_root(_x34) {
1385
1408
  return _ar_get_root.apply(this, arguments);
@@ -1389,20 +1412,20 @@ var Adaptor = /*#__PURE__*/function () {
1389
1412
  }, {
1390
1413
  key: "ar_get_wallet_balance",
1391
1414
  value: function () {
1392
- var _ar_get_wallet_balance = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee34(_ref18) {
1415
+ var _ar_get_wallet_balance = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee35(_ref18) {
1393
1416
  var query, params, body, headers, method;
1394
- return _regeneratorRuntime().wrap(function _callee34$(_context34) {
1395
- while (1) switch (_context34.prev = _context34.next) {
1417
+ return _regeneratorRuntime().wrap(function _callee35$(_context35) {
1418
+ while (1) switch (_context35.prev = _context35.next) {
1396
1419
  case 0:
1397
1420
  query = _ref18.query, params = _ref18.params, body = _ref18.body, headers = _ref18.headers, method = _ref18.method;
1398
- return _context34.abrupt("return", {
1421
+ return _context35.abrupt("return", {
1399
1422
  send: "0"
1400
1423
  });
1401
1424
  case 2:
1402
1425
  case "end":
1403
- return _context34.stop();
1426
+ return _context35.stop();
1404
1427
  }
1405
- }, _callee34);
1428
+ }, _callee35);
1406
1429
  }));
1407
1430
  function ar_get_wallet_balance(_x35) {
1408
1431
  return _ar_get_wallet_balance.apply(this, arguments);
@@ -1412,22 +1435,22 @@ var Adaptor = /*#__PURE__*/function () {
1412
1435
  }, {
1413
1436
  key: "ar_get_mint",
1414
1437
  value: function () {
1415
- var _ar_get_mint = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee35(_ref19) {
1438
+ var _ar_get_mint = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee36(_ref19) {
1416
1439
  var query, params, body, headers, method;
1417
- return _regeneratorRuntime().wrap(function _callee35$(_context35) {
1418
- while (1) switch (_context35.prev = _context35.next) {
1440
+ return _regeneratorRuntime().wrap(function _callee36$(_context36) {
1441
+ while (1) switch (_context36.prev = _context36.next) {
1419
1442
  case 0:
1420
1443
  query = _ref19.query, params = _ref19.params, body = _ref19.body, headers = _ref19.headers, method = _ref19.method;
1421
- return _context35.abrupt("return", {
1444
+ return _context36.abrupt("return", {
1422
1445
  json: {
1423
1446
  id: "0"
1424
1447
  }
1425
1448
  });
1426
1449
  case 2:
1427
1450
  case "end":
1428
- return _context35.stop();
1451
+ return _context36.stop();
1429
1452
  }
1430
- }, _callee35);
1453
+ }, _callee36);
1431
1454
  }));
1432
1455
  function ar_get_mint(_x36) {
1433
1456
  return _ar_get_mint.apply(this, arguments);
@@ -1437,21 +1460,21 @@ var Adaptor = /*#__PURE__*/function () {
1437
1460
  }, {
1438
1461
  key: "ar_get_tx_offset",
1439
1462
  value: function () {
1440
- var _ar_get_tx_offset = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee36(_ref20) {
1463
+ var _ar_get_tx_offset = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee37(_ref20) {
1441
1464
  var query, params, body, headers, method;
1442
- return _regeneratorRuntime().wrap(function _callee36$(_context36) {
1443
- while (1) switch (_context36.prev = _context36.next) {
1465
+ return _regeneratorRuntime().wrap(function _callee37$(_context37) {
1466
+ while (1) switch (_context37.prev = _context37.next) {
1444
1467
  case 0:
1445
1468
  query = _ref20.query, params = _ref20.params, body = _ref20.body, headers = _ref20.headers, method = _ref20.method;
1446
- return _context36.abrupt("return", {
1469
+ return _context37.abrupt("return", {
1447
1470
  status: 400,
1448
1471
  send: null
1449
1472
  });
1450
1473
  case 2:
1451
1474
  case "end":
1452
- return _context36.stop();
1475
+ return _context37.stop();
1453
1476
  }
1454
- }, _callee36);
1477
+ }, _callee37);
1455
1478
  }));
1456
1479
  function ar_get_tx_offset(_x37) {
1457
1480
  return _ar_get_tx_offset.apply(this, arguments);
@@ -1461,20 +1484,20 @@ var Adaptor = /*#__PURE__*/function () {
1461
1484
  }, {
1462
1485
  key: "ar_get_tx_anchor",
1463
1486
  value: function () {
1464
- var _ar_get_tx_anchor = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee37(_ref21) {
1487
+ var _ar_get_tx_anchor = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee38(_ref21) {
1465
1488
  var query, params, body, headers, method;
1466
- return _regeneratorRuntime().wrap(function _callee37$(_context37) {
1467
- while (1) switch (_context37.prev = _context37.next) {
1489
+ return _regeneratorRuntime().wrap(function _callee38$(_context38) {
1490
+ while (1) switch (_context38.prev = _context38.next) {
1468
1491
  case 0:
1469
1492
  query = _ref21.query, params = _ref21.params, body = _ref21.body, headers = _ref21.headers, method = _ref21.method;
1470
- return _context37.abrupt("return", {
1493
+ return _context38.abrupt("return", {
1471
1494
  send: this.mem.getAnchor()
1472
1495
  });
1473
1496
  case 2:
1474
1497
  case "end":
1475
- return _context37.stop();
1498
+ return _context38.stop();
1476
1499
  }
1477
- }, _callee37, this);
1500
+ }, _callee38, this);
1478
1501
  }));
1479
1502
  function ar_get_tx_anchor(_x38) {
1480
1503
  return _ar_get_tx_anchor.apply(this, arguments);
@@ -1484,20 +1507,20 @@ var Adaptor = /*#__PURE__*/function () {
1484
1507
  }, {
1485
1508
  key: "ar_get_mine",
1486
1509
  value: function () {
1487
- var _ar_get_mine = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee38(_ref22) {
1510
+ var _ar_get_mine = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee39(_ref22) {
1488
1511
  var query, params, body, headers, method;
1489
- return _regeneratorRuntime().wrap(function _callee38$(_context38) {
1490
- while (1) switch (_context38.prev = _context38.next) {
1512
+ return _regeneratorRuntime().wrap(function _callee39$(_context39) {
1513
+ while (1) switch (_context39.prev = _context39.next) {
1491
1514
  case 0:
1492
1515
  query = _ref22.query, params = _ref22.params, body = _ref22.body, headers = _ref22.headers, method = _ref22.method;
1493
- return _context38.abrupt("return", {
1516
+ return _context39.abrupt("return", {
1494
1517
  json: params
1495
1518
  });
1496
1519
  case 2:
1497
1520
  case "end":
1498
- return _context38.stop();
1521
+ return _context39.stop();
1499
1522
  }
1500
- }, _callee38);
1523
+ }, _callee39);
1501
1524
  }));
1502
1525
  function ar_get_mine(_x39) {
1503
1526
  return _ar_get_mine.apply(this, arguments);
@@ -1507,33 +1530,33 @@ var Adaptor = /*#__PURE__*/function () {
1507
1530
  }, {
1508
1531
  key: "ar_get_id",
1509
1532
  value: function () {
1510
- var _ar_get_id = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee39(_ref23) {
1533
+ var _ar_get_id = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee40(_ref23) {
1511
1534
  var query, params, body, headers, method, _data;
1512
- return _regeneratorRuntime().wrap(function _callee39$(_context39) {
1513
- while (1) switch (_context39.prev = _context39.next) {
1535
+ return _regeneratorRuntime().wrap(function _callee40$(_context40) {
1536
+ while (1) switch (_context40.prev = _context40.next) {
1514
1537
  case 0:
1515
1538
  query = _ref23.query, params = _ref23.params, body = _ref23.body, headers = _ref23.headers, method = _ref23.method;
1516
- _context39.next = 3;
1539
+ _context40.next = 3;
1517
1540
  return this._ar.data(params.id);
1518
1541
  case 3:
1519
- _data = _context39.sent;
1542
+ _data = _context40.sent;
1520
1543
  if (_data) {
1521
- _context39.next = 8;
1544
+ _context40.next = 8;
1522
1545
  break;
1523
1546
  }
1524
- return _context39.abrupt("return", {
1547
+ return _context40.abrupt("return", {
1525
1548
  status: 404,
1526
1549
  send: null
1527
1550
  });
1528
1551
  case 8:
1529
- return _context39.abrupt("return", {
1552
+ return _context40.abrupt("return", {
1530
1553
  send: Buffer.from(_data, "base64")
1531
1554
  });
1532
1555
  case 9:
1533
1556
  case "end":
1534
- return _context39.stop();
1557
+ return _context40.stop();
1535
1558
  }
1536
- }, _callee39, this);
1559
+ }, _callee40, this);
1537
1560
  }));
1538
1561
  function ar_get_id(_x40) {
1539
1562
  return _ar_get_id.apply(this, arguments);
@@ -1543,20 +1566,20 @@ var Adaptor = /*#__PURE__*/function () {
1543
1566
  }, {
1544
1567
  key: "ar_get_price",
1545
1568
  value: function () {
1546
- var _ar_get_price = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee40(_ref24) {
1569
+ var _ar_get_price = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee41(_ref24) {
1547
1570
  var query, params, body, headers, method;
1548
- return _regeneratorRuntime().wrap(function _callee40$(_context40) {
1549
- while (1) switch (_context40.prev = _context40.next) {
1571
+ return _regeneratorRuntime().wrap(function _callee41$(_context41) {
1572
+ while (1) switch (_context41.prev = _context41.next) {
1550
1573
  case 0:
1551
1574
  query = _ref24.query, params = _ref24.params, body = _ref24.body, headers = _ref24.headers, method = _ref24.method;
1552
- return _context40.abrupt("return", {
1575
+ return _context41.abrupt("return", {
1553
1576
  send: "0"
1554
1577
  });
1555
1578
  case 2:
1556
1579
  case "end":
1557
- return _context40.stop();
1580
+ return _context41.stop();
1558
1581
  }
1559
- }, _callee40);
1582
+ }, _callee41);
1560
1583
  }));
1561
1584
  function ar_get_price(_x41) {
1562
1585
  return _ar_get_price.apply(this, arguments);
@@ -1566,13 +1589,13 @@ var Adaptor = /*#__PURE__*/function () {
1566
1589
  }, {
1567
1590
  key: "ar_post_graphql",
1568
1591
  value: function () {
1569
- var _ar_post_graphql = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee41(_ref25) {
1592
+ var _ar_post_graphql = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee42(_ref25) {
1570
1593
  var query, params, body, headers, method, _query, variables, _toGraphObj, tar, args, res2, edges;
1571
- return _regeneratorRuntime().wrap(function _callee41$(_context41) {
1572
- while (1) switch (_context41.prev = _context41.next) {
1594
+ return _regeneratorRuntime().wrap(function _callee42$(_context42) {
1595
+ while (1) switch (_context42.prev = _context42.next) {
1573
1596
  case 0:
1574
1597
  query = _ref25.query, params = _ref25.params, body = _ref25.body, headers = _ref25.headers, method = _ref25.method;
1575
- _context41.prev = 1;
1598
+ _context42.prev = 1;
1576
1599
  _query = body.query, variables = body.variables;
1577
1600
  _toGraphObj = (0, _utils.toGraphObj)({
1578
1601
  query: _query,
@@ -1580,24 +1603,24 @@ var Adaptor = /*#__PURE__*/function () {
1580
1603
  }), tar = _toGraphObj.tar, args = _toGraphObj.args;
1581
1604
  res2 = null;
1582
1605
  if (!(tar === "transactions")) {
1583
- _context41.next = 11;
1606
+ _context42.next = 11;
1584
1607
  break;
1585
1608
  }
1586
- _context41.next = 8;
1609
+ _context42.next = 8;
1587
1610
  return this.gql.txs(_objectSpread({}, args));
1588
1611
  case 8:
1589
- res2 = _context41.sent;
1590
- _context41.next = 15;
1612
+ res2 = _context42.sent;
1613
+ _context42.next = 15;
1591
1614
  break;
1592
1615
  case 11:
1593
1616
  if (!(tar === "blocks")) {
1594
- _context41.next = 15;
1617
+ _context42.next = 15;
1595
1618
  break;
1596
1619
  }
1597
- _context41.next = 14;
1620
+ _context42.next = 14;
1598
1621
  return this.gql.blocks(_objectSpread({}, args));
1599
1622
  case 14:
1600
- res2 = _context41.sent;
1623
+ res2 = _context42.sent;
1601
1624
  case 15:
1602
1625
  edges = (0, _ramda.map)(function (v) {
1603
1626
  return {
@@ -1605,31 +1628,29 @@ var Adaptor = /*#__PURE__*/function () {
1605
1628
  cursor: v.cursor
1606
1629
  };
1607
1630
  }, res2);
1608
- return _context41.abrupt("return", {
1631
+ return _context42.abrupt("return", {
1609
1632
  json: {
1610
- data: {
1611
- transactions: {
1612
- pageInfo: {
1613
- hasNextPage: true
1614
- },
1615
- edges: edges
1616
- }
1617
- }
1633
+ data: _defineProperty({}, tar, {
1634
+ pageInfo: {
1635
+ hasNextPage: true
1636
+ },
1637
+ edges: edges
1638
+ })
1618
1639
  }
1619
1640
  });
1620
1641
  case 19:
1621
- _context41.prev = 19;
1622
- _context41.t0 = _context41["catch"](1);
1623
- console.log(_context41.t0);
1624
- return _context41.abrupt("return", {
1642
+ _context42.prev = 19;
1643
+ _context42.t0 = _context42["catch"](1);
1644
+ console.log(_context42.t0);
1645
+ return _context42.abrupt("return", {
1625
1646
  status: 400,
1626
1647
  error: "bad request"
1627
1648
  });
1628
1649
  case 23:
1629
1650
  case "end":
1630
- return _context41.stop();
1651
+ return _context42.stop();
1631
1652
  }
1632
- }, _callee41, this, [[1, 19]]);
1653
+ }, _callee42, this, [[1, 19]]);
1633
1654
  }));
1634
1655
  function ar_post_graphql(_x42) {
1635
1656
  return _ar_post_graphql.apply(this, arguments);
@@ -1639,18 +1660,18 @@ var Adaptor = /*#__PURE__*/function () {
1639
1660
  }, {
1640
1661
  key: "ar_post_id",
1641
1662
  value: function () {
1642
- var _ar_post_id = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee42(_ref26) {
1663
+ var _ar_post_id = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime().mark(function _callee43(_ref26) {
1643
1664
  var query, params, body, headers, method, buf;
1644
- return _regeneratorRuntime().wrap(function _callee42$(_context42) {
1645
- while (1) switch (_context42.prev = _context42.next) {
1665
+ return _regeneratorRuntime().wrap(function _callee43$(_context43) {
1666
+ while (1) switch (_context43.prev = _context43.next) {
1646
1667
  case 0:
1647
1668
  query = _ref26.query, params = _ref26.params, body = _ref26.body, headers = _ref26.headers, method = _ref26.method;
1648
1669
  if (!body.chunk) {
1649
- _context42.next = 15;
1670
+ _context43.next = 15;
1650
1671
  break;
1651
1672
  }
1652
1673
  if (!this.data[body.data_root]) {
1653
- _context42.next = 12;
1674
+ _context43.next = 12;
1654
1675
  break;
1655
1676
  }
1656
1677
  this.data[body.data_root].data += body.chunk;
@@ -1662,42 +1683,42 @@ var Adaptor = /*#__PURE__*/function () {
1662
1683
  }
1663
1684
  delete body.chunk;
1664
1685
  if (!(this.data[body.data_root].data_size <= this.data[body.data_root].chunks.length)) {
1665
- _context42.next = 12;
1686
+ _context43.next = 12;
1666
1687
  break;
1667
1688
  }
1668
1689
  this.data[body.data_root].data = this.data[body.data_root].chunks.toString("base64");
1669
- _context42.next = 11;
1690
+ _context43.next = 11;
1670
1691
  return this._ar.postTx(this.data[body.data_root]);
1671
1692
  case 11:
1672
1693
  delete this.data[body.data_root];
1673
1694
  case 12:
1674
- return _context42.abrupt("return", {
1695
+ return _context43.abrupt("return", {
1675
1696
  json: {
1676
1697
  id: body.id
1677
1698
  }
1678
1699
  });
1679
1700
  case 15:
1680
1701
  if (!(body.data_root && body.data === "")) {
1681
- _context42.next = 19;
1702
+ _context43.next = 19;
1682
1703
  break;
1683
1704
  }
1684
1705
  this.data[body.data_root] = body;
1685
- _context42.next = 21;
1706
+ _context43.next = 21;
1686
1707
  break;
1687
1708
  case 19:
1688
- _context42.next = 21;
1709
+ _context43.next = 21;
1689
1710
  return this._ar.postTx(body);
1690
1711
  case 21:
1691
- return _context42.abrupt("return", {
1712
+ return _context43.abrupt("return", {
1692
1713
  json: {
1693
1714
  id: body.id
1694
1715
  }
1695
1716
  });
1696
1717
  case 22:
1697
1718
  case "end":
1698
- return _context42.stop();
1719
+ return _context43.stop();
1699
1720
  }
1700
- }, _callee42, this);
1721
+ }, _callee43, this);
1701
1722
  }));
1702
1723
  function ar_post_id(_x43) {
1703
1724
  return _ar_post_id.apply(this, arguments);