@agent-score/commerce 2.0.0 → 2.0.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.
@@ -742,6 +742,21 @@ function wrapSolanaChargeWithFinalizedBlockhash(baseMethod, rpcUrl) {
742
742
  }
743
743
  };
744
744
  }
745
+ async function composeMppxRequest(mppx, intents, request) {
746
+ if (!mppx || typeof mppx !== "object" || !("compose" in mppx)) {
747
+ throw new Error("composeMppxRequest: argument is not an mppx server instance");
748
+ }
749
+ const compose = mppx.compose;
750
+ if (typeof compose !== "function") {
751
+ throw new Error("composeMppxRequest: mppx.compose is not a function");
752
+ }
753
+ const typedCompose = compose;
754
+ const handler = typedCompose.apply(mppx, [...intents]);
755
+ return handler(request);
756
+ }
757
+ function mppxChallengeHeaders(result) {
758
+ return Object.fromEntries(result.challenge.headers);
759
+ }
745
760
 
746
761
  // src/payment/dispatch.ts
747
762
  function detectRailFromHeaders(headers) {
@@ -1166,6 +1181,7 @@ export {
1166
1181
  buildX402AcceptsFor402,
1167
1182
  classifyOrchestrationError,
1168
1183
  classifyX402SettleResult,
1184
+ composeMppxRequest,
1169
1185
  createMppxServer,
1170
1186
  createX402Server,
1171
1187
  detectRailFromHeaders,
@@ -1178,6 +1194,7 @@ export {
1178
1194
  lazyX402Server,
1179
1195
  loadSolanaFeePayer,
1180
1196
  lookupRail,
1197
+ mppxChallengeHeaders,
1181
1198
  networkFamily,
1182
1199
  networks,
1183
1200
  paymentDirective,