@ar.io/sdk 3.21.0 → 3.21.1-alpha.1

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.
@@ -4,6 +4,7 @@ exports.epochDistributionNoticeGqlQueryFallback = exports.epochDistributionNotic
4
4
  exports.isBlockHeight = isBlockHeight;
5
5
  exports.sortAndPaginateEpochDataIntoEligibleDistributions = sortAndPaginateEpochDataIntoEligibleDistributions;
6
6
  exports.removeEligibleRewardsFromEpochData = removeEligibleRewardsFromEpochData;
7
+ const logger_js_1 = require("../common/logger.js");
7
8
  const constants_js_1 = require("../constants.js");
8
9
  const io_js_1 = require("../types/io.js");
9
10
  const ao_js_1 = require("./ao.js");
@@ -122,12 +123,22 @@ const getEpochDataFromGqlFallback = async ({ ao, epochIndex, processId = constan
122
123
  continue;
123
124
  }
124
125
  for (const message of messageResult?.Messages ?? []) {
125
- const data = JSON.parse(message.Data);
126
- const tags = message.Tags;
127
- // check if the message results include epoch-distribution-notice for the requested epoch index
128
- if (tags.some((tag) => tag.name === 'Action' && tag.value === 'Epoch-Distribution-Notice') &&
129
- tags.some((tag) => tag.name === 'Epoch-Index' && tag.value === epochIndex.toString())) {
130
- return (0, ao_js_1.parseAoEpochData)(data);
126
+ if (!message.Data) {
127
+ continue;
128
+ }
129
+ try {
130
+ const tags = message.Tags;
131
+ // check if the message results include epoch-distribution-notice for the requested epoch index
132
+ if (tags.some((tag) => tag.name === 'Action' &&
133
+ tag.value === 'Epoch-Distribution-Notice') &&
134
+ tags.some((tag) => tag.name === 'Epoch-Index' && tag.value === epochIndex.toString())) {
135
+ const data = JSON.parse(message.Data);
136
+ return (0, ao_js_1.parseAoEpochData)(data);
137
+ }
138
+ }
139
+ catch (error) {
140
+ // report but continue to next message
141
+ logger_js_1.Logger.default.error('Failed to parse AO epoch distribution message:', error, '\nMessage:', message);
131
142
  }
132
143
  }
133
144
  }
@@ -17,4 +17,4 @@
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
18
  exports.version = void 0;
19
19
  // AUTOMATICALLY GENERATED FILE - DO NOT TOUCH
20
- exports.version = '3.21.0';
20
+ exports.version = '3.21.1-alpha.1';
@@ -1,3 +1,4 @@
1
+ import { Logger } from '../common/logger.js';
1
2
  import { ARIO_MAINNET_PROCESS_ID, ARWEAVE_TX_REGEX } from '../constants.js';
2
3
  import { isDistributedEpoch, } from '../types/io.js';
3
4
  import { parseAoEpochData } from './ao.js';
@@ -111,12 +112,22 @@ export const getEpochDataFromGqlFallback = async ({ ao, epochIndex, processId =
111
112
  continue;
112
113
  }
113
114
  for (const message of messageResult?.Messages ?? []) {
114
- const data = JSON.parse(message.Data);
115
- const tags = message.Tags;
116
- // check if the message results include epoch-distribution-notice for the requested epoch index
117
- if (tags.some((tag) => tag.name === 'Action' && tag.value === 'Epoch-Distribution-Notice') &&
118
- tags.some((tag) => tag.name === 'Epoch-Index' && tag.value === epochIndex.toString())) {
119
- return parseAoEpochData(data);
115
+ if (!message.Data) {
116
+ continue;
117
+ }
118
+ try {
119
+ const tags = message.Tags;
120
+ // check if the message results include epoch-distribution-notice for the requested epoch index
121
+ if (tags.some((tag) => tag.name === 'Action' &&
122
+ tag.value === 'Epoch-Distribution-Notice') &&
123
+ tags.some((tag) => tag.name === 'Epoch-Index' && tag.value === epochIndex.toString())) {
124
+ const data = JSON.parse(message.Data);
125
+ return parseAoEpochData(data);
126
+ }
127
+ }
128
+ catch (error) {
129
+ // report but continue to next message
130
+ Logger.default.error('Failed to parse AO epoch distribution message:', error, '\nMessage:', message);
120
131
  }
121
132
  }
122
133
  }
@@ -14,4 +14,4 @@
14
14
  * limitations under the License.
15
15
  */
16
16
  // AUTOMATICALLY GENERATED FILE - DO NOT TOUCH
17
- export const version = '3.21.0';
17
+ export const version = '3.21.1-alpha.1';
@@ -13,4 +13,4 @@
13
13
  * See the License for the specific language governing permissions and
14
14
  * limitations under the License.
15
15
  */
16
- export declare const version = "3.21.0-alpha.1";
16
+ export declare const version = "3.21.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ar.io/sdk",
3
- "version": "3.21.0",
3
+ "version": "3.21.1-alpha.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/ar-io/ar-io-sdk.git"