@scallop-io/sui-scallop-sdk 0.44.26 → 0.44.27

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
@@ -4927,10 +4927,13 @@ var requireObligationInfo2 = async (...params) => {
4927
4927
  if (obligations.length === 0) {
4928
4928
  throw new Error(`No obligation found for sender ${sender}`);
4929
4929
  }
4930
+ const selectedObligation = obligations.find(
4931
+ (obligation) => obligation.id === obligationId || obligation.keyId === obligationKey
4932
+ ) ?? obligations[0];
4930
4933
  return {
4931
- obligationId: obligations[0].id,
4932
- obligationKey: obligations[0].keyId,
4933
- obligationLocked: obligations[0].locked
4934
+ obligationId: selectedObligation.id,
4935
+ obligationKey: selectedObligation.keyId,
4936
+ obligationLocked: selectedObligation.locked
4934
4937
  };
4935
4938
  };
4936
4939
  var getBindedObligationId = async (builder, veScaKey) => {