@lightprotocol/compressed-token 0.1.0 → 0.1.2

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
@@ -1,63 +1,85 @@
1
- js client to interact with the compressed-token program
2
-
3
- WIP.
4
-
5
- ### Requirements
6
-
7
- reproduced on mac m2:
8
-
9
- - node: v20.9.0
10
- - rustup 1.26.0, rustc 1.73.0, cargo 1.73.0
11
- - solana-cli 1.17.5
12
-
13
- ## Producing events for indexing
14
-
15
- First, activate the devenv
16
-
17
- `. ./scripts/devenv.sh`
18
-
19
- If you're new, run
20
-
21
- `./scripts/install.sh`
22
-
23
- Run the monorepo build script
24
- `./scripts/build.sh`
25
-
26
- Go to stateless.js
27
- `cd js/stateless.js`
28
-
29
- and run
30
- `pnpm run test-validator`
31
-
32
- this starts a solana-test-validator + auto-initialized the env, programs, and accounts Light needs.
33
- It should print: "Executing command solana-test-validator...
34
- Waiting for fees to stabilize 1..."
35
- Keep the validator running.
36
-
37
- Now open another terminal, activate the devenv again + move to js/compressed-token.
38
-
39
- now run:
40
-
41
- `pnpm emit-event:create_mint`
42
- `pnpm emit-event:mint_to`
43
- `pnpm emit-event:transfer`
44
-
45
- You'll be able to index the emitted events (output utxos) according to the event rust struct on localnet. Create mint doesn't create an output utxo, mint_to doesn't use input_utxos. also note that currently we're creating mock inputs for the transfer, meaning you don't need to run mint_to before transfer.
46
-
47
- ### Troubleshooting
48
-
49
- If you're having trouble building the project or cli,
50
-
51
- - Nuke git clean -xfd (careful)
52
-
53
- - re-run install.sh etc
54
-
55
- - you may want to manually build the programs (anchor build)
56
- or manually build the cli (`pnpm run build` in ./cli) before running
57
- `./cli/test_bin/run test-validator`
58
-
59
- ### Other side notes
60
-
61
- 1. This is unsafe. We don't verify ZKPs yet, nor do we validate tree roots.
62
- 2. this is also what allows us to make up input-utxos for emit-event:transfer
63
- 3. on-chain runs a sumcheck on the state transition (outputs, inputs).
1
+ # TS client for Interacting with the Compressed-Token Program
2
+
3
+ Use this to interact with the compressed-token program on Solana via the
4
+ Compression RPC API.
5
+
6
+ ### Installation
7
+
8
+ **For use in Node.js or a web application**
9
+
10
+ ```bash
11
+ npm install --save \
12
+ @lightprotocol/compressed-token \
13
+ @lightprotocol/stateless.js \
14
+ @solana/web3.js \
15
+ @coral-xyz/anchor
16
+ ```
17
+
18
+ ### Documentation and examples
19
+
20
+ - [Latest Source code](https://github.com/lightprotocol/lightprotocol/tree/main/js/compressed-token)
21
+ - Documentation and examples will be linked here soon!
22
+
23
+ ### Getting help
24
+
25
+ Have a question or a problem?
26
+ Check out the [Light](https://discord.gg/CYvjBgzRFP) and [Helius](https://discord.gg/Uzzf6a7zKr) Developer Discord servers!
27
+
28
+ When asking for help, please include:
29
+
30
+ - A detailed description of what you're trying to achieve
31
+ - Source code, if possible
32
+ - The text of any errors you encountered, with stacktraces if available
33
+
34
+ ### Contributing
35
+
36
+ The ZK Compression system programs and clients are maintained by
37
+ [Light](https://github.com/lightprotocol) as a part of the Light Protocol.
38
+
39
+ The ZK Compression RPC API and its indexer implementation is maintained by
40
+ [Helius Labs](https://github.com/helius-labs).
41
+
42
+ Light and ZK Compression are open protocols and contributions are welcome. If
43
+ you have a contribution, please open a PR on the respective repository.
44
+
45
+ If you found a bug or would like to request a feature, please file an
46
+ [issue](https://github.com/lightprotocol/lightprotocol/issues/new).
47
+
48
+ If you found a security vulnerability, please follow the [security policy](https://github.com/Lightprotocol/light-protocol/blob/main/SECURITY.md).
49
+
50
+ ### Disclaimer
51
+
52
+ All claims, content, designs, algorithms, estimates, roadmaps, specifications,
53
+ and performance measurements described in this project are done with Light
54
+ Protocol Labs' ("Labs") best efforts. It is up to the reader to check and
55
+ validate their accuracy and truthfulness. Furthermore nothing in this project
56
+ constitutes a solicitation for investment.
57
+
58
+ Any content produced by Labs or developer resources that Labs provides, are for
59
+ educational and inspiration purposes only. Labs does not encourage, induce or
60
+ sanction the deployment, integration or use of any such applications (including
61
+ the code comprising the Light blockchain protocol) in violation of applicable
62
+ laws or regulations and hereby prohibits any such deployment, integration or
63
+ use. This includes use of any such applications by the reader (a) in violation
64
+ of export control or sanctions laws of the United States or any other applicable
65
+ jurisdiction, (b) if the reader is located in or ordinarily resident in a
66
+ country or territory subject to comprehensive sanctions administered by the U.S.
67
+ Office of Foreign Assets Control (OFAC), or (c) if the reader is or is working
68
+ on behalf of a Specially Designated National (SDN) or a person subject to
69
+ similar blocking or denied party prohibitions.
70
+
71
+ The reader should be aware that U.S. export control and sanctions laws prohibit
72
+ U.S. persons (and other persons that are subject to such laws) from transacting
73
+ with persons in certain countries and territories or that are on the SDN list.
74
+ As a project based primarily on open-source software, it is possible that such
75
+ sanctioned persons may nevertheless bypass prohibitions, obtain the code
76
+ comprising the Light blockchain protocol (or other project code or applications)
77
+ and deploy, integrate, or otherwise use it. Accordingly, there is a risk to
78
+ individuals that other persons using the Light blockchain protocol may be
79
+ sanctioned persons and that transactions with such persons would be a violation
80
+ of U.S. export controls and sanctions law. This risk applies to individuals,
81
+ organizations, and other ecosystem participants that deploy, integrate, or use
82
+ the Light blockchain protocol code directly (e.g., as a node operator), and
83
+ individuals that transact on the Light blockchain protocol implementation
84
+ through clients, other kinds of nodes, third party interfaces, and/or wallet
85
+ software.