@lightprotocol/stateless.js 0.1.0-alpha.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/README.md +58 -0
- package/dist/cjs/index.cjs +4031 -0
- package/dist/es/index.js +3988 -0
- package/dist/types/actions/common.d.ts +3 -0
- package/dist/types/actions/compress-lamports.d.ts +16 -0
- package/dist/types/actions/decompress-lamports.d.ts +16 -0
- package/dist/types/actions/index.d.ts +4 -0
- package/dist/types/actions/init-sol-omnibus-account.d.ts +13 -0
- package/dist/types/constants.d.ts +34 -0
- package/dist/types/errors.d.ts +74 -0
- package/dist/types/idls/account_compression.d.ts +932 -0
- package/dist/types/idls/index.d.ts +5 -0
- package/dist/types/idls/light.d.ts +192 -0
- package/dist/types/idls/psp_compressed_pda.d.ts +607 -0
- package/dist/types/idls/user_registry.d.ts +69 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/instruction/index.d.ts +1 -0
- package/dist/types/instruction/pack-compressed-accounts.d.ts +30 -0
- package/dist/types/programs/compressed-pda.d.ts +148 -0
- package/dist/types/programs/index.d.ts +1 -0
- package/dist/types/rpc-interface.d.ts +430 -0
- package/dist/types/rpc.d.ts +26 -0
- package/dist/types/state/BN254.d.ts +20 -0
- package/dist/types/state/compressed-account.d.ts +35 -0
- package/dist/types/state/index.d.ts +3 -0
- package/dist/types/state/types.d.ts +108 -0
- package/dist/types/test-utils/common.d.ts +32 -0
- package/dist/types/test-utils/index.d.ts +5 -0
- package/dist/types/test-utils/merkle-tree.d.ts +92 -0
- package/dist/types/test-utils/parse-event.d.ts +7 -0
- package/dist/types/test-utils/parse-validity-proof.d.ts +20 -0
- package/dist/types/test-utils/test-rpc.d.ts +51 -0
- package/dist/types/utils/airdrop.d.ts +7 -0
- package/dist/types/utils/conversion.d.ts +10 -0
- package/dist/types/utils/index.d.ts +6 -0
- package/dist/types/utils/pipe.d.ts +2 -0
- package/dist/types/utils/send-and-confirm.d.ts +18 -0
- package/dist/types/utils/sleep.d.ts +1 -0
- package/dist/types/utils/validation.d.ts +4 -0
- package/dist/types/wallet/index.d.ts +1 -0
- package/dist/types/wallet/interface.d.ts +25 -0
- package/dist/types/wallet/use-wallet.d.ts +9 -0
- package/dist/umd/index.js +4027 -0
- package/package.json +81 -0
package/README.md
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
js clients for the light protocol system programs
|
|
2
|
+
|
|
3
|
+
### Requirements
|
|
4
|
+
|
|
5
|
+
reproduced on mac m2:
|
|
6
|
+
|
|
7
|
+
- node: v20.9.0
|
|
8
|
+
- rustup 1.26.0, rustc 1.73.0, cargo 1.73.0
|
|
9
|
+
- solana-cli 1.17.5
|
|
10
|
+
|
|
11
|
+
## Producing events for indexing
|
|
12
|
+
|
|
13
|
+
First, activate the devenv
|
|
14
|
+
|
|
15
|
+
`. ./scripts/devenv.sh`
|
|
16
|
+
|
|
17
|
+
If you're new, run
|
|
18
|
+
|
|
19
|
+
`./scripts/install.sh`
|
|
20
|
+
|
|
21
|
+
Run the monorepo build script
|
|
22
|
+
`./scripts/build.sh`
|
|
23
|
+
|
|
24
|
+
Go to stateless.js
|
|
25
|
+
`cd js/stateless.js`
|
|
26
|
+
|
|
27
|
+
and run
|
|
28
|
+
`pnpm run test-validator`
|
|
29
|
+
|
|
30
|
+
this starts a solana-test-validator + auto-initialized the env, programs, and accounts Light needs. Keep the validator running.
|
|
31
|
+
|
|
32
|
+
now open another terminal, enter the devenv + stateless.js again,
|
|
33
|
+
|
|
34
|
+
`cd js/stateless.js`
|
|
35
|
+
|
|
36
|
+
now run:
|
|
37
|
+
|
|
38
|
+
`pnpm emit-event:transfer`
|
|
39
|
+
|
|
40
|
+
This runs ./tests/e2e/transfer-emit-events.test.ts which executes a simple compressed sol transfer against the test-validator. You'll be able to index the emitted events (output utxos) according to the event rust structs.
|
|
41
|
+
|
|
42
|
+
### Troubleshooting
|
|
43
|
+
|
|
44
|
+
If you're having trouble building the project or cli,
|
|
45
|
+
|
|
46
|
+
- Nuke git clean -xfd (careful)
|
|
47
|
+
|
|
48
|
+
- re-run install.sh etc
|
|
49
|
+
|
|
50
|
+
- you may want to manually build the programs (anchor build)
|
|
51
|
+
or manually build the cli (`pnpm run build` in ./cli) before running
|
|
52
|
+
`./cli/test_bin/run test-validator`
|
|
53
|
+
|
|
54
|
+
### Other side notes
|
|
55
|
+
|
|
56
|
+
1. This is unsafe. We don't verify ZKPs yet, nor do we validate tree roots.
|
|
57
|
+
2. this is also what allows us to make up input-utxos for emit-event:transfer
|
|
58
|
+
3. on-chain runs a sumcheck on the state transition (outputs, inputs).
|