@stamprally/server 0.21.0 → 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.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { reconcileRewardStates, consumeReward, evaluateConditionDetailed } from '@stamprally/core';
1
+ import { reconcileRewardStates, consumeReward, sortOperationsDeterministically, evaluateConditionDetailed } from '@stamprally/core';
2
2
 
3
3
  // src/examples/transaction.ts
4
4
  async function executeClaimRewardTransaction(database, store, params2, mutation2) {
@@ -1296,8 +1296,12 @@ var StampRallyServer = class {
1296
1296
  );
1297
1297
  const results = [];
1298
1298
  const rejectedCheckIns = /* @__PURE__ */ new Set();
1299
- const operations = [...request.operations ?? []].map((operation, index) => ({ operation, index })).sort(
1300
- (left, right) => operationTimestamp(left.operation) - operationTimestamp(right.operation) || left.index - right.index
1299
+ const operations = sortOperationsDeterministically(
1300
+ [...request.operations ?? []].map((operation) => ({
1301
+ operation,
1302
+ operationId: syncOperationId(operation, directRequest.userId),
1303
+ timestamp: operationTimestamp(operation)
1304
+ }))
1301
1305
  ).map(({ operation }) => operation);
1302
1306
  for (const operation of operations) {
1303
1307
  try {