@envarai/envarpay 0.2.0-alpha.9 → 2026.1025.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.
Files changed (85) hide show
  1. package/README.md +18 -56
  2. package/dist/commerce/agent-setup.d.ts +19 -0
  3. package/dist/commerce/agent-setup.js +210 -0
  4. package/dist/commerce/alerts.d.ts +5 -15
  5. package/dist/commerce/alerts.js +21 -77
  6. package/dist/commerce/card.js +1 -1
  7. package/dist/commerce/cli.js +74 -137
  8. package/dist/commerce/config.d.ts +1 -4
  9. package/dist/commerce/config.js +5 -81
  10. package/dist/commerce/configure.d.ts +2 -0
  11. package/dist/commerce/configure.js +78 -0
  12. package/dist/commerce/discovery.d.ts +20 -0
  13. package/dist/commerce/discovery.js +162 -0
  14. package/dist/commerce/envar-balance.d.ts +25 -0
  15. package/dist/commerce/envar-balance.js +65 -0
  16. package/dist/commerce/envar-runtime.d.ts +1 -0
  17. package/dist/commerce/envar-runtime.js +7 -0
  18. package/dist/commerce/envar.d.ts +13 -31
  19. package/dist/commerce/envar.js +35 -83
  20. package/dist/commerce/external-agent.d.ts +26 -0
  21. package/dist/commerce/external-agent.js +129 -0
  22. package/dist/commerce/external-events.d.ts +76 -0
  23. package/dist/commerce/external-events.js +273 -0
  24. package/dist/commerce/external-mcp.d.ts +10 -0
  25. package/dist/commerce/external-mcp.js +199 -0
  26. package/dist/commerce/external-oauth.d.ts +12 -0
  27. package/dist/commerce/external-oauth.js +230 -0
  28. package/dist/commerce/external-runtime.d.ts +25 -0
  29. package/dist/commerce/external-runtime.js +244 -0
  30. package/dist/commerce/managed.d.ts +3 -0
  31. package/dist/commerce/managed.js +143 -0
  32. package/dist/commerce/native-inventory.d.ts +9 -0
  33. package/dist/commerce/native-inventory.js +75 -0
  34. package/dist/commerce/native-skills.d.ts +8 -0
  35. package/dist/commerce/native-skills.js +11 -8
  36. package/dist/commerce/openclaw-setup.d.ts +28 -0
  37. package/dist/commerce/openclaw-setup.js +43 -0
  38. package/dist/commerce/operations.d.ts +1 -2
  39. package/dist/commerce/operations.js +17 -20
  40. package/dist/commerce/pricing.d.ts +0 -1
  41. package/dist/commerce/pricing.js +1 -3
  42. package/dist/commerce/runtime.d.ts +2 -2
  43. package/dist/commerce/runtime.js +2 -2
  44. package/dist/commerce/server.d.ts +0 -1
  45. package/dist/commerce/server.js +2 -3
  46. package/dist/commerce/setup.d.ts +25 -0
  47. package/dist/commerce/setup.js +379 -0
  48. package/dist/commerce/store.d.ts +11 -1
  49. package/dist/commerce/store.js +36 -2
  50. package/dist/commerce/types.d.ts +1 -56
  51. package/examples/envar-integration-policy.json +1 -9
  52. package/examples/seller.json +143 -26
  53. package/package.json +11 -20
  54. package/runtime/hermes-setup-probe.py +109 -0
  55. package/runtime/hermes-skill-inventory.py +108 -0
  56. package/schemas/envarpay.config.schema.json +7 -73
  57. package/dist/commerce/buyer-store.d.ts +0 -101
  58. package/dist/commerce/buyer-store.js +0 -168
  59. package/dist/commerce/buyer.d.ts +0 -138
  60. package/dist/commerce/buyer.js +0 -775
  61. package/dist/commerce/chain.d.ts +0 -24
  62. package/dist/commerce/chain.js +0 -146
  63. package/dist/commerce/client-runtime.d.ts +0 -8
  64. package/dist/commerce/client-runtime.js +0 -7
  65. package/dist/commerce/management.d.ts +0 -14
  66. package/dist/commerce/management.js +0 -140
  67. package/dist/commerce/mpp-client.d.ts +0 -70
  68. package/dist/commerce/mpp-client.js +0 -29
  69. package/dist/commerce/mpp-runtime.d.ts +0 -4
  70. package/dist/commerce/mpp-runtime.js +0 -4
  71. package/dist/commerce/mpp.d.ts +0 -53
  72. package/dist/commerce/mpp.js +0 -163
  73. package/dist/commerce/peer-proxy.d.ts +0 -44
  74. package/dist/commerce/peer-proxy.js +0 -673
  75. package/dist/commerce/stripe-issuer.d.ts +0 -41
  76. package/dist/commerce/stripe-issuer.js +0 -351
  77. package/dist/commerce/stripe-provider.d.ts +0 -11
  78. package/dist/commerce/stripe-provider.js +0 -132
  79. package/dist/commerce/x402.d.ts +0 -38
  80. package/dist/commerce/x402.js +0 -181
  81. package/dist/index.d.ts +0 -95
  82. package/dist/index.js +0 -163
  83. package/examples/buyer-policy.json +0 -18
  84. package/schemas/buyer-policy.schema.json +0 -253
  85. /package/{examples → runtime}/native-skill-runner.py +0 -0
@@ -1,52 +1,169 @@
1
1
  {
2
2
  "configVersion": 1,
3
- "agent": {"id": "hermes-researcher", "name": "我的研究助手"},
3
+ "agent": {
4
+ "id": "hermes-researcher",
5
+ "name": "我的研究助手"
6
+ },
4
7
  "paymentProfiles": {
5
- "base-usdc": {
6
- "adapter": "x402", "scheme": "exact", "network": "eip155:84532",
7
- "asset": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
8
- "payTo": "0x2222222222222222222222222222222222222222",
9
- "facilitatorUrl": "https://facilitator.example"
10
- },
11
- "stripe-usd": {"adapter": "mpp", "method": "stripe", "intent": "charge", "currency": "usd", "accountRef": "seller-stripe"}
8
+ "envar-usd": {
9
+ "adapter": "envar_balance",
10
+ "currency": "usd",
11
+ "accountRef": "envar"
12
+ }
12
13
  },
13
14
  "services": [
14
15
  {
15
- "id": "research", "name": "竞品调研", "revision": 1,
16
- "execution": {"type": "a2a", "cardUrl": "http://hermes:9000/research/agent-card.json"},
16
+ "id": "research",
17
+ "name": "竞品调研",
18
+ "revision": 1,
19
+ "execution": {
20
+ "type": "a2a",
21
+ "cardUrl": "http://hermes:9000/research/agent-card.json"
22
+ },
17
23
  "contract": {
18
24
  "inputSchema": {
19
25
  "$schema": "https://json-schema.org/draft/2020-12/schema",
20
- "type": "object", "additionalProperties": false, "required": ["topic", "competitors"],
26
+ "type": "object",
27
+ "additionalProperties": false,
28
+ "required": [
29
+ "topic",
30
+ "competitors"
31
+ ],
21
32
  "properties": {
22
- "topic": {"type": "string", "minLength": 1, "maxLength": 500},
23
- "competitors": {"type": "array", "minItems": 1, "maxItems": 3, "uniqueItems": true, "items": {"type": "string", "minLength": 1, "maxLength": 120}}
33
+ "topic": {
34
+ "type": "string",
35
+ "minLength": 1,
36
+ "maxLength": 500
37
+ },
38
+ "competitors": {
39
+ "type": "array",
40
+ "minItems": 1,
41
+ "maxItems": 3,
42
+ "uniqueItems": true,
43
+ "items": {
44
+ "type": "string",
45
+ "minLength": 1,
46
+ "maxLength": 120
47
+ }
48
+ }
24
49
  }
25
50
  },
26
- "deliverables": ["report.md", "comparison.csv"], "targetDurationSeconds": 600, "includedRevisions": 0
51
+ "deliverables": [
52
+ "report.md",
53
+ "comparison.csv"
54
+ ],
55
+ "targetDurationSeconds": 600,
56
+ "includedRevisions": 0
27
57
  },
28
58
  "offers": [
29
- {"id": "usdc-once", "pricing": {"kind": "fixed", "amount": "3000000"}, "collection": {"kind": "upfront"}, "paymentProfile": "base-usdc"},
30
- {"id": "card-once", "pricing": {"kind": "fixed", "amount": "300"}, "collection": {"kind": "upfront"}, "paymentProfile": "stripe-usd"}
59
+ {
60
+ "id": "balance-once",
61
+ "pricing": {
62
+ "kind": "fixed",
63
+ "amount": "3000000"
64
+ },
65
+ "collection": {
66
+ "kind": "upfront"
67
+ },
68
+ "paymentProfile": "envar-usd"
69
+ }
31
70
  ]
32
71
  },
33
72
  {
34
- "id": "summary-preview", "name": "免费试读", "revision": 1,
35
- "execution": {"type": "a2a", "cardUrl": "http://hermes:9000/preview/agent-card.json"},
73
+ "id": "summary-preview",
74
+ "name": "免费试读",
75
+ "revision": 1,
76
+ "execution": {
77
+ "type": "a2a",
78
+ "cardUrl": "http://hermes:9000/preview/agent-card.json"
79
+ },
36
80
  "contract": {
37
- "inputSchema": {"type": "object", "additionalProperties": false, "required": ["text"], "properties": {"text": {"type": "string", "minLength": 1, "maxLength": 500}}},
38
- "deliverables": ["summary.txt"], "targetDurationSeconds": 60, "includedRevisions": 0
81
+ "inputSchema": {
82
+ "type": "object",
83
+ "additionalProperties": false,
84
+ "required": [
85
+ "text"
86
+ ],
87
+ "properties": {
88
+ "text": {
89
+ "type": "string",
90
+ "minLength": 1,
91
+ "maxLength": 500
92
+ }
93
+ }
94
+ },
95
+ "deliverables": [
96
+ "summary.txt"
97
+ ],
98
+ "targetDurationSeconds": 60,
99
+ "includedRevisions": 0
39
100
  },
40
- "offers": [{"id": "free", "pricing": {"kind": "free"}, "collection": {"kind": "none"}}]
101
+ "offers": [
102
+ {
103
+ "id": "free",
104
+ "pricing": {
105
+ "kind": "free"
106
+ },
107
+ "collection": {
108
+ "kind": "none"
109
+ }
110
+ }
111
+ ]
41
112
  },
42
113
  {
43
- "id": "translation", "name": "文档翻译", "revision": 1,
44
- "execution": {"type": "a2a", "cardUrl": "http://openclaw:9000/translate/agent-card.json"},
114
+ "id": "translation",
115
+ "name": "文档翻译",
116
+ "revision": 1,
117
+ "execution": {
118
+ "type": "a2a",
119
+ "cardUrl": "http://openclaw:9000/translate/agent-card.json"
120
+ },
45
121
  "contract": {
46
- "inputSchema": {"type": "object", "additionalProperties": false, "required": ["documents"], "properties": {"documents": {"type": "array", "minItems": 1, "maxItems": 20, "items": {"type": "string", "minLength": 1, "maxLength": 10000}}}},
47
- "deliverables": ["translations.json"], "targetDurationSeconds": 600, "includedRevisions": 0
122
+ "inputSchema": {
123
+ "type": "object",
124
+ "additionalProperties": false,
125
+ "required": [
126
+ "documents"
127
+ ],
128
+ "properties": {
129
+ "documents": {
130
+ "type": "array",
131
+ "minItems": 1,
132
+ "maxItems": 20,
133
+ "items": {
134
+ "type": "string",
135
+ "minLength": 1,
136
+ "maxLength": 10000
137
+ }
138
+ }
139
+ }
140
+ },
141
+ "deliverables": [
142
+ "translations.json"
143
+ ],
144
+ "targetDurationSeconds": 600,
145
+ "includedRevisions": 0
48
146
  },
49
- "offers": [{"id": "per-document", "pricing": {"kind": "quantity", "unit": "document", "unitAmount": "100000", "quantity": {"pointer": "/documents", "measure": "count", "min": 1, "max": 20}}, "collection": {"kind": "upfront"}, "paymentProfile": "base-usdc"}]
147
+ "offers": [
148
+ {
149
+ "id": "per-document",
150
+ "pricing": {
151
+ "kind": "quantity",
152
+ "unit": "document",
153
+ "unitAmount": "100000",
154
+ "quantity": {
155
+ "pointer": "/documents",
156
+ "measure": "count",
157
+ "min": 1,
158
+ "max": 20
159
+ }
160
+ },
161
+ "collection": {
162
+ "kind": "upfront"
163
+ },
164
+ "paymentProfile": "envar-usd"
165
+ }
166
+ ]
50
167
  }
51
168
  ]
52
169
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@envarai/envarpay",
3
- "version": "0.2.0-alpha.9",
4
- "description": "Independent A2A service commerce, budgeted buyers and x402/MPP payments",
3
+ "version": "2026.1025.1",
4
+ "description": "A2A services with Envar account-balance payments",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "engines": {
@@ -20,18 +20,10 @@
20
20
  "types": "./dist/commerce/runtime.d.ts",
21
21
  "import": "./dist/commerce/runtime.js"
22
22
  },
23
- "./client": {
24
- "types": "./dist/commerce/client-runtime.d.ts",
25
- "import": "./dist/commerce/client-runtime.js"
26
- },
27
23
  "./server": {
28
24
  "types": "./dist/commerce/runtime.d.ts",
29
25
  "import": "./dist/commerce/runtime.js"
30
26
  },
31
- "./mpp": {
32
- "types": "./dist/commerce/mpp-runtime.d.ts",
33
- "import": "./dist/commerce/mpp-runtime.js"
34
- },
35
27
  "./envar": {
36
28
  "types": "./dist/commerce/envar.d.ts",
37
29
  "import": "./dist/commerce/envar.js"
@@ -42,7 +34,8 @@
42
34
  "README.md",
43
35
  "LICENSE",
44
36
  "schemas",
45
- "examples"
37
+ "examples",
38
+ "runtime"
46
39
  ],
47
40
  "repository": {
48
41
  "type": "git",
@@ -51,24 +44,22 @@
51
44
  },
52
45
  "publishConfig": {
53
46
  "access": "public",
54
- "tag": "next"
47
+ "tag": "latest"
55
48
  },
56
49
  "scripts": {
57
- "build": "tsc",
58
- "test": "npm run build && node --test test/*.test.mjs",
59
- "prepack": "npm run build"
50
+ "build": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\" && tsc",
51
+ "test": "npm run build && node --test test/*.test.mjs ../../scripts/release.test.mjs",
52
+ "prepack": "npm run build",
53
+ "version:date": "node ../../scripts/release-version.mjs"
60
54
  },
61
55
  "dependencies": {
62
56
  "@a2a-js/sdk": "1.2.1",
63
57
  "@modelcontextprotocol/sdk": "^1.31.0",
64
- "@x402/core": "2.24.0",
65
- "@x402/evm": "2.24.0",
66
- "@x402/extensions": "2.24.0",
67
58
  "ajv": "8.20.0",
68
59
  "ajv-formats": "3.0.1",
69
60
  "canonicalize": "2.1.0",
70
- "mppx": "0.13.1",
71
- "viem": "2.57.1"
61
+ "yaml": "2.8.2",
62
+ "zod": "4.6.5"
72
63
  },
73
64
  "devDependencies": {
74
65
  "@types/node": "^22.0.0",
@@ -0,0 +1,109 @@
1
+ """Read owner-local Hermes settings through a private pipe; never calls a model."""
2
+
3
+ import json
4
+ import os
5
+ import shlex
6
+ import sys
7
+ from pathlib import Path
8
+
9
+ try:
10
+ import hermes_yaml as yaml
11
+ except ImportError:
12
+ import yaml
13
+
14
+
15
+ def inspect(home):
16
+ home = Path(home or os.environ.get("HERMES_HOME", "~/.hermes")).expanduser().resolve()
17
+ config = yaml.safe_load((home / "config.yaml").read_text()) or {}
18
+ model = config.get("model", {})
19
+ if isinstance(model, str):
20
+ model = {"default": model}
21
+ provider_id = str(model.get("provider", "")).removeprefix("custom:")
22
+ provider = config.get("providers", {}).get(provider_id, {})
23
+ dotenv = {}
24
+ if (home / ".env").exists():
25
+ for line in (home / ".env").read_text().splitlines():
26
+ key, sep, value = line.partition("=")
27
+ if sep and not key.strip().startswith("#"):
28
+ dotenv[key.strip()] = value.strip().strip("\"'")
29
+ key_file = None
30
+ command = shlex.split(provider.get("key_cmd", ""))
31
+ if len(command) == 2 and command[0] == "cat":
32
+ key_file = str(Path(command[1]).expanduser().resolve())
33
+ key = (
34
+ provider.get("api_key")
35
+ or provider.get("key")
36
+ or dotenv.get(provider.get("key_env", ""))
37
+ or os.environ.get(provider.get("key_env", ""))
38
+ or dotenv.get("OPENAI_API_KEY")
39
+ or os.environ.get("OPENAI_API_KEY")
40
+ )
41
+ base = (
42
+ provider.get("api")
43
+ or provider.get("base_url")
44
+ or model.get("base_url")
45
+ or dotenv.get("OPENAI_BASE_URL")
46
+ or os.environ.get("OPENAI_BASE_URL")
47
+ )
48
+ if not model.get("default") or not base or not (key_file or key):
49
+ raise ValueError("Model configuration unavailable")
50
+ if key_file and (not Path(key_file).is_file() or not Path(key_file).read_text().strip()):
51
+ raise ValueError("Model key unavailable")
52
+ roots = [home / "skills"]
53
+ roots.extend(
54
+ Path(os.path.expandvars(str(p))).expanduser().resolve()
55
+ for p in config.get("skills", {}).get("external_dirs", [])
56
+ )
57
+ skills = []
58
+ seen = set()
59
+ for root in roots:
60
+ for entry in sorted(root.rglob("SKILL.md")) if root.is_dir() else []:
61
+ if entry.is_symlink():
62
+ continue
63
+ raw = entry.read_text()
64
+ front = raw.split("---", 2)
65
+ meta = yaml.safe_load(front[1]) if raw.startswith("---\n") and len(front) == 3 else {}
66
+ name = (meta or {}).get("name")
67
+ if not isinstance(name, str) or name in seen:
68
+ continue
69
+ seen.add(name)
70
+ files = []
71
+ unsupported = False
72
+ for file in entry.parent.rglob("*"):
73
+ if file.is_symlink():
74
+ unsupported = True
75
+ elif file.is_file():
76
+ if file.suffix.lower() not in {".md", ".txt"} and file.name != "LICENSE":
77
+ unsupported = True
78
+ files.append(str(file.relative_to(entry.parent)))
79
+ skills.append(
80
+ {
81
+ "name": name,
82
+ "path": str(entry.parent),
83
+ "description": str((meta or {}).get("description", ""))[:500],
84
+ "textPackage": not unsupported,
85
+ "files": len(files),
86
+ }
87
+ )
88
+ return {
89
+ "home": str(home),
90
+ "python": sys.executable,
91
+ "model": model["default"],
92
+ "baseUrl": base,
93
+ "apiKeyFile": key_file,
94
+ "apiKey": None if key_file else key,
95
+ "skills": skills,
96
+ "skillRoots": [str(root) for root in roots],
97
+ }
98
+
99
+
100
+ if __name__ == "__main__":
101
+ try:
102
+ print(json.dumps(inspect(sys.argv[1] if len(sys.argv) > 1 else None)))
103
+ except Exception:
104
+ print(
105
+ "Cannot read this Hermes model configuration. "
106
+ "Configure an OpenAI-compatible model with a base URL and a local API key first.",
107
+ file=sys.stderr,
108
+ )
109
+ sys.exit(1)
@@ -0,0 +1,108 @@
1
+ """Bounded, metadata-only local inventory. Never reads model credentials or executes Skills."""
2
+
3
+ import hashlib
4
+ import json
5
+ import os
6
+ import re
7
+ import sys
8
+ from pathlib import Path
9
+
10
+ try:
11
+ import hermes_yaml as yaml
12
+ except ImportError:
13
+ import yaml
14
+
15
+
16
+ def inventory(home):
17
+ home = Path(home or os.environ.get("HERMES_HOME", "~/.hermes")).expanduser().resolve()
18
+ config = yaml.safe_load((home / "config.yaml").read_text()) or {}
19
+ roots = [home / "skills"]
20
+ roots.extend(
21
+ Path(os.path.expandvars(str(p))).expanduser().resolve()
22
+ for p in config.get("skills", {}).get("external_dirs", [])
23
+ )
24
+ result, seen = [], set()
25
+ for root in roots:
26
+ if not root.is_dir():
27
+ continue
28
+ for folder, directories, files in os.walk(root, followlinks=False):
29
+ directories[:] = sorted(
30
+ d
31
+ for d in directories
32
+ if not d.startswith(".") and not (Path(folder) / d).is_symlink()
33
+ )
34
+ if len(Path(folder).relative_to(root).parts) > 10:
35
+ directories[:] = []
36
+ continue
37
+ if "SKILL.md" not in files:
38
+ continue
39
+ entry = Path(folder) / "SKILL.md"
40
+ if entry.is_symlink() or entry.stat().st_size > 48000:
41
+ continue
42
+ raw = entry.read_text()
43
+ front = raw.split("---", 2)
44
+ try:
45
+ meta = (
46
+ yaml.safe_load(front[1]) if raw.startswith("---\n") and len(front) == 3 else {}
47
+ )
48
+ except Exception:
49
+ continue
50
+ name = (meta or {}).get("name")
51
+ if (
52
+ not isinstance(name, str)
53
+ or not re.fullmatch(r"[a-z][a-z0-9-]{0,63}", name)
54
+ or name in seen
55
+ ):
56
+ continue
57
+ seen.add(name)
58
+ package, size, supported = [], 0, True
59
+ for subfolder, dirs, names in os.walk(entry.parent, followlinks=False):
60
+ for d in dirs[:]:
61
+ if (Path(subfolder) / d).is_symlink():
62
+ supported = False
63
+ dirs.remove(d)
64
+ if len(Path(subfolder).relative_to(entry.parent).parts) > 10:
65
+ supported = False
66
+ dirs[:] = []
67
+ for file_name in sorted(names):
68
+ file = Path(subfolder) / file_name
69
+ if file.is_symlink() or not file.is_file() or file.stat().st_size > 512 * 1024:
70
+ supported = False
71
+ continue
72
+ size += file.stat().st_size
73
+ if size > 1024 * 1024 or len(package) >= 128:
74
+ supported = False
75
+ break
76
+ if (file.suffix.lower() not in {".md", ".txt"} and file.name != "LICENSE"
77
+ and str(file.relative_to(entry.parent)) not in {".clawhub/origin.json", ".openclaw/source-origin.json"}):
78
+ supported = False
79
+ package.append(
80
+ [
81
+ str(file.relative_to(entry.parent)),
82
+ hashlib.sha256(file.read_bytes()).hexdigest(),
83
+ ]
84
+ )
85
+ digest = hashlib.sha256(
86
+ json.dumps(sorted(package), separators=(",", ":")).encode()
87
+ ).hexdigest()
88
+ result.append(
89
+ {
90
+ "name": name,
91
+ "digest": digest,
92
+ "path": str(entry.parent),
93
+ "description": str((meta or {}).get("description", ""))[:500],
94
+ "supported": supported,
95
+ }
96
+ )
97
+ directories[:] = []
98
+ if len(result) >= 128:
99
+ return result
100
+ return result
101
+
102
+
103
+ if __name__ == "__main__":
104
+ try:
105
+ print(json.dumps(inventory(sys.argv[1] if len(sys.argv) > 1 else None)))
106
+ except Exception:
107
+ print("Skill inventory unavailable", file=sys.stderr)
108
+ sys.exit(1)
@@ -38,20 +38,11 @@
38
38
  "propertyNames": {
39
39
  "$ref": "#/$defs/id"
40
40
  },
41
- "additionalProperties": {
42
- "oneOf": [
43
- {
44
- "$ref": "#/$defs/x402"
45
- },
46
- {
47
- "$ref": "#/$defs/mpp"
48
- }
49
- ]
50
- }
41
+ "additionalProperties": { "$ref": "#/$defs/envarBalance" }
51
42
  },
52
43
  "services": {
53
44
  "type": "array",
54
- "minItems": 1,
45
+ "minItems": 0,
55
46
  "maxItems": 64,
56
47
  "items": {
57
48
  "$ref": "#/$defs/service"
@@ -67,77 +58,20 @@
67
58
  "type": "string",
68
59
  "pattern": "^[1-9][0-9]{0,77}$"
69
60
  },
70
- "address": {
71
- "type": "string",
72
- "pattern": "^0x[0-9a-fA-F]{40}$"
73
- },
74
61
  "httpUrl": {
75
62
  "type": "string",
76
63
  "format": "uri",
77
64
  "pattern": "^https?://",
78
65
  "maxLength": 2048
79
66
  },
80
- "x402": {
67
+ "envarBalance": {
81
68
  "type": "object",
82
69
  "additionalProperties": false,
83
- "required": [
84
- "adapter",
85
- "scheme",
86
- "network",
87
- "asset",
88
- "payTo",
89
- "facilitatorUrl"
90
- ],
70
+ "required": ["adapter", "currency", "accountRef"],
91
71
  "properties": {
92
- "adapter": {
93
- "const": "x402"
94
- },
95
- "scheme": {
96
- "const": "exact"
97
- },
98
- "network": {
99
- "type": "string",
100
- "pattern": "^eip155:[1-9][0-9]*$"
101
- },
102
- "asset": {
103
- "$ref": "#/$defs/address"
104
- },
105
- "payTo": {
106
- "$ref": "#/$defs/address"
107
- },
108
- "facilitatorUrl": {
109
- "type": "string",
110
- "format": "uri",
111
- "pattern": "^https://"
112
- }
113
- }
114
- },
115
- "mpp": {
116
- "type": "object",
117
- "additionalProperties": false,
118
- "required": [
119
- "adapter",
120
- "method",
121
- "intent",
122
- "currency",
123
- "accountRef"
124
- ],
125
- "properties": {
126
- "adapter": {
127
- "const": "mpp"
128
- },
129
- "method": {
130
- "const": "stripe"
131
- },
132
- "intent": {
133
- "const": "charge"
134
- },
135
- "currency": {
136
- "const": "usd"
137
- },
138
- "accountRef": {
139
- "$ref": "#/$defs/id"
140
- }
72
+ "adapter": { "const": "envar_balance" },
73
+ "currency": { "const": "usd" },
74
+ "accountRef": { "$ref": "#/$defs/id" }
141
75
  }
142
76
  },
143
77
  "service": {