wao 0.36.3 → 0.36.6

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/cjs/bar.js CHANGED
@@ -171,30 +171,35 @@ var AR = /*#__PURE__*/function (_MAR) {
171
171
  _ref$target = _ref.target, target = _ref$target === void 0 ? "" : _ref$target, _ref$data = _ref.data, data = _ref$data === void 0 ? "1984" : _ref$data, _ref$tags = _ref.tags, tags = _ref$tags === void 0 ? {} : _ref$tags, signer = _ref.signer, item = _ref.item;
172
172
  di = item;
173
173
  if (di) {
174
- _context3.next = 9;
174
+ _context3.next = 10;
175
175
  break;
176
176
  }
177
- _context3.next = 5;
177
+ if (item !== null && item !== void 0 && item.signature) {
178
+ _context3.next = 8;
179
+ break;
180
+ }
181
+ _context3.next = 6;
178
182
  return signer({
179
183
  data: data,
180
184
  tags: (0, _utils.buildTags)(tags),
181
185
  target: target
182
186
  });
183
- case 5:
187
+ case 6:
184
188
  _item = _context3.sent;
185
189
  di = new DataItem(_item.raw);
186
- _context3.next = 10;
190
+ case 8:
191
+ _context3.next = 11;
187
192
  break;
188
- case 9:
189
- tags = (0, _utils.tags)(di.tags);
190
193
  case 10:
191
- _context3.next = 12;
194
+ tags = (0, _utils.tags)(di.tags);
195
+ case 11:
196
+ _context3.next = 13;
192
197
  return this.owner(di);
193
- case 12:
198
+ case 13:
194
199
  owner = _context3.sent;
195
- _context3.next = 15;
200
+ _context3.next = 16;
196
201
  return di.id;
197
- case 15:
202
+ case 16:
198
203
  _context3.t0 = _context3.sent;
199
204
  _context3.t1 = owner;
200
205
  _context3.t2 = di;
@@ -205,7 +210,7 @@ var AR = /*#__PURE__*/function (_MAR) {
205
210
  item: _context3.t2,
206
211
  tags: _context3.t3
207
212
  });
208
- case 20:
213
+ case 21:
209
214
  case "end":
210
215
  return _context3.stop();
211
216
  }
package/cjs/bundler.js CHANGED
@@ -57,11 +57,15 @@ var bundler = function bundler() {
57
57
  _context2.t0 = _regeneratorRuntime().keys((_out$body$commitments = (_out$body = out.body) === null || _out$body === void 0 ? void 0 : _out$body.commitments) !== null && _out$body$commitments !== void 0 ? _out$body$commitments : {});
58
58
  case 7:
59
59
  if ((_context2.t1 = _context2.t0()).done) {
60
- _context2.next = 57;
60
+ _context2.next = 58;
61
61
  break;
62
62
  }
63
63
  k = _context2.t1.value;
64
64
  msg = (_out$body2 = out.body) === null || _out$body2 === void 0 ? void 0 : _out$body2.commitments[k];
65
+ if (!(msg["commitment-device"] === "ans104@1.0")) {
66
+ _context2.next = 56;
67
+ break;
68
+ }
65
69
  signer = {
66
70
  signatureType: 1,
67
71
  signatureLength: 512,
@@ -101,14 +105,14 @@ var bundler = function bundler() {
101
105
  tags: tags
102
106
  };
103
107
  if (type !== "Process") opt.target = out.process;
104
- _context2.next = 18;
108
+ _context2.next = 19;
105
109
  return (0, _arbundles.createData)(out.data || "", signer, opt);
106
- case 18:
110
+ case 19:
107
111
  di = _context2.sent;
108
- _context2.next = 21;
112
+ _context2.next = 22;
109
113
  return di.setSignature(msg.signature);
110
- case 21:
111
- _context2.next = 23;
114
+ case 22:
115
+ _context2.next = 24;
112
116
  return fetch("https://up.arweave.net:443/tx", {
113
117
  method: "POST",
114
118
  headers: {
@@ -116,40 +120,40 @@ var bundler = function bundler() {
116
120
  },
117
121
  body: di.binary
118
122
  });
119
- case 23:
123
+ case 24:
120
124
  _res = _context2.sent;
121
125
  console.log(_res === null || _res === void 0 ? void 0 : _res.status, di.tags);
122
126
  dis = [di];
123
127
  if (!(type === "Message")) {
124
- _context2.next = 55;
128
+ _context2.next = 56;
125
129
  break;
126
130
  }
127
131
  if (out["block-timestamp"]) {
128
- _context2.next = 41;
132
+ _context2.next = 42;
129
133
  break;
130
134
  }
131
- _context2.prev = 28;
135
+ _context2.prev = 29;
132
136
  if (!(Date.now() - last_checked > timeout)) {
133
- _context2.next = 36;
137
+ _context2.next = 37;
134
138
  break;
135
139
  }
136
- _context2.next = 32;
140
+ _context2.next = 33;
137
141
  return fetch("https://arweave.net/block/current").then(function (r) {
138
142
  return r.json();
139
143
  });
140
- case 32:
144
+ case 33:
141
145
  json = _context2.sent;
142
146
  height = json.height;
143
147
  timestamp = json.timestamp;
144
148
  last_checked = Date.now();
145
- case 36:
146
- _context2.next = 41;
149
+ case 37:
150
+ _context2.next = 42;
147
151
  break;
148
- case 38:
149
- _context2.prev = 38;
150
- _context2.t2 = _context2["catch"](28);
152
+ case 39:
153
+ _context2.prev = 39;
154
+ _context2.t2 = _context2["catch"](29);
151
155
  console.log(_context2.t2);
152
- case 41:
156
+ case 42:
153
157
  atags = {
154
158
  Process: out.process,
155
159
  Epoch: out.epoch,
@@ -171,17 +175,17 @@ var bundler = function bundler() {
171
175
  });
172
176
  }
173
177
  _signer = new _turboSdk.ArweaveSigner(jwk);
174
- _context2.next = 47;
178
+ _context2.next = 48;
175
179
  return (0, _arbundles.createData)("", _signer, {
176
180
  tags: _tags
177
181
  });
178
- case 47:
182
+ case 48:
179
183
  di2 = _context2.sent;
180
- _context2.next = 50;
184
+ _context2.next = 51;
181
185
  return di2.sign(_signer);
182
- case 50:
186
+ case 51:
183
187
  dis.push(di2);
184
- _context2.next = 53;
188
+ _context2.next = 54;
185
189
  return fetch("https://up.arweave.net:443/tx", {
186
190
  method: "POST",
187
191
  headers: {
@@ -189,24 +193,24 @@ var bundler = function bundler() {
189
193
  },
190
194
  body: di2.binary
191
195
  });
192
- case 53:
196
+ case 54:
193
197
  res2 = _context2.sent;
194
198
  console.log(res2 === null || res2 === void 0 ? void 0 : res2.status, di2.tags);
195
- case 55:
199
+ case 56:
196
200
  _context2.next = 7;
197
201
  break;
198
- case 57:
199
- _context2.next = 62;
202
+ case 58:
203
+ _context2.next = 63;
200
204
  break;
201
- case 59:
202
- _context2.prev = 59;
205
+ case 60:
206
+ _context2.prev = 60;
203
207
  _context2.t3 = _context2["catch"](4);
204
208
  console.log(_context2.t3);
205
- case 62:
209
+ case 63:
206
210
  case "end":
207
211
  return _context2.stop();
208
212
  }
209
- }, _callee2, null, [[4, 59], [28, 38]]);
213
+ }, _callee2, null, [[4, 60], [29, 39]]);
210
214
  }));
211
215
  return function (_x, _x2) {
212
216
  return _ref2.apply(this, arguments);