{"id":29027615,"url":"https://github.com/defi0x1/token-swap-program","last_synced_at":"2025-06-26T06:37:27.795Z","repository":{"id":233954748,"uuid":"622770059","full_name":"defi0x1/token-swap-program","owner":"defi0x1","description":"Swap SOL / Token program","archived":false,"fork":false,"pushed_at":"2025-04-30T17:02:12.000Z","size":396,"stargazers_count":17,"open_issues_count":5,"forks_count":7,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-13T04:45:42.810Z","etag":null,"topics":["solana-program","swap-token"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/defi0x1.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-04-03T02:57:07.000Z","updated_at":"2025-05-18T17:40:26.000Z","dependencies_parsed_at":"2025-06-13T04:45:46.052Z","dependency_job_id":"dffd30d7-3386-4396-bc02-c4fa6d143644","html_url":"https://github.com/defi0x1/token-swap-program","commit_stats":null,"previous_names":["docongminh/token-swap-program","defi0x1/token-swap-program"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/defi0x1/token-swap-program","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defi0x1%2Ftoken-swap-program","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defi0x1%2Ftoken-swap-program/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defi0x1%2Ftoken-swap-program/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defi0x1%2Ftoken-swap-program/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/defi0x1","download_url":"https://codeload.github.com/defi0x1/token-swap-program/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/defi0x1%2Ftoken-swap-program/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262017152,"owners_count":23245579,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["solana-program","swap-token"],"created_at":"2025-06-26T06:37:14.271Z","updated_at":"2025-06-26T06:37:27.778Z","avatar_url":"https://github.com/defi0x1.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# solana program swap token\n\n\n## Overview\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"460\" height=\"300\" src=\"https://github.com/docongminh/token-swap-program/blob/master/resources/overview.png\"\u003e\n\u003c/p\u003e\n\n## Install\n  ```bash\n    npm install\n  ```\n  \n## Run unitest\nRun solana vadidator local:\n```bash\n  solana-test-validator --reset\n```\n\nRun Unit test\n\n```bash\n  anchor test --skip-local-validator\n```\n\n\nResult example:\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"460\" height=\"300\" src=\"https://github.com/docongminh/token-swap-program/blob/master/resources/unittest.png\"\u003e\n\u003c/p\u003e\n\n\n## Run test Swap SOL -\u003e Token\n- The program deployed on [devnet](https://explorer.solana.com/address/swapEsYJ7iLDbYeg9154yR1dsUjumanS7LF9KEiJQae?cluster=devnet).\n\n[Program ID](https://explorer.solana.com/address/swapEsYJ7iLDbYeg9154yR1dsUjumanS7LF9KEiJQae?cluster=devnet):\n```ts\n  const programId = swapEsYJ7iLDbYeg9154yR1dsUjumanS7LF9KEiJQae\n```\n[Token mint address](https://explorer.solana.com/address/HVTEudbUMJaMRzCnQ2fo1cq6vL9gqHD9mYbvYhfkmQuh?cluster=devnet):\n```ts\n  const mintAddress = HVTEudbUMJaMRzCnQ2fo1cq6vL9gqHD9mYbvYhfkmQuh\n```\n\nRun swap:\n```bash\n  npx ts-node client/swap.ts\n```\n \n## Notes:\n  - Currently, I have set default SOL value for swap: 0.5 SOL -\u003e receive 5 Token. use specified value at [here](https://github.com/docongminh/token-swap-program/blob/master/client/swap.ts#L26-L41)\n  - I made public `authority`, `master authority`, and `user` [private key](https://github.com/docongminh/token-swap-program/tree/master/client/keys) for convenient testing. All wallet have already been airdrop SOL for network fees.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefi0x1%2Ftoken-swap-program","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdefi0x1%2Ftoken-swap-program","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefi0x1%2Ftoken-swap-program/lists"}