@thawgate/cli 0.1.0
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 +22 -0
- package/README.md +72 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1092 -0
- package/dist/index.js.map +1 -0
- package/package.json +55 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Superteam Brazil
|
|
4
|
+
Copyright (c) 2026 Arya
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# @thawgate/cli
|
|
2
|
+
|
|
3
|
+
`thawgate`: the [`@thawgate/sdk`](../sdk/README.md) operations from a shell. It covers ThawGate policies on Token ACL mints, SSS-ACL stablecoins (sss-token is the example issuer), the holder flows (explain, unlock, freeze-if-invalid) and SAS credentials. Before S11 the binary was called `sss-token`.
|
|
4
|
+
|
|
5
|
+
> Devnet only; the gate is unaudited. npm publishing is planned for v0.1.0 (S17). Until then, build it from the repo: `yarn install && yarn workspace @thawgate/sdk build && yarn workspace @thawgate/cli build`, then run `node cli/dist/index.js …` (or `npm pack` both packages and install the tarballs, see the SDK README). It runs on Node 20 and 22.
|
|
6
|
+
|
|
7
|
+
## Configuration
|
|
8
|
+
|
|
9
|
+
| Setting | Flag (before the subcommand) | Environment | Default |
|
|
10
|
+
|---|---|---|---|
|
|
11
|
+
| RPC | `--rpc-url` | `SSS_RPC_URL` | `https://api.devnet.solana.com` |
|
|
12
|
+
| Keypair | `--keypair` | `SSS_KEYPAIR_PATH` | `~/.config/solana/id.json` |
|
|
13
|
+
| Commitment | `--commitment` | `SSS_COMMITMENT` | `confirmed` |
|
|
14
|
+
| sss-token / hook program | | `SSS_PROGRAM_ID` / `SSS_HOOK_PROGRAM_ID` | the devnet deployments |
|
|
15
|
+
|
|
16
|
+
`thawgate config set` writes `~/.thawgate/config.json`. If that file doesn't exist, the old `~/.sss-token/config.json` is read. `--json` prints the result as JSON on stdout, with progress lines on stderr. Commands that send log to `~/.thawgate/audit.log`.
|
|
17
|
+
|
|
18
|
+
## Commands
|
|
19
|
+
|
|
20
|
+
**Issuer (SSS-ACL stablecoins)**
|
|
21
|
+
|
|
22
|
+
| Command | |
|
|
23
|
+
|---|---|
|
|
24
|
+
| `create-stablecoin --name --symbol [--uri] [--decimals 6] <policy flags> --reserves <base units> --report-uri <uri> [--max-staleness 86400] [--attestor <pubkey>]` | Creates the mint, the Token ACL config, the ThawGate policy, the minter role and the reserves (3 transactions). |
|
|
25
|
+
| `enable-token-acl --mint <policy flags>` | `enable_token_acl` on a mint you initialized in Acl mode. |
|
|
26
|
+
| `mint`, `burn`, `freeze`, `thaw`, `pause`, `unpause`, `grant-role`, `revoke-role`, `roles …`, `minters …`, `transfer-authority`, `status`, `supply`, `holders` | The sss-token issuer commands. They work on Acl mints too (checked on localnet in S11). |
|
|
27
|
+
| `blacklist --mint --target <wallet> --reason [--token-account <pubkey>] --confirm` | `--token-account` must be owned by the target; the default is its ATA. On Token ACL mints a thawed account is frozen in the same transaction. A wallet removed with `unblacklist` can be blacklisted again. |
|
|
28
|
+
| `unblacklist`, `seize` | |
|
|
29
|
+
| `allowlist add|remove --mint --wallet` | For `allowOnly` / `bypassForPdas` policies. The mint needs `enable_allowlist`. A removed wallet can be added again. |
|
|
30
|
+
| `reserves post --mint --amount <base units> [--report-uri <uri>] [--as-of <unix seconds>]` | Posts the mint's reserves. Your `--keypair` must be the mint's attestor. The report URI defaults to the last one posted, and as-of to the cluster's time. Minting may rely on the post until as-of + the mint's max staleness (printed as `freshUntil`). |
|
|
31
|
+
|
|
32
|
+
**Policy** (`<policy flags>` = `--blacklist on|off`, `--allowlist off|allowOnly|bypassForPdas`, `--sas-credential <pubkey> --sas-schema <pubkey>`, `--min-kyc <n>`; `policy update` also takes `--no-sas`)
|
|
33
|
+
|
|
34
|
+
| Command | |
|
|
35
|
+
|---|---|
|
|
36
|
+
| `policy show --mint` | The policy and the mint's Token ACL config. |
|
|
37
|
+
| `policy init --mint <policy flags> [--authority]` | For a Token ACL mint whose freeze authority is your key. |
|
|
38
|
+
| `policy update --mint <policy flags>` | Changes only the flags given. `--min-kyc` alone keeps the stored credential and schema. Holders who no longer comply become freezable. |
|
|
39
|
+
| `policy setup-extra-metas --mint` | Rewrites both extra-metas lists (idempotent). |
|
|
40
|
+
| `swap-gate --mint <policy flags> [--skip-metadata] --confirm` | Moves an existing Token ACL mint to ThawGate in one transaction. |
|
|
41
|
+
|
|
42
|
+
**Holders**
|
|
43
|
+
|
|
44
|
+
| Command | |
|
|
45
|
+
|---|---|
|
|
46
|
+
| `explain --mint --wallet [--token-account]` | Why the wallet may or may not hold the token. It simulates and sends nothing. |
|
|
47
|
+
| `unlock --mint [--owner]` | Explains first. If the gate would allow it, creates the owner's ATA and thaws it (you pay). Otherwise it prints the reason and exits 1. |
|
|
48
|
+
| `freeze-if-invalid --token-account` | Freezes permissionlessly only if the policy flags the owner. |
|
|
49
|
+
|
|
50
|
+
**SAS** (self-issued test credentials; production policies name a KYC provider's credential)
|
|
51
|
+
|
|
52
|
+
| Command | |
|
|
53
|
+
|---|---|
|
|
54
|
+
| `sas create-credential --name [--signer <pubkey>...]` | |
|
|
55
|
+
| `sas create-schema --credential --name [--description]` | The KYC layout ThawGate reads: `kyc_level: u8, country: String`. |
|
|
56
|
+
| `sas attest --credential --schema --wallet --kyc-level [--country IN] [--expiry-days 365]` | `--expiry-days 0` = never expires. |
|
|
57
|
+
| `sas revoke --credential --schema --wallet` | Under a SAS policy, the wallet's accounts become freezable. |
|
|
58
|
+
|
|
59
|
+
## Example
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
export SSS_RPC_URL=https://api.devnet.solana.com
|
|
63
|
+
K="--keypair issuer.json --json"
|
|
64
|
+
CRED=$(thawgate $K sas create-credential --name "My KYC" | jq -r .credential)
|
|
65
|
+
SCHEMA=$(thawgate $K sas create-schema --credential $CRED --name my-kyc | jq -r .schema)
|
|
66
|
+
MINT=$(thawgate $K create-stablecoin --name "My USD" --symbol MUSD --blacklist on \
|
|
67
|
+
--sas-credential $CRED --sas-schema $SCHEMA --min-kyc 1 \
|
|
68
|
+
--reserves 1000000000000 --report-uri https://example.com/reserves.json | jq -r .mint)
|
|
69
|
+
thawgate $K explain --mint $MINT --wallet <HOLDER> # denied NO_CREDENTIAL
|
|
70
|
+
thawgate $K sas attest --credential $CRED --schema $SCHEMA --wallet <HOLDER> --kyc-level 1
|
|
71
|
+
thawgate $K unlock --mint $MINT --owner <HOLDER> # unlocked
|
|
72
|
+
```
|
package/dist/index.d.ts
ADDED