-
Notifications
You must be signed in to change notification settings - Fork 300
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
1,716 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.anchor | ||
.DS_Store | ||
target | ||
**/*.rs.bk | ||
node_modules | ||
test-ledger | ||
.yarn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[toolchain] | ||
|
||
[features] | ||
resolution = true | ||
skip-lint = false | ||
|
||
[programs.localnet] | ||
close_account = "4So9Jbx672BRL9RvfB8Sux2NMVX5QJRnhmdWyij3kkFg" | ||
|
||
[registry] | ||
url = "https://api.apr.dev" | ||
|
||
[provider] | ||
cluster = "Localnet" | ||
wallet = "~/.config/solana/id.json" | ||
|
||
[scripts] | ||
test = "pnpm ts-mocha -p ./tsconfig.json -t 1000000 tests/**/*.ts" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[workspace] | ||
members = [ | ||
"programs/*" | ||
] | ||
resolver = "2" | ||
|
||
[profile.release] | ||
overflow-checks = true | ||
lto = "fat" | ||
codegen-units = 1 | ||
[profile.release.build-override] | ||
opt-level = 3 | ||
incremental = false | ||
codegen-units = 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Destroy an Account | ||
> **_NOTE_:_** If you haven't installed poseidon yet, follow the installation steps [here](https://turbin3.github.io/poseidon/installation.html) | ||
- We're writing our TypeScript program code in [/ts-programs](./ts-programs/) | ||
- Once TypeScript program is completed, generate a program id and replace the `PROGRAM_ID` with the actual one. To generate a program id, run: | ||
``` | ||
anchor keys list | ||
# You'll get something similar, but it will definitely be different | ||
close-account: At2EEHZ4zq2roeR5Cba6dryYEsmsHz7MKt9tjUCpCng1 | ||
``` | ||
- To convert your TypeScript Solana program to Anchor program, run | ||
``` | ||
poseidon -i ./ts-programs/closeAccount.ts -o programs/close-account/src/lib.rs | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// Migrations are an early feature. Currently, they're nothing more than this | ||
// single deploy script that's invoked from the CLI, injecting a provider | ||
// configured from the workspace's Anchor.toml. | ||
|
||
const anchor = require("@coral-xyz/anchor"); | ||
|
||
module.exports = async function (provider) { | ||
// Configure client to use the provider. | ||
anchor.setProvider(provider); | ||
|
||
// Add your deploy script here. | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"license": "ISC", | ||
"scripts": { | ||
"lint:fix": "prettier */*.js \"*/**/*{.js,.ts}\" -w", | ||
"lint": "prettier */*.js \"*/**/*{.js,.ts}\" --check" | ||
}, | ||
"dependencies": { | ||
"@coral-xyz/anchor": "^0.30.1" | ||
}, | ||
"devDependencies": { | ||
"@biomejs/biome": "^1.9.4", | ||
"@types/bn.js": "^5.1.6", | ||
"@types/chai": "^4.3.20", | ||
"@types/mocha": "^9.0.0", | ||
"chai": "^4.5.0", | ||
"mocha": "^9.0.3", | ||
"prettier": "^2.8.8", | ||
"ts-mocha": "^10.0.0", | ||
"typescript": "^4.3.5" | ||
} | ||
} |
Oops, something went wrong.