@ar.io/sdk 2.0.0-alpha.8 → 2.0.0-alpha.9
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/bundles/web.bundle.min.js +2 -2
- package/lib/cjs/common/io.js +48 -8
- package/lib/cjs/version.js +1 -1
- package/lib/esm/common/io.js +48 -8
- package/lib/esm/version.js +1 -1
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
package/lib/cjs/common/io.js
CHANGED
|
@@ -52,7 +52,12 @@ class IOReadable {
|
|
|
52
52
|
{
|
|
53
53
|
name: 'Timestamp',
|
|
54
54
|
value: params?.timestamp?.toString() ??
|
|
55
|
-
(await this.arweave.blocks
|
|
55
|
+
(await this.arweave.blocks
|
|
56
|
+
.getCurrent()
|
|
57
|
+
.then((block) => {
|
|
58
|
+
return { timestamp: block.timestamp * 1000 };
|
|
59
|
+
})
|
|
60
|
+
.catch(() => {
|
|
56
61
|
return { timestamp: Date.now() }; // fallback to current time
|
|
57
62
|
})).timestamp.toString(),
|
|
58
63
|
},
|
|
@@ -72,7 +77,12 @@ class IOReadable {
|
|
|
72
77
|
{
|
|
73
78
|
name: 'Timestamp',
|
|
74
79
|
value: epoch?.timestamp?.toString() ??
|
|
75
|
-
(await this.arweave.blocks
|
|
80
|
+
(await this.arweave.blocks
|
|
81
|
+
.getCurrent()
|
|
82
|
+
.then((block) => {
|
|
83
|
+
return { timestamp: block.timestamp * 1000 };
|
|
84
|
+
})
|
|
85
|
+
.catch(() => {
|
|
76
86
|
return { timestamp: Date.now() }; // fallback to current time
|
|
77
87
|
})).timestamp.toString(),
|
|
78
88
|
},
|
|
@@ -144,7 +154,12 @@ class IOReadable {
|
|
|
144
154
|
{ name: 'Action', value: 'Epoch' },
|
|
145
155
|
{
|
|
146
156
|
name: 'Timestamp',
|
|
147
|
-
value: (await this.arweave.blocks
|
|
157
|
+
value: (await this.arweave.blocks
|
|
158
|
+
.getCurrent()
|
|
159
|
+
.then((block) => {
|
|
160
|
+
return { timestamp: block.timestamp * 1000 };
|
|
161
|
+
})
|
|
162
|
+
.catch(() => {
|
|
148
163
|
return { timestamp: Date.now() }; // fallback to current time
|
|
149
164
|
})).timestamp.toString(),
|
|
150
165
|
},
|
|
@@ -157,7 +172,12 @@ class IOReadable {
|
|
|
157
172
|
{
|
|
158
173
|
name: 'Timestamp',
|
|
159
174
|
value: epoch?.timestamp?.toString() ??
|
|
160
|
-
(await this.arweave.blocks
|
|
175
|
+
(await this.arweave.blocks
|
|
176
|
+
.getCurrent()
|
|
177
|
+
.then((block) => {
|
|
178
|
+
return { timestamp: block.timestamp * 1000 };
|
|
179
|
+
})
|
|
180
|
+
.catch(() => {
|
|
161
181
|
return { timestamp: Date.now() }; // fallback to current time
|
|
162
182
|
})).timestamp.toString(),
|
|
163
183
|
},
|
|
@@ -177,7 +197,12 @@ class IOReadable {
|
|
|
177
197
|
{
|
|
178
198
|
name: 'Timestamp',
|
|
179
199
|
value: epoch?.timestamp?.toString() ??
|
|
180
|
-
(await this.arweave.blocks
|
|
200
|
+
(await this.arweave.blocks
|
|
201
|
+
.getCurrent()
|
|
202
|
+
.then((block) => {
|
|
203
|
+
return { timestamp: block.timestamp * 1000 };
|
|
204
|
+
})
|
|
205
|
+
.catch(() => {
|
|
181
206
|
return { timestamp: Date.now() }; // fallback to current time
|
|
182
207
|
})).timestamp.toString(),
|
|
183
208
|
},
|
|
@@ -197,7 +222,12 @@ class IOReadable {
|
|
|
197
222
|
{
|
|
198
223
|
name: 'Timestamp',
|
|
199
224
|
value: epoch?.timestamp?.toString() ??
|
|
200
|
-
(await this.arweave.blocks
|
|
225
|
+
(await this.arweave.blocks
|
|
226
|
+
.getCurrent()
|
|
227
|
+
.then((block) => {
|
|
228
|
+
return { timestamp: block.timestamp * 1000 };
|
|
229
|
+
})
|
|
230
|
+
.catch(() => {
|
|
201
231
|
return { timestamp: `${Date.now()}` }; // fallback to current time
|
|
202
232
|
})).timestamp.toString(),
|
|
203
233
|
},
|
|
@@ -217,7 +247,12 @@ class IOReadable {
|
|
|
217
247
|
{
|
|
218
248
|
name: 'Timestamp',
|
|
219
249
|
value: epoch?.timestamp?.toString() ??
|
|
220
|
-
(await this.arweave.blocks
|
|
250
|
+
(await this.arweave.blocks
|
|
251
|
+
.getCurrent()
|
|
252
|
+
.then((block) => {
|
|
253
|
+
return { timestamp: block.timestamp * 1000 };
|
|
254
|
+
})
|
|
255
|
+
.catch(() => {
|
|
221
256
|
return { timestamp: Date.now() }; // fallback to current time
|
|
222
257
|
})).timestamp.toString(),
|
|
223
258
|
},
|
|
@@ -256,7 +291,12 @@ class IOReadable {
|
|
|
256
291
|
},
|
|
257
292
|
{
|
|
258
293
|
name: 'Timestamp',
|
|
259
|
-
value: (await this.arweave.blocks
|
|
294
|
+
value: (await this.arweave.blocks
|
|
295
|
+
.getCurrent()
|
|
296
|
+
.then((block) => {
|
|
297
|
+
return { timestamp: block.timestamp * 1000 };
|
|
298
|
+
})
|
|
299
|
+
.catch(() => {
|
|
260
300
|
return { timestamp: Date.now() }; // fallback to current time
|
|
261
301
|
})).timestamp.toString(),
|
|
262
302
|
},
|
package/lib/cjs/version.js
CHANGED
package/lib/esm/common/io.js
CHANGED
|
@@ -48,7 +48,12 @@ export class IOReadable {
|
|
|
48
48
|
{
|
|
49
49
|
name: 'Timestamp',
|
|
50
50
|
value: params?.timestamp?.toString() ??
|
|
51
|
-
(await this.arweave.blocks
|
|
51
|
+
(await this.arweave.blocks
|
|
52
|
+
.getCurrent()
|
|
53
|
+
.then((block) => {
|
|
54
|
+
return { timestamp: block.timestamp * 1000 };
|
|
55
|
+
})
|
|
56
|
+
.catch(() => {
|
|
52
57
|
return { timestamp: Date.now() }; // fallback to current time
|
|
53
58
|
})).timestamp.toString(),
|
|
54
59
|
},
|
|
@@ -68,7 +73,12 @@ export class IOReadable {
|
|
|
68
73
|
{
|
|
69
74
|
name: 'Timestamp',
|
|
70
75
|
value: epoch?.timestamp?.toString() ??
|
|
71
|
-
(await this.arweave.blocks
|
|
76
|
+
(await this.arweave.blocks
|
|
77
|
+
.getCurrent()
|
|
78
|
+
.then((block) => {
|
|
79
|
+
return { timestamp: block.timestamp * 1000 };
|
|
80
|
+
})
|
|
81
|
+
.catch(() => {
|
|
72
82
|
return { timestamp: Date.now() }; // fallback to current time
|
|
73
83
|
})).timestamp.toString(),
|
|
74
84
|
},
|
|
@@ -140,7 +150,12 @@ export class IOReadable {
|
|
|
140
150
|
{ name: 'Action', value: 'Epoch' },
|
|
141
151
|
{
|
|
142
152
|
name: 'Timestamp',
|
|
143
|
-
value: (await this.arweave.blocks
|
|
153
|
+
value: (await this.arweave.blocks
|
|
154
|
+
.getCurrent()
|
|
155
|
+
.then((block) => {
|
|
156
|
+
return { timestamp: block.timestamp * 1000 };
|
|
157
|
+
})
|
|
158
|
+
.catch(() => {
|
|
144
159
|
return { timestamp: Date.now() }; // fallback to current time
|
|
145
160
|
})).timestamp.toString(),
|
|
146
161
|
},
|
|
@@ -153,7 +168,12 @@ export class IOReadable {
|
|
|
153
168
|
{
|
|
154
169
|
name: 'Timestamp',
|
|
155
170
|
value: epoch?.timestamp?.toString() ??
|
|
156
|
-
(await this.arweave.blocks
|
|
171
|
+
(await this.arweave.blocks
|
|
172
|
+
.getCurrent()
|
|
173
|
+
.then((block) => {
|
|
174
|
+
return { timestamp: block.timestamp * 1000 };
|
|
175
|
+
})
|
|
176
|
+
.catch(() => {
|
|
157
177
|
return { timestamp: Date.now() }; // fallback to current time
|
|
158
178
|
})).timestamp.toString(),
|
|
159
179
|
},
|
|
@@ -173,7 +193,12 @@ export class IOReadable {
|
|
|
173
193
|
{
|
|
174
194
|
name: 'Timestamp',
|
|
175
195
|
value: epoch?.timestamp?.toString() ??
|
|
176
|
-
(await this.arweave.blocks
|
|
196
|
+
(await this.arweave.blocks
|
|
197
|
+
.getCurrent()
|
|
198
|
+
.then((block) => {
|
|
199
|
+
return { timestamp: block.timestamp * 1000 };
|
|
200
|
+
})
|
|
201
|
+
.catch(() => {
|
|
177
202
|
return { timestamp: Date.now() }; // fallback to current time
|
|
178
203
|
})).timestamp.toString(),
|
|
179
204
|
},
|
|
@@ -193,7 +218,12 @@ export class IOReadable {
|
|
|
193
218
|
{
|
|
194
219
|
name: 'Timestamp',
|
|
195
220
|
value: epoch?.timestamp?.toString() ??
|
|
196
|
-
(await this.arweave.blocks
|
|
221
|
+
(await this.arweave.blocks
|
|
222
|
+
.getCurrent()
|
|
223
|
+
.then((block) => {
|
|
224
|
+
return { timestamp: block.timestamp * 1000 };
|
|
225
|
+
})
|
|
226
|
+
.catch(() => {
|
|
197
227
|
return { timestamp: `${Date.now()}` }; // fallback to current time
|
|
198
228
|
})).timestamp.toString(),
|
|
199
229
|
},
|
|
@@ -213,7 +243,12 @@ export class IOReadable {
|
|
|
213
243
|
{
|
|
214
244
|
name: 'Timestamp',
|
|
215
245
|
value: epoch?.timestamp?.toString() ??
|
|
216
|
-
(await this.arweave.blocks
|
|
246
|
+
(await this.arweave.blocks
|
|
247
|
+
.getCurrent()
|
|
248
|
+
.then((block) => {
|
|
249
|
+
return { timestamp: block.timestamp * 1000 };
|
|
250
|
+
})
|
|
251
|
+
.catch(() => {
|
|
217
252
|
return { timestamp: Date.now() }; // fallback to current time
|
|
218
253
|
})).timestamp.toString(),
|
|
219
254
|
},
|
|
@@ -252,7 +287,12 @@ export class IOReadable {
|
|
|
252
287
|
},
|
|
253
288
|
{
|
|
254
289
|
name: 'Timestamp',
|
|
255
|
-
value: (await this.arweave.blocks
|
|
290
|
+
value: (await this.arweave.blocks
|
|
291
|
+
.getCurrent()
|
|
292
|
+
.then((block) => {
|
|
293
|
+
return { timestamp: block.timestamp * 1000 };
|
|
294
|
+
})
|
|
295
|
+
.catch(() => {
|
|
256
296
|
return { timestamp: Date.now() }; // fallback to current time
|
|
257
297
|
})).timestamp.toString(),
|
|
258
298
|
},
|
package/lib/esm/version.js
CHANGED
package/lib/types/version.d.ts
CHANGED