@playthecut/agent 0.2.0 → 0.2.3

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.
package/README.md CHANGED
@@ -50,7 +50,7 @@ A delegate names the account with `smartWallet` in the query, because the signat
50
50
 
51
51
  These stay on a Privy session: `POST /api/auth/session`, `POST /api/auth/sync-wallets`, delegate install and revoke, and `/api/admin`. Public sport, event, and field routes stay unsigned. `AGENT` is a player type. It is not staff, so an agent signature on an admin route is rejected and an agent cannot create a public contest.
52
52
 
53
- `keyid` is `eip8128:<chainId>:0x<signer>`. The chain is `8453` or `84532` and must equal `chainId` on the request. `created` and `expires` are unix seconds. `expires - created` is at most one hour. `nonce` is a single-use ASCII string of at most 128 bytes. The server stores `(keyid, nonce)` until `expires`.
53
+ `keyid` is `eip155:<chainId>:0x<signer>`, with the signer address lowercase. The chain is `8453` or `84532` and must equal `chainId` on the request. `created` and `expires` are unix seconds. `expires - created` is at most one hour. `nonce` is a single-use ASCII string of at most 128 bytes. The server stores `(keyid, nonce)` until `expires`.
54
54
 
55
55
  The signer is the delegate address, or the smart wallet when the user signs. A signature over a changed method, path, query, or body is rejected.
56
56
 
package/api.md CHANGED
@@ -21,7 +21,7 @@ A lineup roster is `candidates` on every request and response. A write is an ord
21
21
  | `privy` | Privy bearer only. |
22
22
  | `staff` | Privy bearer and `userType` `ADMIN` or `SUPER_ADMIN`. |
23
23
 
24
- Player routes accept either a Privy bearer token or an [ERC-8128](https://erc8128.org) HTTP message signature. The headers are `Signature-Input` and `Signature`, plus `Content-Digest` when the request has a body. Sending both credentials is `400`. The signer is an active delegate for the signed `smartWallet` query, or the wallet verified with ERC-1271 when that query is omitted. `user.address` is the wallet. `keyid` is `eip8128:<chainId>:0x<signer>` and its chain must equal `X-Cut-Chain-Id` when that header is present (`8453` or `84532`). The signature is Request-Bound and Non-Replayable: `created` and `expires` are at most one hour apart, and `(keyid, nonce)` is consumed until `expires`.
24
+ Player routes accept either a Privy bearer token or an [ERC-8128](https://erc8128.org) HTTP message signature. The headers are `Signature-Input` and `Signature`, plus `Content-Digest` when the request has a body. Sending both credentials is `400`. The signer is an active delegate for the signed `smartWallet` query, or the wallet verified with ERC-1271 when that query is omitted. `user.address` is the wallet. `keyid` is `eip155:<chainId>:0x<signer>` (lowercase address) and its chain must equal `X-Cut-Chain-Id` when that header is present (`8453` or `84532`). The signature is Request-Bound and Non-Replayable: `created` and `expires` are at most one hour apart, and `(keyid, nonce)` is consumed until `expires`.
25
25
 
26
26
  `AGENT` is a player type. It is not staff.
27
27
 
@@ -62,6 +62,7 @@ JSON bodies are capped at 128 KiB.
62
62
  | `/unsubscribe` | `unsubscribe.ts` |
63
63
  | `/stream` | `stream.ts` |
64
64
  | `/bot` | `bot.ts` |
65
+ | `/paymaster` | `paymaster.ts` |
65
66
 
66
67
  ---
67
68
 
@@ -73,6 +74,14 @@ JSON bodies are capped at 128 KiB.
73
74
 
74
75
  ---
75
76
 
77
+ ## Paymaster (`/api/paymaster`)
78
+
79
+ | Method | Path | Auth | Description |
80
+ |--------|------|------|-------------|
81
+ | POST | `/` | none | ERC-7677 paymaster JSON-RPC. Accepts `pm_getPaymasterStubData` and `pm_getPaymasterData`. Privy's dashboard paymaster URL points here. There is no bearer token: Privy posts the user operation from the browser. The server sponsors it only when the chain is Base or Base Sepolia, the EntryPoint is v0.7, the sender is a stored `UserWallet` for that chain, the gas limits are within the server cap, and the Kernel `execute` calldata is on the allowlist. Allowed calls are `createContest` on the contest factory, `approve` of a stored contest and `transfer` on the payment token, the six contest entry and claim functions on a stored contest address, and `installValidations` or `uninstallValidation` on the sender. The server then calls Pimlico with `PIMLICO_SPONSORSHIP_POLICY_ID` and ignores any policy id in the request. A Pimlico result above the gas cap is returned as a JSON-RPC error. |
82
+
83
+ ---
84
+
76
85
  ## Auth (`/api/auth`)
77
86
 
78
87
  | Method | Path | Auth | Description |
package/docs/agents.md CHANGED
@@ -50,7 +50,7 @@ A delegate names the account with `smartWallet` in the query, because the signat
50
50
 
51
51
  These stay on a Privy session: `POST /api/auth/session`, `POST /api/auth/sync-wallets`, delegate install and revoke, and `/api/admin`. Public sport, event, and field routes stay unsigned. `AGENT` is a player type. It is not staff, so an agent signature on an admin route is rejected and an agent cannot create a public contest.
52
52
 
53
- `keyid` is `eip8128:<chainId>:0x<signer>`. The chain is `8453` or `84532` and must equal `chainId` on the request. `created` and `expires` are unix seconds. `expires - created` is at most one hour. `nonce` is a single-use ASCII string of at most 128 bytes. The server stores `(keyid, nonce)` until `expires`.
53
+ `keyid` is `eip155:<chainId>:0x<signer>`, with the signer address lowercase. The chain is `8453` or `84532` and must equal `chainId` on the request. `created` and `expires` are unix seconds. `expires - created` is at most one hour. `nonce` is a single-use ASCII string of at most 128 bytes. The server stores `(keyid, nonce)` until `expires`.
54
54
 
55
55
  The signer is the delegate address, or the smart wallet when the user signs. A signature over a changed method, path, query, or body is rejected.
56
56
 
package/docs/api.md CHANGED
@@ -21,7 +21,7 @@ A lineup roster is `candidates` on every request and response. A write is an ord
21
21
  | `privy` | Privy bearer only. |
22
22
  | `staff` | Privy bearer and `userType` `ADMIN` or `SUPER_ADMIN`. |
23
23
 
24
- Player routes accept either a Privy bearer token or an [ERC-8128](https://erc8128.org) HTTP message signature. The headers are `Signature-Input` and `Signature`, plus `Content-Digest` when the request has a body. Sending both credentials is `400`. The signer is an active delegate for the signed `smartWallet` query, or the wallet verified with ERC-1271 when that query is omitted. `user.address` is the wallet. `keyid` is `eip8128:<chainId>:0x<signer>` and its chain must equal `X-Cut-Chain-Id` when that header is present (`8453` or `84532`). The signature is Request-Bound and Non-Replayable: `created` and `expires` are at most one hour apart, and `(keyid, nonce)` is consumed until `expires`.
24
+ Player routes accept either a Privy bearer token or an [ERC-8128](https://erc8128.org) HTTP message signature. The headers are `Signature-Input` and `Signature`, plus `Content-Digest` when the request has a body. Sending both credentials is `400`. The signer is an active delegate for the signed `smartWallet` query, or the wallet verified with ERC-1271 when that query is omitted. `user.address` is the wallet. `keyid` is `eip155:<chainId>:0x<signer>` (lowercase address) and its chain must equal `X-Cut-Chain-Id` when that header is present (`8453` or `84532`). The signature is Request-Bound and Non-Replayable: `created` and `expires` are at most one hour apart, and `(keyid, nonce)` is consumed until `expires`.
25
25
 
26
26
  `AGENT` is a player type. It is not staff.
27
27
 
@@ -62,6 +62,7 @@ JSON bodies are capped at 128 KiB.
62
62
  | `/unsubscribe` | `unsubscribe.ts` |
63
63
  | `/stream` | `stream.ts` |
64
64
  | `/bot` | `bot.ts` |
65
+ | `/paymaster` | `paymaster.ts` |
65
66
 
66
67
  ---
67
68
 
@@ -73,6 +74,14 @@ JSON bodies are capped at 128 KiB.
73
74
 
74
75
  ---
75
76
 
77
+ ## Paymaster (`/api/paymaster`)
78
+
79
+ | Method | Path | Auth | Description |
80
+ |--------|------|------|-------------|
81
+ | POST | `/` | none | ERC-7677 paymaster JSON-RPC. Accepts `pm_getPaymasterStubData` and `pm_getPaymasterData`. Privy's dashboard paymaster URL points here. There is no bearer token: Privy posts the user operation from the browser. The server sponsors it only when the chain is Base or Base Sepolia, the EntryPoint is v0.7, the sender is a stored `UserWallet` for that chain, the gas limits are within the server cap, and the Kernel `execute` calldata is on the allowlist. Allowed calls are `createContest` on the contest factory, `approve` of a stored contest and `transfer` on the payment token, the six contest entry and claim functions on a stored contest address, and `installValidations` or `uninstallValidation` on the sender. The server then calls Pimlico with `PIMLICO_SPONSORSHIP_POLICY_ID` and ignores any policy id in the request. A Pimlico result above the gas cap is returned as a JSON-RPC error. |
82
+
83
+ ---
84
+
76
85
  ## Auth (`/api/auth`)
77
86
 
78
87
  | Method | Path | Auth | Description |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@playthecut/agent",
3
- "version": "0.2.0",
3
+ "version": "0.2.3",
4
4
  "description": "Sign and send Play The Cut agent requests",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",