@anywalletkit/protocol-swap2-core 0.8.0 → 0.9.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.
@@ -7,7 +7,7 @@ import {
7
7
  nativeUnits,
8
8
  normalizeTypedDomain,
9
9
  swap2ChainId
10
- } from "../chunk-CRCDWV3L.js";
10
+ } from "../chunk-PU5NM3Y6.js";
11
11
  import "../chunk-IVR3SREQ.js";
12
12
  import "../chunk-2KC734UX.js";
13
13
  export {
@@ -907,6 +907,8 @@ var BaseSwap2Protocol = class extends import_core.Swap2Protocol {
907
907
  }
908
908
  } else if (remote && !pinnedTargets.includes(unsigned.to.toLowerCase())) {
909
909
  throw new Swap2ValidationError(`swap2: remote provider '${q.provider}' calls ${(0, import_viem.getAddress)(unsigned.to)} on ${this.fromChain}, which the app did not pin as a call target (remoteProvider callTargets) \u2014 refused`);
910
+ } else if (remote && provider.verifiesQuotes !== true && provider.verifiesBuilds !== true) {
911
+ throw new Swap2ValidationError(`swap2: remote provider '${q.provider}' calls ${(0, import_viem.getAddress)(unsigned.to)} with calldata the app does not check (remoteProvider verifyQuote / verifyBuild) \u2014 refused`);
910
912
  }
911
913
  }
912
914
  const needsApproval = !!unsigned.approvalAddress && !!source.contract;
@@ -1394,6 +1396,9 @@ function remotePinRefusal(provider, q, chain) {
1394
1396
  if (tx.data !== void 0 && tx.to && !pinned(provider.callTargets?.(chain), tx.to)) {
1395
1397
  return `${provider.name}: the route calls ${tx.to}, which the app did not pin as a call target on ${chain} (remoteProvider callTargets)`;
1396
1398
  }
1399
+ if (tx.data !== void 0 && provider.verifiesQuotes !== true && provider.verifiesBuilds !== true) {
1400
+ return `${provider.name}: the route's calldata is not checked by the app (remoteProvider verifyQuote / verifyBuild) \u2014 a pinned target alone does not say whom it pays`;
1401
+ }
1397
1402
  return null;
1398
1403
  }
1399
1404