{"id":21833552,"url":"https://github.com/ghvstcode/sleeng","last_synced_at":"2025-07-05T09:05:01.595Z","repository":{"id":194007319,"uuid":"689459369","full_name":"Ghvstcode/sleeng","owner":"Ghvstcode","description":null,"archived":false,"fork":false,"pushed_at":"2023-09-10T16:55:04.000Z","size":146,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-21T13:56:51.985Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/Ghvstcode.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}},"created_at":"2023-09-09T21:53:38.000Z","updated_at":"2023-09-11T05:57:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"85fbe404-750d-44fb-98e1-11e213c2b15e","html_url":"https://github.com/Ghvstcode/sleeng","commit_stats":null,"previous_names":["ghvstcode/sleeng"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Ghvstcode/sleeng","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ghvstcode%2Fsleeng","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ghvstcode%2Fsleeng/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ghvstcode%2Fsleeng/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ghvstcode%2Fsleeng/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ghvstcode","download_url":"https://codeload.github.com/Ghvstcode/sleeng/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ghvstcode%2Fsleeng/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263715326,"owners_count":23500241,"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":[],"created_at":"2024-11-27T19:32:01.818Z","updated_at":"2025-07-05T09:05:01.576Z","avatar_url":"https://github.com/Ghvstcode.png","language":"Go","readme":"\n\n# Development Notes\n* I Decided to make the wallet both a **file-based wallet** and a **_paper-based wallet_**. The user can specify which they want to use by using the -p flag.\n  * If a user decides to use the paper-based wallet, the seed phrase is displayed to the user and the user is prompted to write it down.\n  * If a user decides to use the file-based wallet, the private key is saved to a file in the users local machine.\n  * The user can specify a private key using the -k flag.\n* I decided to make it a multi-wallet CLI, so the user can create multiple wallets and manage them.\n  * The first wallet created is the default wallet, and the user can specify which wallet they want to use by using the -a flag.\n  * The decision to make it a multi-wallet CLI affected the structure of the JSON file where the private keys are stored. Regardless I wanted the files to be sort of solana CLI compatible, so a user can copy the private key from the file and use it with the solana CLI or any other solana wallet.\n  * The JSON file looks like this \"{\"activeAlias\":\"tester\",\"wallets\":{\"tester\":{\"PrivateKey\":\"[92,15,204,133,134,51,239,138,85,241,239,241,4,222,128,85,174,71,118,164,209,211,36,177,104,134,209,129,117,109,239,73,218,29,176,154,4,216,255,8,183,212,169,166,234,195,223,93,32,19,59,140,197,76,42,59,114,79,212,204,90,38,195,171]\",\"balance\":\"0\",\"publicKey\":\"FgS8tPasZJW7TkwxpHdj5UeSrYrCT6mSw9jTx5aY8CNv\"}}}\"\n  * With fields for the active alias, the wallets, and the wallet fields.\n  * The active alias is the alias of the wallet that is currently being used.\n  * The wallets field is a map of all the wallets created by the user.\n  * The wallet fields are the private key, balance, and public key of the wallet.\n  * Note that the balance field although it exists is barely useful, I did not get around to implementing updating it and all that.\n* I did not get around to implementing logic around rate limiting request made by this app both to the Kraken API for exchange rate data and the Solana API for transaction history.\n* A very interesting bit of this project was the retrieveing of transaction history from the Solana API. To get a single transaction we make about 3 RPC calls, 1 to get the signatures of all the public key, then we have all the transaction signatures we iterate over the array \u0026 make another API call to get confirmed transaction details for the signature, then another one to get the block time of the slot data. Expensive stuff. I make use of concurrency to try to imrpove the processs aloowing up to 50 transactions to be fetched concurrently once we get the signature.\n* I only got around a 33.4% test coverage!\n* Possible Improvements - (Better handling of transaction related errors, )\n* \n# Solana Wallet CLI\n\n## Overview\n\nThis command-line interface (CLI) is designed to interact with Solana wallets. The CLI allows you to perform a diverse set of tasks such as creating new wallets, checking balances, fetching exchange rates, sending funds, and viewing transaction history.\n\n## Table of Contents\n\n- [Commands](#commands)\n    - [Root](#root)\n    - [Initialize Wallet](#initialize-wallet)\n    - [Send Funds](#send-funds)\n    - [Transaction History](#transaction-history)\n    - [Get Wallet Address](#get-wallet-address)\n    - [Get Wallet Balance](#get-wallet-balance)\n    - [Get Exchange Rate](#get-exchange-rate)\n- [Options](#options)\n    - [Persistent Flags](#persistent-flags)\n\n---\n\n## Commands\n\n### Root\n\nThe root command initializes the CLI application.\n\nUsage:\n```bash\nwallet\n```\nThis command accepts persistent flags for specifying a base58 encoded private key and an optional alias for the wallet.\n\n---\n\n### Initialize Wallet\n\nThe `init` command creates a new Solana wallet and saves its private key to disk.\n\nUsage:\n```bash\nwallet init\n```\nFlags:\n- `--paper` or `-p`: Creates a paper-based wallet and displays the seed phrase.\n\n\u003e Note: The wallet address is copied to your clipboard after successful initialization.\n\n---\n\n### Send Funds\n\nThe `send` command allows you to send funds to another Solana wallet.\n\nUsage:\n```bash\nwallet send [EUR amount] [destination]\n```\nArguments:\n- `EUR amount`: The amount of money you wish to send in EUR.\n- `destination`: The destination Solana wallet address.\n\nUpon successfully sending funds, a transaction signature will be displayed.\n\n---\n\n### Transaction History\n\nThe `transactions` command displays your transaction history, sorted by most recent transactions first.\n\nUsage:\n```bash\nwallet transactions\n```\n\n\u003e Note: If you have no transactions, \"No transactions to display\" will be shown.\n\n---\n\n### Get Wallet Address\n\nThe `address` command retrieves your Solana wallet address.\n\nUsage:\n```bash\nwallet address\n```\n\nThis command outputs the wallet address tied to the private key you've initialized or specified.\n\n---\n\n### Get Wallet Balance\n\nThe `balance` command provides the current balance of your Solana wallet in SOL and EUR.\n\nUsage:\n```bash\nwallet balance\n```\n\nThe balance is displayed in both SOL and its equivalent in EUR based on the current exchange rate.\n\n---\n\n### Get Exchange Rate\n\nThe `rate` command fetches the current exchange rate between SOL and EUR.\n\nUsage:\n```bash\nwallet rate\n```\n\nThe output shows the exchange rate at the moment of fetching and may include a timestamp.\n\n---\n\n## Options\n\n### Persistent Flags\n\nThe following flags can be used with any command:\n\n- `--key` or `-k`: A base58 encoded private key.\n- `--alias` or `-a`: An optional alias for easier wallet management.\n\n\u003e Example: `wallet --key=\u003cyour_base58_encoded_key\u003e --alias=\u003cwallet_alias\u003e`\n\n---","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghvstcode%2Fsleeng","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fghvstcode%2Fsleeng","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fghvstcode%2Fsleeng/lists"}