Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add token swap native #334

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ members = [
"tokens/token-2022/default-account-state/native/program",
"tokens/token-2022/transfer-fee/native/program",
"tokens/token-2022/multiple-extensions/native/program",
"tokens/token-swap/native/program",
]
resolver = "2"

Expand Down
15 changes: 2 additions & 13 deletions tokens/token-swap/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -317,16 +317,5 @@ https://github.com/solana-developers/program-examples/blob/419cb6b6c20e8b1c65711
This code burns the specified amount of liquidity tokens (amount) by calling the token::burn function. The liquidity tokens are destroyed, reducing the total supply.
Finally, this code returns Ok(()) if all operations in the function executed successfully. This indicates that the liquidity withdrawal was completed without any errors.














## Potential extensions
- Add instruction for the admin to change fee
22 changes: 22 additions & 0 deletions tokens/token-swap/native/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"scripts": {
"test": "pnpm ts-mocha -p ./tests/tsconfig.test.json -t 1000000 ./tests/*.ts",
"build-and-test": "cargo build-sbf --manifest-path=./program/Cargo.toml --sbf-out-dir=./tests/fixtures && pnpm test",
"build": "cargo build-sbf --manifest-path=./program/Cargo.toml --sbf-out-dir=./program/target/so",
"deploy": "solana program deploy ./program/target/so/program.so"
},
"devDependencies": {
"@solana/spl-token": "^0.4.9",
"@solana/web3.js": "^1.95.8",
"@types/chai": "^4.3.0",
"@types/mocha": "^9.0.0",
"borsh": "^0.7.0",
"chai": "^4.3.4",
"chai-as-promised": "^8.0.1",
"mocha": "^9.0.3",
"solana-bankrun": "^0.4.0",
"spl-token-bankrun": "^0.2.6",
"ts-mocha": "^10.0.0",
"typescript": "^4.3.5"
}
}
Loading