├── .DS_Store ├── .gitignore ├── LICENSE ├── README.md ├── anchor ├── .DS_Store ├── .eslintrc.json ├── .swcrc ├── Anchor.toml ├── Cargo.lock ├── Cargo.toml ├── README.md ├── jest.config.ts ├── migrations │ └── deploy.ts ├── package-lock.json ├── package.json ├── programs │ └── journal │ │ ├── Cargo.toml │ │ ├── Xargo.toml │ │ └── src │ │ └── lib.rs ├── project.json ├── src │ ├── index.ts │ └── journal-exports.ts ├── tests │ └── journal.spec.ts ├── tsconfig.json ├── tsconfig.lib.json └── tsconfig.spec.json ├── jest.config.ts ├── jest.preset.js ├── nx.json ├── package-lock.json ├── package.json ├── tsconfig.base.json ├── vercel.json └── web ├── .DS_Store ├── .eslintrc.json ├── app ├── .DS_Store ├── account │ ├── [address] │ │ └── page.tsx │ └── page.tsx ├── api │ └── hello │ │ └── route.ts ├── clusters │ └── page.tsx ├── global.css ├── journal │ └── page.tsx ├── layout.tsx ├── page.module.css ├── page.tsx └── react-query-provider.tsx ├── components ├── .DS_Store ├── account │ ├── account-data-access.tsx │ ├── account-detail-feature.tsx │ ├── account-list-feature.tsx │ └── account-ui.tsx ├── cluster │ ├── cluster-data-access.tsx │ ├── cluster-feature.tsx │ └── cluster-ui.tsx ├── dashboard │ └── dashboard-feature.tsx ├── journal │ ├── journal-data-access.tsx │ ├── journal-feature.tsx │ └── journal-ui.tsx ├── solana │ └── solana-provider.tsx └── ui │ └── ui-layout.tsx ├── index.d.ts ├── next-env.d.ts ├── next.config.js ├── postcss.config.js ├── project.json ├── public ├── .gitkeep ├── favicon.ico └── solana-logo.png ├── tailwind.config.js └── tsconfig.json /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solana-developers/CRUD-dApp/c6f453d067bacfc47183a8a36a95b3e4fdfcf030/.DS_Store -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | dist 5 | tmp 6 | /out-tsc 7 | # dependencies 8 | node_modules 9 | # IDEs and editors 10 | /.idea 11 | .project 12 | .classpath 13 | .c9/ 14 | *.launch 15 | .settings/ 16 | *.sublime-workspace 17 | # IDE - VSCode 18 | .vscode/* 19 | !.vscode/settings.json 20 | !.vscode/tasks.json 21 | !.vscode/launch.json 22 | !.vscode/extensions.json 23 | # misc 24 | /.sass-cache 25 | /connect.lock 26 | /coverage 27 | /libpeerconnection.log 28 | npm-debug.log 29 | yarn-error.log 30 | testem.log 31 | /typings 32 | # System Files 33 | .DS_Store 34 | Thumbs.db 35 | .nx/cache 36 | # Next.js 37 | .next 38 | out 39 | .anchor 40 | anchor/target/* 41 | anchor/target/deploy 42 | anchor/target/debug 43 | anchor/target/release 44 | anchor/target/sbf-solana-solana 45 | anchor/target/.rustc_info.json 46 | !anchor/target/idl/*.json 47 | !anchor/target/types/*.ts 48 | test-ledger 49 | .yarn -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 brimigs 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Basic CRUD app 2 | This is an example of an on-chain CRUD dapp. This example is a journal dapp where you can create, read, update, and delete journal entries on the solana blockchain and interact with the solana program via a UI. 3 | 4 | Test it out here: [solana-journal-eight.vercel.app](solana-journal-eight.vercel.app) 5 | 6 | This project was created using the [create-solana-dapp](https://github.com/solana-developers/create-solana-dapp) generator. 7 | 8 | ## Getting Started 9 | 10 | ### Prerequisites 11 | 12 | - Node v18.18.0 or higher 13 | - Rust v1.70.0 or higher 14 | - Anchor CLI 0.29.0 or higher 15 | - Solana CLI 1.17.0 or higher 16 | 17 | ### Installation 18 | 19 | #### Clone repo 20 | 21 | ```shell 22 | git clone 23 | cd 24 | ``` 25 | 26 | #### Install dependencies 27 | 28 | ```shell 29 | npm install 30 | ``` 31 | 32 | #### Start the web app 33 | 34 | ``` 35 | npm run dev 36 | ``` 37 | 38 | ## Apps 39 | 40 | ### Anchor 41 | 42 | This is a Solana program written in Rust using the Anchor framework. 43 | 44 | Note: The solana program code for the journal dapp can be found in `anchor/programs/src/lib.rs` 45 | 46 | #### Commands 47 | 48 | You can use any normal anchor commands. Either move to the `anchor` directory and run the `anchor` command or prefix the command with `npm run`, eg: `npm run anchor`. 49 | 50 | #### Sync the program id: 51 | 52 | Running this command will create a new keypair in the `anchor/target/deploy` directory and save the address to the Anchor config file and update the `declare_id!` macro in the `./src/lib.rs` file of the program. 53 | 54 | You will manually need to update the constant in `anchor/lib/counter-exports.ts` to match the new program id. 55 | 56 | ```shell 57 | npm run anchor keys sync 58 | ``` 59 | 60 | #### Build the program: 61 | 62 | ```shell 63 | npm run anchor-build 64 | ``` 65 | 66 | #### Start the test validator with the program deployed: 67 | 68 | ```shell 69 | npm run anchor-localnet 70 | ``` 71 | 72 | #### Run the tests 73 | 74 | ```shell 75 | npm run anchor-test 76 | ``` 77 | 78 | #### Deploy to Devnet 79 | 80 | ```shell 81 | npm run anchor deploy --provider.cluster devnet 82 | ``` 83 | 84 | ### Web 85 | 86 | This is a React app that uses the Anchor generated client to interact with the Solana program. 87 | 88 | #### Commands 89 | 90 | Start the web app 91 | 92 | ```shell 93 | npm run dev 94 | ``` 95 | 96 | Build the web app 97 | 98 | ```shell 99 | npm run build 100 | ``` 101 | -------------------------------------------------------------------------------- /anchor/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solana-developers/CRUD-dApp/c6f453d067bacfc47183a8a36a95b3e4fdfcf030/anchor/.DS_Store -------------------------------------------------------------------------------- /anchor/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["../.eslintrc.json"], 3 | "ignorePatterns": ["!**/*"], 4 | "overrides": [ 5 | { 6 | "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], 7 | "rules": {} 8 | }, 9 | { 10 | "files": ["*.ts", "*.tsx"], 11 | "rules": {} 12 | }, 13 | { 14 | "files": ["*.js", "*.jsx"], 15 | "rules": {} 16 | }, 17 | { 18 | "files": ["*.json"], 19 | "parser": "jsonc-eslint-parser", 20 | "rules": { 21 | "@nx/dependency-checks": [ 22 | "error", 23 | { 24 | "ignoredFiles": ["{projectRoot}/rollup.config.{js,ts,mjs,mts}"] 25 | } 26 | ] 27 | } 28 | } 29 | ] 30 | } 31 | -------------------------------------------------------------------------------- /anchor/.swcrc: -------------------------------------------------------------------------------- 1 | { 2 | "jsc": { 3 | "target": "es2017", 4 | "parser": { 5 | "syntax": "typescript", 6 | "decorators": true, 7 | "dynamicImport": true 8 | }, 9 | "transform": { 10 | "decoratorMetadata": true, 11 | "legacyDecorator": true 12 | }, 13 | "keepClassNames": true, 14 | "externalHelpers": true, 15 | "loose": true 16 | }, 17 | "module": { 18 | "type": "es6" 19 | }, 20 | "sourceMaps": true, 21 | "exclude": [ 22 | "jest.config.ts", 23 | ".*\\.spec.tsx?$", 24 | ".*\\.test.tsx?$", 25 | "./src/jest-setup.ts$", 26 | "./**/jest-setup.ts$", 27 | ".*.js$" 28 | ] 29 | } 30 | -------------------------------------------------------------------------------- /anchor/Anchor.toml: -------------------------------------------------------------------------------- 1 | [toolchain] 2 | 3 | [features] 4 | seeds = false 5 | skip-lint = false 6 | 7 | [programs.localnet] 8 | journal = "94L2mJxVu6ZMmHaGsCHRQ65Kk2mea6aTnwWjSdfSsmBC" 9 | 10 | [registry] 11 | url = "https://api.apr.dev" 12 | 13 | [provider] 14 | cluster = "Localnet" 15 | wallet = "/Users/brimigs/.config/solana/id.json" 16 | 17 | [scripts] 18 | test = "../node_modules/.bin/nx run anchor:jest" 19 | 20 | [test] 21 | startup_wait = 5000 22 | shutdown_wait = 2000 23 | upgradeable = false 24 | 25 | [test.validator] 26 | bind_address = "127.0.0.1" 27 | ledger = ".anchor/test-ledger" 28 | rpc_port = 8899 29 | -------------------------------------------------------------------------------- /anchor/Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "ahash" 7 | version = "0.7.8" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "891477e0c6a8957309ee5c45a6368af3ae14bb510732d2684ffa19af310920f9" 10 | dependencies = [ 11 | "getrandom 0.2.12", 12 | "once_cell", 13 | "version_check", 14 | ] 15 | 16 | [[package]] 17 | name = "ahash" 18 | version = "0.8.11" 19 | source = "registry+https://github.com/rust-lang/crates.io-index" 20 | checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" 21 | dependencies = [ 22 | "cfg-if", 23 | "once_cell", 24 | "version_check", 25 | "zerocopy", 26 | ] 27 | 28 | [[package]] 29 | name = "aho-corasick" 30 | version = "1.1.3" 31 | source = "registry+https://github.com/rust-lang/crates.io-index" 32 | checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" 33 | dependencies = [ 34 | "memchr", 35 | ] 36 | 37 | [[package]] 38 | name = "anchor-attribute-access-control" 39 | version = "0.30.1" 40 | source = "registry+https://github.com/rust-lang/crates.io-index" 41 | checksum = "47fe28365b33e8334dd70ae2f34a43892363012fe239cf37d2ee91693575b1f8" 42 | dependencies = [ 43 | "anchor-syn", 44 | "proc-macro2", 45 | "quote", 46 | "syn 1.0.109", 47 | ] 48 | 49 | [[package]] 50 | name = "anchor-attribute-account" 51 | version = "0.30.1" 52 | source = "registry+https://github.com/rust-lang/crates.io-index" 53 | checksum = "3c288d496168268d198d9b53ee9f4f9d260a55ba4df9877ea1d4486ad6109e0f" 54 | dependencies = [ 55 | "anchor-syn", 56 | "bs58 0.5.0", 57 | "proc-macro2", 58 | "quote", 59 | "syn 1.0.109", 60 | ] 61 | 62 | [[package]] 63 | name = "anchor-attribute-constant" 64 | version = "0.30.1" 65 | source = "registry+https://github.com/rust-lang/crates.io-index" 66 | checksum = "49b77b6948d0eeaaa129ce79eea5bbbb9937375a9241d909ca8fb9e006bb6e90" 67 | dependencies = [ 68 | "anchor-syn", 69 | "quote", 70 | "syn 1.0.109", 71 | ] 72 | 73 | [[package]] 74 | name = "anchor-attribute-error" 75 | version = "0.30.1" 76 | source = "registry+https://github.com/rust-lang/crates.io-index" 77 | checksum = "4d20bb569c5a557c86101b944721d865e1fd0a4c67c381d31a44a84f07f84828" 78 | dependencies = [ 79 | "anchor-syn", 80 | "quote", 81 | "syn 1.0.109", 82 | ] 83 | 84 | [[package]] 85 | name = "anchor-attribute-event" 86 | version = "0.30.1" 87 | source = "registry+https://github.com/rust-lang/crates.io-index" 88 | checksum = "4cebd8d0671a3a9dc3160c48598d652c34c77de6be4d44345b8b514323284d57" 89 | dependencies = [ 90 | "anchor-syn", 91 | "proc-macro2", 92 | "quote", 93 | "syn 1.0.109", 94 | ] 95 | 96 | [[package]] 97 | name = "anchor-attribute-program" 98 | version = "0.30.1" 99 | source = "registry+https://github.com/rust-lang/crates.io-index" 100 | checksum = "efb2a5eb0860e661ab31aff7bb5e0288357b176380e985bade4ccb395981b42d" 101 | dependencies = [ 102 | "anchor-lang-idl", 103 | "anchor-syn", 104 | "anyhow", 105 | "bs58 0.5.0", 106 | "heck", 107 | "proc-macro2", 108 | "quote", 109 | "serde_json", 110 | "syn 1.0.109", 111 | ] 112 | 113 | [[package]] 114 | name = "anchor-derive-accounts" 115 | version = "0.30.1" 116 | source = "registry+https://github.com/rust-lang/crates.io-index" 117 | checksum = "04368b5abef4266250ca8d1d12f4dff860242681e4ec22b885dcfe354fd35aa1" 118 | dependencies = [ 119 | "anchor-syn", 120 | "quote", 121 | "syn 1.0.109", 122 | ] 123 | 124 | [[package]] 125 | name = "anchor-derive-serde" 126 | version = "0.30.1" 127 | source = "registry+https://github.com/rust-lang/crates.io-index" 128 | checksum = "e0bb0e0911ad4a70cab880cdd6287fe1e880a1a9d8e4e6defa8e9044b9796a6c" 129 | dependencies = [ 130 | "anchor-syn", 131 | "borsh-derive-internal 0.10.3", 132 | "proc-macro2", 133 | "quote", 134 | "syn 1.0.109", 135 | ] 136 | 137 | [[package]] 138 | name = "anchor-derive-space" 139 | version = "0.30.1" 140 | source = "registry+https://github.com/rust-lang/crates.io-index" 141 | checksum = "5ef415ff156dc82e9ecb943189b0cb241b3a6bfc26a180234dc21bd3ef3ce0cb" 142 | dependencies = [ 143 | "proc-macro2", 144 | "quote", 145 | "syn 1.0.109", 146 | ] 147 | 148 | [[package]] 149 | name = "anchor-lang" 150 | version = "0.30.1" 151 | source = "registry+https://github.com/rust-lang/crates.io-index" 152 | checksum = "6620c9486d9d36a4389cab5e37dc34a42ed0bfaa62e6a75a2999ce98f8f2e373" 153 | dependencies = [ 154 | "anchor-attribute-access-control", 155 | "anchor-attribute-account", 156 | "anchor-attribute-constant", 157 | "anchor-attribute-error", 158 | "anchor-attribute-event", 159 | "anchor-attribute-program", 160 | "anchor-derive-accounts", 161 | "anchor-derive-serde", 162 | "anchor-derive-space", 163 | "anchor-lang-idl", 164 | "arrayref", 165 | "base64 0.21.7", 166 | "bincode", 167 | "borsh 0.10.3", 168 | "bytemuck", 169 | "getrandom 0.2.12", 170 | "solana-program", 171 | "thiserror", 172 | ] 173 | 174 | [[package]] 175 | name = "anchor-lang-idl" 176 | version = "0.1.1" 177 | source = "registry+https://github.com/rust-lang/crates.io-index" 178 | checksum = "31cf97b4e6f7d6144a05e435660fcf757dbc3446d38d0e2b851d11ed13625bba" 179 | dependencies = [ 180 | "anchor-lang-idl-spec", 181 | "anyhow", 182 | "heck", 183 | "regex", 184 | "serde", 185 | "serde_json", 186 | "sha2 0.10.8", 187 | ] 188 | 189 | [[package]] 190 | name = "anchor-lang-idl-spec" 191 | version = "0.1.0" 192 | source = "registry+https://github.com/rust-lang/crates.io-index" 193 | checksum = "2bdf143115440fe621bdac3a29a1f7472e09f6cd82b2aa569429a0c13f103838" 194 | dependencies = [ 195 | "anyhow", 196 | "serde", 197 | ] 198 | 199 | [[package]] 200 | name = "anchor-syn" 201 | version = "0.30.1" 202 | source = "registry+https://github.com/rust-lang/crates.io-index" 203 | checksum = "f99daacb53b55cfd37ce14d6c9905929721137fd4c67bbab44a19802aecb622f" 204 | dependencies = [ 205 | "anyhow", 206 | "bs58 0.5.0", 207 | "cargo_toml", 208 | "heck", 209 | "proc-macro2", 210 | "quote", 211 | "serde", 212 | "serde_json", 213 | "sha2 0.10.8", 214 | "syn 1.0.109", 215 | "thiserror", 216 | ] 217 | 218 | [[package]] 219 | name = "anyhow" 220 | version = "1.0.80" 221 | source = "registry+https://github.com/rust-lang/crates.io-index" 222 | checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" 223 | 224 | [[package]] 225 | name = "ark-bn254" 226 | version = "0.4.0" 227 | source = "registry+https://github.com/rust-lang/crates.io-index" 228 | checksum = "a22f4561524cd949590d78d7d4c5df8f592430d221f7f3c9497bbafd8972120f" 229 | dependencies = [ 230 | "ark-ec", 231 | "ark-ff", 232 | "ark-std", 233 | ] 234 | 235 | [[package]] 236 | name = "ark-ec" 237 | version = "0.4.2" 238 | source = "registry+https://github.com/rust-lang/crates.io-index" 239 | checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" 240 | dependencies = [ 241 | "ark-ff", 242 | "ark-poly", 243 | "ark-serialize", 244 | "ark-std", 245 | "derivative", 246 | "hashbrown 0.13.2", 247 | "itertools", 248 | "num-traits", 249 | "zeroize", 250 | ] 251 | 252 | [[package]] 253 | name = "ark-ff" 254 | version = "0.4.2" 255 | source = "registry+https://github.com/rust-lang/crates.io-index" 256 | checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" 257 | dependencies = [ 258 | "ark-ff-asm", 259 | "ark-ff-macros", 260 | "ark-serialize", 261 | "ark-std", 262 | "derivative", 263 | "digest 0.10.7", 264 | "itertools", 265 | "num-bigint", 266 | "num-traits", 267 | "paste", 268 | "rustc_version", 269 | "zeroize", 270 | ] 271 | 272 | [[package]] 273 | name = "ark-ff-asm" 274 | version = "0.4.2" 275 | source = "registry+https://github.com/rust-lang/crates.io-index" 276 | checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" 277 | dependencies = [ 278 | "quote", 279 | "syn 1.0.109", 280 | ] 281 | 282 | [[package]] 283 | name = "ark-ff-macros" 284 | version = "0.4.2" 285 | source = "registry+https://github.com/rust-lang/crates.io-index" 286 | checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" 287 | dependencies = [ 288 | "num-bigint", 289 | "num-traits", 290 | "proc-macro2", 291 | "quote", 292 | "syn 1.0.109", 293 | ] 294 | 295 | [[package]] 296 | name = "ark-poly" 297 | version = "0.4.2" 298 | source = "registry+https://github.com/rust-lang/crates.io-index" 299 | checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" 300 | dependencies = [ 301 | "ark-ff", 302 | "ark-serialize", 303 | "ark-std", 304 | "derivative", 305 | "hashbrown 0.13.2", 306 | ] 307 | 308 | [[package]] 309 | name = "ark-serialize" 310 | version = "0.4.2" 311 | source = "registry+https://github.com/rust-lang/crates.io-index" 312 | checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" 313 | dependencies = [ 314 | "ark-serialize-derive", 315 | "ark-std", 316 | "digest 0.10.7", 317 | "num-bigint", 318 | ] 319 | 320 | [[package]] 321 | name = "ark-serialize-derive" 322 | version = "0.4.2" 323 | source = "registry+https://github.com/rust-lang/crates.io-index" 324 | checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" 325 | dependencies = [ 326 | "proc-macro2", 327 | "quote", 328 | "syn 1.0.109", 329 | ] 330 | 331 | [[package]] 332 | name = "ark-std" 333 | version = "0.4.0" 334 | source = "registry+https://github.com/rust-lang/crates.io-index" 335 | checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" 336 | dependencies = [ 337 | "num-traits", 338 | "rand 0.8.5", 339 | ] 340 | 341 | [[package]] 342 | name = "arrayref" 343 | version = "0.3.7" 344 | source = "registry+https://github.com/rust-lang/crates.io-index" 345 | checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" 346 | 347 | [[package]] 348 | name = "arrayvec" 349 | version = "0.7.4" 350 | source = "registry+https://github.com/rust-lang/crates.io-index" 351 | checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" 352 | 353 | [[package]] 354 | name = "autocfg" 355 | version = "1.1.0" 356 | source = "registry+https://github.com/rust-lang/crates.io-index" 357 | checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" 358 | 359 | [[package]] 360 | name = "base64" 361 | version = "0.12.3" 362 | source = "registry+https://github.com/rust-lang/crates.io-index" 363 | checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" 364 | 365 | [[package]] 366 | name = "base64" 367 | version = "0.21.7" 368 | source = "registry+https://github.com/rust-lang/crates.io-index" 369 | checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" 370 | 371 | [[package]] 372 | name = "bincode" 373 | version = "1.3.3" 374 | source = "registry+https://github.com/rust-lang/crates.io-index" 375 | checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" 376 | dependencies = [ 377 | "serde", 378 | ] 379 | 380 | [[package]] 381 | name = "bitflags" 382 | version = "1.3.2" 383 | source = "registry+https://github.com/rust-lang/crates.io-index" 384 | checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" 385 | 386 | [[package]] 387 | name = "bitflags" 388 | version = "2.4.2" 389 | source = "registry+https://github.com/rust-lang/crates.io-index" 390 | checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" 391 | dependencies = [ 392 | "serde", 393 | ] 394 | 395 | [[package]] 396 | name = "bitmaps" 397 | version = "2.1.0" 398 | source = "registry+https://github.com/rust-lang/crates.io-index" 399 | checksum = "031043d04099746d8db04daf1fa424b2bc8bd69d92b25962dcde24da39ab64a2" 400 | dependencies = [ 401 | "typenum", 402 | ] 403 | 404 | [[package]] 405 | name = "blake3" 406 | version = "1.5.0" 407 | source = "registry+https://github.com/rust-lang/crates.io-index" 408 | checksum = "0231f06152bf547e9c2b5194f247cd97aacf6dcd8b15d8e5ec0663f64580da87" 409 | dependencies = [ 410 | "arrayref", 411 | "arrayvec", 412 | "cc", 413 | "cfg-if", 414 | "constant_time_eq", 415 | "digest 0.10.7", 416 | ] 417 | 418 | [[package]] 419 | name = "block-buffer" 420 | version = "0.9.0" 421 | source = "registry+https://github.com/rust-lang/crates.io-index" 422 | checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" 423 | dependencies = [ 424 | "generic-array", 425 | ] 426 | 427 | [[package]] 428 | name = "block-buffer" 429 | version = "0.10.4" 430 | source = "registry+https://github.com/rust-lang/crates.io-index" 431 | checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" 432 | dependencies = [ 433 | "generic-array", 434 | ] 435 | 436 | [[package]] 437 | name = "borsh" 438 | version = "0.9.3" 439 | source = "registry+https://github.com/rust-lang/crates.io-index" 440 | checksum = "15bf3650200d8bffa99015595e10f1fbd17de07abbc25bb067da79e769939bfa" 441 | dependencies = [ 442 | "borsh-derive 0.9.3", 443 | "hashbrown 0.11.2", 444 | ] 445 | 446 | [[package]] 447 | name = "borsh" 448 | version = "0.10.3" 449 | source = "registry+https://github.com/rust-lang/crates.io-index" 450 | checksum = "4114279215a005bc675e386011e594e1d9b800918cea18fcadadcce864a2046b" 451 | dependencies = [ 452 | "borsh-derive 0.10.3", 453 | "hashbrown 0.13.2", 454 | ] 455 | 456 | [[package]] 457 | name = "borsh" 458 | version = "1.3.1" 459 | source = "registry+https://github.com/rust-lang/crates.io-index" 460 | checksum = "f58b559fd6448c6e2fd0adb5720cd98a2506594cafa4737ff98c396f3e82f667" 461 | dependencies = [ 462 | "borsh-derive 1.3.1", 463 | "cfg_aliases", 464 | ] 465 | 466 | [[package]] 467 | name = "borsh-derive" 468 | version = "0.9.3" 469 | source = "registry+https://github.com/rust-lang/crates.io-index" 470 | checksum = "6441c552f230375d18e3cc377677914d2ca2b0d36e52129fe15450a2dce46775" 471 | dependencies = [ 472 | "borsh-derive-internal 0.9.3", 473 | "borsh-schema-derive-internal 0.9.3", 474 | "proc-macro-crate 0.1.5", 475 | "proc-macro2", 476 | "syn 1.0.109", 477 | ] 478 | 479 | [[package]] 480 | name = "borsh-derive" 481 | version = "0.10.3" 482 | source = "registry+https://github.com/rust-lang/crates.io-index" 483 | checksum = "0754613691538d51f329cce9af41d7b7ca150bc973056f1156611489475f54f7" 484 | dependencies = [ 485 | "borsh-derive-internal 0.10.3", 486 | "borsh-schema-derive-internal 0.10.3", 487 | "proc-macro-crate 0.1.5", 488 | "proc-macro2", 489 | "syn 1.0.109", 490 | ] 491 | 492 | [[package]] 493 | name = "borsh-derive" 494 | version = "1.3.1" 495 | source = "registry+https://github.com/rust-lang/crates.io-index" 496 | checksum = "7aadb5b6ccbd078890f6d7003694e33816e6b784358f18e15e7e6d9f065a57cd" 497 | dependencies = [ 498 | "once_cell", 499 | "proc-macro-crate 3.1.0", 500 | "proc-macro2", 501 | "quote", 502 | "syn 2.0.52", 503 | "syn_derive", 504 | ] 505 | 506 | [[package]] 507 | name = "borsh-derive-internal" 508 | version = "0.9.3" 509 | source = "registry+https://github.com/rust-lang/crates.io-index" 510 | checksum = "5449c28a7b352f2d1e592a8a28bf139bc71afb0764a14f3c02500935d8c44065" 511 | dependencies = [ 512 | "proc-macro2", 513 | "quote", 514 | "syn 1.0.109", 515 | ] 516 | 517 | [[package]] 518 | name = "borsh-derive-internal" 519 | version = "0.10.3" 520 | source = "registry+https://github.com/rust-lang/crates.io-index" 521 | checksum = "afb438156919598d2c7bad7e1c0adf3d26ed3840dbc010db1a882a65583ca2fb" 522 | dependencies = [ 523 | "proc-macro2", 524 | "quote", 525 | "syn 1.0.109", 526 | ] 527 | 528 | [[package]] 529 | name = "borsh-schema-derive-internal" 530 | version = "0.9.3" 531 | source = "registry+https://github.com/rust-lang/crates.io-index" 532 | checksum = "cdbd5696d8bfa21d53d9fe39a714a18538bad11492a42d066dbbc395fb1951c0" 533 | dependencies = [ 534 | "proc-macro2", 535 | "quote", 536 | "syn 1.0.109", 537 | ] 538 | 539 | [[package]] 540 | name = "borsh-schema-derive-internal" 541 | version = "0.10.3" 542 | source = "registry+https://github.com/rust-lang/crates.io-index" 543 | checksum = "634205cc43f74a1b9046ef87c4540ebda95696ec0f315024860cad7c5b0f5ccd" 544 | dependencies = [ 545 | "proc-macro2", 546 | "quote", 547 | "syn 1.0.109", 548 | ] 549 | 550 | [[package]] 551 | name = "bs58" 552 | version = "0.4.0" 553 | source = "registry+https://github.com/rust-lang/crates.io-index" 554 | checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" 555 | 556 | [[package]] 557 | name = "bs58" 558 | version = "0.5.0" 559 | source = "registry+https://github.com/rust-lang/crates.io-index" 560 | checksum = "f5353f36341f7451062466f0b755b96ac3a9547e4d7f6b70d603fc721a7d7896" 561 | dependencies = [ 562 | "tinyvec", 563 | ] 564 | 565 | [[package]] 566 | name = "bumpalo" 567 | version = "3.15.4" 568 | source = "registry+https://github.com/rust-lang/crates.io-index" 569 | checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" 570 | 571 | [[package]] 572 | name = "bv" 573 | version = "0.11.1" 574 | source = "registry+https://github.com/rust-lang/crates.io-index" 575 | checksum = "8834bb1d8ee5dc048ee3124f2c7c1afcc6bc9aed03f11e9dfd8c69470a5db340" 576 | dependencies = [ 577 | "feature-probe", 578 | "serde", 579 | ] 580 | 581 | [[package]] 582 | name = "bytemuck" 583 | version = "1.14.3" 584 | source = "registry+https://github.com/rust-lang/crates.io-index" 585 | checksum = "a2ef034f05691a48569bd920a96c81b9d91bbad1ab5ac7c4616c1f6ef36cb79f" 586 | dependencies = [ 587 | "bytemuck_derive", 588 | ] 589 | 590 | [[package]] 591 | name = "bytemuck_derive" 592 | version = "1.6.0" 593 | source = "registry+https://github.com/rust-lang/crates.io-index" 594 | checksum = "4da9a32f3fed317401fa3c862968128267c3106685286e15d5aaa3d7389c2f60" 595 | dependencies = [ 596 | "proc-macro2", 597 | "quote", 598 | "syn 2.0.52", 599 | ] 600 | 601 | [[package]] 602 | name = "byteorder" 603 | version = "1.5.0" 604 | source = "registry+https://github.com/rust-lang/crates.io-index" 605 | checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" 606 | 607 | [[package]] 608 | name = "cargo_toml" 609 | version = "0.19.2" 610 | source = "registry+https://github.com/rust-lang/crates.io-index" 611 | checksum = "a98356df42a2eb1bd8f1793ae4ee4de48e384dd974ce5eac8eee802edb7492be" 612 | dependencies = [ 613 | "serde", 614 | "toml 0.8.12", 615 | ] 616 | 617 | [[package]] 618 | name = "cc" 619 | version = "1.0.90" 620 | source = "registry+https://github.com/rust-lang/crates.io-index" 621 | checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" 622 | dependencies = [ 623 | "jobserver", 624 | "libc", 625 | ] 626 | 627 | [[package]] 628 | name = "cfg-if" 629 | version = "1.0.0" 630 | source = "registry+https://github.com/rust-lang/crates.io-index" 631 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 632 | 633 | [[package]] 634 | name = "cfg_aliases" 635 | version = "0.1.1" 636 | source = "registry+https://github.com/rust-lang/crates.io-index" 637 | checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" 638 | 639 | [[package]] 640 | name = "console_error_panic_hook" 641 | version = "0.1.7" 642 | source = "registry+https://github.com/rust-lang/crates.io-index" 643 | checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" 644 | dependencies = [ 645 | "cfg-if", 646 | "wasm-bindgen", 647 | ] 648 | 649 | [[package]] 650 | name = "console_log" 651 | version = "0.2.2" 652 | source = "registry+https://github.com/rust-lang/crates.io-index" 653 | checksum = "e89f72f65e8501878b8a004d5a1afb780987e2ce2b4532c562e367a72c57499f" 654 | dependencies = [ 655 | "log", 656 | "web-sys", 657 | ] 658 | 659 | [[package]] 660 | name = "constant_time_eq" 661 | version = "0.3.0" 662 | source = "registry+https://github.com/rust-lang/crates.io-index" 663 | checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" 664 | 665 | [[package]] 666 | name = "cpufeatures" 667 | version = "0.2.12" 668 | source = "registry+https://github.com/rust-lang/crates.io-index" 669 | checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" 670 | dependencies = [ 671 | "libc", 672 | ] 673 | 674 | [[package]] 675 | name = "crossbeam-deque" 676 | version = "0.8.5" 677 | source = "registry+https://github.com/rust-lang/crates.io-index" 678 | checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" 679 | dependencies = [ 680 | "crossbeam-epoch", 681 | "crossbeam-utils", 682 | ] 683 | 684 | [[package]] 685 | name = "crossbeam-epoch" 686 | version = "0.9.18" 687 | source = "registry+https://github.com/rust-lang/crates.io-index" 688 | checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" 689 | dependencies = [ 690 | "crossbeam-utils", 691 | ] 692 | 693 | [[package]] 694 | name = "crossbeam-utils" 695 | version = "0.8.19" 696 | source = "registry+https://github.com/rust-lang/crates.io-index" 697 | checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" 698 | 699 | [[package]] 700 | name = "crunchy" 701 | version = "0.2.2" 702 | source = "registry+https://github.com/rust-lang/crates.io-index" 703 | checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" 704 | 705 | [[package]] 706 | name = "crypto-common" 707 | version = "0.1.6" 708 | source = "registry+https://github.com/rust-lang/crates.io-index" 709 | checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" 710 | dependencies = [ 711 | "generic-array", 712 | "typenum", 713 | ] 714 | 715 | [[package]] 716 | name = "crypto-mac" 717 | version = "0.8.0" 718 | source = "registry+https://github.com/rust-lang/crates.io-index" 719 | checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" 720 | dependencies = [ 721 | "generic-array", 722 | "subtle", 723 | ] 724 | 725 | [[package]] 726 | name = "curve25519-dalek" 727 | version = "3.2.1" 728 | source = "registry+https://github.com/rust-lang/crates.io-index" 729 | checksum = "90f9d052967f590a76e62eb387bd0bbb1b000182c3cefe5364db6b7211651bc0" 730 | dependencies = [ 731 | "byteorder", 732 | "digest 0.9.0", 733 | "rand_core 0.5.1", 734 | "serde", 735 | "subtle", 736 | "zeroize", 737 | ] 738 | 739 | [[package]] 740 | name = "derivative" 741 | version = "2.2.0" 742 | source = "registry+https://github.com/rust-lang/crates.io-index" 743 | checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" 744 | dependencies = [ 745 | "proc-macro2", 746 | "quote", 747 | "syn 1.0.109", 748 | ] 749 | 750 | [[package]] 751 | name = "digest" 752 | version = "0.9.0" 753 | source = "registry+https://github.com/rust-lang/crates.io-index" 754 | checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" 755 | dependencies = [ 756 | "generic-array", 757 | ] 758 | 759 | [[package]] 760 | name = "digest" 761 | version = "0.10.7" 762 | source = "registry+https://github.com/rust-lang/crates.io-index" 763 | checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" 764 | dependencies = [ 765 | "block-buffer 0.10.4", 766 | "crypto-common", 767 | "subtle", 768 | ] 769 | 770 | [[package]] 771 | name = "either" 772 | version = "1.10.0" 773 | source = "registry+https://github.com/rust-lang/crates.io-index" 774 | checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" 775 | 776 | [[package]] 777 | name = "equivalent" 778 | version = "1.0.1" 779 | source = "registry+https://github.com/rust-lang/crates.io-index" 780 | checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" 781 | 782 | [[package]] 783 | name = "feature-probe" 784 | version = "0.1.1" 785 | source = "registry+https://github.com/rust-lang/crates.io-index" 786 | checksum = "835a3dc7d1ec9e75e2b5fb4ba75396837112d2060b03f7d43bc1897c7f7211da" 787 | 788 | [[package]] 789 | name = "generic-array" 790 | version = "0.14.7" 791 | source = "registry+https://github.com/rust-lang/crates.io-index" 792 | checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" 793 | dependencies = [ 794 | "serde", 795 | "typenum", 796 | "version_check", 797 | ] 798 | 799 | [[package]] 800 | name = "getrandom" 801 | version = "0.1.16" 802 | source = "registry+https://github.com/rust-lang/crates.io-index" 803 | checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" 804 | dependencies = [ 805 | "cfg-if", 806 | "js-sys", 807 | "libc", 808 | "wasi 0.9.0+wasi-snapshot-preview1", 809 | "wasm-bindgen", 810 | ] 811 | 812 | [[package]] 813 | name = "getrandom" 814 | version = "0.2.12" 815 | source = "registry+https://github.com/rust-lang/crates.io-index" 816 | checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" 817 | dependencies = [ 818 | "cfg-if", 819 | "js-sys", 820 | "libc", 821 | "wasi 0.11.0+wasi-snapshot-preview1", 822 | "wasm-bindgen", 823 | ] 824 | 825 | [[package]] 826 | name = "hashbrown" 827 | version = "0.11.2" 828 | source = "registry+https://github.com/rust-lang/crates.io-index" 829 | checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" 830 | dependencies = [ 831 | "ahash 0.7.8", 832 | ] 833 | 834 | [[package]] 835 | name = "hashbrown" 836 | version = "0.13.2" 837 | source = "registry+https://github.com/rust-lang/crates.io-index" 838 | checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" 839 | dependencies = [ 840 | "ahash 0.8.11", 841 | ] 842 | 843 | [[package]] 844 | name = "hashbrown" 845 | version = "0.14.3" 846 | source = "registry+https://github.com/rust-lang/crates.io-index" 847 | checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" 848 | 849 | [[package]] 850 | name = "heck" 851 | version = "0.3.3" 852 | source = "registry+https://github.com/rust-lang/crates.io-index" 853 | checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" 854 | dependencies = [ 855 | "unicode-segmentation", 856 | ] 857 | 858 | [[package]] 859 | name = "hmac" 860 | version = "0.8.1" 861 | source = "registry+https://github.com/rust-lang/crates.io-index" 862 | checksum = "126888268dcc288495a26bf004b38c5fdbb31682f992c84ceb046a1f0fe38840" 863 | dependencies = [ 864 | "crypto-mac", 865 | "digest 0.9.0", 866 | ] 867 | 868 | [[package]] 869 | name = "hmac-drbg" 870 | version = "0.3.0" 871 | source = "registry+https://github.com/rust-lang/crates.io-index" 872 | checksum = "17ea0a1394df5b6574da6e0c1ade9e78868c9fb0a4e5ef4428e32da4676b85b1" 873 | dependencies = [ 874 | "digest 0.9.0", 875 | "generic-array", 876 | "hmac", 877 | ] 878 | 879 | [[package]] 880 | name = "im" 881 | version = "15.1.0" 882 | source = "registry+https://github.com/rust-lang/crates.io-index" 883 | checksum = "d0acd33ff0285af998aaf9b57342af478078f53492322fafc47450e09397e0e9" 884 | dependencies = [ 885 | "bitmaps", 886 | "rand_core 0.6.4", 887 | "rand_xoshiro", 888 | "rayon", 889 | "serde", 890 | "sized-chunks", 891 | "typenum", 892 | "version_check", 893 | ] 894 | 895 | [[package]] 896 | name = "indexmap" 897 | version = "2.2.5" 898 | source = "registry+https://github.com/rust-lang/crates.io-index" 899 | checksum = "7b0b929d511467233429c45a44ac1dcaa21ba0f5ba11e4879e6ed28ddb4f9df4" 900 | dependencies = [ 901 | "equivalent", 902 | "hashbrown 0.14.3", 903 | ] 904 | 905 | [[package]] 906 | name = "itertools" 907 | version = "0.10.5" 908 | source = "registry+https://github.com/rust-lang/crates.io-index" 909 | checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" 910 | dependencies = [ 911 | "either", 912 | ] 913 | 914 | [[package]] 915 | name = "itoa" 916 | version = "1.0.10" 917 | source = "registry+https://github.com/rust-lang/crates.io-index" 918 | checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" 919 | 920 | [[package]] 921 | name = "jobserver" 922 | version = "0.1.28" 923 | source = "registry+https://github.com/rust-lang/crates.io-index" 924 | checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" 925 | dependencies = [ 926 | "libc", 927 | ] 928 | 929 | [[package]] 930 | name = "journal" 931 | version = "0.1.0" 932 | dependencies = [ 933 | "anchor-lang", 934 | ] 935 | 936 | [[package]] 937 | name = "js-sys" 938 | version = "0.3.69" 939 | source = "registry+https://github.com/rust-lang/crates.io-index" 940 | checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" 941 | dependencies = [ 942 | "wasm-bindgen", 943 | ] 944 | 945 | [[package]] 946 | name = "keccak" 947 | version = "0.1.5" 948 | source = "registry+https://github.com/rust-lang/crates.io-index" 949 | checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" 950 | dependencies = [ 951 | "cpufeatures", 952 | ] 953 | 954 | [[package]] 955 | name = "lazy_static" 956 | version = "1.4.0" 957 | source = "registry+https://github.com/rust-lang/crates.io-index" 958 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 959 | 960 | [[package]] 961 | name = "libc" 962 | version = "0.2.153" 963 | source = "registry+https://github.com/rust-lang/crates.io-index" 964 | checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" 965 | 966 | [[package]] 967 | name = "libsecp256k1" 968 | version = "0.6.0" 969 | source = "registry+https://github.com/rust-lang/crates.io-index" 970 | checksum = "c9d220bc1feda2ac231cb78c3d26f27676b8cf82c96971f7aeef3d0cf2797c73" 971 | dependencies = [ 972 | "arrayref", 973 | "base64 0.12.3", 974 | "digest 0.9.0", 975 | "hmac-drbg", 976 | "libsecp256k1-core", 977 | "libsecp256k1-gen-ecmult", 978 | "libsecp256k1-gen-genmult", 979 | "rand 0.7.3", 980 | "serde", 981 | "sha2 0.9.9", 982 | "typenum", 983 | ] 984 | 985 | [[package]] 986 | name = "libsecp256k1-core" 987 | version = "0.2.2" 988 | source = "registry+https://github.com/rust-lang/crates.io-index" 989 | checksum = "d0f6ab710cec28cef759c5f18671a27dae2a5f952cdaaee1d8e2908cb2478a80" 990 | dependencies = [ 991 | "crunchy", 992 | "digest 0.9.0", 993 | "subtle", 994 | ] 995 | 996 | [[package]] 997 | name = "libsecp256k1-gen-ecmult" 998 | version = "0.2.1" 999 | source = "registry+https://github.com/rust-lang/crates.io-index" 1000 | checksum = "ccab96b584d38fac86a83f07e659f0deafd0253dc096dab5a36d53efe653c5c3" 1001 | dependencies = [ 1002 | "libsecp256k1-core", 1003 | ] 1004 | 1005 | [[package]] 1006 | name = "libsecp256k1-gen-genmult" 1007 | version = "0.2.1" 1008 | source = "registry+https://github.com/rust-lang/crates.io-index" 1009 | checksum = "67abfe149395e3aa1c48a2beb32b068e2334402df8181f818d3aee2b304c4f5d" 1010 | dependencies = [ 1011 | "libsecp256k1-core", 1012 | ] 1013 | 1014 | [[package]] 1015 | name = "light-poseidon" 1016 | version = "0.2.0" 1017 | source = "registry+https://github.com/rust-lang/crates.io-index" 1018 | checksum = "3c9a85a9752c549ceb7578064b4ed891179d20acd85f27318573b64d2d7ee7ee" 1019 | dependencies = [ 1020 | "ark-bn254", 1021 | "ark-ff", 1022 | "num-bigint", 1023 | "thiserror", 1024 | ] 1025 | 1026 | [[package]] 1027 | name = "lock_api" 1028 | version = "0.4.11" 1029 | source = "registry+https://github.com/rust-lang/crates.io-index" 1030 | checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" 1031 | dependencies = [ 1032 | "autocfg", 1033 | "scopeguard", 1034 | ] 1035 | 1036 | [[package]] 1037 | name = "log" 1038 | version = "0.4.21" 1039 | source = "registry+https://github.com/rust-lang/crates.io-index" 1040 | checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" 1041 | 1042 | [[package]] 1043 | name = "memchr" 1044 | version = "2.7.1" 1045 | source = "registry+https://github.com/rust-lang/crates.io-index" 1046 | checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" 1047 | 1048 | [[package]] 1049 | name = "memmap2" 1050 | version = "0.5.10" 1051 | source = "registry+https://github.com/rust-lang/crates.io-index" 1052 | checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" 1053 | dependencies = [ 1054 | "libc", 1055 | ] 1056 | 1057 | [[package]] 1058 | name = "memoffset" 1059 | version = "0.9.0" 1060 | source = "registry+https://github.com/rust-lang/crates.io-index" 1061 | checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" 1062 | dependencies = [ 1063 | "autocfg", 1064 | ] 1065 | 1066 | [[package]] 1067 | name = "num-bigint" 1068 | version = "0.4.4" 1069 | source = "registry+https://github.com/rust-lang/crates.io-index" 1070 | checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" 1071 | dependencies = [ 1072 | "autocfg", 1073 | "num-integer", 1074 | "num-traits", 1075 | ] 1076 | 1077 | [[package]] 1078 | name = "num-derive" 1079 | version = "0.4.2" 1080 | source = "registry+https://github.com/rust-lang/crates.io-index" 1081 | checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" 1082 | dependencies = [ 1083 | "proc-macro2", 1084 | "quote", 1085 | "syn 2.0.52", 1086 | ] 1087 | 1088 | [[package]] 1089 | name = "num-integer" 1090 | version = "0.1.46" 1091 | source = "registry+https://github.com/rust-lang/crates.io-index" 1092 | checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" 1093 | dependencies = [ 1094 | "num-traits", 1095 | ] 1096 | 1097 | [[package]] 1098 | name = "num-traits" 1099 | version = "0.2.18" 1100 | source = "registry+https://github.com/rust-lang/crates.io-index" 1101 | checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" 1102 | dependencies = [ 1103 | "autocfg", 1104 | ] 1105 | 1106 | [[package]] 1107 | name = "once_cell" 1108 | version = "1.19.0" 1109 | source = "registry+https://github.com/rust-lang/crates.io-index" 1110 | checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" 1111 | 1112 | [[package]] 1113 | name = "opaque-debug" 1114 | version = "0.3.1" 1115 | source = "registry+https://github.com/rust-lang/crates.io-index" 1116 | checksum = "c08d65885ee38876c4f86fa503fb49d7b507c2b62552df7c70b2fce627e06381" 1117 | 1118 | [[package]] 1119 | name = "parking_lot" 1120 | version = "0.12.1" 1121 | source = "registry+https://github.com/rust-lang/crates.io-index" 1122 | checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" 1123 | dependencies = [ 1124 | "lock_api", 1125 | "parking_lot_core", 1126 | ] 1127 | 1128 | [[package]] 1129 | name = "parking_lot_core" 1130 | version = "0.9.9" 1131 | source = "registry+https://github.com/rust-lang/crates.io-index" 1132 | checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" 1133 | dependencies = [ 1134 | "cfg-if", 1135 | "libc", 1136 | "redox_syscall", 1137 | "smallvec", 1138 | "windows-targets", 1139 | ] 1140 | 1141 | [[package]] 1142 | name = "paste" 1143 | version = "1.0.14" 1144 | source = "registry+https://github.com/rust-lang/crates.io-index" 1145 | checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" 1146 | 1147 | [[package]] 1148 | name = "pbkdf2" 1149 | version = "0.4.0" 1150 | source = "registry+https://github.com/rust-lang/crates.io-index" 1151 | checksum = "216eaa586a190f0a738f2f918511eecfa90f13295abec0e457cdebcceda80cbd" 1152 | dependencies = [ 1153 | "crypto-mac", 1154 | ] 1155 | 1156 | [[package]] 1157 | name = "ppv-lite86" 1158 | version = "0.2.17" 1159 | source = "registry+https://github.com/rust-lang/crates.io-index" 1160 | checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" 1161 | 1162 | [[package]] 1163 | name = "proc-macro-crate" 1164 | version = "0.1.5" 1165 | source = "registry+https://github.com/rust-lang/crates.io-index" 1166 | checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" 1167 | dependencies = [ 1168 | "toml 0.5.11", 1169 | ] 1170 | 1171 | [[package]] 1172 | name = "proc-macro-crate" 1173 | version = "3.1.0" 1174 | source = "registry+https://github.com/rust-lang/crates.io-index" 1175 | checksum = "6d37c51ca738a55da99dc0c4a34860fd675453b8b36209178c2249bb13651284" 1176 | dependencies = [ 1177 | "toml_edit 0.21.1", 1178 | ] 1179 | 1180 | [[package]] 1181 | name = "proc-macro-error" 1182 | version = "1.0.4" 1183 | source = "registry+https://github.com/rust-lang/crates.io-index" 1184 | checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" 1185 | dependencies = [ 1186 | "proc-macro-error-attr", 1187 | "proc-macro2", 1188 | "quote", 1189 | "version_check", 1190 | ] 1191 | 1192 | [[package]] 1193 | name = "proc-macro-error-attr" 1194 | version = "1.0.4" 1195 | source = "registry+https://github.com/rust-lang/crates.io-index" 1196 | checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" 1197 | dependencies = [ 1198 | "proc-macro2", 1199 | "quote", 1200 | "version_check", 1201 | ] 1202 | 1203 | [[package]] 1204 | name = "proc-macro2" 1205 | version = "1.0.78" 1206 | source = "registry+https://github.com/rust-lang/crates.io-index" 1207 | checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" 1208 | dependencies = [ 1209 | "unicode-ident", 1210 | ] 1211 | 1212 | [[package]] 1213 | name = "quote" 1214 | version = "1.0.35" 1215 | source = "registry+https://github.com/rust-lang/crates.io-index" 1216 | checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" 1217 | dependencies = [ 1218 | "proc-macro2", 1219 | ] 1220 | 1221 | [[package]] 1222 | name = "rand" 1223 | version = "0.7.3" 1224 | source = "registry+https://github.com/rust-lang/crates.io-index" 1225 | checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" 1226 | dependencies = [ 1227 | "getrandom 0.1.16", 1228 | "libc", 1229 | "rand_chacha 0.2.2", 1230 | "rand_core 0.5.1", 1231 | "rand_hc", 1232 | ] 1233 | 1234 | [[package]] 1235 | name = "rand" 1236 | version = "0.8.5" 1237 | source = "registry+https://github.com/rust-lang/crates.io-index" 1238 | checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" 1239 | dependencies = [ 1240 | "libc", 1241 | "rand_chacha 0.3.1", 1242 | "rand_core 0.6.4", 1243 | ] 1244 | 1245 | [[package]] 1246 | name = "rand_chacha" 1247 | version = "0.2.2" 1248 | source = "registry+https://github.com/rust-lang/crates.io-index" 1249 | checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" 1250 | dependencies = [ 1251 | "ppv-lite86", 1252 | "rand_core 0.5.1", 1253 | ] 1254 | 1255 | [[package]] 1256 | name = "rand_chacha" 1257 | version = "0.3.1" 1258 | source = "registry+https://github.com/rust-lang/crates.io-index" 1259 | checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" 1260 | dependencies = [ 1261 | "ppv-lite86", 1262 | "rand_core 0.6.4", 1263 | ] 1264 | 1265 | [[package]] 1266 | name = "rand_core" 1267 | version = "0.5.1" 1268 | source = "registry+https://github.com/rust-lang/crates.io-index" 1269 | checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" 1270 | dependencies = [ 1271 | "getrandom 0.1.16", 1272 | ] 1273 | 1274 | [[package]] 1275 | name = "rand_core" 1276 | version = "0.6.4" 1277 | source = "registry+https://github.com/rust-lang/crates.io-index" 1278 | checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" 1279 | dependencies = [ 1280 | "getrandom 0.2.12", 1281 | ] 1282 | 1283 | [[package]] 1284 | name = "rand_hc" 1285 | version = "0.2.0" 1286 | source = "registry+https://github.com/rust-lang/crates.io-index" 1287 | checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" 1288 | dependencies = [ 1289 | "rand_core 0.5.1", 1290 | ] 1291 | 1292 | [[package]] 1293 | name = "rand_xoshiro" 1294 | version = "0.6.0" 1295 | source = "registry+https://github.com/rust-lang/crates.io-index" 1296 | checksum = "6f97cdb2a36ed4183de61b2f824cc45c9f1037f28afe0a322e9fff4c108b5aaa" 1297 | dependencies = [ 1298 | "rand_core 0.6.4", 1299 | ] 1300 | 1301 | [[package]] 1302 | name = "rayon" 1303 | version = "1.9.0" 1304 | source = "registry+https://github.com/rust-lang/crates.io-index" 1305 | checksum = "e4963ed1bc86e4f3ee217022bd855b297cef07fb9eac5dfa1f788b220b49b3bd" 1306 | dependencies = [ 1307 | "either", 1308 | "rayon-core", 1309 | ] 1310 | 1311 | [[package]] 1312 | name = "rayon-core" 1313 | version = "1.12.1" 1314 | source = "registry+https://github.com/rust-lang/crates.io-index" 1315 | checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" 1316 | dependencies = [ 1317 | "crossbeam-deque", 1318 | "crossbeam-utils", 1319 | ] 1320 | 1321 | [[package]] 1322 | name = "redox_syscall" 1323 | version = "0.4.1" 1324 | source = "registry+https://github.com/rust-lang/crates.io-index" 1325 | checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" 1326 | dependencies = [ 1327 | "bitflags 1.3.2", 1328 | ] 1329 | 1330 | [[package]] 1331 | name = "regex" 1332 | version = "1.10.5" 1333 | source = "registry+https://github.com/rust-lang/crates.io-index" 1334 | checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" 1335 | dependencies = [ 1336 | "aho-corasick", 1337 | "memchr", 1338 | "regex-automata", 1339 | "regex-syntax", 1340 | ] 1341 | 1342 | [[package]] 1343 | name = "regex-automata" 1344 | version = "0.4.7" 1345 | source = "registry+https://github.com/rust-lang/crates.io-index" 1346 | checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" 1347 | dependencies = [ 1348 | "aho-corasick", 1349 | "memchr", 1350 | "regex-syntax", 1351 | ] 1352 | 1353 | [[package]] 1354 | name = "regex-syntax" 1355 | version = "0.8.4" 1356 | source = "registry+https://github.com/rust-lang/crates.io-index" 1357 | checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" 1358 | 1359 | [[package]] 1360 | name = "rustc-hash" 1361 | version = "1.1.0" 1362 | source = "registry+https://github.com/rust-lang/crates.io-index" 1363 | checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" 1364 | 1365 | [[package]] 1366 | name = "rustc_version" 1367 | version = "0.4.0" 1368 | source = "registry+https://github.com/rust-lang/crates.io-index" 1369 | checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" 1370 | dependencies = [ 1371 | "semver", 1372 | ] 1373 | 1374 | [[package]] 1375 | name = "rustversion" 1376 | version = "1.0.14" 1377 | source = "registry+https://github.com/rust-lang/crates.io-index" 1378 | checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" 1379 | 1380 | [[package]] 1381 | name = "ryu" 1382 | version = "1.0.17" 1383 | source = "registry+https://github.com/rust-lang/crates.io-index" 1384 | checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" 1385 | 1386 | [[package]] 1387 | name = "scopeguard" 1388 | version = "1.2.0" 1389 | source = "registry+https://github.com/rust-lang/crates.io-index" 1390 | checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" 1391 | 1392 | [[package]] 1393 | name = "semver" 1394 | version = "1.0.22" 1395 | source = "registry+https://github.com/rust-lang/crates.io-index" 1396 | checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" 1397 | 1398 | [[package]] 1399 | name = "serde" 1400 | version = "1.0.197" 1401 | source = "registry+https://github.com/rust-lang/crates.io-index" 1402 | checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" 1403 | dependencies = [ 1404 | "serde_derive", 1405 | ] 1406 | 1407 | [[package]] 1408 | name = "serde_bytes" 1409 | version = "0.11.14" 1410 | source = "registry+https://github.com/rust-lang/crates.io-index" 1411 | checksum = "8b8497c313fd43ab992087548117643f6fcd935cbf36f176ffda0aacf9591734" 1412 | dependencies = [ 1413 | "serde", 1414 | ] 1415 | 1416 | [[package]] 1417 | name = "serde_derive" 1418 | version = "1.0.197" 1419 | source = "registry+https://github.com/rust-lang/crates.io-index" 1420 | checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" 1421 | dependencies = [ 1422 | "proc-macro2", 1423 | "quote", 1424 | "syn 2.0.52", 1425 | ] 1426 | 1427 | [[package]] 1428 | name = "serde_json" 1429 | version = "1.0.114" 1430 | source = "registry+https://github.com/rust-lang/crates.io-index" 1431 | checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" 1432 | dependencies = [ 1433 | "itoa", 1434 | "ryu", 1435 | "serde", 1436 | ] 1437 | 1438 | [[package]] 1439 | name = "serde_spanned" 1440 | version = "0.6.6" 1441 | source = "registry+https://github.com/rust-lang/crates.io-index" 1442 | checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" 1443 | dependencies = [ 1444 | "serde", 1445 | ] 1446 | 1447 | [[package]] 1448 | name = "sha2" 1449 | version = "0.9.9" 1450 | source = "registry+https://github.com/rust-lang/crates.io-index" 1451 | checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" 1452 | dependencies = [ 1453 | "block-buffer 0.9.0", 1454 | "cfg-if", 1455 | "cpufeatures", 1456 | "digest 0.9.0", 1457 | "opaque-debug", 1458 | ] 1459 | 1460 | [[package]] 1461 | name = "sha2" 1462 | version = "0.10.8" 1463 | source = "registry+https://github.com/rust-lang/crates.io-index" 1464 | checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" 1465 | dependencies = [ 1466 | "cfg-if", 1467 | "cpufeatures", 1468 | "digest 0.10.7", 1469 | ] 1470 | 1471 | [[package]] 1472 | name = "sha3" 1473 | version = "0.10.8" 1474 | source = "registry+https://github.com/rust-lang/crates.io-index" 1475 | checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" 1476 | dependencies = [ 1477 | "digest 0.10.7", 1478 | "keccak", 1479 | ] 1480 | 1481 | [[package]] 1482 | name = "sized-chunks" 1483 | version = "0.6.5" 1484 | source = "registry+https://github.com/rust-lang/crates.io-index" 1485 | checksum = "16d69225bde7a69b235da73377861095455d298f2b970996eec25ddbb42b3d1e" 1486 | dependencies = [ 1487 | "bitmaps", 1488 | "typenum", 1489 | ] 1490 | 1491 | [[package]] 1492 | name = "smallvec" 1493 | version = "1.13.1" 1494 | source = "registry+https://github.com/rust-lang/crates.io-index" 1495 | checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" 1496 | 1497 | [[package]] 1498 | name = "solana-frozen-abi" 1499 | version = "1.18.5" 1500 | source = "registry+https://github.com/rust-lang/crates.io-index" 1501 | checksum = "d50a7a9565c0050e1c3cda3811870ba54c57dbf3e71e50d145a9b1c43e50dda6" 1502 | dependencies = [ 1503 | "block-buffer 0.10.4", 1504 | "bs58 0.4.0", 1505 | "bv", 1506 | "either", 1507 | "generic-array", 1508 | "im", 1509 | "lazy_static", 1510 | "log", 1511 | "memmap2", 1512 | "rustc_version", 1513 | "serde", 1514 | "serde_bytes", 1515 | "serde_derive", 1516 | "sha2 0.10.8", 1517 | "solana-frozen-abi-macro", 1518 | "subtle", 1519 | "thiserror", 1520 | ] 1521 | 1522 | [[package]] 1523 | name = "solana-frozen-abi-macro" 1524 | version = "1.18.5" 1525 | source = "registry+https://github.com/rust-lang/crates.io-index" 1526 | checksum = "a5ba5861cb68c48e5403e4ec030bcc25191af3c42919d377c5f43ed3d343e441" 1527 | dependencies = [ 1528 | "proc-macro2", 1529 | "quote", 1530 | "rustc_version", 1531 | "syn 2.0.52", 1532 | ] 1533 | 1534 | [[package]] 1535 | name = "solana-program" 1536 | version = "1.18.5" 1537 | source = "registry+https://github.com/rust-lang/crates.io-index" 1538 | checksum = "72868a6513315be93b7b6fd38f3ac91aaca9401e8ff89720755363eede3ed87e" 1539 | dependencies = [ 1540 | "ark-bn254", 1541 | "ark-ec", 1542 | "ark-ff", 1543 | "ark-serialize", 1544 | "base64 0.21.7", 1545 | "bincode", 1546 | "bitflags 2.4.2", 1547 | "blake3", 1548 | "borsh 0.10.3", 1549 | "borsh 0.9.3", 1550 | "borsh 1.3.1", 1551 | "bs58 0.4.0", 1552 | "bv", 1553 | "bytemuck", 1554 | "cc", 1555 | "console_error_panic_hook", 1556 | "console_log", 1557 | "curve25519-dalek", 1558 | "getrandom 0.2.12", 1559 | "itertools", 1560 | "js-sys", 1561 | "lazy_static", 1562 | "libc", 1563 | "libsecp256k1", 1564 | "light-poseidon", 1565 | "log", 1566 | "memoffset", 1567 | "num-bigint", 1568 | "num-derive", 1569 | "num-traits", 1570 | "parking_lot", 1571 | "rand 0.8.5", 1572 | "rustc_version", 1573 | "rustversion", 1574 | "serde", 1575 | "serde_bytes", 1576 | "serde_derive", 1577 | "serde_json", 1578 | "sha2 0.10.8", 1579 | "sha3", 1580 | "solana-frozen-abi", 1581 | "solana-frozen-abi-macro", 1582 | "solana-sdk-macro", 1583 | "thiserror", 1584 | "tiny-bip39", 1585 | "wasm-bindgen", 1586 | "zeroize", 1587 | ] 1588 | 1589 | [[package]] 1590 | name = "solana-sdk-macro" 1591 | version = "1.18.5" 1592 | source = "registry+https://github.com/rust-lang/crates.io-index" 1593 | checksum = "e1c1760e8335a094197c956bd4fe86e88cb34c1063860c77905e90e22632b46f" 1594 | dependencies = [ 1595 | "bs58 0.4.0", 1596 | "proc-macro2", 1597 | "quote", 1598 | "rustversion", 1599 | "syn 2.0.52", 1600 | ] 1601 | 1602 | [[package]] 1603 | name = "subtle" 1604 | version = "2.5.0" 1605 | source = "registry+https://github.com/rust-lang/crates.io-index" 1606 | checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" 1607 | 1608 | [[package]] 1609 | name = "syn" 1610 | version = "1.0.109" 1611 | source = "registry+https://github.com/rust-lang/crates.io-index" 1612 | checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" 1613 | dependencies = [ 1614 | "proc-macro2", 1615 | "quote", 1616 | "unicode-ident", 1617 | ] 1618 | 1619 | [[package]] 1620 | name = "syn" 1621 | version = "2.0.52" 1622 | source = "registry+https://github.com/rust-lang/crates.io-index" 1623 | checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" 1624 | dependencies = [ 1625 | "proc-macro2", 1626 | "quote", 1627 | "unicode-ident", 1628 | ] 1629 | 1630 | [[package]] 1631 | name = "syn_derive" 1632 | version = "0.1.8" 1633 | source = "registry+https://github.com/rust-lang/crates.io-index" 1634 | checksum = "1329189c02ff984e9736652b1631330da25eaa6bc639089ed4915d25446cbe7b" 1635 | dependencies = [ 1636 | "proc-macro-error", 1637 | "proc-macro2", 1638 | "quote", 1639 | "syn 2.0.52", 1640 | ] 1641 | 1642 | [[package]] 1643 | name = "thiserror" 1644 | version = "1.0.57" 1645 | source = "registry+https://github.com/rust-lang/crates.io-index" 1646 | checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" 1647 | dependencies = [ 1648 | "thiserror-impl", 1649 | ] 1650 | 1651 | [[package]] 1652 | name = "thiserror-impl" 1653 | version = "1.0.57" 1654 | source = "registry+https://github.com/rust-lang/crates.io-index" 1655 | checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" 1656 | dependencies = [ 1657 | "proc-macro2", 1658 | "quote", 1659 | "syn 2.0.52", 1660 | ] 1661 | 1662 | [[package]] 1663 | name = "tiny-bip39" 1664 | version = "0.8.2" 1665 | source = "registry+https://github.com/rust-lang/crates.io-index" 1666 | checksum = "ffc59cb9dfc85bb312c3a78fd6aa8a8582e310b0fa885d5bb877f6dcc601839d" 1667 | dependencies = [ 1668 | "anyhow", 1669 | "hmac", 1670 | "once_cell", 1671 | "pbkdf2", 1672 | "rand 0.7.3", 1673 | "rustc-hash", 1674 | "sha2 0.9.9", 1675 | "thiserror", 1676 | "unicode-normalization", 1677 | "wasm-bindgen", 1678 | "zeroize", 1679 | ] 1680 | 1681 | [[package]] 1682 | name = "tinyvec" 1683 | version = "1.6.0" 1684 | source = "registry+https://github.com/rust-lang/crates.io-index" 1685 | checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" 1686 | dependencies = [ 1687 | "tinyvec_macros", 1688 | ] 1689 | 1690 | [[package]] 1691 | name = "tinyvec_macros" 1692 | version = "0.1.1" 1693 | source = "registry+https://github.com/rust-lang/crates.io-index" 1694 | checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" 1695 | 1696 | [[package]] 1697 | name = "toml" 1698 | version = "0.5.11" 1699 | source = "registry+https://github.com/rust-lang/crates.io-index" 1700 | checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" 1701 | dependencies = [ 1702 | "serde", 1703 | ] 1704 | 1705 | [[package]] 1706 | name = "toml" 1707 | version = "0.8.12" 1708 | source = "registry+https://github.com/rust-lang/crates.io-index" 1709 | checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" 1710 | dependencies = [ 1711 | "serde", 1712 | "serde_spanned", 1713 | "toml_datetime", 1714 | "toml_edit 0.22.12", 1715 | ] 1716 | 1717 | [[package]] 1718 | name = "toml_datetime" 1719 | version = "0.6.5" 1720 | source = "registry+https://github.com/rust-lang/crates.io-index" 1721 | checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" 1722 | dependencies = [ 1723 | "serde", 1724 | ] 1725 | 1726 | [[package]] 1727 | name = "toml_edit" 1728 | version = "0.21.1" 1729 | source = "registry+https://github.com/rust-lang/crates.io-index" 1730 | checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" 1731 | dependencies = [ 1732 | "indexmap", 1733 | "toml_datetime", 1734 | "winnow 0.5.40", 1735 | ] 1736 | 1737 | [[package]] 1738 | name = "toml_edit" 1739 | version = "0.22.12" 1740 | source = "registry+https://github.com/rust-lang/crates.io-index" 1741 | checksum = "d3328d4f68a705b2a4498da1d580585d39a6510f98318a2cec3018a7ec61ddef" 1742 | dependencies = [ 1743 | "indexmap", 1744 | "serde", 1745 | "serde_spanned", 1746 | "toml_datetime", 1747 | "winnow 0.6.15", 1748 | ] 1749 | 1750 | [[package]] 1751 | name = "typenum" 1752 | version = "1.17.0" 1753 | source = "registry+https://github.com/rust-lang/crates.io-index" 1754 | checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" 1755 | 1756 | [[package]] 1757 | name = "unicode-ident" 1758 | version = "1.0.12" 1759 | source = "registry+https://github.com/rust-lang/crates.io-index" 1760 | checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" 1761 | 1762 | [[package]] 1763 | name = "unicode-normalization" 1764 | version = "0.1.23" 1765 | source = "registry+https://github.com/rust-lang/crates.io-index" 1766 | checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" 1767 | dependencies = [ 1768 | "tinyvec", 1769 | ] 1770 | 1771 | [[package]] 1772 | name = "unicode-segmentation" 1773 | version = "1.11.0" 1774 | source = "registry+https://github.com/rust-lang/crates.io-index" 1775 | checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" 1776 | 1777 | [[package]] 1778 | name = "version_check" 1779 | version = "0.9.4" 1780 | source = "registry+https://github.com/rust-lang/crates.io-index" 1781 | checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" 1782 | 1783 | [[package]] 1784 | name = "wasi" 1785 | version = "0.9.0+wasi-snapshot-preview1" 1786 | source = "registry+https://github.com/rust-lang/crates.io-index" 1787 | checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" 1788 | 1789 | [[package]] 1790 | name = "wasi" 1791 | version = "0.11.0+wasi-snapshot-preview1" 1792 | source = "registry+https://github.com/rust-lang/crates.io-index" 1793 | checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" 1794 | 1795 | [[package]] 1796 | name = "wasm-bindgen" 1797 | version = "0.2.92" 1798 | source = "registry+https://github.com/rust-lang/crates.io-index" 1799 | checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" 1800 | dependencies = [ 1801 | "cfg-if", 1802 | "wasm-bindgen-macro", 1803 | ] 1804 | 1805 | [[package]] 1806 | name = "wasm-bindgen-backend" 1807 | version = "0.2.92" 1808 | source = "registry+https://github.com/rust-lang/crates.io-index" 1809 | checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" 1810 | dependencies = [ 1811 | "bumpalo", 1812 | "log", 1813 | "once_cell", 1814 | "proc-macro2", 1815 | "quote", 1816 | "syn 2.0.52", 1817 | "wasm-bindgen-shared", 1818 | ] 1819 | 1820 | [[package]] 1821 | name = "wasm-bindgen-macro" 1822 | version = "0.2.92" 1823 | source = "registry+https://github.com/rust-lang/crates.io-index" 1824 | checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" 1825 | dependencies = [ 1826 | "quote", 1827 | "wasm-bindgen-macro-support", 1828 | ] 1829 | 1830 | [[package]] 1831 | name = "wasm-bindgen-macro-support" 1832 | version = "0.2.92" 1833 | source = "registry+https://github.com/rust-lang/crates.io-index" 1834 | checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" 1835 | dependencies = [ 1836 | "proc-macro2", 1837 | "quote", 1838 | "syn 2.0.52", 1839 | "wasm-bindgen-backend", 1840 | "wasm-bindgen-shared", 1841 | ] 1842 | 1843 | [[package]] 1844 | name = "wasm-bindgen-shared" 1845 | version = "0.2.92" 1846 | source = "registry+https://github.com/rust-lang/crates.io-index" 1847 | checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" 1848 | 1849 | [[package]] 1850 | name = "web-sys" 1851 | version = "0.3.69" 1852 | source = "registry+https://github.com/rust-lang/crates.io-index" 1853 | checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" 1854 | dependencies = [ 1855 | "js-sys", 1856 | "wasm-bindgen", 1857 | ] 1858 | 1859 | [[package]] 1860 | name = "windows-targets" 1861 | version = "0.48.5" 1862 | source = "registry+https://github.com/rust-lang/crates.io-index" 1863 | checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" 1864 | dependencies = [ 1865 | "windows_aarch64_gnullvm", 1866 | "windows_aarch64_msvc", 1867 | "windows_i686_gnu", 1868 | "windows_i686_msvc", 1869 | "windows_x86_64_gnu", 1870 | "windows_x86_64_gnullvm", 1871 | "windows_x86_64_msvc", 1872 | ] 1873 | 1874 | [[package]] 1875 | name = "windows_aarch64_gnullvm" 1876 | version = "0.48.5" 1877 | source = "registry+https://github.com/rust-lang/crates.io-index" 1878 | checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" 1879 | 1880 | [[package]] 1881 | name = "windows_aarch64_msvc" 1882 | version = "0.48.5" 1883 | source = "registry+https://github.com/rust-lang/crates.io-index" 1884 | checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" 1885 | 1886 | [[package]] 1887 | name = "windows_i686_gnu" 1888 | version = "0.48.5" 1889 | source = "registry+https://github.com/rust-lang/crates.io-index" 1890 | checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" 1891 | 1892 | [[package]] 1893 | name = "windows_i686_msvc" 1894 | version = "0.48.5" 1895 | source = "registry+https://github.com/rust-lang/crates.io-index" 1896 | checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" 1897 | 1898 | [[package]] 1899 | name = "windows_x86_64_gnu" 1900 | version = "0.48.5" 1901 | source = "registry+https://github.com/rust-lang/crates.io-index" 1902 | checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" 1903 | 1904 | [[package]] 1905 | name = "windows_x86_64_gnullvm" 1906 | version = "0.48.5" 1907 | source = "registry+https://github.com/rust-lang/crates.io-index" 1908 | checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" 1909 | 1910 | [[package]] 1911 | name = "windows_x86_64_msvc" 1912 | version = "0.48.5" 1913 | source = "registry+https://github.com/rust-lang/crates.io-index" 1914 | checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" 1915 | 1916 | [[package]] 1917 | name = "winnow" 1918 | version = "0.5.40" 1919 | source = "registry+https://github.com/rust-lang/crates.io-index" 1920 | checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" 1921 | dependencies = [ 1922 | "memchr", 1923 | ] 1924 | 1925 | [[package]] 1926 | name = "winnow" 1927 | version = "0.6.15" 1928 | source = "registry+https://github.com/rust-lang/crates.io-index" 1929 | checksum = "557404e450152cd6795bb558bca69e43c585055f4606e3bcae5894fc6dac9ba0" 1930 | dependencies = [ 1931 | "memchr", 1932 | ] 1933 | 1934 | [[package]] 1935 | name = "zerocopy" 1936 | version = "0.7.32" 1937 | source = "registry+https://github.com/rust-lang/crates.io-index" 1938 | checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" 1939 | dependencies = [ 1940 | "zerocopy-derive", 1941 | ] 1942 | 1943 | [[package]] 1944 | name = "zerocopy-derive" 1945 | version = "0.7.32" 1946 | source = "registry+https://github.com/rust-lang/crates.io-index" 1947 | checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" 1948 | dependencies = [ 1949 | "proc-macro2", 1950 | "quote", 1951 | "syn 2.0.52", 1952 | ] 1953 | 1954 | [[package]] 1955 | name = "zeroize" 1956 | version = "1.3.0" 1957 | source = "registry+https://github.com/rust-lang/crates.io-index" 1958 | checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd" 1959 | dependencies = [ 1960 | "zeroize_derive", 1961 | ] 1962 | 1963 | [[package]] 1964 | name = "zeroize_derive" 1965 | version = "1.4.2" 1966 | source = "registry+https://github.com/rust-lang/crates.io-index" 1967 | checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" 1968 | dependencies = [ 1969 | "proc-macro2", 1970 | "quote", 1971 | "syn 2.0.52", 1972 | ] 1973 | -------------------------------------------------------------------------------- /anchor/Cargo.toml: -------------------------------------------------------------------------------- 1 | [workspace] 2 | members = [ 3 | "programs/*" 4 | ] 5 | resolver = "2" 6 | 7 | [profile.release] 8 | overflow-checks = true 9 | lto = "fat" 10 | codegen-units = 1 11 | [profile.release.build-override] 12 | opt-level = 3 13 | incremental = false 14 | codegen-units = 1 15 | -------------------------------------------------------------------------------- /anchor/README.md: -------------------------------------------------------------------------------- 1 | # anchor 2 | 3 | This library was generated with [Nx](https://nx.dev). 4 | 5 | ## Building 6 | 7 | Run `nx build anchor` to build the library. 8 | 9 | ## Running unit tests 10 | 11 | Run `nx test anchor` to execute the unit tests via [Jest](https://jestjs.io). 12 | -------------------------------------------------------------------------------- /anchor/jest.config.ts: -------------------------------------------------------------------------------- 1 | /* eslint-disable */ 2 | import { readFileSync } from 'fs'; 3 | 4 | // Reading the SWC compilation config and remove the "exclude" 5 | // for the test files to be compiled by SWC 6 | const { exclude: _, ...swcJestConfig } = JSON.parse( 7 | readFileSync(`${__dirname}/.swcrc`, 'utf-8') 8 | ); 9 | 10 | // disable .swcrc look-up by SWC core because we're passing in swcJestConfig ourselves. 11 | // If we do not disable this, SWC Core will read .swcrc and won't transform our test files due to "exclude" 12 | if (swcJestConfig.swcrc === undefined) { 13 | swcJestConfig.swcrc = false; 14 | } 15 | 16 | // Uncomment if using global setup/teardown files being transformed via swc 17 | // https://nx.dev/packages/jest/documents/overview#global-setup/teardown-with-nx-libraries 18 | // jest needs EsModule Interop to find the default exported setup/teardown functions 19 | // swcJestConfig.module.noInterop = false; 20 | 21 | export default { 22 | displayName: 'anchor', 23 | preset: '../jest.preset.js', 24 | transform: { 25 | '^.+\\.[tj]s$': ['@swc/jest', swcJestConfig], 26 | }, 27 | moduleFileExtensions: ['ts', 'js', 'html'], 28 | testEnvironment: '', 29 | coverageDirectory: '../coverage/anchor', 30 | }; 31 | -------------------------------------------------------------------------------- /anchor/migrations/deploy.ts: -------------------------------------------------------------------------------- 1 | // Migrations are an early feature. Currently, they're nothing more than this 2 | // single deploy script that's invoked from the CLI, injecting a provider 3 | // configured from the workspace's Anchor.toml. 4 | 5 | import * as anchor from '@coral-xyz/anchor'; 6 | 7 | module.exports = async function (provider) { 8 | // Configure client to use the provider. 9 | anchor.setProvider(provider); 10 | 11 | // Add your deploy script here. 12 | }; 13 | -------------------------------------------------------------------------------- /anchor/package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@journal/anchor", 3 | "version": "0.0.1", 4 | "lockfileVersion": 3, 5 | "requires": true, 6 | "packages": { 7 | "": { 8 | "name": "@journal/anchor", 9 | "version": "0.0.1", 10 | "dependencies": { 11 | "@coral-xyz/anchor": "^0.30.1", 12 | "@solana/web3.js": "1.90.0" 13 | } 14 | }, 15 | "node_modules/@babel/runtime": { 16 | "version": "7.24.8", 17 | "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.24.8.tgz", 18 | "integrity": "sha512-5F7SDGs1T72ZczbRwbGO9lQi0NLjQxzl6i4lJxLxfW9U5UluCSyEJeniWvnhl3/euNiqQVbo8zruhsDfid0esA==", 19 | "license": "MIT", 20 | "dependencies": { 21 | "regenerator-runtime": "^0.14.0" 22 | }, 23 | "engines": { 24 | "node": ">=6.9.0" 25 | } 26 | }, 27 | "node_modules/@coral-xyz/anchor": { 28 | "version": "0.30.1", 29 | "resolved": "https://registry.npmjs.org/@coral-xyz/anchor/-/anchor-0.30.1.tgz", 30 | "integrity": "sha512-gDXFoF5oHgpriXAaLpxyWBHdCs8Awgf/gLHIo6crv7Aqm937CNdY+x+6hoj7QR5vaJV7MxWSQ0NGFzL3kPbWEQ==", 31 | "license": "(MIT OR Apache-2.0)", 32 | "dependencies": { 33 | "@coral-xyz/anchor-errors": "^0.30.1", 34 | "@coral-xyz/borsh": "^0.30.1", 35 | "@noble/hashes": "^1.3.1", 36 | "@solana/web3.js": "^1.68.0", 37 | "bn.js": "^5.1.2", 38 | "bs58": "^4.0.1", 39 | "buffer-layout": "^1.2.2", 40 | "camelcase": "^6.3.0", 41 | "cross-fetch": "^3.1.5", 42 | "crypto-hash": "^1.3.0", 43 | "eventemitter3": "^4.0.7", 44 | "pako": "^2.0.3", 45 | "snake-case": "^3.0.4", 46 | "superstruct": "^0.15.4", 47 | "toml": "^3.0.0" 48 | }, 49 | "engines": { 50 | "node": ">=11" 51 | } 52 | }, 53 | "node_modules/@coral-xyz/anchor-errors": { 54 | "version": "0.30.1", 55 | "resolved": "https://registry.npmjs.org/@coral-xyz/anchor-errors/-/anchor-errors-0.30.1.tgz", 56 | "integrity": "sha512-9Mkradf5yS5xiLWrl9WrpjqOrAV+/W2RQHDlbnAZBivoGpOs1ECjoDCkVk4aRG8ZdiFiB8zQEVlxf+8fKkmSfQ==", 57 | "license": "Apache-2.0", 58 | "engines": { 59 | "node": ">=10" 60 | } 61 | }, 62 | "node_modules/@coral-xyz/borsh": { 63 | "version": "0.30.1", 64 | "resolved": "https://registry.npmjs.org/@coral-xyz/borsh/-/borsh-0.30.1.tgz", 65 | "integrity": "sha512-aaxswpPrCFKl8vZTbxLssA2RvwX2zmKLlRCIktJOwW+VpVwYtXRtlWiIP+c2pPRKneiTiWCN2GEMSH9j1zTlWQ==", 66 | "license": "Apache-2.0", 67 | "dependencies": { 68 | "bn.js": "^5.1.2", 69 | "buffer-layout": "^1.2.0" 70 | }, 71 | "engines": { 72 | "node": ">=10" 73 | }, 74 | "peerDependencies": { 75 | "@solana/web3.js": "^1.68.0" 76 | } 77 | }, 78 | "node_modules/@noble/curves": { 79 | "version": "1.4.2", 80 | "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.4.2.tgz", 81 | "integrity": "sha512-TavHr8qycMChk8UwMld0ZDRvatedkzWfH8IiaeGCfymOP5i0hSCozz9vHOL0nkwk7HRMlFnAiKpS2jrUmSybcw==", 82 | "license": "MIT", 83 | "dependencies": { 84 | "@noble/hashes": "1.4.0" 85 | }, 86 | "funding": { 87 | "url": "https://paulmillr.com/funding/" 88 | } 89 | }, 90 | "node_modules/@noble/hashes": { 91 | "version": "1.4.0", 92 | "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", 93 | "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", 94 | "license": "MIT", 95 | "engines": { 96 | "node": ">= 16" 97 | }, 98 | "funding": { 99 | "url": "https://paulmillr.com/funding/" 100 | } 101 | }, 102 | "node_modules/@solana/buffer-layout": { 103 | "version": "4.0.1", 104 | "resolved": "https://registry.npmjs.org/@solana/buffer-layout/-/buffer-layout-4.0.1.tgz", 105 | "integrity": "sha512-E1ImOIAD1tBZFRdjeM4/pzTiTApC0AOBGwyAMS4fwIodCWArzJ3DWdoh8cKxeFM2fElkxBh2Aqts1BPC373rHA==", 106 | "license": "MIT", 107 | "dependencies": { 108 | "buffer": "~6.0.3" 109 | }, 110 | "engines": { 111 | "node": ">=5.10" 112 | } 113 | }, 114 | "node_modules/@solana/web3.js": { 115 | "version": "1.90.0", 116 | "resolved": "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.90.0.tgz", 117 | "integrity": "sha512-p0cb/COXb8NNVSMkGMPwqQ6NvObZgUitN80uOedMB+jbYWOKOeJBuPnzhenkIV9RX0krGwyuY1Ltn5O8MGFsEw==", 118 | "license": "MIT", 119 | "dependencies": { 120 | "@babel/runtime": "^7.23.4", 121 | "@noble/curves": "^1.2.0", 122 | "@noble/hashes": "^1.3.2", 123 | "@solana/buffer-layout": "^4.0.1", 124 | "agentkeepalive": "^4.5.0", 125 | "bigint-buffer": "^1.1.5", 126 | "bn.js": "^5.2.1", 127 | "borsh": "^0.7.0", 128 | "bs58": "^4.0.1", 129 | "buffer": "6.0.3", 130 | "fast-stable-stringify": "^1.0.0", 131 | "jayson": "^4.1.0", 132 | "node-fetch": "^2.7.0", 133 | "rpc-websockets": "^7.5.1", 134 | "superstruct": "^0.14.2" 135 | } 136 | }, 137 | "node_modules/@solana/web3.js/node_modules/superstruct": { 138 | "version": "0.14.2", 139 | "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-0.14.2.tgz", 140 | "integrity": "sha512-nPewA6m9mR3d6k7WkZ8N8zpTWfenFH3q9pA2PkuiZxINr9DKB2+40wEQf0ixn8VaGuJ78AB6iWOtStI+/4FKZQ==", 141 | "license": "MIT" 142 | }, 143 | "node_modules/@types/connect": { 144 | "version": "3.4.38", 145 | "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", 146 | "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", 147 | "license": "MIT", 148 | "dependencies": { 149 | "@types/node": "*" 150 | } 151 | }, 152 | "node_modules/@types/node": { 153 | "version": "12.20.55", 154 | "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz", 155 | "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==", 156 | "license": "MIT" 157 | }, 158 | "node_modules/@types/ws": { 159 | "version": "7.4.7", 160 | "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz", 161 | "integrity": "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==", 162 | "license": "MIT", 163 | "dependencies": { 164 | "@types/node": "*" 165 | } 166 | }, 167 | "node_modules/agentkeepalive": { 168 | "version": "4.5.0", 169 | "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.5.0.tgz", 170 | "integrity": "sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew==", 171 | "license": "MIT", 172 | "dependencies": { 173 | "humanize-ms": "^1.2.1" 174 | }, 175 | "engines": { 176 | "node": ">= 8.0.0" 177 | } 178 | }, 179 | "node_modules/base-x": { 180 | "version": "3.0.10", 181 | "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.10.tgz", 182 | "integrity": "sha512-7d0s06rR9rYaIWHkpfLIFICM/tkSVdoPC9qYAQRpxn9DdKNWNsKC0uk++akckyLq16Tx2WIinnZ6WRriAt6njQ==", 183 | "license": "MIT", 184 | "dependencies": { 185 | "safe-buffer": "^5.0.1" 186 | } 187 | }, 188 | "node_modules/base64-js": { 189 | "version": "1.5.1", 190 | "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", 191 | "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", 192 | "funding": [ 193 | { 194 | "type": "github", 195 | "url": "https://github.com/sponsors/feross" 196 | }, 197 | { 198 | "type": "patreon", 199 | "url": "https://www.patreon.com/feross" 200 | }, 201 | { 202 | "type": "consulting", 203 | "url": "https://feross.org/support" 204 | } 205 | ], 206 | "license": "MIT" 207 | }, 208 | "node_modules/bigint-buffer": { 209 | "version": "1.1.5", 210 | "resolved": "https://registry.npmjs.org/bigint-buffer/-/bigint-buffer-1.1.5.tgz", 211 | "integrity": "sha512-trfYco6AoZ+rKhKnxA0hgX0HAbVP/s808/EuDSe2JDzUnCp/xAsli35Orvk67UrTEcwuxZqYZDmfA2RXJgxVvA==", 212 | "hasInstallScript": true, 213 | "license": "Apache-2.0", 214 | "dependencies": { 215 | "bindings": "^1.3.0" 216 | }, 217 | "engines": { 218 | "node": ">= 10.0.0" 219 | } 220 | }, 221 | "node_modules/bindings": { 222 | "version": "1.5.0", 223 | "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", 224 | "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", 225 | "license": "MIT", 226 | "dependencies": { 227 | "file-uri-to-path": "1.0.0" 228 | } 229 | }, 230 | "node_modules/bn.js": { 231 | "version": "5.2.1", 232 | "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", 233 | "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", 234 | "license": "MIT" 235 | }, 236 | "node_modules/borsh": { 237 | "version": "0.7.0", 238 | "resolved": "https://registry.npmjs.org/borsh/-/borsh-0.7.0.tgz", 239 | "integrity": "sha512-CLCsZGIBCFnPtkNnieW/a8wmreDmfUtjU2m9yHrzPXIlNbqVs0AQrSatSG6vdNYUqdc83tkQi2eHfF98ubzQLA==", 240 | "license": "Apache-2.0", 241 | "dependencies": { 242 | "bn.js": "^5.2.0", 243 | "bs58": "^4.0.0", 244 | "text-encoding-utf-8": "^1.0.2" 245 | } 246 | }, 247 | "node_modules/bs58": { 248 | "version": "4.0.1", 249 | "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", 250 | "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", 251 | "license": "MIT", 252 | "dependencies": { 253 | "base-x": "^3.0.2" 254 | } 255 | }, 256 | "node_modules/buffer": { 257 | "version": "6.0.3", 258 | "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", 259 | "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", 260 | "funding": [ 261 | { 262 | "type": "github", 263 | "url": "https://github.com/sponsors/feross" 264 | }, 265 | { 266 | "type": "patreon", 267 | "url": "https://www.patreon.com/feross" 268 | }, 269 | { 270 | "type": "consulting", 271 | "url": "https://feross.org/support" 272 | } 273 | ], 274 | "license": "MIT", 275 | "dependencies": { 276 | "base64-js": "^1.3.1", 277 | "ieee754": "^1.2.1" 278 | } 279 | }, 280 | "node_modules/buffer-layout": { 281 | "version": "1.2.2", 282 | "resolved": "https://registry.npmjs.org/buffer-layout/-/buffer-layout-1.2.2.tgz", 283 | "integrity": "sha512-kWSuLN694+KTk8SrYvCqwP2WcgQjoRCiF5b4QDvkkz8EmgD+aWAIceGFKMIAdmF/pH+vpgNV3d3kAKorcdAmWA==", 284 | "license": "MIT", 285 | "engines": { 286 | "node": ">=4.5" 287 | } 288 | }, 289 | "node_modules/bufferutil": { 290 | "version": "4.0.8", 291 | "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.8.tgz", 292 | "integrity": "sha512-4T53u4PdgsXqKaIctwF8ifXlRTTmEPJ8iEPWFdGZvcf7sbwYo6FKFEX9eNNAnzFZ7EzJAQ3CJeOtCRA4rDp7Pw==", 293 | "hasInstallScript": true, 294 | "license": "MIT", 295 | "optional": true, 296 | "dependencies": { 297 | "node-gyp-build": "^4.3.0" 298 | }, 299 | "engines": { 300 | "node": ">=6.14.2" 301 | } 302 | }, 303 | "node_modules/camelcase": { 304 | "version": "6.3.0", 305 | "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", 306 | "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", 307 | "license": "MIT", 308 | "engines": { 309 | "node": ">=10" 310 | }, 311 | "funding": { 312 | "url": "https://github.com/sponsors/sindresorhus" 313 | } 314 | }, 315 | "node_modules/commander": { 316 | "version": "2.20.3", 317 | "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", 318 | "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", 319 | "license": "MIT" 320 | }, 321 | "node_modules/cross-fetch": { 322 | "version": "3.1.8", 323 | "resolved": "https://registry.npmjs.org/cross-fetch/-/cross-fetch-3.1.8.tgz", 324 | "integrity": "sha512-cvA+JwZoU0Xq+h6WkMvAUqPEYy92Obet6UdKLfW60qn99ftItKjB5T+BkyWOFWe2pUyfQ+IJHmpOTznqk1M6Kg==", 325 | "license": "MIT", 326 | "dependencies": { 327 | "node-fetch": "^2.6.12" 328 | } 329 | }, 330 | "node_modules/crypto-hash": { 331 | "version": "1.3.0", 332 | "resolved": "https://registry.npmjs.org/crypto-hash/-/crypto-hash-1.3.0.tgz", 333 | "integrity": "sha512-lyAZ0EMyjDkVvz8WOeVnuCPvKVBXcMv1l5SVqO1yC7PzTwrD/pPje/BIRbWhMoPe436U+Y2nD7f5bFx0kt+Sbg==", 334 | "license": "MIT", 335 | "engines": { 336 | "node": ">=8" 337 | }, 338 | "funding": { 339 | "url": "https://github.com/sponsors/sindresorhus" 340 | } 341 | }, 342 | "node_modules/delay": { 343 | "version": "5.0.0", 344 | "resolved": "https://registry.npmjs.org/delay/-/delay-5.0.0.tgz", 345 | "integrity": "sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw==", 346 | "license": "MIT", 347 | "engines": { 348 | "node": ">=10" 349 | }, 350 | "funding": { 351 | "url": "https://github.com/sponsors/sindresorhus" 352 | } 353 | }, 354 | "node_modules/dot-case": { 355 | "version": "3.0.4", 356 | "resolved": "https://registry.npmjs.org/dot-case/-/dot-case-3.0.4.tgz", 357 | "integrity": "sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==", 358 | "license": "MIT", 359 | "dependencies": { 360 | "no-case": "^3.0.4", 361 | "tslib": "^2.0.3" 362 | } 363 | }, 364 | "node_modules/es6-promise": { 365 | "version": "4.2.8", 366 | "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", 367 | "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==", 368 | "license": "MIT" 369 | }, 370 | "node_modules/es6-promisify": { 371 | "version": "5.0.0", 372 | "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", 373 | "integrity": "sha512-C+d6UdsYDk0lMebHNR4S2NybQMMngAOnOwYBQjTOiv0MkoJMP0Myw2mgpDLBcpfCmRLxyFqYhS/CfOENq4SJhQ==", 374 | "license": "MIT", 375 | "dependencies": { 376 | "es6-promise": "^4.0.3" 377 | } 378 | }, 379 | "node_modules/eventemitter3": { 380 | "version": "4.0.7", 381 | "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", 382 | "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", 383 | "license": "MIT" 384 | }, 385 | "node_modules/eyes": { 386 | "version": "0.1.8", 387 | "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", 388 | "integrity": "sha512-GipyPsXO1anza0AOZdy69Im7hGFCNB7Y/NGjDlZGJ3GJJLtwNSb2vrzYrTYJRrRloVx7pl+bhUaTB8yiccPvFQ==", 389 | "engines": { 390 | "node": "> 0.1.90" 391 | } 392 | }, 393 | "node_modules/fast-stable-stringify": { 394 | "version": "1.0.0", 395 | "resolved": "https://registry.npmjs.org/fast-stable-stringify/-/fast-stable-stringify-1.0.0.tgz", 396 | "integrity": "sha512-wpYMUmFu5f00Sm0cj2pfivpmawLZ0NKdviQ4w9zJeR8JVtOpOxHmLaJuj0vxvGqMJQWyP/COUkF75/57OKyRag==", 397 | "license": "MIT" 398 | }, 399 | "node_modules/file-uri-to-path": { 400 | "version": "1.0.0", 401 | "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", 402 | "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", 403 | "license": "MIT" 404 | }, 405 | "node_modules/humanize-ms": { 406 | "version": "1.2.1", 407 | "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", 408 | "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", 409 | "license": "MIT", 410 | "dependencies": { 411 | "ms": "^2.0.0" 412 | } 413 | }, 414 | "node_modules/ieee754": { 415 | "version": "1.2.1", 416 | "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", 417 | "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", 418 | "funding": [ 419 | { 420 | "type": "github", 421 | "url": "https://github.com/sponsors/feross" 422 | }, 423 | { 424 | "type": "patreon", 425 | "url": "https://www.patreon.com/feross" 426 | }, 427 | { 428 | "type": "consulting", 429 | "url": "https://feross.org/support" 430 | } 431 | ], 432 | "license": "BSD-3-Clause" 433 | }, 434 | "node_modules/isomorphic-ws": { 435 | "version": "4.0.1", 436 | "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz", 437 | "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==", 438 | "license": "MIT", 439 | "peerDependencies": { 440 | "ws": "*" 441 | } 442 | }, 443 | "node_modules/jayson": { 444 | "version": "4.1.1", 445 | "resolved": "https://registry.npmjs.org/jayson/-/jayson-4.1.1.tgz", 446 | "integrity": "sha512-5ZWm4Q/0DHPyeMfAsrwViwUS2DMVsQgWh8bEEIVTkfb3DzHZ2L3G5WUnF+AKmGjjM9r1uAv73SaqC1/U4RL45w==", 447 | "license": "MIT", 448 | "dependencies": { 449 | "@types/connect": "^3.4.33", 450 | "@types/node": "^12.12.54", 451 | "@types/ws": "^7.4.4", 452 | "commander": "^2.20.3", 453 | "delay": "^5.0.0", 454 | "es6-promisify": "^5.0.0", 455 | "eyes": "^0.1.8", 456 | "isomorphic-ws": "^4.0.1", 457 | "json-stringify-safe": "^5.0.1", 458 | "JSONStream": "^1.3.5", 459 | "uuid": "^8.3.2", 460 | "ws": "^7.5.10" 461 | }, 462 | "bin": { 463 | "jayson": "bin/jayson.js" 464 | }, 465 | "engines": { 466 | "node": ">=8" 467 | } 468 | }, 469 | "node_modules/json-stringify-safe": { 470 | "version": "5.0.1", 471 | "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", 472 | "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", 473 | "license": "ISC" 474 | }, 475 | "node_modules/jsonparse": { 476 | "version": "1.3.1", 477 | "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", 478 | "integrity": "sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==", 479 | "engines": [ 480 | "node >= 0.2.0" 481 | ], 482 | "license": "MIT" 483 | }, 484 | "node_modules/JSONStream": { 485 | "version": "1.3.5", 486 | "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", 487 | "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", 488 | "license": "(MIT OR Apache-2.0)", 489 | "dependencies": { 490 | "jsonparse": "^1.2.0", 491 | "through": ">=2.2.7 <3" 492 | }, 493 | "bin": { 494 | "JSONStream": "bin.js" 495 | }, 496 | "engines": { 497 | "node": "*" 498 | } 499 | }, 500 | "node_modules/lower-case": { 501 | "version": "2.0.2", 502 | "resolved": "https://registry.npmjs.org/lower-case/-/lower-case-2.0.2.tgz", 503 | "integrity": "sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==", 504 | "license": "MIT", 505 | "dependencies": { 506 | "tslib": "^2.0.3" 507 | } 508 | }, 509 | "node_modules/ms": { 510 | "version": "2.1.3", 511 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", 512 | "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", 513 | "license": "MIT" 514 | }, 515 | "node_modules/no-case": { 516 | "version": "3.0.4", 517 | "resolved": "https://registry.npmjs.org/no-case/-/no-case-3.0.4.tgz", 518 | "integrity": "sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==", 519 | "license": "MIT", 520 | "dependencies": { 521 | "lower-case": "^2.0.2", 522 | "tslib": "^2.0.3" 523 | } 524 | }, 525 | "node_modules/node-fetch": { 526 | "version": "2.7.0", 527 | "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", 528 | "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", 529 | "license": "MIT", 530 | "dependencies": { 531 | "whatwg-url": "^5.0.0" 532 | }, 533 | "engines": { 534 | "node": "4.x || >=6.0.0" 535 | }, 536 | "peerDependencies": { 537 | "encoding": "^0.1.0" 538 | }, 539 | "peerDependenciesMeta": { 540 | "encoding": { 541 | "optional": true 542 | } 543 | } 544 | }, 545 | "node_modules/node-gyp-build": { 546 | "version": "4.8.1", 547 | "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.1.tgz", 548 | "integrity": "sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==", 549 | "license": "MIT", 550 | "optional": true, 551 | "bin": { 552 | "node-gyp-build": "bin.js", 553 | "node-gyp-build-optional": "optional.js", 554 | "node-gyp-build-test": "build-test.js" 555 | } 556 | }, 557 | "node_modules/pako": { 558 | "version": "2.1.0", 559 | "resolved": "https://registry.npmjs.org/pako/-/pako-2.1.0.tgz", 560 | "integrity": "sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug==", 561 | "license": "(MIT AND Zlib)" 562 | }, 563 | "node_modules/regenerator-runtime": { 564 | "version": "0.14.1", 565 | "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", 566 | "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", 567 | "license": "MIT" 568 | }, 569 | "node_modules/rpc-websockets": { 570 | "version": "7.11.2", 571 | "resolved": "https://registry.npmjs.org/rpc-websockets/-/rpc-websockets-7.11.2.tgz", 572 | "integrity": "sha512-pL9r5N6AVHlMN/vT98+fcO+5+/UcPLf/4tq+WUaid/PPUGS/ttJ3y8e9IqmaWKtShNAysMSjkczuEA49NuV7UQ==", 573 | "license": "LGPL-3.0-only", 574 | "dependencies": { 575 | "eventemitter3": "^4.0.7", 576 | "uuid": "^8.3.2", 577 | "ws": "^8.5.0" 578 | }, 579 | "funding": { 580 | "type": "paypal", 581 | "url": "https://paypal.me/kozjak" 582 | }, 583 | "optionalDependencies": { 584 | "bufferutil": "^4.0.1", 585 | "utf-8-validate": "^5.0.2" 586 | } 587 | }, 588 | "node_modules/rpc-websockets/node_modules/ws": { 589 | "version": "8.18.0", 590 | "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", 591 | "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", 592 | "license": "MIT", 593 | "engines": { 594 | "node": ">=10.0.0" 595 | }, 596 | "peerDependencies": { 597 | "bufferutil": "^4.0.1", 598 | "utf-8-validate": ">=5.0.2" 599 | }, 600 | "peerDependenciesMeta": { 601 | "bufferutil": { 602 | "optional": true 603 | }, 604 | "utf-8-validate": { 605 | "optional": true 606 | } 607 | } 608 | }, 609 | "node_modules/safe-buffer": { 610 | "version": "5.2.1", 611 | "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", 612 | "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", 613 | "funding": [ 614 | { 615 | "type": "github", 616 | "url": "https://github.com/sponsors/feross" 617 | }, 618 | { 619 | "type": "patreon", 620 | "url": "https://www.patreon.com/feross" 621 | }, 622 | { 623 | "type": "consulting", 624 | "url": "https://feross.org/support" 625 | } 626 | ], 627 | "license": "MIT" 628 | }, 629 | "node_modules/snake-case": { 630 | "version": "3.0.4", 631 | "resolved": "https://registry.npmjs.org/snake-case/-/snake-case-3.0.4.tgz", 632 | "integrity": "sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==", 633 | "license": "MIT", 634 | "dependencies": { 635 | "dot-case": "^3.0.4", 636 | "tslib": "^2.0.3" 637 | } 638 | }, 639 | "node_modules/superstruct": { 640 | "version": "0.15.5", 641 | "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-0.15.5.tgz", 642 | "integrity": "sha512-4AOeU+P5UuE/4nOUkmcQdW5y7i9ndt1cQd/3iUe+LTz3RxESf/W/5lg4B74HbDMMv8PHnPnGCQFH45kBcrQYoQ==", 643 | "license": "MIT" 644 | }, 645 | "node_modules/text-encoding-utf-8": { 646 | "version": "1.0.2", 647 | "resolved": "https://registry.npmjs.org/text-encoding-utf-8/-/text-encoding-utf-8-1.0.2.tgz", 648 | "integrity": "sha512-8bw4MY9WjdsD2aMtO0OzOCY3pXGYNx2d2FfHRVUKkiCPDWjKuOlhLVASS+pD7VkLTVjW268LYJHwsnPFlBpbAg==" 649 | }, 650 | "node_modules/through": { 651 | "version": "2.3.8", 652 | "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", 653 | "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", 654 | "license": "MIT" 655 | }, 656 | "node_modules/toml": { 657 | "version": "3.0.0", 658 | "resolved": "https://registry.npmjs.org/toml/-/toml-3.0.0.tgz", 659 | "integrity": "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==", 660 | "license": "MIT" 661 | }, 662 | "node_modules/tr46": { 663 | "version": "0.0.3", 664 | "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", 665 | "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", 666 | "license": "MIT" 667 | }, 668 | "node_modules/tslib": { 669 | "version": "2.6.3", 670 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", 671 | "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==", 672 | "license": "0BSD" 673 | }, 674 | "node_modules/utf-8-validate": { 675 | "version": "5.0.10", 676 | "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz", 677 | "integrity": "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==", 678 | "hasInstallScript": true, 679 | "license": "MIT", 680 | "optional": true, 681 | "dependencies": { 682 | "node-gyp-build": "^4.3.0" 683 | }, 684 | "engines": { 685 | "node": ">=6.14.2" 686 | } 687 | }, 688 | "node_modules/uuid": { 689 | "version": "8.3.2", 690 | "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", 691 | "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", 692 | "license": "MIT", 693 | "bin": { 694 | "uuid": "dist/bin/uuid" 695 | } 696 | }, 697 | "node_modules/webidl-conversions": { 698 | "version": "3.0.1", 699 | "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", 700 | "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", 701 | "license": "BSD-2-Clause" 702 | }, 703 | "node_modules/whatwg-url": { 704 | "version": "5.0.0", 705 | "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", 706 | "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", 707 | "license": "MIT", 708 | "dependencies": { 709 | "tr46": "~0.0.3", 710 | "webidl-conversions": "^3.0.0" 711 | } 712 | }, 713 | "node_modules/ws": { 714 | "version": "7.5.10", 715 | "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", 716 | "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", 717 | "license": "MIT", 718 | "engines": { 719 | "node": ">=8.3.0" 720 | }, 721 | "peerDependencies": { 722 | "bufferutil": "^4.0.1", 723 | "utf-8-validate": "^5.0.2" 724 | }, 725 | "peerDependenciesMeta": { 726 | "bufferutil": { 727 | "optional": true 728 | }, 729 | "utf-8-validate": { 730 | "optional": true 731 | } 732 | } 733 | } 734 | } 735 | } 736 | -------------------------------------------------------------------------------- /anchor/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@journal/anchor", 3 | "version": "0.0.1", 4 | "dependencies": { 5 | "@coral-xyz/anchor": "^0.30.1", 6 | "@solana/web3.js": "1.90.0" 7 | }, 8 | "type": "commonjs", 9 | "main": "./index.cjs", 10 | "module": "./index.js" 11 | } 12 | -------------------------------------------------------------------------------- /anchor/programs/journal/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "journal" 3 | version = "0.1.0" 4 | description = "Created with Anchor" 5 | edition = "2021" 6 | 7 | [lib] 8 | crate-type = ["cdylib", "lib"] 9 | name = "journal" 10 | 11 | [features] 12 | no-entrypoint = [] 13 | no-idl = [] 14 | no-log-ix-name = [] 15 | cpi = ["no-entrypoint"] 16 | default = [] 17 | idl-build = ["anchor-lang/idl-build"] 18 | 19 | [dependencies] 20 | anchor-lang = "0.30.1" 21 | -------------------------------------------------------------------------------- /anchor/programs/journal/Xargo.toml: -------------------------------------------------------------------------------- 1 | [target.bpfel-unknown-unknown.dependencies.std] 2 | features = [] 3 | -------------------------------------------------------------------------------- /anchor/programs/journal/src/lib.rs: -------------------------------------------------------------------------------- 1 | use anchor_lang::prelude::*; 2 | 3 | // This is your program's public key and it will update 4 | // automatically when you build the project. 5 | declare_id!("94L2mJxVu6ZMmHaGsCHRQ65Kk2mea6aTnwWjSdfSsmBC"); 6 | 7 | #[program] 8 | mod journal { 9 | use super::*; 10 | 11 | pub fn create_journal_entry( 12 | ctx: Context, 13 | title: String, 14 | message: String, 15 | ) -> Result<()> { 16 | msg!("Journal Entry Created"); 17 | msg!("Title: {}", title); 18 | msg!("Message: {}", message); 19 | 20 | let journal_entry = &mut ctx.accounts.journal_entry; 21 | journal_entry.owner = ctx.accounts.owner.key(); 22 | journal_entry.title = title; 23 | journal_entry.message = message; 24 | Ok(()) 25 | } 26 | 27 | pub fn update_journal_entry( 28 | ctx: Context, 29 | title: String, 30 | message: String, 31 | ) -> Result<()> { 32 | msg!("Journal Entry Updated"); 33 | msg!("Title: {}", title); 34 | msg!("Message: {}", message); 35 | 36 | let journal_entry = &mut ctx.accounts.journal_entry; 37 | journal_entry.message = message; 38 | 39 | Ok(()) 40 | } 41 | 42 | pub fn delete_journal_entry(_ctx: Context, title: String) -> Result<()> { 43 | msg!("Journal entry titled {} deleted", title); 44 | Ok(()) 45 | } 46 | } 47 | 48 | #[account] 49 | pub struct JournalEntryState { 50 | pub owner: Pubkey, 51 | pub title: String, 52 | pub message: String, 53 | } 54 | 55 | #[derive(Accounts)] 56 | #[instruction(title: String, message: String)] 57 | pub struct CreateEntry<'info> { 58 | #[account( 59 | init, 60 | seeds = [title.as_bytes(), owner.key().as_ref()], 61 | bump, 62 | payer = owner, 63 | space = 8 + 32 + 4 + title.len() + 4 + message.len() 64 | )] 65 | pub journal_entry: Account<'info, JournalEntryState>, 66 | #[account(mut)] 67 | pub owner: Signer<'info>, 68 | pub system_program: Program<'info, System>, 69 | } 70 | 71 | #[derive(Accounts)] 72 | #[instruction(title: String, message: String)] 73 | pub struct UpdateEntry<'info> { 74 | #[account( 75 | mut, 76 | seeds = [title.as_bytes(), owner.key().as_ref()], 77 | bump, 78 | realloc = 8 + 32 + 4 + title.len() + 4 + message.len(), 79 | realloc::payer = owner, 80 | realloc::zero = true, 81 | )] 82 | pub journal_entry: Account<'info, JournalEntryState>, 83 | #[account(mut)] 84 | pub owner: Signer<'info>, 85 | pub system_program: Program<'info, System>, 86 | } 87 | 88 | #[derive(Accounts)] 89 | #[instruction(title: String)] 90 | pub struct DeleteEntry<'info> { 91 | #[account( 92 | mut, 93 | seeds = [title.as_bytes(), owner.key().as_ref()], 94 | bump, 95 | close= owner, 96 | )] 97 | pub journal_entry: Account<'info, JournalEntryState>, 98 | #[account(mut)] 99 | pub owner: Signer<'info>, 100 | pub system_program: Program<'info, System>, 101 | } 102 | -------------------------------------------------------------------------------- /anchor/project.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "anchor", 3 | "$schema": "../node_modules/nx/schemas/project-schema.json", 4 | "sourceRoot": "anchor/src", 5 | "projectType": "library", 6 | "targets": { 7 | "build": { 8 | "executor": "@nx/rollup:rollup", 9 | "outputs": ["{options.outputPath}"], 10 | "options": { 11 | "outputPath": "dist/anchor", 12 | "main": "anchor/src/index.ts", 13 | "tsConfig": "anchor/tsconfig.lib.json", 14 | "assets": [], 15 | "project": "anchor/package.json", 16 | "compiler": "swc", 17 | "format": ["cjs", "esm"] 18 | } 19 | }, 20 | "lint": { 21 | "executor": "@nx/eslint:lint", 22 | "outputs": ["{options.outputFile}"] 23 | }, 24 | "test": { 25 | "executor": "nx:run-commands", 26 | "options": { 27 | "cwd": "anchor", 28 | "commands": ["anchor test"], 29 | "parallel": false 30 | } 31 | }, 32 | "anchor": { 33 | "executor": "nx:run-commands", 34 | "options": { 35 | "cwd": "anchor", 36 | "commands": ["anchor"], 37 | "parallel": false 38 | } 39 | }, 40 | "localnet": { 41 | "executor": "nx:run-commands", 42 | "options": { 43 | "cwd": "anchor", 44 | "commands": ["anchor localnet"], 45 | "parallel": false 46 | } 47 | }, 48 | "jest": { 49 | "executor": "@nx/jest:jest", 50 | "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], 51 | "options": { 52 | "jestConfig": "anchor/jest.config.ts" 53 | } 54 | } 55 | }, 56 | "tags": [] 57 | } 58 | -------------------------------------------------------------------------------- /anchor/src/index.ts: -------------------------------------------------------------------------------- 1 | // This file was generated by preset-anchor. Programs are exported from this file. 2 | 3 | export * from './journal-exports'; 4 | -------------------------------------------------------------------------------- /anchor/src/journal-exports.ts: -------------------------------------------------------------------------------- 1 | // Here we export some useful types and functions for interacting with the Anchor program. 2 | import { AnchorProvider, Program } from "@coral-xyz/anchor"; 3 | import { Cluster, PublicKey } from "@solana/web3.js"; 4 | import JournalIDL from "../target/idl/journal.json"; 5 | import type { Journal } from "../target/types/journal"; 6 | 7 | // Re-export the generated IDL and type 8 | export { Journal, JournalIDL }; 9 | 10 | // After updating your program ID (e.g. after running `anchor keys sync`) update the value below. 11 | export const JOURNAL_PROGRAM_ID = new PublicKey( 12 | "EZB64BQPMPzGNEV6XvrxTSPcQHCXaRF7aXMgunxQ6LNh" 13 | ); 14 | 15 | // This is a helper function to get the Counter Anchor program. 16 | export function getJournalProgram(provider: AnchorProvider) { 17 | return new Program(JournalIDL as Journal, provider); 18 | } 19 | 20 | // This is a helper function to get the program ID for the Journal program depending on the cluster. 21 | export function getJournalProgramId(cluster: Cluster) { 22 | switch (cluster) { 23 | case "devnet": 24 | case "testnet": 25 | case "mainnet-beta": 26 | default: 27 | return JOURNAL_PROGRAM_ID; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /anchor/tests/journal.spec.ts: -------------------------------------------------------------------------------- 1 | import * as anchor from '@coral-xyz/anchor'; 2 | import { Program } from '@coral-xyz/anchor'; 3 | import { Keypair } from '@solana/web3.js'; 4 | import { Journal } from '../target/types/journal'; 5 | 6 | describe('journal', () => { 7 | // Configure the client to use the local cluster. 8 | const provider = anchor.AnchorProvider.env(); 9 | anchor.setProvider(provider); 10 | const payer = provider.wallet as anchor.Wallet; 11 | 12 | const program = anchor.workspace.Journal as Program; 13 | 14 | const journalKeypair = Keypair.generate(); 15 | 16 | it('Initialize Journal', async () => { 17 | await program.methods 18 | .initialize() 19 | .accounts({ 20 | journal: journalKeypair.publicKey, 21 | payer: payer.publicKey, 22 | }) 23 | .signers([journalKeypair]) 24 | .rpc(); 25 | 26 | const currentCount = await program.account.journal.fetch( 27 | journalKeypair.publicKey 28 | ); 29 | 30 | expect(currentCount.count).toEqual(0); 31 | }); 32 | 33 | it('Increment Journal', async () => { 34 | await program.methods 35 | .increment() 36 | .accounts({ journal: journalKeypair.publicKey }) 37 | .rpc(); 38 | 39 | const currentCount = await program.account.journal.fetch( 40 | journalKeypair.publicKey 41 | ); 42 | 43 | expect(currentCount.count).toEqual(1); 44 | }); 45 | 46 | it('Increment Journal Again', async () => { 47 | await program.methods 48 | .increment() 49 | .accounts({ journal: journalKeypair.publicKey }) 50 | .rpc(); 51 | 52 | const currentCount = await program.account.journal.fetch( 53 | journalKeypair.publicKey 54 | ); 55 | 56 | expect(currentCount.count).toEqual(2); 57 | }); 58 | 59 | it('Decrement Journal', async () => { 60 | await program.methods 61 | .decrement() 62 | .accounts({ journal: journalKeypair.publicKey }) 63 | .rpc(); 64 | 65 | const currentCount = await program.account.journal.fetch( 66 | journalKeypair.publicKey 67 | ); 68 | 69 | expect(currentCount.count).toEqual(1); 70 | }); 71 | 72 | it('Set journal value', async () => { 73 | await program.methods 74 | .set(42) 75 | .accounts({ journal: journalKeypair.publicKey }) 76 | .rpc(); 77 | 78 | const currentCount = await program.account.journal.fetch( 79 | journalKeypair.publicKey 80 | ); 81 | 82 | expect(currentCount.count).toEqual(42); 83 | }); 84 | 85 | it('Set close the journal account', async () => { 86 | await program.methods 87 | .close() 88 | .accounts({ 89 | payer: payer.publicKey, 90 | journal: journalKeypair.publicKey, 91 | }) 92 | .rpc(); 93 | 94 | // The account should no longer exist, returning null. 95 | const userAccount = await program.account.journal.fetchNullable( 96 | journalKeypair.publicKey 97 | ); 98 | expect(userAccount).toBeNull(); 99 | }); 100 | }); 101 | -------------------------------------------------------------------------------- /anchor/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.base.json", 3 | "compilerOptions": { 4 | "module": "commonjs" 5 | }, 6 | "files": [], 7 | "include": [], 8 | "references": [ 9 | { 10 | "path": "./tsconfig.lib.json" 11 | }, 12 | { 13 | "path": "./tsconfig.spec.json" 14 | } 15 | ] 16 | } 17 | -------------------------------------------------------------------------------- /anchor/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../dist/out-tsc", 5 | "declaration": true, 6 | "types": ["node"], 7 | "resolveJsonModule": true, 8 | "allowSyntheticDefaultImports": true 9 | }, 10 | "include": ["src/**/*.ts"], 11 | "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"] 12 | } 13 | -------------------------------------------------------------------------------- /anchor/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "include": [ 9 | "jest.config.ts", 10 | "src/**/*.test.ts", 11 | "src/**/*.spec.ts", 12 | "src/**/*.d.ts" 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /jest.config.ts: -------------------------------------------------------------------------------- 1 | import { getJestProjects } from '@nx/jest'; 2 | 3 | export default { 4 | projects: getJestProjects(), 5 | }; 6 | -------------------------------------------------------------------------------- /jest.preset.js: -------------------------------------------------------------------------------- 1 | const nxPreset = require('@nx/jest/preset').default; 2 | 3 | module.exports = { ...nxPreset }; 4 | -------------------------------------------------------------------------------- /nx.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "./node_modules/nx/schemas/nx-schema.json", 3 | "targetDefaults": { 4 | "build": { 5 | "cache": true, 6 | "dependsOn": ["^build"], 7 | "inputs": ["production", "^production"] 8 | }, 9 | "lint": { 10 | "cache": true, 11 | "inputs": [ 12 | "default", 13 | "{workspaceRoot}/.eslintrc.json", 14 | "{workspaceRoot}/.eslintignore", 15 | "{workspaceRoot}/eslint.config.js" 16 | ] 17 | }, 18 | "@nx/jest:jest": { 19 | "cache": true, 20 | "inputs": ["default", "^production", "{workspaceRoot}/jest.preset.js"], 21 | "options": { 22 | "passWithNoTests": true 23 | }, 24 | "configurations": { 25 | "ci": { 26 | "ci": true, 27 | "codeCoverage": true 28 | } 29 | } 30 | } 31 | }, 32 | "namedInputs": { 33 | "default": ["{projectRoot}/**/*", "sharedGlobals"], 34 | "production": [ 35 | "default", 36 | "!{projectRoot}/.eslintrc.json", 37 | "!{projectRoot}/eslint.config.js", 38 | "!{projectRoot}/**/?(*.)+(spec|test).[jt]s?(x)?(.snap)", 39 | "!{projectRoot}/tsconfig.spec.json", 40 | "!{projectRoot}/jest.config.[jt]s", 41 | "!{projectRoot}/src/test-setup.[jt]s", 42 | "!{projectRoot}/test-setup.[jt]s" 43 | ], 44 | "sharedGlobals": [] 45 | }, 46 | "generators": { 47 | "@nx/react": { 48 | "application": { 49 | "babel": true 50 | } 51 | }, 52 | "@nx/next": { 53 | "application": { 54 | "style": "css", 55 | "linter": "eslint" 56 | } 57 | } 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "@journal/source", 3 | "version": "0.0.0", 4 | "license": "MIT", 5 | "scripts": { 6 | "anchor": "nx run anchor:anchor", 7 | "anchor-build": "nx run anchor:anchor build", 8 | "anchor-localnet": "nx run anchor:anchor localnet", 9 | "anchor-test": "nx run anchor:anchor test", 10 | "feature": "nx generate @solana-developers/preset-react:feature", 11 | "build": "nx build web", 12 | "dev": "nx serve web" 13 | }, 14 | "private": true, 15 | "dependencies": { 16 | "@coral-xyz/anchor": "^0.30.1", 17 | "@solana-developers/preset-next": "2.2.0", 18 | "@solana/spl-token": "0.4.1", 19 | "@solana/wallet-adapter-base": "^0.9.23", 20 | "@solana/wallet-adapter-react": "^0.15.35", 21 | "@solana/wallet-adapter-react-ui": "^0.9.35", 22 | "@solana/web3.js": "1.90.0", 23 | "@swc/helpers": "~0.5.2", 24 | "@tabler/icons-react": "2.47.0", 25 | "@tailwindcss/typography": "0.5.10", 26 | "@tanstack/react-query": "5.24.1", 27 | "@tanstack/react-query-next-experimental": "5.24.1", 28 | "bs58": "5.0.0", 29 | "buffer": "6.0.3", 30 | "daisyui": "4.7.2", 31 | "encoding": "0.1.13", 32 | "jotai": "2.6.5", 33 | "next": "13.4.4", 34 | "react": "18.2.0", 35 | "react-dom": "18.2.0", 36 | "react-hot-toast": "2.4.1", 37 | "tslib": "^2.3.0" 38 | }, 39 | "devDependencies": { 40 | "@nx/eslint": "17.2.7", 41 | "@nx/eslint-plugin": "17.2.7", 42 | "@nx/jest": "17.2.7", 43 | "@nx/js": "17.2.7", 44 | "@nx/next": "17.2.7", 45 | "@nx/react": "17.2.7", 46 | "@nx/rollup": "17.2.7", 47 | "@nx/workspace": "17.2.7", 48 | "@swc-node/register": "~1.6.7", 49 | "@swc/cli": "~0.1.62", 50 | "@swc/core": "~1.3.85", 51 | "@swc/jest": "0.2.20", 52 | "@testing-library/react": "14.0.0", 53 | "@types/jest": "^29.4.0", 54 | "@types/node": "18.16.9", 55 | "@types/react": "18.2.33", 56 | "@types/react-dom": "18.2.14", 57 | "@typescript-eslint/eslint-plugin": "^6.9.1", 58 | "@typescript-eslint/parser": "^6.9.1", 59 | "autoprefixer": "10.4.13", 60 | "eslint": "~8.48.0", 61 | "eslint-config-next": "13.4.4", 62 | "eslint-config-prettier": "^9.0.0", 63 | "eslint-plugin-import": "2.27.5", 64 | "eslint-plugin-jsx-a11y": "6.7.1", 65 | "eslint-plugin-react": "7.32.2", 66 | "eslint-plugin-react-hooks": "4.6.0", 67 | "jest": "^29.4.1", 68 | "jest-environment-jsdom": "^29.4.1", 69 | "nx": "17.2.7", 70 | "postcss": "8.4.21", 71 | "prettier": "^2.6.2", 72 | "tailwindcss": "3.2.7", 73 | "ts-jest": "^29.1.0", 74 | "ts-node": "10.9.1", 75 | "typescript": "~5.2.2" 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /tsconfig.base.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "rootDir": ".", 5 | "sourceMap": true, 6 | "declaration": false, 7 | "moduleResolution": "node", 8 | "emitDecoratorMetadata": true, 9 | "experimentalDecorators": true, 10 | "importHelpers": true, 11 | "target": "es2015", 12 | "module": "esnext", 13 | "lib": ["es2020", "dom"], 14 | "skipLibCheck": true, 15 | "skipDefaultLibCheck": true, 16 | "baseUrl": ".", 17 | "paths": { 18 | "@/*": ["./web/*"], 19 | "@journal/anchor": ["anchor/src/index.ts"] 20 | } 21 | }, 22 | "exclude": ["node_modules", "tmp"] 23 | } 24 | -------------------------------------------------------------------------------- /vercel.json: -------------------------------------------------------------------------------- 1 | { 2 | "buildCommand": "npm run build", 3 | "outputDirectory": "dist/web/.next" 4 | } 5 | -------------------------------------------------------------------------------- /web/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solana-developers/CRUD-dApp/c6f453d067bacfc47183a8a36a95b3e4fdfcf030/web/.DS_Store -------------------------------------------------------------------------------- /web/.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": [ 3 | "plugin:@nx/react-typescript", 4 | "next", 5 | "next/core-web-vitals", 6 | "../.eslintrc.json" 7 | ], 8 | "ignorePatterns": ["!**/*", ".next/**/*"], 9 | "overrides": [ 10 | { 11 | "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], 12 | "rules": { 13 | "@next/next/no-html-link-for-pages": ["error", "web/pages"] 14 | } 15 | }, 16 | { 17 | "files": ["*.ts", "*.tsx"], 18 | "rules": {} 19 | }, 20 | { 21 | "files": ["*.js", "*.jsx"], 22 | "rules": {} 23 | }, 24 | { 25 | "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], 26 | "rules": { 27 | "@nx/enforce-module-boundaries": [ 28 | "error", 29 | { 30 | "allow": ["@/"] 31 | } 32 | ] 33 | } 34 | } 35 | ] 36 | } 37 | -------------------------------------------------------------------------------- /web/app/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solana-developers/CRUD-dApp/c6f453d067bacfc47183a8a36a95b3e4fdfcf030/web/app/.DS_Store -------------------------------------------------------------------------------- /web/app/account/[address]/page.tsx: -------------------------------------------------------------------------------- 1 | import AccountDetailFeature from '@/components/account/account-detail-feature'; 2 | 3 | export default function Page() { 4 | return ; 5 | } 6 | -------------------------------------------------------------------------------- /web/app/account/page.tsx: -------------------------------------------------------------------------------- 1 | import AccountListFeature from '@/components/account/account-list-feature'; 2 | 3 | export default function Page() { 4 | return ; 5 | } 6 | -------------------------------------------------------------------------------- /web/app/api/hello/route.ts: -------------------------------------------------------------------------------- 1 | export async function GET(request: Request) { 2 | return new Response('Hello, from API!'); 3 | } 4 | -------------------------------------------------------------------------------- /web/app/clusters/page.tsx: -------------------------------------------------------------------------------- 1 | import ClusterFeature from '@/components/cluster/cluster-feature'; 2 | 3 | export default function Page() { 4 | return ; 5 | } 6 | -------------------------------------------------------------------------------- /web/app/global.css: -------------------------------------------------------------------------------- 1 | @tailwind base; 2 | @tailwind components; 3 | @tailwind utilities; 4 | 5 | html, 6 | body { 7 | height: 100%; 8 | } 9 | 10 | .wallet-adapter-button-trigger { 11 | background: rgb(100, 26, 230) !important; 12 | border-radius: 8px !important; 13 | padding-left: 16px !important; 14 | padding-right: 16px !important; 15 | } 16 | .wallet-adapter-dropdown-list, 17 | .wallet-adapter-button { 18 | font-family: inherit !important; 19 | } 20 | -------------------------------------------------------------------------------- /web/app/journal/page.tsx: -------------------------------------------------------------------------------- 1 | import JournalFeature from '@/components/journal/journal-feature'; 2 | 3 | export default function Page() { 4 | return ; 5 | } 6 | -------------------------------------------------------------------------------- /web/app/layout.tsx: -------------------------------------------------------------------------------- 1 | import './global.css'; 2 | import { UiLayout } from '@/components/ui/ui-layout'; 3 | import { ClusterProvider } from '@/components/cluster/cluster-data-access'; 4 | import { SolanaProvider } from '@/components/solana/solana-provider'; 5 | import { ReactQueryProvider } from './react-query-provider'; 6 | 7 | export const metadata = { 8 | title: 'journal', 9 | description: 'Generated by create-solana-dapp', 10 | }; 11 | 12 | const links: { label: string; path: string }[] = [ 13 | { label: 'Account', path: '/account' }, 14 | { label: 'Clusters', path: '/clusters' }, 15 | { label: 'Journal Program', path: '/journal' }, 16 | ]; 17 | 18 | export default function RootLayout({ 19 | children, 20 | }: { 21 | children: React.ReactNode; 22 | }) { 23 | return ( 24 | 25 | 26 | 27 | 28 | 29 | {children} 30 | 31 | 32 | 33 | 34 | 35 | ); 36 | } 37 | -------------------------------------------------------------------------------- /web/app/page.module.css: -------------------------------------------------------------------------------- 1 | .page { 2 | } 3 | -------------------------------------------------------------------------------- /web/app/page.tsx: -------------------------------------------------------------------------------- 1 | import DashboardFeature from '@/components/dashboard/dashboard-feature'; 2 | 3 | export default function Page() { 4 | return ; 5 | } 6 | -------------------------------------------------------------------------------- /web/app/react-query-provider.tsx: -------------------------------------------------------------------------------- 1 | 'use client'; 2 | 3 | import React, { ReactNode, useState } from 'react'; 4 | import { ReactQueryStreamedHydration } from '@tanstack/react-query-next-experimental'; 5 | import { QueryClientProvider, QueryClient } from '@tanstack/react-query'; 6 | 7 | export function ReactQueryProvider({ children }: { children: ReactNode }) { 8 | const [client] = useState(new QueryClient()); 9 | 10 | return ( 11 | 12 | {children} 13 | 14 | ); 15 | } 16 | -------------------------------------------------------------------------------- /web/components/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/solana-developers/CRUD-dApp/c6f453d067bacfc47183a8a36a95b3e4fdfcf030/web/components/.DS_Store -------------------------------------------------------------------------------- /web/components/account/account-data-access.tsx: -------------------------------------------------------------------------------- 1 | 'use client'; 2 | 3 | import { useConnection, useWallet } from '@solana/wallet-adapter-react'; 4 | import { TOKEN_2022_PROGRAM_ID, TOKEN_PROGRAM_ID } from '@solana/spl-token'; 5 | import { 6 | Connection, 7 | LAMPORTS_PER_SOL, 8 | PublicKey, 9 | SystemProgram, 10 | TransactionMessage, 11 | TransactionSignature, 12 | VersionedTransaction, 13 | } from '@solana/web3.js'; 14 | import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; 15 | import toast from 'react-hot-toast'; 16 | import { useTransactionToast } from '../ui/ui-layout'; 17 | 18 | export function useGetBalance({ address }: { address: PublicKey }) { 19 | const { connection } = useConnection(); 20 | 21 | return useQuery({ 22 | queryKey: ['get-balance', { endpoint: connection.rpcEndpoint, address }], 23 | queryFn: () => connection.getBalance(address), 24 | }); 25 | } 26 | 27 | export function useGetSignatures({ address }: { address: PublicKey }) { 28 | const { connection } = useConnection(); 29 | 30 | return useQuery({ 31 | queryKey: ['get-signatures', { endpoint: connection.rpcEndpoint, address }], 32 | queryFn: () => connection.getConfirmedSignaturesForAddress2(address), 33 | }); 34 | } 35 | 36 | export function useGetTokenAccounts({ address }: { address: PublicKey }) { 37 | const { connection } = useConnection(); 38 | 39 | return useQuery({ 40 | queryKey: [ 41 | 'get-token-accounts', 42 | { endpoint: connection.rpcEndpoint, address }, 43 | ], 44 | queryFn: async () => { 45 | const [tokenAccounts, token2022Accounts] = await Promise.all([ 46 | connection.getParsedTokenAccountsByOwner(address, { 47 | programId: TOKEN_PROGRAM_ID, 48 | }), 49 | connection.getParsedTokenAccountsByOwner(address, { 50 | programId: TOKEN_2022_PROGRAM_ID, 51 | }), 52 | ]); 53 | return [...tokenAccounts.value, ...token2022Accounts.value]; 54 | }, 55 | }); 56 | } 57 | 58 | export function useTransferSol({ address }: { address: PublicKey }) { 59 | const { connection } = useConnection(); 60 | const transactionToast = useTransactionToast(); 61 | const wallet = useWallet(); 62 | const client = useQueryClient(); 63 | 64 | return useMutation({ 65 | mutationKey: [ 66 | 'transfer-sol', 67 | { endpoint: connection.rpcEndpoint, address }, 68 | ], 69 | mutationFn: async (input: { destination: PublicKey; amount: number }) => { 70 | let signature: TransactionSignature = ''; 71 | try { 72 | const { transaction, latestBlockhash } = await createTransaction({ 73 | publicKey: address, 74 | destination: input.destination, 75 | amount: input.amount, 76 | connection, 77 | }); 78 | 79 | // Send transaction and await for signature 80 | signature = await wallet.sendTransaction(transaction, connection); 81 | 82 | // Send transaction and await for signature 83 | await connection.confirmTransaction( 84 | { signature, ...latestBlockhash }, 85 | 'confirmed' 86 | ); 87 | 88 | console.log(signature); 89 | return signature; 90 | } catch (error: unknown) { 91 | console.log('error', `Transaction failed! ${error}`, signature); 92 | 93 | return; 94 | } 95 | }, 96 | onSuccess: (signature) => { 97 | if (signature) { 98 | transactionToast(signature); 99 | } 100 | return Promise.all([ 101 | client.invalidateQueries({ 102 | queryKey: [ 103 | 'get-balance', 104 | { endpoint: connection.rpcEndpoint, address }, 105 | ], 106 | }), 107 | client.invalidateQueries({ 108 | queryKey: [ 109 | 'get-signatures', 110 | { endpoint: connection.rpcEndpoint, address }, 111 | ], 112 | }), 113 | ]); 114 | }, 115 | onError: (error) => { 116 | toast.error(`Transaction failed! ${error}`); 117 | }, 118 | }); 119 | } 120 | 121 | export function useRequestAirdrop({ address }: { address: PublicKey }) { 122 | const { connection } = useConnection(); 123 | const transactionToast = useTransactionToast(); 124 | const client = useQueryClient(); 125 | 126 | return useMutation({ 127 | mutationKey: ['airdrop', { endpoint: connection.rpcEndpoint, address }], 128 | mutationFn: async (amount: number = 1) => { 129 | const [latestBlockhash, signature] = await Promise.all([ 130 | connection.getLatestBlockhash(), 131 | connection.requestAirdrop(address, amount * LAMPORTS_PER_SOL), 132 | ]); 133 | 134 | await connection.confirmTransaction( 135 | { signature, ...latestBlockhash }, 136 | 'confirmed' 137 | ); 138 | return signature; 139 | }, 140 | onSuccess: (signature) => { 141 | transactionToast(signature); 142 | return Promise.all([ 143 | client.invalidateQueries({ 144 | queryKey: [ 145 | 'get-balance', 146 | { endpoint: connection.rpcEndpoint, address }, 147 | ], 148 | }), 149 | client.invalidateQueries({ 150 | queryKey: [ 151 | 'get-signatures', 152 | { endpoint: connection.rpcEndpoint, address }, 153 | ], 154 | }), 155 | ]); 156 | }, 157 | }); 158 | } 159 | 160 | async function createTransaction({ 161 | publicKey, 162 | destination, 163 | amount, 164 | connection, 165 | }: { 166 | publicKey: PublicKey; 167 | destination: PublicKey; 168 | amount: number; 169 | connection: Connection; 170 | }): Promise<{ 171 | transaction: VersionedTransaction; 172 | latestBlockhash: { blockhash: string; lastValidBlockHeight: number }; 173 | }> { 174 | // Get the latest blockhash to use in our transaction 175 | const latestBlockhash = await connection.getLatestBlockhash(); 176 | 177 | // Create instructions to send, in this case a simple transfer 178 | const instructions = [ 179 | SystemProgram.transfer({ 180 | fromPubkey: publicKey, 181 | toPubkey: destination, 182 | lamports: amount * LAMPORTS_PER_SOL, 183 | }), 184 | ]; 185 | 186 | // Create a new TransactionMessage with version and compile it to legacy 187 | const messageLegacy = new TransactionMessage({ 188 | payerKey: publicKey, 189 | recentBlockhash: latestBlockhash.blockhash, 190 | instructions, 191 | }).compileToLegacyMessage(); 192 | 193 | // Create a new VersionedTransaction which supports legacy and v0 194 | const transaction = new VersionedTransaction(messageLegacy); 195 | 196 | return { 197 | transaction, 198 | latestBlockhash, 199 | }; 200 | } 201 | -------------------------------------------------------------------------------- /web/components/account/account-detail-feature.tsx: -------------------------------------------------------------------------------- 1 | 'use client'; 2 | 3 | import { PublicKey } from '@solana/web3.js'; 4 | import { useMemo } from 'react'; 5 | 6 | import { useParams } from 'next/navigation'; 7 | 8 | import { ExplorerLink } from '../cluster/cluster-ui'; 9 | import { AppHero, ellipsify } from '../ui/ui-layout'; 10 | import { 11 | AccountBalance, 12 | AccountButtons, 13 | AccountTokens, 14 | AccountTransactions, 15 | } from './account-ui'; 16 | 17 | export default function AccountDetailFeature() { 18 | const params = useParams(); 19 | const address = useMemo(() => { 20 | if (!params.address) { 21 | return; 22 | } 23 | try { 24 | return new PublicKey(params.address); 25 | } catch (e) { 26 | console.log(`Invalid public key`, e); 27 | } 28 | }, [params]); 29 | if (!address) { 30 | return
Error loading account
; 31 | } 32 | 33 | return ( 34 |
35 | } 37 | subtitle={ 38 |
39 | 43 |
44 | } 45 | > 46 |
47 | 48 |
49 |
50 |
51 | 52 | 53 |
54 |
55 | ); 56 | } 57 | -------------------------------------------------------------------------------- /web/components/account/account-list-feature.tsx: -------------------------------------------------------------------------------- 1 | 'use client'; 2 | 3 | import { useWallet } from '@solana/wallet-adapter-react'; 4 | import { WalletButton } from '../solana/solana-provider'; 5 | 6 | import { redirect } from 'next/navigation'; 7 | 8 | export default function AccountListFeature() { 9 | const { publicKey } = useWallet(); 10 | 11 | if (publicKey) { 12 | return redirect(`/account/${publicKey.toString()}`); 13 | } 14 | 15 | return ( 16 |
17 |
18 | 19 |
20 |
21 | ); 22 | } 23 | -------------------------------------------------------------------------------- /web/components/account/account-ui.tsx: -------------------------------------------------------------------------------- 1 | 'use client'; 2 | 3 | import { useWallet } from '@solana/wallet-adapter-react'; 4 | import { LAMPORTS_PER_SOL, PublicKey } from '@solana/web3.js'; 5 | import { IconRefresh } from '@tabler/icons-react'; 6 | import { useQueryClient } from '@tanstack/react-query'; 7 | import { useMemo, useState } from 'react'; 8 | import { AppModal, ellipsify } from '../ui/ui-layout'; 9 | import { useCluster } from '../cluster/cluster-data-access'; 10 | import { ExplorerLink } from '../cluster/cluster-ui'; 11 | import { 12 | useGetBalance, 13 | useGetSignatures, 14 | useGetTokenAccounts, 15 | useRequestAirdrop, 16 | useTransferSol, 17 | } from './account-data-access'; 18 | 19 | export function AccountBalance({ address }: { address: PublicKey }) { 20 | const query = useGetBalance({ address }); 21 | 22 | return ( 23 |
24 |

query.refetch()} 27 | > 28 | {query.data ? : '...'} SOL 29 |

30 |
31 | ); 32 | } 33 | export function AccountChecker() { 34 | const { publicKey } = useWallet(); 35 | if (!publicKey) { 36 | return null; 37 | } 38 | return ; 39 | } 40 | export function AccountBalanceCheck({ address }: { address: PublicKey }) { 41 | const { cluster } = useCluster(); 42 | const mutation = useRequestAirdrop({ address }); 43 | const query = useGetBalance({ address }); 44 | 45 | if (query.isLoading) { 46 | return null; 47 | } 48 | if (query.isError || !query.data) { 49 | return ( 50 |
51 | 52 | You are connected to {cluster.name} but your account 53 | is not found on this cluster. 54 | 55 | 63 |
64 | ); 65 | } 66 | return null; 67 | } 68 | 69 | export function AccountButtons({ address }: { address: PublicKey }) { 70 | const wallet = useWallet(); 71 | const { cluster } = useCluster(); 72 | const [showAirdropModal, setShowAirdropModal] = useState(false); 73 | const [showReceiveModal, setShowReceiveModal] = useState(false); 74 | const [showSendModal, setShowSendModal] = useState(false); 75 | 76 | return ( 77 |
78 | setShowAirdropModal(false)} 80 | address={address} 81 | show={showAirdropModal} 82 | /> 83 | setShowReceiveModal(false)} 87 | /> 88 | setShowSendModal(false)} 92 | /> 93 |
94 | 101 | 108 | 114 |
115 |
116 | ); 117 | } 118 | 119 | export function AccountTokens({ address }: { address: PublicKey }) { 120 | const [showAll, setShowAll] = useState(false); 121 | const query = useGetTokenAccounts({ address }); 122 | const client = useQueryClient(); 123 | const items = useMemo(() => { 124 | if (showAll) return query.data; 125 | return query.data?.slice(0, 5); 126 | }, [query.data, showAll]); 127 | 128 | return ( 129 |
130 |
131 |
132 |

Token Accounts

133 |
134 | {query.isLoading ? ( 135 | 136 | ) : ( 137 | 148 | )} 149 |
150 |
151 |
152 | {query.isError && ( 153 |
154 |           Error: {query.error?.message.toString()}
155 |         
156 | )} 157 | {query.isSuccess && ( 158 |
159 | {query.data.length === 0 ? ( 160 |
No token accounts found.
161 | ) : ( 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | {items?.map(({ account, pubkey }) => ( 172 | 173 | 183 | 193 | 198 | 199 | ))} 200 | 201 | {(query.data?.length ?? 0) > 5 && ( 202 | 203 | 211 | 212 | )} 213 | 214 |
Public KeyMintBalance
174 |
175 | 176 | 180 | 181 |
182 |
184 |
185 | 186 | 190 | 191 |
192 |
194 | 195 | {account.data.parsed.info.tokenAmount.uiAmount} 196 | 197 |
204 | 210 |
215 | )} 216 |
217 | )} 218 |
219 | ); 220 | } 221 | 222 | export function AccountTransactions({ address }: { address: PublicKey }) { 223 | const query = useGetSignatures({ address }); 224 | const [showAll, setShowAll] = useState(false); 225 | 226 | const items = useMemo(() => { 227 | if (showAll) return query.data; 228 | return query.data?.slice(0, 5); 229 | }, [query.data, showAll]); 230 | 231 | return ( 232 |
233 |
234 |

Transaction History

235 |
236 | {query.isLoading ? ( 237 | 238 | ) : ( 239 | 245 | )} 246 |
247 |
248 | {query.isError && ( 249 |
250 |           Error: {query.error?.message.toString()}
251 |         
252 | )} 253 | {query.isSuccess && ( 254 |
255 | {query.data.length === 0 ? ( 256 |
No transactions found.
257 | ) : ( 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 266 | 267 | 268 | {items?.map((item) => ( 269 | 270 | 276 | 282 | 285 | 297 | 298 | ))} 299 | {(query.data?.length ?? 0) > 5 && ( 300 | 301 | 309 | 310 | )} 311 | 312 |
SignatureSlotBlock TimeStatus
271 | 275 | 277 | 281 | 283 | {new Date((item.blockTime ?? 0) * 1000).toISOString()} 284 | 286 | {item.err ? ( 287 |
291 | Failed 292 |
293 | ) : ( 294 |
Success
295 | )} 296 |
302 | 308 |
313 | )} 314 |
315 | )} 316 |
317 | ); 318 | } 319 | 320 | function BalanceSol({ balance }: { balance: number }) { 321 | return ( 322 | {Math.round((balance / LAMPORTS_PER_SOL) * 100000) / 100000} 323 | ); 324 | } 325 | 326 | function ModalReceive({ 327 | hide, 328 | show, 329 | address, 330 | }: { 331 | hide: () => void; 332 | show: boolean; 333 | address: PublicKey; 334 | }) { 335 | return ( 336 | 337 |

Receive assets by sending them to your public key:

338 | {address.toString()} 339 |
340 | ); 341 | } 342 | 343 | function ModalAirdrop({ 344 | hide, 345 | show, 346 | address, 347 | }: { 348 | hide: () => void; 349 | show: boolean; 350 | address: PublicKey; 351 | }) { 352 | const mutation = useRequestAirdrop({ address }); 353 | const [amount, setAmount] = useState('2'); 354 | 355 | return ( 356 | mutation.mutateAsync(parseFloat(amount)).then(() => hide())} 363 | > 364 | setAmount(e.target.value)} 373 | /> 374 | 375 | ); 376 | } 377 | 378 | function ModalSend({ 379 | hide, 380 | show, 381 | address, 382 | }: { 383 | hide: () => void; 384 | show: boolean; 385 | address: PublicKey; 386 | }) { 387 | const wallet = useWallet(); 388 | const mutation = useTransferSol({ address }); 389 | const [destination, setDestination] = useState(''); 390 | const [amount, setAmount] = useState('1'); 391 | 392 | if (!address || !wallet.sendTransaction) { 393 | return
Wallet not connected
; 394 | } 395 | 396 | return ( 397 | { 404 | mutation 405 | .mutateAsync({ 406 | destination: new PublicKey(destination), 407 | amount: parseFloat(amount), 408 | }) 409 | .then(() => hide()); 410 | }} 411 | > 412 | setDestination(e.target.value)} 419 | /> 420 | setAmount(e.target.value)} 429 | /> 430 | 431 | ); 432 | } 433 | -------------------------------------------------------------------------------- /web/components/cluster/cluster-data-access.tsx: -------------------------------------------------------------------------------- 1 | 'use client'; 2 | 3 | import { clusterApiUrl, Connection } from '@solana/web3.js'; 4 | import { atom, useAtomValue, useSetAtom } from 'jotai'; 5 | import { atomWithStorage } from 'jotai/utils'; 6 | import { createContext, ReactNode, useContext } from 'react'; 7 | import toast from 'react-hot-toast'; 8 | 9 | export interface Cluster { 10 | name: string; 11 | endpoint: string; 12 | network?: ClusterNetwork; 13 | active?: boolean; 14 | } 15 | 16 | export enum ClusterNetwork { 17 | Mainnet = 'mainnet-beta', 18 | Testnet = 'testnet', 19 | Devnet = 'devnet', 20 | Custom = 'custom', 21 | } 22 | 23 | // By default, we don't configure the mainnet-beta cluster 24 | // The endpoint provided by clusterApiUrl('mainnet-beta') does not allow access from the browser due to CORS restrictions 25 | // To use the mainnet-beta cluster, provide a custom endpoint 26 | export const defaultClusters: Cluster[] = [ 27 | { 28 | name: 'devnet', 29 | endpoint: clusterApiUrl('devnet'), 30 | network: ClusterNetwork.Devnet, 31 | }, 32 | { name: 'local', endpoint: 'http://localhost:8899' }, 33 | { 34 | name: 'testnet', 35 | endpoint: clusterApiUrl('testnet'), 36 | network: ClusterNetwork.Testnet, 37 | }, 38 | ]; 39 | 40 | const clusterAtom = atomWithStorage( 41 | 'solana-cluster', 42 | defaultClusters[0] 43 | ); 44 | const clustersAtom = atomWithStorage( 45 | 'solana-clusters', 46 | defaultClusters 47 | ); 48 | 49 | const activeClustersAtom = atom((get) => { 50 | const clusters = get(clustersAtom); 51 | const cluster = get(clusterAtom); 52 | return clusters.map((item) => ({ 53 | ...item, 54 | active: item.name === cluster.name, 55 | })); 56 | }); 57 | 58 | const activeClusterAtom = atom((get) => { 59 | const clusters = get(activeClustersAtom); 60 | 61 | return clusters.find((item) => item.active) || clusters[0]; 62 | }); 63 | 64 | export interface ClusterProviderContext { 65 | cluster: Cluster; 66 | clusters: Cluster[]; 67 | addCluster: (cluster: Cluster) => void; 68 | deleteCluster: (cluster: Cluster) => void; 69 | setCluster: (cluster: Cluster) => void; 70 | getExplorerUrl(path: string): string; 71 | } 72 | 73 | const Context = createContext( 74 | {} as ClusterProviderContext 75 | ); 76 | 77 | export function ClusterProvider({ children }: { children: ReactNode }) { 78 | const cluster = useAtomValue(activeClusterAtom); 79 | const clusters = useAtomValue(activeClustersAtom); 80 | const setCluster = useSetAtom(clusterAtom); 81 | const setClusters = useSetAtom(clustersAtom); 82 | 83 | const value: ClusterProviderContext = { 84 | cluster, 85 | clusters: clusters.sort((a, b) => (a.name > b.name ? 1 : -1)), 86 | addCluster: (cluster: Cluster) => { 87 | try { 88 | new Connection(cluster.endpoint); 89 | setClusters([...clusters, cluster]); 90 | } catch (err) { 91 | toast.error(`${err}`); 92 | } 93 | }, 94 | deleteCluster: (cluster: Cluster) => { 95 | setClusters(clusters.filter((item) => item.name !== cluster.name)); 96 | }, 97 | setCluster: (cluster: Cluster) => setCluster(cluster), 98 | getExplorerUrl: (path: string) => 99 | `https://explorer.solana.com/${path}${getClusterUrlParam(cluster)}`, 100 | }; 101 | return {children}; 102 | } 103 | 104 | export function useCluster() { 105 | return useContext(Context); 106 | } 107 | 108 | function getClusterUrlParam(cluster: Cluster): string { 109 | let suffix = ''; 110 | switch (cluster.network) { 111 | case ClusterNetwork.Devnet: 112 | suffix = 'devnet'; 113 | break; 114 | case ClusterNetwork.Mainnet: 115 | suffix = ''; 116 | break; 117 | case ClusterNetwork.Testnet: 118 | suffix = 'testnet'; 119 | break; 120 | default: 121 | suffix = `custom&customUrl=${encodeURIComponent(cluster.endpoint)}`; 122 | break; 123 | } 124 | 125 | return suffix.length ? `?cluster=${suffix}` : ''; 126 | } 127 | -------------------------------------------------------------------------------- /web/components/cluster/cluster-feature.tsx: -------------------------------------------------------------------------------- 1 | 'use client'; 2 | 3 | import { useState } from 'react'; 4 | import { AppHero } from '../ui/ui-layout'; 5 | import { ClusterUiModal } from './cluster-ui'; 6 | import { ClusterUiTable } from './cluster-ui'; 7 | 8 | export default function ClusterFeature() { 9 | const [showModal, setShowModal] = useState(false); 10 | 11 | return ( 12 |
13 | 17 | setShowModal(false)} 20 | /> 21 | 27 | 28 | 29 |
30 | ); 31 | } 32 | -------------------------------------------------------------------------------- /web/components/cluster/cluster-ui.tsx: -------------------------------------------------------------------------------- 1 | 'use client'; 2 | 3 | import { useConnection } from '@solana/wallet-adapter-react'; 4 | import { IconTrash } from '@tabler/icons-react'; 5 | import { useQuery } from '@tanstack/react-query'; 6 | import { ReactNode, useState } from 'react'; 7 | import { AppModal } from '../ui/ui-layout'; 8 | import { ClusterNetwork, useCluster } from './cluster-data-access'; 9 | import { Connection } from '@solana/web3.js'; 10 | 11 | export function ExplorerLink({ 12 | path, 13 | label, 14 | className, 15 | }: { 16 | path: string; 17 | label: string; 18 | className?: string; 19 | }) { 20 | const { getExplorerUrl } = useCluster(); 21 | return ( 22 | 28 | {label} 29 | 30 | ); 31 | } 32 | 33 | export function ClusterChecker({ children }: { children: ReactNode }) { 34 | const { cluster } = useCluster(); 35 | const { connection } = useConnection(); 36 | 37 | const query = useQuery({ 38 | queryKey: ['version', { cluster, endpoint: connection.rpcEndpoint }], 39 | queryFn: () => connection.getVersion(), 40 | retry: 1, 41 | }); 42 | if (query.isLoading) { 43 | return null; 44 | } 45 | if (query.isError || !query.data) { 46 | return ( 47 |
48 | 49 | Error connecting to cluster {cluster.name} 50 | 51 | 57 |
58 | ); 59 | } 60 | return children; 61 | } 62 | 63 | export function ClusterUiSelect() { 64 | const { clusters, setCluster, cluster } = useCluster(); 65 | return ( 66 |
67 | 70 |
    74 | {clusters.map((item) => ( 75 |
  • 76 | 84 |
  • 85 | ))} 86 |
87 |
88 | ); 89 | } 90 | 91 | export function ClusterUiModal({ 92 | hideModal, 93 | show, 94 | }: { 95 | hideModal: () => void; 96 | show: boolean; 97 | }) { 98 | const { addCluster } = useCluster(); 99 | const [name, setName] = useState(''); 100 | const [network, setNetwork] = useState(); 101 | const [endpoint, setEndpoint] = useState(''); 102 | 103 | return ( 104 | { 109 | try { 110 | new Connection(endpoint); 111 | if (name) { 112 | addCluster({ name, network, endpoint }); 113 | hideModal(); 114 | } else { 115 | console.log('Invalid cluster name'); 116 | } 117 | } catch { 118 | console.log('Invalid cluster endpoint'); 119 | } 120 | }} 121 | submitLabel="Save" 122 | > 123 | setName(e.target.value)} 129 | /> 130 | setEndpoint(e.target.value)} 136 | /> 137 | 147 | 148 | ); 149 | } 150 | 151 | export function ClusterUiTable() { 152 | const { clusters, setCluster, deleteCluster } = useCluster(); 153 | return ( 154 |
155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | {clusters.map((item) => ( 164 | 165 | 188 | 200 | 201 | ))} 202 | 203 |
Name/ Network / EndpointActions
166 |
167 | 168 | {item?.active ? ( 169 | item.name 170 | ) : ( 171 | 178 | )} 179 | 180 |
181 | 182 | Network: {item.network ?? 'custom'} 183 | 184 |
185 | {item.endpoint} 186 |
187 |
189 | 199 |
204 |
205 | ); 206 | } 207 | -------------------------------------------------------------------------------- /web/components/dashboard/dashboard-feature.tsx: -------------------------------------------------------------------------------- 1 | 'use client'; 2 | 3 | import { AppHero } from '../ui/ui-layout'; 4 | 5 | const links: { label: string; href: string }[] = [ 6 | { label: 'Solana Docs', href: 'https://docs.solana.com/' }, 7 | { label: 'Solana Faucet', href: 'https://faucet.solana.com/' }, 8 | { label: 'Solana Cookbook', href: 'https://solanacookbook.com/' }, 9 | { label: 'Solana Stack Overflow', href: 'https://solana.stackexchange.com/' }, 10 | { 11 | label: 'Solana Developers GitHub', 12 | href: 'https://github.com/solana-developers/', 13 | }, 14 | ]; 15 | 16 | export default function DashboardFeature() { 17 | return ( 18 |
19 | 20 |
21 |
22 |

Here are some helpful links to get you started.

23 | {links.map((link, index) => ( 24 | 34 | ))} 35 |
36 |
37 |
38 | ); 39 | } 40 | -------------------------------------------------------------------------------- /web/components/journal/journal-data-access.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import { getJournalProgram, getJournalProgramId } from "@journal/anchor"; 4 | import { useConnection } from "@solana/wallet-adapter-react"; 5 | import { Cluster, PublicKey } from "@solana/web3.js"; 6 | import { useMutation, useQuery } from "@tanstack/react-query"; 7 | import toast from "react-hot-toast"; 8 | import { useCluster } from "../cluster/cluster-data-access"; 9 | import { useAnchorProvider } from "../solana/solana-provider"; 10 | import { useTransactionToast } from "../ui/ui-layout"; 11 | import { useMemo } from "react"; 12 | 13 | interface CreateEntryArgs { 14 | title: string; 15 | message: string; 16 | owner: PublicKey; 17 | } 18 | 19 | export function useJournalProgram() { 20 | const { connection } = useConnection(); 21 | const { cluster } = useCluster(); 22 | const transactionToast = useTransactionToast(); 23 | const provider = useAnchorProvider(); 24 | const programId = useMemo( 25 | () => getJournalProgramId(cluster.network as Cluster), 26 | [cluster] 27 | ); 28 | const program = getJournalProgram(provider); 29 | 30 | const accounts = useQuery({ 31 | queryKey: ["journal", "all", { cluster }], 32 | queryFn: () => program.account.journalEntryState.all(), 33 | }); 34 | 35 | const getProgramAccount = useQuery({ 36 | queryKey: ["get-program-account", { cluster }], 37 | queryFn: () => connection.getParsedAccountInfo(programId), 38 | }); 39 | 40 | const createEntry = useMutation({ 41 | mutationKey: ["journalEntry", "create", { cluster }], 42 | mutationFn: async ({ title, message }) => { 43 | return program.methods.createJournalEntry(title, message).rpc(); 44 | }, 45 | onSuccess: (signature) => { 46 | transactionToast(signature); 47 | accounts.refetch(); 48 | }, 49 | onError: (error) => { 50 | toast.error(`Failed to create journal entry: ${error.message}`); 51 | }, 52 | }); 53 | 54 | return { 55 | program, 56 | programId, 57 | accounts, 58 | getProgramAccount, 59 | createEntry, 60 | }; 61 | } 62 | 63 | export function useJournalProgramAccount({ account }: { account: PublicKey }) { 64 | const { cluster } = useCluster(); 65 | const transactionToast = useTransactionToast(); 66 | const { program, accounts } = useJournalProgram(); 67 | 68 | const accountQuery = useQuery({ 69 | queryKey: ["journal", "fetch", { cluster, account }], 70 | queryFn: () => program.account.journalEntryState.fetch(account), 71 | }); 72 | 73 | const updateEntry = useMutation({ 74 | mutationKey: ["journalEntry", "update", { cluster }], 75 | mutationFn: async ({ title, message, owner }) => { 76 | return program.methods.updateJournalEntry(title, message).rpc(); 77 | }, 78 | onSuccess: (signature) => { 79 | transactionToast(signature); 80 | accounts.refetch(); 81 | }, 82 | onError: (error) => { 83 | toast.error(`Failed to update journal entry: ${error.message}`); 84 | }, 85 | }); 86 | 87 | const deleteEntry = useMutation({ 88 | mutationKey: ["journal", "deleteEntry", { cluster, account }], 89 | mutationFn: (title: string) => 90 | program.methods.deleteJournalEntry(title).rpc(), 91 | onSuccess: (tx) => { 92 | transactionToast(tx); 93 | return accounts.refetch(); 94 | }, 95 | }); 96 | 97 | return { 98 | accountQuery, 99 | updateEntry, 100 | deleteEntry, 101 | }; 102 | } 103 | -------------------------------------------------------------------------------- /web/components/journal/journal-feature.tsx: -------------------------------------------------------------------------------- 1 | 'use client'; 2 | 3 | import { useWallet } from '@solana/wallet-adapter-react'; 4 | import { WalletButton } from '../solana/solana-provider'; 5 | import { AppHero, ellipsify } from '../ui/ui-layout'; 6 | import { ExplorerLink } from '../cluster/cluster-ui'; 7 | import { useJournalProgram } from './journal-data-access'; 8 | import { JournalCreate, JournalList } from './journal-ui'; 9 | 10 | export default function JournalFeature() { 11 | const { publicKey } = useWallet(); 12 | const { programId } = useJournalProgram(); 13 | 14 | return publicKey ? ( 15 |
16 | 22 |

23 | 27 |

28 | 29 |
30 | 31 |
32 | ) : ( 33 |
34 |
35 |
36 | 37 |
38 |
39 |
40 | ); 41 | } 42 | -------------------------------------------------------------------------------- /web/components/journal/journal-ui.tsx: -------------------------------------------------------------------------------- 1 | "use client"; 2 | 3 | import { PublicKey } from "@solana/web3.js"; 4 | import { ellipsify } from "../ui/ui-layout"; 5 | import { ExplorerLink } from "../cluster/cluster-ui"; 6 | import { 7 | useJournalProgram, 8 | useJournalProgramAccount, 9 | } from "./journal-data-access"; 10 | import { useWallet } from "@solana/wallet-adapter-react"; 11 | import { useState } from "react"; 12 | 13 | export function JournalCreate() { 14 | const { createEntry } = useJournalProgram(); 15 | const { publicKey } = useWallet(); 16 | const [title, setTitle] = useState(""); 17 | const [message, setMessage] = useState(""); 18 | 19 | const isFormValid = title.trim() !== "" && message.trim() !== ""; 20 | 21 | const handleSubmit = () => { 22 | if (publicKey && isFormValid) { 23 | createEntry.mutateAsync({ title, message, owner: publicKey }); 24 | } 25 | }; 26 | 27 | if (!publicKey) { 28 | return

Connect your wallet

; 29 | } 30 | 31 | return ( 32 |
33 | setTitle(e.target.value)} 38 | className="input input-bordered w-full max-w-xs" 39 | /> 40 |