@bankofai/wallet-cli-x402-plugin 0.0.0-stage → 0.1.0-next.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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 BANK OF AI
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.
package/README.md CHANGED
@@ -1,3 +1,65 @@
1
- # Temporary Holding Version
1
+ # @bankofai/wallet-cli-x402-plugin
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ `x402` is a plugin for [wallet-cli](https://github.com/tronprotocol/wallet-cli). x402 is a payment protocol over HTTP: an
4
+ endpoint answers an unpaid request with HTTP `402 Payment Required` and the payment routes it accepts, the
5
+ client signs a payment and repeats the request, and a facilitator service settles the payment on chain. The
6
+ plugin pays x402 endpoints from a wallet-cli account, runs a local x402 paywall, and reads the x402
7
+ provider catalog.
8
+
9
+ It needs wallet-cli with plugin support ([Requirements](#requirements)). No credentials, except the GasFree
10
+ service keys with `--gasfree-relay gasfree` ([Credentials and settings](#credentials-and-settings)).
11
+
12
+ ## Requirements
13
+
14
+ - wallet-cli with plugin support and a plugin SDK of version 1.0 or a later 1.x (this package declares
15
+ `sdkVersion` `^1.0.0`). Plugin support is on wallet-cli's `feat/plugin-architecture` branch and not
16
+ yet in a release.
17
+ - Node.js 22.23.4+, 24.22.1+ or 26.12.1+.
18
+
19
+ ## Install
20
+
21
+ wallet-cli installs a plugin only by its npm package name. This package is not on npm yet; until it is,
22
+ publish it to a private or local npm registry and set `pluginRegistry` to it, as the
23
+ [wallet-cli plugins guide](https://github.com/tronprotocol/wallet-cli/blob/develop/ts/docs/guide/plugins.md) describes.
24
+
25
+ ```bash
26
+ wallet-cli plugin install @bankofai/wallet-cli-x402-plugin
27
+ wallet-cli plugin list
28
+ ```
29
+
30
+ ## Commands
31
+
32
+ | Command | What it does |
33
+ |---|---|
34
+ | [`x402 pay`](https://github.com/BofAI/wallet-cli-plugins/blob/main/packages/x402/docs/commands/pay.md) | Request an endpoint and pay an x402 challenge |
35
+ | [`x402 serve`](https://github.com/BofAI/wallet-cli-plugins/blob/main/packages/x402/docs/commands/serve.md) | Run a local x402-protected endpoint |
36
+ | [`x402 roundtrip`](https://github.com/BofAI/wallet-cli-plugins/blob/main/packages/x402/docs/commands/roundtrip.md) | Start a local paywall, pay it, and exit |
37
+ | [`x402 provider-list`](https://github.com/BofAI/wallet-cli-plugins/blob/main/packages/x402/docs/commands/provider-list.md) | List x402 catalog providers |
38
+ | [`x402 provider-show`](https://github.com/BofAI/wallet-cli-plugins/blob/main/packages/x402/docs/commands/provider-show.md) | Show one x402 provider |
39
+ | [`x402 endpoint-list`](https://github.com/BofAI/wallet-cli-plugins/blob/main/packages/x402/docs/commands/endpoint-list.md) | List one x402 provider's endpoints |
40
+ | [`x402 update-catalog`](https://github.com/BofAI/wallet-cli-plugins/blob/main/packages/x402/docs/commands/update-catalog.md) | Refresh the local x402 provider catalog cache |
41
+
42
+ `wallet-cli x402 <command> --help` shows the options of each command. What the plugin adds to wallet-cli's
43
+ JSON output and error codes is in [machine-interface.md](https://github.com/BofAI/wallet-cli-plugins/blob/main/packages/x402/docs/machine-interface.md).
44
+
45
+ ## Credentials and settings
46
+
47
+ None, except when `--gasfree-relay gasfree` (the GasFree Open API) is selected: whatever the scheme, the
48
+ command then needs the API key and secret of the GasFree service (open.gasfree.io), also to validate its
49
+ options and for a dry run. The default `official` relay and an HTTPS relay URL of your own need none. This
50
+ plugin declares the keys itself; set them with wallet-cli's [`config`](https://github.com/tronprotocol/wallet-cli/blob/develop/ts/docs/commands/config.md) from stdin; the
51
+ separate `gasfree` plugin need not be installed:
52
+
53
+ ```bash
54
+ printf '%s\n' "$KEY" | wallet-cli config gasfreeApiKey --api-key-stdin
55
+ printf '%s\n' "$SECRET" | wallet-cli config gasfreeApiSecret --api-key-stdin
56
+ ```
57
+
58
+ For `--gasfree-relay gasfree`, the GasFree service of a network comes from the `gasfree` block of that
59
+ network in wallet-cli's `config.yaml`; mainnet and Nile have builtin defaults, which a written block
60
+ replaces whole.
61
+
62
+ ## License
63
+
64
+ [MIT](https://github.com/BofAI/wallet-cli-plugins/blob/main/LICENSE). The licences of the third-party packages bundled into `dist/index.mjs` are in
65
+ `dist/THIRD_PARTY_LICENSES.txt`.