Skip to content

Commit 8139019

Browse files
authored
Example on how to use account data as seeds (#111)
* Example on how to use account data as seeds * Update pnpm-lock.yaml * Update readme.md
1 parent b992087 commit 8139019

File tree

14 files changed

+2176
-0
lines changed

14 files changed

+2176
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
.anchor
3+
.DS_Store
4+
target
5+
**/*.rs.bk
6+
node_modules
7+
test-ledger
8+
.yarn
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
.anchor
3+
.DS_Store
4+
target
5+
node_modules
6+
dist
7+
build
8+
test-ledger
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"tabWidth": 2,
3+
"useTabs": false,
4+
"singleQuote": false,
5+
"printWidth": 80,
6+
"trailingComma": "all",
7+
"arrowParens": "avoid",
8+
"endOfLine": "auto",
9+
"proseWrap": "always"
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
[programs.localnet]
3+
transfer_hook = "1qahDxKHeCLZhbBU2NyMU6vQCQmEUmdeSEBrG5drffK"
4+
5+
[registry]
6+
url = "https://api.apr.dev"
7+
8+
[provider]
9+
cluster = "Localnet"
10+
wallet = "~/.config/solana/id.json"
11+
12+
[scripts]
13+
test = "pnpm ts-mocha -p ./tsconfig.json -t 100000 tests/**/*.ts"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
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+
const anchor = require('@coral-xyz/anchor');
6+
7+
module.exports = async (provider) => {
8+
// Configure client to use the provider.
9+
anchor.setProvider(provider);
10+
11+
// Add your deploy script here.
12+
};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"scripts": {
3+
"lint:fix": "prettier */*.js \"*/**/*{.js,.ts}\" -w",
4+
"lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check"
5+
},
6+
"dependencies": {
7+
"@coral-xyz/anchor": "^0.30.1",
8+
"@solana/spl-token": "^0.4.0",
9+
"@solana/web3.js": "^1.92.3"
10+
},
11+
"devDependencies": {
12+
"@types/bn.js": "^5.1.0",
13+
"@types/chai-as-promised": "^7.1.8",
14+
"chai-as-promised": "^7.1.2",
15+
"@types/chai": "^4.3.0",
16+
"chai": "^4.3.4",
17+
"@types/mocha": "^9.0.0",
18+
"mocha": "^9.0.3",
19+
"prettier": "^2.6.2",
20+
"ts-mocha": "^10.0.0",
21+
"typescript": "^4.3.5"
22+
}
23+
}

0 commit comments

Comments
 (0)