-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Account Compression: JS SDK release 0.1.1 (#3680)
* ac: beet* as deps, not peerDeps * ac: expose depth size pairs, add canopyDepth to CMTAccount getters * ac: add tests for CMT Account * ac: update README.md * ac: update lockfile
- Loading branch information
Showing
7 changed files
with
135 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,42 @@ | ||
# Account Compression SDK | ||
# `@solana/spl-account-compression` | ||
|
||
Currently contains a typescript SDK to interact with on-chain SPL ConcurrentMerkleTrees. | ||
A TypeScript library for interacting with SPL Account Compression and SPL NoOp. | ||
|
||
Used to test Account Compression program. | ||
## Install | ||
|
||
# Setting up the Solita-based Typescript SDK | ||
```shell | ||
npm install --save @solana/spl-account-compression @solana/web3.js | ||
``` | ||
|
||
__OR__ | ||
|
||
```shell | ||
yarn add @solana/spl-account-compression @solana/web3.js | ||
``` | ||
|
||
|
||
## Examples | ||
|
||
* Solana Program Library [tests](https://github.com/solana-labs/solana-program-library/tree/master/account-compression/sdk/tests) | ||
|
||
* Metaplex Program Library Compressed NFT [tests](https://github.com/metaplex-foundation/metaplex-program-library/tree/master/bubblegum/js/tests) | ||
|
||
## Information | ||
|
||
This on-chain program provides an interface for composing smart-contracts to create and use SPL ConcurrentMerkleTrees. The primary application of using SPL ConcurrentMerkleTrees is to make edits to off-chain data with on-chain verification. | ||
|
||
This program is targeted towards supporting [Metaplex Compressed NFTs](https://github.com/metaplex-foundation/metaplex-program-library/tree/master/bubblegum) and may be subject to change. | ||
|
||
Note: Using this program requires an indexer to parse transaction information and write relevant information to an off-chain database. | ||
|
||
A **rough draft** of the whitepaper for SPL ConcurrentMerkleTree's can be found [here](https://drive.google.com/file/d/1BOpa5OFmara50fTvL0VIVYjtg-qzHCVc/view). | ||
|
||
## Build from Source | ||
|
||
0. Install dependencies with `yarn`. | ||
|
||
1. Generate the Solita SDK with `yarn solita`. | ||
|
||
2. Then build the SDK with `yarn build`. | ||
|
||
# Testing the SDK | ||
|
||
Run `yarn test`. Expect `jest` to detect an open handle that prevents it from exiting tests naturally. | ||
3. Run tests with `yarn test`. (Expect `jest` to detect an open handle that prevents it from exiting naturally) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"name": "@solana/spl-account-compression", | ||
"description": "SPL Account Compression Program JS API", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"author": "Solana Maintainers <[email protected]>", | ||
"repository": { | ||
"url": "https://github.com/solana-labs/solana-program-library", | ||
|
@@ -37,7 +37,9 @@ | |
"start-validator": "solana-test-validator --reset --quiet --bpf-program cmtDvXumGCrqC1Age74AVPhSRVXJMd8PJS91L8KbNCK ../target/deploy/spl_account_compression.so --bpf-program noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV ../target/deploy/spl_noop.so", | ||
"run-tests": "jest tests --detectOpenHandles", | ||
"run-tests:events": "jest tests/events --detectOpenHandles", | ||
"run-tests:accounts": "jest tests/accounts --detectOpenHandles", | ||
"test:events": "start-server-and-test start-validator http://localhost:8899/health run-tests:events", | ||
"test:accounts": "start-server-and-test start-validator http://localhost:8899/health run-tests:accounts", | ||
"test": "start-server-and-test start-validator http://localhost:8899/health run-tests" | ||
}, | ||
"dependencies": { | ||
|
@@ -46,11 +48,11 @@ | |
"borsh": "^0.7.0" | ||
}, | ||
"peerDependencies": { | ||
"@metaplex-foundation/beet": "^0.6.1", | ||
"@metaplex-foundation/beet-solana": "^0.6.1", | ||
"@solana/web3.js": "^1.50.1" | ||
}, | ||
"devDependencies": { | ||
"@metaplex-foundation/beet": "^0.7.1", | ||
"@metaplex-foundation/beet-solana": "^0.4.0", | ||
"@metaplex-foundation/rustbin": "^0.3.1", | ||
"@metaplex-foundation/solita": "0.15.2", | ||
"@project-serum/anchor": "^0.25.0", | ||
|
@@ -68,4 +70,4 @@ | |
"typescript": "=4.7.4", | ||
"typescript-collections": "^1.3.3" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters