@zeroxyz/cli 0.0.11 → 0.0.13

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 +15 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ import { Command as Command8 } from "commander";
6
6
  // package.json
7
7
  var package_default = {
8
8
  name: "@zeroxyz/cli",
9
- version: "0.0.11",
9
+ version: "0.0.13",
10
10
  type: "module",
11
11
  bin: {
12
12
  zero: "dist/index.js",
@@ -832,6 +832,7 @@ var searchResultSchema = z2.object({
832
832
  position: z2.number(),
833
833
  slug: z2.string(),
834
834
  name: z2.string(),
835
+ canonicalName: z2.string().nullable().optional(),
835
836
  description: z2.string(),
836
837
  url: z2.string(),
837
838
  cost: z2.object({ amount: z2.string(), asset: z2.string() }),
@@ -994,6 +995,12 @@ var BASE_CHAIN_ID = 8453;
994
995
  var TEMPO_CHAIN_ID = 4217;
995
996
  var TEMPO_TESTNET_CHAIN_ID = 42431;
996
997
  var DEFAULT_MAX_DEPOSIT = "100";
998
+ var KNOWN_EIP712_DOMAINS = {
999
+ // USDC on Base
1000
+ [USDC_BASE.toLowerCase()]: { name: "USDC", version: "2" },
1001
+ // USDC on Base Sepolia
1002
+ [USDC_BASE_SEPOLIA.toLowerCase()]: { name: "USDC", version: "2" }
1003
+ };
997
1004
  var buildRelayClientOptions = () => ({
998
1005
  baseApiUrl: MAINNET_RELAY_API,
999
1006
  source: "zero-cli",
@@ -1115,6 +1122,13 @@ var PaymentService = class {
1115
1122
  new ExactEvmScheme(this.account)
1116
1123
  );
1117
1124
  client.onBeforePaymentCreation(async (context) => {
1125
+ const selected = context.selectedRequirements;
1126
+ if (selected && (!selected.extra?.name || !selected.extra?.version)) {
1127
+ const known = KNOWN_EIP712_DOMAINS[selected.asset?.toLowerCase() ?? ""];
1128
+ if (known) {
1129
+ selected.extra = { ...selected.extra, ...known };
1130
+ }
1131
+ }
1118
1132
  const requirement = context.paymentRequired.accepts[0];
1119
1133
  if (!requirement) return;
1120
1134
  capturedAmount = formatUnits(BigInt(requirement.amount), 6);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zeroxyz/cli",
3
- "version": "0.0.11",
3
+ "version": "0.0.13",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "zero": "dist/index.js",