@zeroxyz/cli 1.34.0 → 1.34.2

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.
Files changed (2) hide show
  1. package/dist/index.js +42 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -93043,7 +93043,7 @@ init_esm_shims();
93043
93043
  // ../sdk/dist/index.js
93044
93044
  init_esm_shims();
93045
93045
 
93046
- // ../sdk/dist/chunk-C5F7JW77.js
93046
+ // ../sdk/dist/chunk-53I2GRFF.js
93047
93047
  init_esm_shims();
93048
93048
 
93049
93049
  // ../../node_modules/.pnpm/viem@2.52.2_bufferutil@4.1.0_typescript@5.9.3_utf-8-validate@6.0.6_zod@4.3.6/node_modules/viem/_esm/index.js
@@ -166852,7 +166852,7 @@ var redactUrl = (raw) => {
166852
166852
  };
166853
166853
  var truncateError = (raw) => raw.length > ERROR_MAX ? `${raw.slice(0, ERROR_MAX)}\u2026` : raw;
166854
166854
  var package_default = {
166855
- version: "0.27.0"
166855
+ version: "0.27.2"
166856
166856
  };
166857
166857
  var SDK_VERSION2 = package_default.version;
166858
166858
  var ZeroError = class extends Error {
@@ -167415,7 +167415,6 @@ var ensureRelayClient = () => {
167415
167415
  if (relayInitialized) return;
167416
167416
  createClient2({
167417
167417
  baseApiUrl: MAINNET_RELAY_API,
167418
- source: "zero-sdk",
167419
167418
  chains: [
167420
167419
  convertViemChainToRelayChain(base),
167421
167420
  convertViemChainToRelayChain(tempo)
@@ -167458,7 +167457,10 @@ var executeByoReverseBridge = async (input) => {
167458
167457
  amount: amountRaw.toString(),
167459
167458
  tradeType: "EXACT_INPUT",
167460
167459
  user: account.address,
167461
- recipient: account.address
167460
+ recipient: account.address,
167461
+ // Pin the referrer off even if the host app configured the shared Relay
167462
+ // client with a `source` (see ensureRelayClient).
167463
+ options: { referrer: void 0 }
167462
167464
  });
167463
167465
  const stepTxs = [];
167464
167466
  for (const step of quote.steps ?? []) {
@@ -168889,7 +168891,8 @@ var Payments = class {
168889
168891
  recipient: account.address,
168890
168892
  // usePermit signs an EIP-712 Permit2 message — works for both
168891
168893
  // account mode and session mode (via managed-account adapter).
168892
- options: { usePermit: true }
168894
+ // referrer pinned off — see ensureRelayClient.
168895
+ options: { usePermit: true, referrer: void 0 }
168893
168896
  });
168894
168897
  let bridgeTxHash = null;
168895
168898
  await getClient().actions.execute({
@@ -168960,7 +168963,6 @@ var Payments = class {
168960
168963
  if (this.relayInitialized) return;
168961
168964
  createClient2({
168962
168965
  baseApiUrl: MAINNET_RELAY_API,
168963
- source: "zero-sdk",
168964
168966
  // Both chains registered so post-bridge confirmation polling can
168965
168967
  // resolve Tempo's RPC; omitting Tempo would hang waiting for a
168966
168968
  // Tempo tx hash on the Base transport.
@@ -169677,9 +169679,39 @@ var extractUnrecognizedKeys = (bodyRaw) => {
169677
169679
  visit(parsed);
169678
169680
  return [...new Set(out)].slice(0, 8);
169679
169681
  };
169682
+ var NOT_ACCEPTING_ORDERS_HINT = "this storefront isn't accepting orders yet \u2014 don't pay or retry; pick another capability";
169683
+ var STOREFRONT_GATE_HINTS = /* @__PURE__ */ new Map([
169684
+ [
169685
+ "plan_required",
169686
+ "the seller sells this call on a plan you don't hold \u2014 buy one of the plans listed in this response (POST its `purchase.url` with your identity bearer; a free trial costs nothing), then retry"
169687
+ ],
169688
+ [
169689
+ "verified_email_required",
169690
+ "the seller only serves buyers with a verified email \u2014 changing the request won't help; have the account owner verify their email on their Zero identity, then retry"
169691
+ ],
169692
+ [
169693
+ "usage_not_priced",
169694
+ "the seller hasn't priced this call on any plan, so it can't be bought right now \u2014 pick another capability"
169695
+ ],
169696
+ ["not_accepting_orders", NOT_ACCEPTING_ORDERS_HINT],
169697
+ ["signing_secret_required", NOT_ACCEPTING_ORDERS_HINT]
169698
+ ]);
169699
+ var STOREFRONT_GATE_CODE_RE = /\b(?:bearer|plan|verified_email|signing_secret|payment)_required\b/g;
169700
+ var storefrontGateCode = (bodyRaw) => {
169701
+ if (!bodyRaw) return void 0;
169702
+ try {
169703
+ const code = JSON.parse(bodyRaw)?.error;
169704
+ return typeof code === "string" ? code : void 0;
169705
+ } catch {
169706
+ return void 0;
169707
+ }
169708
+ };
169680
169709
  var computeFixHint = (status, message2, bodyRaw) => {
169681
169710
  if (status < 400 || status >= 500) return void 0;
169711
+ if (status === 402) return void 0;
169682
169712
  const hay = `${message2 ?? ""} ${bodyRaw ?? ""}`.toLowerCase();
169713
+ const gateHint = STOREFRONT_GATE_HINTS.get(storefrontGateCode(bodyRaw) ?? "");
169714
+ if (gateHint) return gateHint;
169683
169715
  if (status === 405 || /method not allowed|method_not_allowed/.test(hay)) {
169684
169716
  const allowed = extractAllowedMethod(`${bodyRaw ?? ""} ${message2 ?? ""}`);
169685
169717
  return allowed ? `the endpoint expects ${allowed}, not the method you used \u2014 retry with -X ${allowed}` : "the endpoint rejected this HTTP method \u2014 check the capability's method (`zero get <slug>`) and retry with the right -X";
@@ -169701,7 +169733,9 @@ var computeFixHint = (status, message2, bodyRaw) => {
169701
169733
  if ((status === 401 || status === 403) && /bearer|identity|unauthorized|credential|agent_auth/.test(hay)) {
169702
169734
  return 'the seller requires an agent identity credential \u2014 run `zero auth identity <host>` and resend with `-H "Authorization: Bearer <token>"`';
169703
169735
  }
169704
- if (/required|missing|must (include|provide|have|contain)|is expected/.test(hay)) {
169736
+ if (/required|missing|must (include|provide|have|contain)|is expected/.test(
169737
+ hay.replace(STOREFRONT_GATE_CODE_RE, "")
169738
+ )) {
169705
169739
  const field = extractFieldName(message2 ?? "");
169706
169740
  return field ? `add the required field '${field}' to the request body, then retry` : "the request is missing one or more required fields \u2014 check the capability schema (`zero get <slug>`), then retry";
169707
169741
  }
@@ -176859,7 +176893,7 @@ var placeholderFor = (fieldName, propSchema) => String(sampleValueFor(fieldName,
176859
176893
  // package.json
176860
176894
  var package_default2 = {
176861
176895
  name: "@zeroxyz/cli",
176862
- version: "1.34.0",
176896
+ version: "1.34.2",
176863
176897
  type: "module",
176864
176898
  bin: {
176865
176899
  zero: "dist/index.js",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeroxyz/cli",
3
- "version": "1.34.0",
3
+ "version": "1.34.2",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "zero": "dist/index.js",