Skip to content

Commit b764c22

Browse files
authored
New directory layout (#3)
* Initial commit * removed submodule * added contracts directory * update gitignore * readme updated * requested changes
1 parent fdd322d commit b764c22

File tree

100 files changed

+1338
-59636
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+1338
-59636
lines changed

.env

Lines changed: 0 additions & 1 deletion
This file was deleted.

.env.production

Lines changed: 0 additions & 1 deletion
This file was deleted.

.gitignore

Lines changed: 45 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,52 @@
1-
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
.idea
8+
build
29

3-
# dependencies
4-
/node_modules
5-
/.pnp
6-
.pnp.js
10+
# node-waf configuration
11+
.lock-wscript
712

8-
# testing
9-
/coverage
13+
# Compiled binary addons (https://nodejs.org/api/addons.html)
14+
build/Release
1015

11-
# production
12-
/build
16+
# Dependency directories
17+
node_modules/
18+
**/node_modules/
19+
jspm_packages/
1320

14-
# misc
15-
.DS_Store
16-
.env.local
17-
.env.development.local
18-
.env.test.local
19-
.env.production.local
21+
# TypeScript v1 declaration files
22+
typings/
2023

21-
npm-debug.log*
22-
yarn-debug.log*
23-
yarn-error.log*
24+
# Optional npm cache directory
25+
.npm
2426

25-
.idea
27+
# Optional eslint cache
28+
.eslintcache
29+
30+
# Optional REPL history
31+
.node_repl_history
32+
33+
# Output of 'npm pack'
34+
*.tgz
35+
36+
# Yarn Integrity file
37+
.yarn-integrity
38+
39+
# dotenv environment variables file
40+
.env
41+
42+
# parcel-bundler cache (https://parceljs.org/)
43+
.cache
44+
45+
# next.js build output
46+
.next
47+
48+
# nuxt.js build output
49+
.nuxt
2650

27-
/test-ledger
51+
# vuepress build output
52+
.vuepress/dist

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,4 +198,4 @@
198198
distributed under the License is distributed on an "AS IS" BASIS,
199199
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200200
See the License for the specific language governing permissions and
201-
limitations under the License.
201+
limitations under the License.

README.md

Lines changed: 2 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,3 @@
1-
# 🏗 Solana App Scaffold
2-
Scaffolding for a dapp built on Solana
1+
# Pyth Examples
32

4-
# Quickstart
5-
6-
```bash
7-
git clone https://github.com/pyth-network/pyth-examples.git
8-
9-
cd pyth-examples
10-
```
11-
12-
```bash
13-
14-
yarn
15-
16-
```
17-
18-
```bash
19-
20-
yarn start
21-
22-
```
23-
24-
# Environment Setup
25-
1. Install Rust from https://rustup.rs/
26-
2. Install Solana v1.6.7 or later from https://docs.solana.com/cli/install-solana-cli-tools#use-solanas-install-tool
27-
3. Install Node
28-
4. Install NPM, Yarn
29-
30-
# Build Smart Contract (compiled for BPF)
31-
Run the following from the program/ subdirectory:
32-
33-
```bash
34-
$ cargo build-bpf
35-
$ cargo test-bpf
36-
```
37-
# Directory structure
38-
39-
## program
40-
41-
Solana program template in Rust
42-
43-
### program/src/lib.rs
44-
* process_instruction function is used to run all calls issued to the smart contract
45-
46-
## src/actions
47-
48-
Setup here actions that will interact with Solana programs using sendTransaction function
49-
50-
## src/contexts
51-
52-
React context objects that are used propagate state of accounts across the application
53-
54-
## src/hooks
55-
56-
Pyth hook
57-
* usePyth - hook for fetching products and prices
58-
59-
Generic react hooks to interact with token program:
60-
* useUserBalance - query for balance of any user token by mint, returns:
61-
- balance
62-
- balanceLamports
63-
- balanceInUSD
64-
* useUserTotalBalance - aggregates user balance across all token accounts and returns value in USD
65-
- balanceInUSD
66-
* useAccountByMint
67-
* useTokenName
68-
* useUserAccounts
69-
70-
## src/views
71-
72-
* home - main page for your app
73-
* faucet - airdrops SOL on Testnet and Devnet
3+
This repository contains examples of applications integrating Pyth products and services.

craco.config.js

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)