Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/orange-wasps-sip.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-lz-oapp": minor
---

add Solana OApp example
20 changes: 20 additions & 0 deletions examples/oapp-solana/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.-
# / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \
# `-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-'
#
# Example environment configuration
#
# .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.-. .-.-
# / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \ \ / / \
# `-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-' `-`-'

# By default, the examples support both mnemonic-based and private key-based authentication
#
# You don't need to set both of these values, just pick the one that you prefer and set that one
MNEMONIC=
PRIVATE_KEY=
# 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
SOLANA_PRIVATE_KEY=
SOLANA_KEYPAIR_PATH=
RPC_URL_SOLANA=
RPC_URL_SOLANA_TESTNET=
11 changes: 11 additions & 0 deletions examples/oapp-solana/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
lib/client/generated/
artifacts
cache
dist
node_modules
out
*.log
*.sol
*.yaml
*.lock
package-lock.json
12 changes: 12 additions & 0 deletions examples/oapp-solana/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
require('@rushstack/eslint-patch/modern-module-resolution');

module.exports = {
root: true,
extends: ['@layerzerolabs/eslint-config-next/recommended'],
rules: {
// @layerzerolabs/eslint-config-next defines rules for turborepo-based projects
// that are not relevant for this particular project
'turbo/no-undeclared-env-vars': 'off',
'import/no-unresolved': 'warn', // Updated to warn to avoid erratic popping up of this particular error even when the package has been installed correctly
},
};
30 changes: 30 additions & 0 deletions examples/oapp-solana/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
node_modules
.env
coverage
coverage.json
typechain
typechain-types

# Solana
target
target/debug
target/sbf-solana-solana
buffer.json
.anchor

# Hardhat files
cache
artifacts

# LayerZero specific files
.layerzero

# foundry test compilation files
out

# pnpm
pnpm-error.log

# Editor and OS files
.DS_Store
.idea
1 change: 1 addition & 0 deletions examples/oapp-solana/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
v18.18.0
11 changes: 11 additions & 0 deletions examples/oapp-solana/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
lib/client/generated/
artifacts/
cache/
dist/
node_modules/
out/
*.log
*ignore
*.yaml
*.lock
package-lock.json
3 changes: 3 additions & 0 deletions examples/oapp-solana/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
...require('@layerzerolabs/prettier-config-next'),
};
18 changes: 18 additions & 0 deletions examples/oapp-solana/Anchor.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[toolchain]

[features]
seeds = false
skip-lint = false

[programs.localnet]
my_oapp = "41NCdrEvXhQ4mZgyJkmqYxL6A1uEmnraGj31UJ6PsXd3"

[registry]
url = "https://api.apr.dev"

[provider]
cluster = "Localnet"
wallet = "~/.config/solana/id.json"

[scripts]
test = "yarn run ts-mocha -b -p ./tsconfig.json -t 10000000 sdk/tests/**/*.test.ts"
Loading