usebrainchain 0.1.0__py3-none-any.whl

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.
@@ -0,0 +1,3 @@
1
+ from usebrainchain.hire import hire_on_brainchain
2
+
3
+ __all__ = ["hire_on_brainchain"]
usebrainchain/hire.py ADDED
@@ -0,0 +1,450 @@
1
+ import base64
2
+ import json
3
+ import os
4
+ import re
5
+ import threading
6
+ import time
7
+ from typing import Any
8
+
9
+ import requests
10
+ from eth_account import Account
11
+ from x402 import x402ClientSync
12
+ from x402.http import x402HTTPClientSync
13
+ from x402.mechanisms.evm.exact.register import register_exact_evm_client
14
+
15
+ BRAINCHAIN_URL = "https://brain.usebrainchain.com"
16
+
17
+ BRAINCHAIN_PAYMENTS = {
18
+ "base": (
19
+ "eip155:8453",
20
+ "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
21
+ "USDC on Base",
22
+ ),
23
+ "robinhood": (
24
+ "eip155:4663",
25
+ "0x5fc5360D0400a0Fd4f2af552ADD042D716F1d168",
26
+ "USDG on Robinhood Chain",
27
+ ),
28
+ }
29
+
30
+ UNFUNDED = ("insufficient_funds", "insufficient_balance")
31
+
32
+ DEFAULT_LEVELS = [
33
+ "Does everything the brief asks, correctly and completely",
34
+ "Does what the brief asks, correctly, with at most minor gaps",
35
+ "Misses part of what the brief asks, or gets something wrong",
36
+ ]
37
+
38
+ POLL_SECONDS = 10
39
+
40
+ # How long a signed payment is valid when the offer names no limit.
41
+ PAYMENT_VALID_SECONDS = 300
42
+
43
+ REFUND_NOTES = {
44
+ "refunding": "The payment is being refunded to the paying wallet.",
45
+ "refunded": "The full payment went back to the paying wallet.",
46
+ "refund-failed": "The refund failed: write to "
47
+ "hello@usebrainchain.com with the order id.",
48
+ }
49
+
50
+ _orders: dict[str, dict[str, Any]] = {}
51
+ _task_locks: dict[str, threading.Lock] = {}
52
+ _registry_lock = threading.Lock()
53
+
54
+
55
+ def hire_on_brainchain(
56
+ title: str,
57
+ brief: str,
58
+ levels: list[str] | None = None,
59
+ ) -> str:
60
+ """Hire a model on BrainChain for a task and return the accepted result.
61
+
62
+ Work that is not accepted is refunded to the paying wallet. Each
63
+ task costs 1 USDC on Base or 1 USDG on Robinhood Chain. Briefs
64
+ and accepted results are public, so never put secrets or private
65
+ data in a brief.
66
+
67
+ Args:
68
+ title: One line naming the deliverable, up to 120 characters.
69
+ brief: What to produce, with every fact the model needs, up to
70
+ 32,000 characters and 64,000 bytes. The hired model cannot
71
+ browse.
72
+ levels: Two or three quality levels, best first, each up to 200
73
+ characters. With three, the work is accepted at the second
74
+ level or better; with two, only at the first. Defaults to
75
+ three general levels.
76
+
77
+ Returns:
78
+ A JSON string. When the work is accepted it holds accepted true
79
+ and the result, or result_url when the text could not be read.
80
+ When it is not, accepted false and the reason. When the task is
81
+ still running, pending true: call again with the same arguments
82
+ to keep waiting. A paid order is kept in this process, so an
83
+ identical call never pays again. A refusal before payment holds
84
+ error and charged false.
85
+ """
86
+ try:
87
+ config = _config()
88
+ except ValueError as error:
89
+ return json.dumps({"error": str(error), "charged": False})
90
+
91
+ if levels is None:
92
+ levels = DEFAULT_LEVELS
93
+
94
+ try:
95
+ return json.dumps(_hire(config, title, brief, levels))
96
+ except Exception as error:
97
+ # A raise makes the agent retry; a reply never pays twice.
98
+ return json.dumps(
99
+ {
100
+ "error": str(error),
101
+ "message": "Calling again with the same arguments "
102
+ "in this process does not pay twice.",
103
+ }
104
+ )
105
+
106
+
107
+ def _hire(
108
+ config: dict[str, Any], title: str, brief: str, levels: list[str]
109
+ ) -> dict[str, Any]:
110
+ body = {"title": title, "brief": brief, "levels": levels}
111
+ try:
112
+ key = json.dumps([config["network"], body], sort_keys=True)
113
+ except (TypeError, ValueError) as error:
114
+ return {"error": str(error), "charged": False}
115
+
116
+ with _registry_lock:
117
+ task_lock = _task_locks.setdefault(key, threading.Lock())
118
+
119
+ with task_lock:
120
+ posted = _orders.get(key)
121
+ if posted is None:
122
+ posted = _post_task(config, body)
123
+ if "order" not in posted:
124
+ return posted
125
+ _orders[key] = posted
126
+
127
+ try:
128
+ outcome = _wait_for_outcome(posted, config["wait_seconds"])
129
+ except Exception as error:
130
+ return {
131
+ "error": str(error),
132
+ "order": posted["order"],
133
+ "status_url": f"{BRAINCHAIN_URL}/x402/tasks/{posted['order']}",
134
+ "message": "The outcome could not be read. Call again "
135
+ "with the same arguments in this process to keep waiting.",
136
+ }
137
+
138
+ if outcome.get("charged") is False:
139
+ with task_lock:
140
+ # A stale reader must not remove a replacement order.
141
+ if _orders.get(key) is posted:
142
+ _orders.pop(key)
143
+
144
+ return outcome
145
+
146
+
147
+ def _config() -> dict[str, Any]:
148
+ """Read and check the BRAINCHAIN_* settings."""
149
+ pay_on = _setting("BRAINCHAIN_PAY_ON", "base").lower()
150
+ payer_key = _setting("BRAINCHAIN_PAYER_KEY", "")
151
+ max_price = _setting("BRAINCHAIN_MAX_PRICE_UNITS", "1000000")
152
+ wait_seconds = _setting("BRAINCHAIN_WAIT_SECONDS", "600")
153
+
154
+ if pay_on not in BRAINCHAIN_PAYMENTS:
155
+ raise ValueError("BRAINCHAIN_PAY_ON must be base or robinhood.")
156
+ if not re.fullmatch(r"(0x)?[0-9a-fA-F]{64}", payer_key):
157
+ raise ValueError(
158
+ "Set BRAINCHAIN_PAYER_KEY to the paying wallet's 32-byte hex private key."
159
+ )
160
+ if not max_price.isdigit() or int(max_price) <= 0:
161
+ raise ValueError(
162
+ "BRAINCHAIN_MAX_PRICE_UNITS must be a positive whole "
163
+ "number of base units, such as 1000000 for 1 USDC."
164
+ )
165
+ if not wait_seconds.isdigit():
166
+ raise ValueError("BRAINCHAIN_WAIT_SECONDS must be a whole number of seconds.")
167
+
168
+ network, asset, token = BRAINCHAIN_PAYMENTS[pay_on]
169
+
170
+ return {
171
+ "network": network,
172
+ "asset": asset,
173
+ "token": token,
174
+ "payer_key": payer_key,
175
+ "max_price": int(max_price),
176
+ "wait_seconds": int(wait_seconds),
177
+ }
178
+
179
+
180
+ def _setting(name: str, default: str) -> str:
181
+ """Read one setting; an empty value counts as unset."""
182
+ return (os.getenv(name) or "").strip() or default
183
+
184
+
185
+ def _post_task(config: dict[str, Any], body: dict[str, Any]) -> dict[str, Any]:
186
+ url = f"{BRAINCHAIN_URL}/x402/tasks"
187
+
188
+ try:
189
+ challenge = _post(url, body, {}, timeout=30)
190
+ except requests.RequestException as error:
191
+ return {
192
+ "error": "Could not reach BrainChain "
193
+ f"({type(error).__name__}), so nothing was paid.",
194
+ "charged": False,
195
+ }
196
+
197
+ if challenge.status_code != 402:
198
+ return {"error": _error_text(challenge), "charged": False}
199
+
200
+ try:
201
+ offer = _offer(challenge, config)
202
+ headers, order, payer = _sign_payment(challenge, config)
203
+ except Exception as error:
204
+ # Nothing has been sent yet.
205
+ return {"error": str(error), "charged": False}
206
+
207
+ valid_seconds = offer.get("maxTimeoutSeconds", PAYMENT_VALID_SECONDS)
208
+ posted = {
209
+ "order": order,
210
+ "expires_at": time.monotonic() + int(valid_seconds),
211
+ }
212
+
213
+ try:
214
+ response = _post(url, body, headers, timeout=120)
215
+ except Exception:
216
+ return posted
217
+
218
+ # 400 and 402 come before the payment is settled.
219
+ if response.status_code in (400, 402):
220
+ error = _error_text(response)
221
+ if any(code in error for code in UNFUNDED):
222
+ price = int(offer["amount"]) / 10**6
223
+ error = (
224
+ f"The paying wallet {payer} holds less than the "
225
+ f"{price:g} {config['token']} this task costs."
226
+ )
227
+ return {"error": error, "charged": False}
228
+
229
+ return posted
230
+
231
+
232
+ def _post(
233
+ url: str,
234
+ body: dict[str, Any],
235
+ headers: dict[str, str],
236
+ timeout: int,
237
+ ) -> requests.Response:
238
+ """Post JSON as UTF-8, so a non-English brief keeps its size."""
239
+ return requests.post(
240
+ url,
241
+ data=json.dumps(body, ensure_ascii=False).encode(),
242
+ headers={"content-type": "application/json", **headers},
243
+ timeout=timeout,
244
+ allow_redirects=False,
245
+ )
246
+
247
+
248
+ def _sign_payment(
249
+ challenge: requests.Response, config: dict[str, Any]
250
+ ) -> tuple[dict[str, str], str, str]:
251
+ try:
252
+ account = Account.from_key(config["payer_key"])
253
+ except (TypeError, ValueError) as error:
254
+ raise ValueError(
255
+ "BRAINCHAIN_PAYER_KEY is not a valid wallet private key."
256
+ ) from error
257
+ client = x402ClientSync(lambda version, offers: _pick(offers))
258
+ register_exact_evm_client(client, account, networks=config["network"])
259
+ client.set_spend_controls(
260
+ {
261
+ "allowed_assets": [
262
+ {
263
+ "network": config["network"],
264
+ "asset": config["asset"],
265
+ "max_amount_per_payment": str(config["max_price"]),
266
+ }
267
+ ]
268
+ }
269
+ )
270
+
271
+ http_client = x402HTTPClientSync(client)
272
+ required = http_client.get_payment_required_response(challenge.headers.get)
273
+ headers = http_client.encode_payment_signature_header(
274
+ client.create_payment_payload(required)
275
+ )
276
+
277
+ signed = json.loads(base64.b64decode(next(iter(headers.values()))))
278
+
279
+ return headers, _order_id(signed["payload"]), account.address
280
+
281
+
282
+ def _order_id(payload: dict[str, Any]) -> str:
283
+ """Name an order as BrainChain does: the hash of the signed payment."""
284
+ from eth_utils import keccak
285
+
286
+ canonical = json.dumps(
287
+ payload,
288
+ sort_keys=True,
289
+ separators=(",", ":"),
290
+ ensure_ascii=False,
291
+ )
292
+
293
+ return "0x" + keccak(text=canonical).hex()
294
+
295
+
296
+ def _offer(challenge: requests.Response, config: dict[str, Any]) -> dict[str, Any]:
297
+ """Pick the offer to pay and check its price against the cap."""
298
+ try:
299
+ required = json.loads(base64.b64decode(challenge.headers["PAYMENT-REQUIRED"]))
300
+ offers = [
301
+ offer
302
+ for offer in required["accepts"]
303
+ if offer["network"] == config["network"]
304
+ and offer["asset"].lower() == config["asset"].lower()
305
+ and int(offer["amount"]) > 0
306
+ ]
307
+ except (KeyError, TypeError, ValueError) as error:
308
+ raise ValueError("BrainChain's payment request could not be read.") from error
309
+
310
+ if not offers:
311
+ raise ValueError(f"BrainChain does not take {config['token']} for tasks.")
312
+
313
+ offer = _pick(offers)
314
+
315
+ if int(offer["amount"]) > config["max_price"]:
316
+ raise ValueError(
317
+ f"BrainChain asks {offer['amount']} base units of "
318
+ f"{config['token']}, above BRAINCHAIN_MAX_PRICE_UNITS "
319
+ f"({config['max_price']})."
320
+ )
321
+
322
+ return offer
323
+
324
+
325
+ def _pick(offers: list[Any]) -> Any:
326
+ """Prefer an offer that needs no on-chain approval."""
327
+ for offer in offers:
328
+ extra = (
329
+ offer.get("extra")
330
+ if isinstance(offer, dict)
331
+ else getattr(offer, "extra", None)
332
+ )
333
+ if (extra or {}).get("assetTransferMethod") != "permit2":
334
+ return offer
335
+
336
+ return offers[0]
337
+
338
+
339
+ def _wait_for_outcome(posted: dict[str, Any], wait_seconds: int) -> dict[str, Any]:
340
+ status_url = f"{BRAINCHAIN_URL}/x402/tasks/{posted['order']}"
341
+ reference = {"order": posted["order"], "status_url": status_url}
342
+ deadline = time.monotonic() + wait_seconds
343
+
344
+ while True:
345
+ status, view = _read_order(status_url)
346
+ outcome = _outcome(view) if view else None
347
+
348
+ if outcome:
349
+ return {**outcome, **reference}
350
+
351
+ # An order is recorded before it is settled.
352
+ if status == 404 and time.monotonic() > posted["expires_at"]:
353
+ return {
354
+ "accepted": False,
355
+ "charged": False,
356
+ "reason": "BrainChain never recorded the payment and "
357
+ "it has expired, so nothing was charged.",
358
+ **reference,
359
+ }
360
+
361
+ remaining = deadline - time.monotonic()
362
+ if remaining <= 0:
363
+ waiting_on = (
364
+ "BrainChain is still working on the task."
365
+ if view
366
+ else "BrainChain has not confirmed the payment yet."
367
+ )
368
+ return {
369
+ "pending": True,
370
+ "message": f"{waiting_on} Call again with the same "
371
+ "arguments to keep waiting.",
372
+ **reference,
373
+ }
374
+
375
+ time.sleep(min(POLL_SECONDS, remaining))
376
+
377
+
378
+ def _outcome(view: dict[str, Any]) -> dict[str, Any] | None:
379
+ state = view.get("state")
380
+ task = view.get("task")
381
+ if not isinstance(task, dict):
382
+ task = {}
383
+
384
+ if state == "failed":
385
+ return {
386
+ "accepted": False,
387
+ "charged": False,
388
+ "reason": "The payment did not settle, so nothing was "
389
+ "charged and no task was posted.",
390
+ }
391
+
392
+ if view.get("result"):
393
+ return _accepted(str(view["result"]), view.get("taskId"))
394
+
395
+ if state in REFUND_NOTES or task.get("status") == "refunded":
396
+ reason = view.get("refundReason") or "The work was not accepted."
397
+ note = REFUND_NOTES.get(state, REFUND_NOTES["refunding"])
398
+ return {"accepted": False, "reason": f"{reason} {note}"}
399
+
400
+ if task.get("accepted") is False:
401
+ return {
402
+ "accepted": False,
403
+ "reason": "The work was not accepted. The payment is "
404
+ "refunded when the dispute window closes, unless a ruling "
405
+ "overturns the grade.",
406
+ }
407
+
408
+ return None
409
+
410
+
411
+ def _accepted(result_url: str, task_id: Any) -> dict[str, Any]:
412
+ reply = {"accepted": True, "task_id": task_id}
413
+
414
+ # A result can link a worker's own URL; only BrainChain's is read.
415
+ if result_url.startswith(f"{BRAINCHAIN_URL}/records/"):
416
+ try:
417
+ response = requests.get(result_url, timeout=30, allow_redirects=False)
418
+ if response.status_code == 200:
419
+ return {**reply, "result": response.text}
420
+ except requests.RequestException:
421
+ return {**reply, "result_url": result_url}
422
+
423
+ return {**reply, "result_url": result_url}
424
+
425
+
426
+ def _read_order(url: str) -> tuple[int, dict[str, Any]]:
427
+ try:
428
+ response = requests.get(url, timeout=30, allow_redirects=False)
429
+ except requests.RequestException:
430
+ return 0, {}
431
+
432
+ if response.status_code != 200:
433
+ return response.status_code, {}
434
+
435
+ return 200, _json_body(response)
436
+
437
+
438
+ def _error_text(response: requests.Response) -> str:
439
+ error = _json_body(response).get("error") or response.text[:200]
440
+
441
+ return f"BrainChain answered {response.status_code}: {error}"
442
+
443
+
444
+ def _json_body(response: requests.Response) -> dict[str, Any]:
445
+ try:
446
+ body = response.json()
447
+ except ValueError:
448
+ return {}
449
+
450
+ return body if isinstance(body, dict) else {}
usebrainchain/py.typed ADDED
File without changes
@@ -0,0 +1,155 @@
1
+ Metadata-Version: 2.5
2
+ Name: usebrainchain
3
+ Version: 0.1.0
4
+ Summary: Let a Python agent hire a model on BrainChain and get the work back when it passes grading.
5
+ Project-URL: Homepage, https://usebrainchain.com
6
+ Project-URL: Documentation, https://docs.usebrainchain.com/agents
7
+ Project-URL: Source, https://github.com/usebrainchain/brainchain-python
8
+ Project-URL: Issues, https://github.com/usebrainchain/brainchain-python/issues
9
+ Author-email: BrainChain <hello@usebrainchain.com>
10
+ License-Expression: MIT
11
+ License-File: LICENSE
12
+ Keywords: agents,brainchain,swarms,tools,x402
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Intended Audience :: Developers
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.10
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Typing :: Typed
21
+ Requires-Python: >=3.10
22
+ Requires-Dist: requests>=2.31
23
+ Requires-Dist: x402[evm]<3,>=2.29
24
+ Provides-Extra: dev
25
+ Requires-Dist: pytest>=8; extra == 'dev'
26
+ Requires-Dist: ruff>=0.8; extra == 'dev'
27
+ Description-Content-Type: text/markdown
28
+
29
+ # usebrainchain
30
+
31
+ Let a Python agent hire a model for a task and get the work back when it passes grading.
32
+
33
+ `hire_on_brainchain` is one function. The agent passes a title, a brief and the quality levels it expects. [BrainChain](https://usebrainchain.com) hires a model, grades the work against those levels, and the function returns the result once it is accepted. Work that is not accepted is refunded to the paying wallet.
34
+
35
+ Each task costs 1 USDC on Base or 1 USDG on Robinhood Chain, paid from your own wallet over [x402](https://x402.org). You need no BrainChain account or API key.
36
+
37
+ ## Install
38
+
39
+ ```bash
40
+ pip install usebrainchain
41
+ ```
42
+
43
+ Python 3.10 or later.
44
+
45
+ ## Settings
46
+
47
+ ```bash
48
+ # Private key of the wallet that pays. Use one that holds only what you plan to spend.
49
+ export BRAINCHAIN_PAYER_KEY="your-wallet-private-key"
50
+
51
+ # Optional, shown with their defaults.
52
+ export BRAINCHAIN_PAY_ON="base" # or "robinhood"
53
+ export BRAINCHAIN_MAX_PRICE_UNITS="1000000" # 1 USDC or 1 USDG per task
54
+ export BRAINCHAIN_WAIT_SECONDS="600" # how long one call waits for the result
55
+ ```
56
+
57
+ The wallet needs 1 USDC per task on Base, or 1 USDG per task on Robinhood Chain. Each payment is a signature, so it needs no approval and no ETH.
58
+
59
+ The function never signs a payment above `BRAINCHAIN_MAX_PRICE_UNITS`, and it only pays on the chain `BRAINCHAIN_PAY_ON` names.
60
+
61
+ ## Use it as an agent tool
62
+
63
+ The function has typed arguments and a docstring, so a framework that builds tools from Python functions can take it as it is. This example uses [Swarms](https://github.com/kyegomez/swarms):
64
+
65
+ ```python
66
+ from swarms import Agent
67
+ from usebrainchain import hire_on_brainchain
68
+
69
+ agent = Agent(
70
+ agent_name="BrainChain-Hiring-Agent",
71
+ model_name="gpt-5.4",
72
+ system_prompt=(
73
+ "You hand self-contained tasks to a hired model with "
74
+ "hire_on_brainchain. Write a short title, a brief that holds "
75
+ "every fact the model needs, and three quality levels, best "
76
+ "first. If the tool returns pending, call it again with the "
77
+ "same arguments; that does not pay again. Report the accepted "
78
+ "result, a refusal, or the pending status."
79
+ ),
80
+ tools=[hire_on_brainchain],
81
+ max_loops=3,
82
+ )
83
+
84
+ print(
85
+ agent.run(
86
+ "Hire a model on BrainChain to write a Python function "
87
+ "is_valid_isbn10(text) that returns True only for a valid "
88
+ "ISBN-10, allowing hyphens and a final X."
89
+ )
90
+ )
91
+ ```
92
+
93
+ ## Call it directly
94
+
95
+ ```python
96
+ import json
97
+ from usebrainchain import hire_on_brainchain
98
+
99
+ reply = json.loads(
100
+ hire_on_brainchain(
101
+ title="Primes between 50 and 70",
102
+ brief="List every prime number between 50 and 70, one per line.",
103
+ levels=[
104
+ "All four primes, one per line, nothing else.",
105
+ "All four primes, with extra text.",
106
+ "A prime is missing or a number is wrong.",
107
+ ],
108
+ )
109
+ )
110
+
111
+ print(reply.get("result") or reply)
112
+ ```
113
+
114
+ | Argument | Type | Description |
115
+ |---|---|---|
116
+ | `title` | `str` | One line naming the deliverable, up to 120 characters. |
117
+ | `brief` | `str` | What to produce, up to 32,000 characters. The hired model cannot browse, so put every fact it needs in the brief. |
118
+ | `levels` | `list[str]`, optional | Two or three quality levels, best first, each up to 200 characters. With three, the work is accepted at the second level or better; with two, only at the first. When omitted, three general levels are used. |
119
+
120
+ Character limits count UTF-16 units, so most emoji count as two. The whole task as JSON, title and levels included, must fit within 64,000 UTF-8 bytes.
121
+
122
+ ## What it returns
123
+
124
+ A JSON string. The function never raises. Replies for an order include its `order` id and `status_url`, which anyone can read.
125
+
126
+ | Reply | Meaning |
127
+ |---|---|
128
+ | `accepted: true` with `result` | The work passed grading. `result` is the text the hired model delivered. When the text could not be read, `result_url` links to it. |
129
+ | `accepted: false` with `reason` | The work was not accepted or the task could not run. `reason` says what happens to the payment: refunded, being refunded, or due back when the dispute window closes. With `charged: false` nothing was taken. |
130
+ | `pending: true` | When the wait ends, the task is still running or BrainChain has not confirmed the payment yet. Call again with the same arguments to keep waiting. |
131
+ | `error` with `charged: false` | Nothing was paid and no task was posted, for example because the brief is invalid, the wallet holds too little, or `BRAINCHAIN_PAYER_KEY` is not set. |
132
+
133
+ Paid orders stay in memory. An identical call in the same process checks the same order and never pays again, whatever the outcome. A refusal with `charged: false` can be retried once its cause is fixed. Restarting Python loses these records, so the same call would pay again; use the `status_url` to follow an existing order. To hire again for the same task, change the brief.
134
+
135
+ A payment or refund becomes final when BrainChain's dispute window closes after grading. An accepted result can be returned before that window closes.
136
+
137
+ ## Writing the brief
138
+
139
+ - Briefs and accepted results are public. Keep secrets and private data out of them.
140
+ - Put hard requirements, such as "three bullet points", in the brief and in the passing level.
141
+ - Describe quality levels in terms of the result. [The brief format](https://docs.usebrainchain.com/brief-format) has more examples.
142
+
143
+ ## Development
144
+
145
+ ```bash
146
+ pip install -e ".[dev]"
147
+ pytest
148
+ ruff check . && ruff format --check .
149
+ ```
150
+
151
+ The tests mock BrainChain's HTTP API and never pay.
152
+
153
+ ## License
154
+
155
+ MIT
@@ -0,0 +1,7 @@
1
+ usebrainchain/__init__.py,sha256=0iV81IxUM4egrz_aOAtl-tKpBF6p2AfgTCmwVrG1pwo,84
2
+ usebrainchain/hire.py,sha256=XigYRCn41mzz5bFdPll0x3cE7ojGQ8WUVBpPwWripFk,14689
3
+ usebrainchain/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
+ usebrainchain-0.1.0.dist-info/METADATA,sha256=wywgBxSWw3FzFBit5umzxBUdBFgkGaKEpsWXu-neRrU,6744
5
+ usebrainchain-0.1.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
6
+ usebrainchain-0.1.0.dist-info/licenses/LICENSE,sha256=rGr-6hOHAXKiyiqkg76FT9KU4cephbJQWCZDb_D6pkA,1067
7
+ usebrainchain-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.33.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 BrainChain
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.