Skip to content

Commit b6a838b

Browse files
authored
DEVREL-468 feat: add oapp-solana (LayerZero-Labs#1482)
1 parent ba04fc9 commit b6a838b

97 files changed

Lines changed: 9731 additions & 14 deletions

File tree

Some content is hidden

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

.changeset/orange-wasps-sip.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"create-lz-oapp": minor
3+
---
4+
5+
add Solana OApp example

examples/oapp-solana/.env.example

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.-
2+
# / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \
3+
# `-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-'
4+
#
5+
# Example environment configuration
6+
#
7+
# .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.-
8+
# / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \
9+
# `-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-'
10+
11+
# By default, the examples support both mnemonic-based and private key-based authentication
12+
#
13+
# You don't need to set both of these values, just pick the one that you prefer and set that one
14+
MNEMONIC=
15+
PRIVATE_KEY=
16+
# You also don't need to set both of the following values. Also, by default, if no value is set, the default keypair path of ./config/solana/id.json will be used
17+
SOLANA_PRIVATE_KEY=
18+
SOLANA_KEYPAIR_PATH=
19+
RPC_URL_SOLANA=
20+
RPC_URL_SOLANA_TESTNET=

examples/oapp-solana/.eslintignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
lib/client/generated/
2+
artifacts
3+
cache
4+
dist
5+
node_modules
6+
out
7+
*.log
8+
*.sol
9+
*.yaml
10+
*.lock
11+
package-lock.json

examples/oapp-solana/.eslintrc.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
require('@rushstack/eslint-patch/modern-module-resolution');
2+
3+
module.exports = {
4+
root: true,
5+
extends: ['@layerzerolabs/eslint-config-next/recommended'],
6+
rules: {
7+
// @layerzerolabs/eslint-config-next defines rules for turborepo-based projects
8+
// that are not relevant for this particular project
9+
'turbo/no-undeclared-env-vars': 'off',
10+
'import/no-unresolved': 'warn', // Updated to warn to avoid erratic popping up of this particular error even when the package has been installed correctly
11+
},
12+
};

examples/oapp-solana/.gitignore

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
node_modules
2+
.env
3+
coverage
4+
coverage.json
5+
typechain
6+
typechain-types
7+
8+
# Solana
9+
target
10+
target/debug
11+
target/sbf-solana-solana
12+
buffer.json
13+
.anchor
14+
15+
# Hardhat files
16+
cache
17+
artifacts
18+
19+
# LayerZero specific files
20+
.layerzero
21+
22+
# foundry test compilation files
23+
out
24+
25+
# pnpm
26+
pnpm-error.log
27+
28+
# Editor and OS files
29+
.DS_Store
30+
.idea

examples/oapp-solana/.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v18.18.0
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
lib/client/generated/
2+
artifacts/
3+
cache/
4+
dist/
5+
node_modules/
6+
out/
7+
*.log
8+
*ignore
9+
*.yaml
10+
*.lock
11+
package-lock.json
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
...require('@layerzerolabs/prettier-config-next'),
3+
};

examples/oapp-solana/Anchor.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
[toolchain]
2+
3+
[features]
4+
seeds = false
5+
skip-lint = false
6+
7+
[programs.localnet]
8+
my_oapp = "41NCdrEvXhQ4mZgyJkmqYxL6A1uEmnraGj31UJ6PsXd3"
9+
10+
[registry]
11+
url = "https://api.apr.dev"
12+
13+
[provider]
14+
cluster = "Localnet"
15+
wallet = "~/.config/solana/id.json"
16+
17+
[scripts]
18+
test = "yarn run ts-mocha -b -p ./tsconfig.json -t 10000000 sdk/tests/**/*.test.ts"

0 commit comments

Comments
 (0)