@glamsystems/glam-cli 0.1.18 → 0.1.20
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 +4 -122
- package/main.js +439 -192
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# GLAM CLI
|
|
2
2
|
|
|
3
|
+

|
|
4
|
+
|
|
3
5
|
A convenient way of interacting with the GLAM program.
|
|
4
6
|
|
|
5
7
|
## Installation
|
|
@@ -10,126 +12,6 @@ npm install -g @glamsystems/glam-cli
|
|
|
10
12
|
|
|
11
13
|
After installation, you can use the CLI with the `glam-cli` command.
|
|
12
14
|
|
|
13
|
-
##
|
|
14
|
-
|
|
15
|
-
The CLI expects a configuration file at `~/.config/glam/config.json`. The file should contain the following content:
|
|
16
|
-
|
|
17
|
-
```json
|
|
18
|
-
{
|
|
19
|
-
"cluster": "",
|
|
20
|
-
"json_rpc_url": "",
|
|
21
|
-
"tx_rpc_url": "",
|
|
22
|
-
"keypair_path": "",
|
|
23
|
-
"priority_fee": {
|
|
24
|
-
"micro_lamports": 0,
|
|
25
|
-
"level": "",
|
|
26
|
-
"helius_api_key": ""
|
|
27
|
-
},
|
|
28
|
-
"glam_state": ""
|
|
29
|
-
}
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
_At minimum, you need to provide `cluster`, `json_rpc_url`, and `keypair_path`._
|
|
33
|
-
|
|
34
|
-
Here's a quick explanation of each field:
|
|
35
|
-
|
|
36
|
-
- `cluster`: Value must be one of `mainnet-beta`, `devnet`, or `localnet`.
|
|
37
|
-
- `json_rpc_url`: The URL of your preferred Solana JSON RPC endpoint.
|
|
38
|
-
- `tx_rpc_url`: Optional. If not set it defaults to `json_rpc_url`. Use this to specify a separate RPC endpoint you want to use for landing transactions.
|
|
39
|
-
- `keypair_path`: Path to your keypair JSON file.
|
|
40
|
-
- `priority_fee`:
|
|
41
|
-
- `micro_lamports`: Optional (defaults to 0). If provided, `level` and `helius_api_key` will be ignored.
|
|
42
|
-
- `level`: Optional (defaults to `Min`). Only applied if cluster is `mainnet-beta`. Other options are `Min`, `Medium`, `High`, `VeryHigh`, `UnsafeMax`, `Default` (more info can be found [here](https://docs.helius.dev/solana-apis/priority-fee-api)).
|
|
43
|
-
- `helius_api_key`: Optional. Only applied if cluster is `mainnet-beta`. If not provided `level` will be ignored. The API key is needed to fetch the priority fee estimate from Helius.
|
|
44
|
-
- `glam_state`: Optional. If you want to set a default active GLAM state, you can do so here. Alternatively, you can use the `set` command to set the active GLAM state later on.
|
|
45
|
-
|
|
46
|
-
## Commands
|
|
47
|
-
|
|
48
|
-
Run `glam-cli --help` to see all available commands. Here are the main command categories:
|
|
49
|
-
|
|
50
|
-
### General Commands
|
|
51
|
-
|
|
52
|
-
- `glam-cli env` - Show environment setup
|
|
53
|
-
- `glam-cli list` - List GLAM products the wallet has access to
|
|
54
|
-
- `-o, --owner-only` - Only list products the wallet owns
|
|
55
|
-
- `-a, --all` - List all GLAM products
|
|
56
|
-
|
|
57
|
-
### Product Management
|
|
58
|
-
|
|
59
|
-
- `glam-cli view [state]` - View a GLAM product by its state pubkey
|
|
60
|
-
- `-c, --compact` - Compact output
|
|
61
|
-
- `glam-cli set <state>` - Set active GLAM product
|
|
62
|
-
- `glam-cli create <path>` - Create a new GLAM product from a JSON file
|
|
63
|
-
- `glam-cli close [state]` - Close a GLAM product
|
|
64
|
-
- `-y, --yes` - Skip confirmation prompt
|
|
65
|
-
- `glam-cli update-owner <new-owner-pubkey>` - Update the owner of a GLAM product (**dangerous! may lead to loss of assets if you don't control the new owner wallet**)
|
|
66
|
-
- `-y, --yes` - Skip confirmation prompt
|
|
67
|
-
- `glam-cli withdraw <asset> <amount>` - Withdraw asset (mint address) from the vault
|
|
68
|
-
- `-y, --yes` - Skip confirmation prompt
|
|
69
|
-
|
|
70
|
-
### Delegate Management
|
|
71
|
-
|
|
72
|
-
- `glam-cli delegate list` - List delegates and permissions
|
|
73
|
-
- `glam-cli delegate set <pubkey> <permissions...>` - Set delegate permissions
|
|
74
|
-
- `glam-cli delegate delete <pubkey>` - Revoke all delegate permissions for a pubkey
|
|
75
|
-
|
|
76
|
-
### Mint Management
|
|
77
|
-
|
|
78
|
-
- `glam-cli mint holders` - List all token holders
|
|
79
|
-
- `glam-cli mint update <state> <options...>` - Update mint policies
|
|
80
|
-
- `-l, --lockup <seconds>` - Set lockup period in seconds
|
|
81
|
-
- `-f, --frozen <boolean>` - Set default account state frozen
|
|
82
|
-
- `glam-cli mint create-account <owner>` - Idempotent create a token account for a user
|
|
83
|
-
- `glam-cli mint freeze <accounts...>` - Freeze token accounts (space-separated pubkeys)
|
|
84
|
-
- `glam-cli mint unfreeze <accounts...>` - Unfreeze token accounts (space-separated pubkeys)
|
|
85
|
-
- `glam-cli mint issue <recipient> <amount>` - Mint tokens to a recipient
|
|
86
|
-
- `glam-cli mint burn <from> <amount>` - Burn tokens from a user
|
|
87
|
-
- `glam-cli mint transfer <from> <to> <amount>` - Force transfer tokens between accounts
|
|
88
|
-
|
|
89
|
-
### Integration Management
|
|
15
|
+
## Documentation
|
|
90
16
|
|
|
91
|
-
|
|
92
|
-
- `glam-cli integration enable <name>` - Enable an integration
|
|
93
|
-
- `glam-cli integration disable <name>` - Disable an integration
|
|
94
|
-
|
|
95
|
-
### Token Operations
|
|
96
|
-
|
|
97
|
-
- `glam-cli swap <from> <to> <amount>` - Swap assets held in the vault
|
|
98
|
-
- `-m, --max-accounts <num>` - Specify max accounts allowed
|
|
99
|
-
- `-s, --slippage-bps <bps>` - Specify slippage bps
|
|
100
|
-
- `-d, --only-direct-routes` - Direct routes only
|
|
101
|
-
|
|
102
|
-
### Liquid Staking
|
|
103
|
-
|
|
104
|
-
- `glam-cli lst stake <stakepool> <amount>` - Stake `<amount>` SOL into `<stakepool>`
|
|
105
|
-
- `glam-cli lst unstake <asset> <amount>` - Unstake `<amount>` worth of `<asset>` (mint address)
|
|
106
|
-
- `glam-cli lst list` - List all stake accounts
|
|
107
|
-
- `glam-cli lst withdraw <accounts...>` - Withdraw staking accounts (space-separated pubkeys)
|
|
108
|
-
- `glam-cli lst marinade-list` - List all Marinade tickets
|
|
109
|
-
- `glam-cli lst marinade-claim <tickets...>` - Claim Marinade tickets (space-separated)
|
|
110
|
-
|
|
111
|
-
### Jupiter (JUP) Staking
|
|
112
|
-
|
|
113
|
-
- `glam-cli jup stake <amount>` - Stake JUP tokens
|
|
114
|
-
- `glam-cli jup unstake` - Unstake all JUP tokens
|
|
115
|
-
- `glam-cli jup withdraw` - Withdraw all unstaked JUP
|
|
116
|
-
|
|
117
|
-
### Governance
|
|
118
|
-
|
|
119
|
-
- `glam-cli vote <proposal> <side>` - Vote on a proposal
|
|
120
|
-
|
|
121
|
-
## Development
|
|
122
|
-
|
|
123
|
-
### Build from Source
|
|
124
|
-
|
|
125
|
-
Clone https://github.com/glamsystems/glam/, enter the repo and run:
|
|
126
|
-
|
|
127
|
-
```bash
|
|
128
|
-
pnpm install && pnpm run cli-build
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
### Run in Development Mode
|
|
132
|
-
|
|
133
|
-
```bash
|
|
134
|
-
npx nx run cli:dev -- --args="command [options]"
|
|
135
|
-
```
|
|
17
|
+
Please visit [GLAM CLI Documentation](https://docs.glam.systems/cli/) for more information.
|