@ar.io/sdk 3.5.1-alpha.2 → 3.5.1-alpha.4
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 +20 -25
- package/lib/cjs/constants.js +2 -2
- package/lib/cjs/version.js +1 -1
- package/lib/esm/common/io.js +20 -25
- package/lib/esm/constants.js +2 -2
- package/lib/esm/version.js +1 -1
- package/lib/types/constants.d.ts +2 -2
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
package/lib/cjs/common/io.js
CHANGED
|
@@ -81,13 +81,12 @@ class ARIOReadable {
|
|
|
81
81
|
}));
|
|
82
82
|
}
|
|
83
83
|
async getEpoch(epoch) {
|
|
84
|
+
const epochIndex = await this.computeEpochIndex(epoch);
|
|
84
85
|
const currentIndex = await this.computeCurrentEpochIndex();
|
|
85
|
-
|
|
86
|
-
if (requestedEpochIndex !== undefined &&
|
|
87
|
-
requestedEpochIndex < currentIndex) {
|
|
86
|
+
if (epochIndex !== undefined && epochIndex < currentIndex) {
|
|
88
87
|
const epochData = await (0, arweave_js_1.getEpochDataFromGql)({
|
|
89
88
|
arweave: this.arweave,
|
|
90
|
-
epochIndex:
|
|
89
|
+
epochIndex: epochIndex,
|
|
91
90
|
processId: this.process.processId,
|
|
92
91
|
});
|
|
93
92
|
return epochData;
|
|
@@ -97,7 +96,7 @@ class ARIOReadable {
|
|
|
97
96
|
{ name: 'Action', value: 'Epoch' },
|
|
98
97
|
{
|
|
99
98
|
name: 'Epoch-Index',
|
|
100
|
-
value:
|
|
99
|
+
value: currentIndex.toString(),
|
|
101
100
|
},
|
|
102
101
|
];
|
|
103
102
|
return this.process.read({
|
|
@@ -209,13 +208,12 @@ class ARIOReadable {
|
|
|
209
208
|
});
|
|
210
209
|
}
|
|
211
210
|
async getPrescribedObservers(epoch) {
|
|
212
|
-
const
|
|
211
|
+
const epochIndex = await this.computeEpochIndex(epoch);
|
|
213
212
|
const currentIndex = await this.computeCurrentEpochIndex();
|
|
214
|
-
if (
|
|
215
|
-
requestedEpochIndex < currentIndex) {
|
|
213
|
+
if (epochIndex !== undefined && epochIndex < currentIndex) {
|
|
216
214
|
const epochData = await (0, arweave_js_1.getEpochDataFromGql)({
|
|
217
215
|
arweave: this.arweave,
|
|
218
|
-
epochIndex:
|
|
216
|
+
epochIndex: epochIndex,
|
|
219
217
|
processId: this.process.processId,
|
|
220
218
|
});
|
|
221
219
|
return epochData?.prescribedObservers;
|
|
@@ -224,7 +222,7 @@ class ARIOReadable {
|
|
|
224
222
|
{ name: 'Action', value: 'Epoch-Prescribed-Observers' },
|
|
225
223
|
{
|
|
226
224
|
name: 'Epoch-Index',
|
|
227
|
-
value:
|
|
225
|
+
value: currentIndex.toString(),
|
|
228
226
|
},
|
|
229
227
|
];
|
|
230
228
|
return this.process.read({
|
|
@@ -232,13 +230,12 @@ class ARIOReadable {
|
|
|
232
230
|
});
|
|
233
231
|
}
|
|
234
232
|
async getPrescribedNames(epoch) {
|
|
235
|
-
const
|
|
233
|
+
const epochIndex = await this.computeEpochIndex(epoch);
|
|
236
234
|
const currentIndex = await this.computeCurrentEpochIndex();
|
|
237
|
-
if (
|
|
238
|
-
requestedEpochIndex < currentIndex) {
|
|
235
|
+
if (epochIndex !== undefined && epochIndex < currentIndex) {
|
|
239
236
|
const epochData = await (0, arweave_js_1.getEpochDataFromGql)({
|
|
240
237
|
arweave: this.arweave,
|
|
241
|
-
epochIndex:
|
|
238
|
+
epochIndex: epochIndex,
|
|
242
239
|
processId: this.process.processId,
|
|
243
240
|
});
|
|
244
241
|
return epochData?.prescribedNames;
|
|
@@ -247,7 +244,7 @@ class ARIOReadable {
|
|
|
247
244
|
{ name: 'Action', value: 'Epoch-Prescribed-Names' },
|
|
248
245
|
{
|
|
249
246
|
name: 'Epoch-Index',
|
|
250
|
-
value:
|
|
247
|
+
value: currentIndex.toString(),
|
|
251
248
|
},
|
|
252
249
|
];
|
|
253
250
|
return this.process.read({
|
|
@@ -256,13 +253,12 @@ class ARIOReadable {
|
|
|
256
253
|
}
|
|
257
254
|
// we need to find the epoch index for the epoch that is currently being distributed and fetch it from gql
|
|
258
255
|
async getObservations(epoch) {
|
|
259
|
-
const
|
|
256
|
+
const epochIndex = await this.computeEpochIndex(epoch);
|
|
260
257
|
const currentIndex = await this.computeCurrentEpochIndex();
|
|
261
|
-
if (
|
|
262
|
-
requestedEpochIndex < currentIndex) {
|
|
258
|
+
if (epochIndex !== undefined && epochIndex < currentIndex) {
|
|
263
259
|
const epochData = await (0, arweave_js_1.getEpochDataFromGql)({
|
|
264
260
|
arweave: this.arweave,
|
|
265
|
-
epochIndex:
|
|
261
|
+
epochIndex: epochIndex,
|
|
266
262
|
processId: this.process.processId,
|
|
267
263
|
});
|
|
268
264
|
return epochData?.observations;
|
|
@@ -272,7 +268,7 @@ class ARIOReadable {
|
|
|
272
268
|
{ name: 'Action', value: 'Epoch-Observations' },
|
|
273
269
|
{
|
|
274
270
|
name: 'Epoch-Index',
|
|
275
|
-
value:
|
|
271
|
+
value: currentIndex.toString(),
|
|
276
272
|
},
|
|
277
273
|
];
|
|
278
274
|
return this.process.read({
|
|
@@ -280,13 +276,12 @@ class ARIOReadable {
|
|
|
280
276
|
});
|
|
281
277
|
}
|
|
282
278
|
async getDistributions(epoch) {
|
|
283
|
-
const
|
|
279
|
+
const epochIndex = await this.computeEpochIndex(epoch);
|
|
284
280
|
const currentIndex = await this.computeCurrentEpochIndex();
|
|
285
|
-
if (
|
|
286
|
-
requestedEpochIndex < currentIndex) {
|
|
281
|
+
if (epochIndex !== undefined && epochIndex < currentIndex) {
|
|
287
282
|
const epochData = await (0, arweave_js_1.getEpochDataFromGql)({
|
|
288
283
|
arweave: this.arweave,
|
|
289
|
-
epochIndex:
|
|
284
|
+
epochIndex: epochIndex,
|
|
290
285
|
processId: this.process.processId,
|
|
291
286
|
});
|
|
292
287
|
return epochData?.distributions;
|
|
@@ -296,7 +291,7 @@ class ARIOReadable {
|
|
|
296
291
|
{ name: 'Action', value: 'Epoch-Distributions' },
|
|
297
292
|
{
|
|
298
293
|
name: 'Epoch-Index',
|
|
299
|
-
value:
|
|
294
|
+
value: currentIndex.toString(),
|
|
300
295
|
},
|
|
301
296
|
];
|
|
302
297
|
return this.process.read({
|
package/lib/cjs/constants.js
CHANGED
|
@@ -29,7 +29,7 @@ exports.arioDevnetProcessId = exports.ARIO_DEVNET_PROCESS_ID;
|
|
|
29
29
|
exports.ARIO_TESTNET_PROCESS_ID = 'agYcCFJtrMG6cqMuZfskIkFTGvUPddICmtQSBIoPdiA';
|
|
30
30
|
exports.ANT_REGISTRY_ID = 'i_le_yKKPVstLTDSmkHRqf-wYphMnwB9OhleiTgMkWc';
|
|
31
31
|
exports.MARIO_PER_ARIO = 1_000_000;
|
|
32
|
-
exports.AOS_MODULE_ID = '
|
|
33
|
-
exports.ANT_LUA_ID = '
|
|
32
|
+
exports.AOS_MODULE_ID = '4uMwpOuU-YF9pKbqC73tmMCf2OLFUY8U0gCWEUCy-4M';
|
|
33
|
+
exports.ANT_LUA_ID = 's9drxRd-ylbJVtAi14tGmF7e42kA69PgfKUtgtmvAmU';
|
|
34
34
|
exports.AO_AUTHORITY = 'fcoN_xJeisVsPXA-trzVAuIiqO3ydLQxM-L4XbrQKzY';
|
|
35
35
|
exports.DEFAULT_SCHEDULER_ID = '_GQ33BkPtZrqxA84vM8Zk-N2aO0toNNu_C-l-rawrBA';
|
package/lib/cjs/version.js
CHANGED
package/lib/esm/common/io.js
CHANGED
|
@@ -77,13 +77,12 @@ export class ARIOReadable {
|
|
|
77
77
|
}));
|
|
78
78
|
}
|
|
79
79
|
async getEpoch(epoch) {
|
|
80
|
+
const epochIndex = await this.computeEpochIndex(epoch);
|
|
80
81
|
const currentIndex = await this.computeCurrentEpochIndex();
|
|
81
|
-
|
|
82
|
-
if (requestedEpochIndex !== undefined &&
|
|
83
|
-
requestedEpochIndex < currentIndex) {
|
|
82
|
+
if (epochIndex !== undefined && epochIndex < currentIndex) {
|
|
84
83
|
const epochData = await getEpochDataFromGql({
|
|
85
84
|
arweave: this.arweave,
|
|
86
|
-
epochIndex:
|
|
85
|
+
epochIndex: epochIndex,
|
|
87
86
|
processId: this.process.processId,
|
|
88
87
|
});
|
|
89
88
|
return epochData;
|
|
@@ -93,7 +92,7 @@ export class ARIOReadable {
|
|
|
93
92
|
{ name: 'Action', value: 'Epoch' },
|
|
94
93
|
{
|
|
95
94
|
name: 'Epoch-Index',
|
|
96
|
-
value:
|
|
95
|
+
value: currentIndex.toString(),
|
|
97
96
|
},
|
|
98
97
|
];
|
|
99
98
|
return this.process.read({
|
|
@@ -205,13 +204,12 @@ export class ARIOReadable {
|
|
|
205
204
|
});
|
|
206
205
|
}
|
|
207
206
|
async getPrescribedObservers(epoch) {
|
|
208
|
-
const
|
|
207
|
+
const epochIndex = await this.computeEpochIndex(epoch);
|
|
209
208
|
const currentIndex = await this.computeCurrentEpochIndex();
|
|
210
|
-
if (
|
|
211
|
-
requestedEpochIndex < currentIndex) {
|
|
209
|
+
if (epochIndex !== undefined && epochIndex < currentIndex) {
|
|
212
210
|
const epochData = await getEpochDataFromGql({
|
|
213
211
|
arweave: this.arweave,
|
|
214
|
-
epochIndex:
|
|
212
|
+
epochIndex: epochIndex,
|
|
215
213
|
processId: this.process.processId,
|
|
216
214
|
});
|
|
217
215
|
return epochData?.prescribedObservers;
|
|
@@ -220,7 +218,7 @@ export class ARIOReadable {
|
|
|
220
218
|
{ name: 'Action', value: 'Epoch-Prescribed-Observers' },
|
|
221
219
|
{
|
|
222
220
|
name: 'Epoch-Index',
|
|
223
|
-
value:
|
|
221
|
+
value: currentIndex.toString(),
|
|
224
222
|
},
|
|
225
223
|
];
|
|
226
224
|
return this.process.read({
|
|
@@ -228,13 +226,12 @@ export class ARIOReadable {
|
|
|
228
226
|
});
|
|
229
227
|
}
|
|
230
228
|
async getPrescribedNames(epoch) {
|
|
231
|
-
const
|
|
229
|
+
const epochIndex = await this.computeEpochIndex(epoch);
|
|
232
230
|
const currentIndex = await this.computeCurrentEpochIndex();
|
|
233
|
-
if (
|
|
234
|
-
requestedEpochIndex < currentIndex) {
|
|
231
|
+
if (epochIndex !== undefined && epochIndex < currentIndex) {
|
|
235
232
|
const epochData = await getEpochDataFromGql({
|
|
236
233
|
arweave: this.arweave,
|
|
237
|
-
epochIndex:
|
|
234
|
+
epochIndex: epochIndex,
|
|
238
235
|
processId: this.process.processId,
|
|
239
236
|
});
|
|
240
237
|
return epochData?.prescribedNames;
|
|
@@ -243,7 +240,7 @@ export class ARIOReadable {
|
|
|
243
240
|
{ name: 'Action', value: 'Epoch-Prescribed-Names' },
|
|
244
241
|
{
|
|
245
242
|
name: 'Epoch-Index',
|
|
246
|
-
value:
|
|
243
|
+
value: currentIndex.toString(),
|
|
247
244
|
},
|
|
248
245
|
];
|
|
249
246
|
return this.process.read({
|
|
@@ -252,13 +249,12 @@ export class ARIOReadable {
|
|
|
252
249
|
}
|
|
253
250
|
// we need to find the epoch index for the epoch that is currently being distributed and fetch it from gql
|
|
254
251
|
async getObservations(epoch) {
|
|
255
|
-
const
|
|
252
|
+
const epochIndex = await this.computeEpochIndex(epoch);
|
|
256
253
|
const currentIndex = await this.computeCurrentEpochIndex();
|
|
257
|
-
if (
|
|
258
|
-
requestedEpochIndex < currentIndex) {
|
|
254
|
+
if (epochIndex !== undefined && epochIndex < currentIndex) {
|
|
259
255
|
const epochData = await getEpochDataFromGql({
|
|
260
256
|
arweave: this.arweave,
|
|
261
|
-
epochIndex:
|
|
257
|
+
epochIndex: epochIndex,
|
|
262
258
|
processId: this.process.processId,
|
|
263
259
|
});
|
|
264
260
|
return epochData?.observations;
|
|
@@ -268,7 +264,7 @@ export class ARIOReadable {
|
|
|
268
264
|
{ name: 'Action', value: 'Epoch-Observations' },
|
|
269
265
|
{
|
|
270
266
|
name: 'Epoch-Index',
|
|
271
|
-
value:
|
|
267
|
+
value: currentIndex.toString(),
|
|
272
268
|
},
|
|
273
269
|
];
|
|
274
270
|
return this.process.read({
|
|
@@ -276,13 +272,12 @@ export class ARIOReadable {
|
|
|
276
272
|
});
|
|
277
273
|
}
|
|
278
274
|
async getDistributions(epoch) {
|
|
279
|
-
const
|
|
275
|
+
const epochIndex = await this.computeEpochIndex(epoch);
|
|
280
276
|
const currentIndex = await this.computeCurrentEpochIndex();
|
|
281
|
-
if (
|
|
282
|
-
requestedEpochIndex < currentIndex) {
|
|
277
|
+
if (epochIndex !== undefined && epochIndex < currentIndex) {
|
|
283
278
|
const epochData = await getEpochDataFromGql({
|
|
284
279
|
arweave: this.arweave,
|
|
285
|
-
epochIndex:
|
|
280
|
+
epochIndex: epochIndex,
|
|
286
281
|
processId: this.process.processId,
|
|
287
282
|
});
|
|
288
283
|
return epochData?.distributions;
|
|
@@ -292,7 +287,7 @@ export class ARIOReadable {
|
|
|
292
287
|
{ name: 'Action', value: 'Epoch-Distributions' },
|
|
293
288
|
{
|
|
294
289
|
name: 'Epoch-Index',
|
|
295
|
-
value:
|
|
290
|
+
value: currentIndex.toString(),
|
|
296
291
|
},
|
|
297
292
|
];
|
|
298
293
|
return this.process.read({
|
package/lib/esm/constants.js
CHANGED
|
@@ -26,7 +26,7 @@ export const arioDevnetProcessId = ARIO_DEVNET_PROCESS_ID;
|
|
|
26
26
|
export const ARIO_TESTNET_PROCESS_ID = 'agYcCFJtrMG6cqMuZfskIkFTGvUPddICmtQSBIoPdiA';
|
|
27
27
|
export const ANT_REGISTRY_ID = 'i_le_yKKPVstLTDSmkHRqf-wYphMnwB9OhleiTgMkWc';
|
|
28
28
|
export const MARIO_PER_ARIO = 1_000_000;
|
|
29
|
-
export const AOS_MODULE_ID = '
|
|
30
|
-
export const ANT_LUA_ID = '
|
|
29
|
+
export const AOS_MODULE_ID = '4uMwpOuU-YF9pKbqC73tmMCf2OLFUY8U0gCWEUCy-4M';
|
|
30
|
+
export const ANT_LUA_ID = 's9drxRd-ylbJVtAi14tGmF7e42kA69PgfKUtgtmvAmU';
|
|
31
31
|
export const AO_AUTHORITY = 'fcoN_xJeisVsPXA-trzVAuIiqO3ydLQxM-L4XbrQKzY';
|
|
32
32
|
export const DEFAULT_SCHEDULER_ID = '_GQ33BkPtZrqxA84vM8Zk-N2aO0toNNu_C-l-rawrBA';
|
package/lib/esm/version.js
CHANGED
package/lib/types/constants.d.ts
CHANGED
|
@@ -24,7 +24,7 @@ export declare const arioDevnetProcessId = "GaQrvEMKBpkjofgnBi_B3IgIDmY_XYelVLB6
|
|
|
24
24
|
export declare const ARIO_TESTNET_PROCESS_ID = "agYcCFJtrMG6cqMuZfskIkFTGvUPddICmtQSBIoPdiA";
|
|
25
25
|
export declare const ANT_REGISTRY_ID = "i_le_yKKPVstLTDSmkHRqf-wYphMnwB9OhleiTgMkWc";
|
|
26
26
|
export declare const MARIO_PER_ARIO = 1000000;
|
|
27
|
-
export declare const AOS_MODULE_ID = "
|
|
28
|
-
export declare const ANT_LUA_ID = "
|
|
27
|
+
export declare const AOS_MODULE_ID = "4uMwpOuU-YF9pKbqC73tmMCf2OLFUY8U0gCWEUCy-4M";
|
|
28
|
+
export declare const ANT_LUA_ID = "s9drxRd-ylbJVtAi14tGmF7e42kA69PgfKUtgtmvAmU";
|
|
29
29
|
export declare const AO_AUTHORITY = "fcoN_xJeisVsPXA-trzVAuIiqO3ydLQxM-L4XbrQKzY";
|
|
30
30
|
export declare const DEFAULT_SCHEDULER_ID = "_GQ33BkPtZrqxA84vM8Zk-N2aO0toNNu_C-l-rawrBA";
|
package/lib/types/version.d.ts
CHANGED