{"id":27982105,"url":"https://github.com/codebender828/svm-transaction-serializer-toolkit","last_synced_at":"2025-05-08T03:48:07.205Z","repository":{"id":288415756,"uuid":"967152774","full_name":"codebender828/svm-transaction-serializer-toolkit","owner":"codebender828","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-17T11:02:23.000Z","size":21,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-08T03:48:01.199Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/codebender828.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":"2025-04-16T02:35:26.000Z","updated_at":"2025-04-17T11:02:27.000Z","dependencies_parsed_at":"2025-04-20T08:00:54.575Z","dependency_job_id":null,"html_url":"https://github.com/codebender828/svm-transaction-serializer-toolkit","commit_stats":null,"previous_names":["codebender828/svm-transaction-serializer-toolkit"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebender828%2Fsvm-transaction-serializer-toolkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebender828%2Fsvm-transaction-serializer-toolkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebender828%2Fsvm-transaction-serializer-toolkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codebender828%2Fsvm-transaction-serializer-toolkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codebender828","download_url":"https://codeload.github.com/codebender828/svm-transaction-serializer-toolkit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252996198,"owners_count":21837616,"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":"2025-05-08T03:48:06.577Z","updated_at":"2025-05-08T03:48:07.199Z","avatar_url":"https://github.com/codebender828.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SVM Transaction Serialization Toolkit\n\nThis toolkit helps you serialize Solana or Sonic transactions into different formats (Base58 and Base64) that can be used with Squads Protocol or with Explorer Inspection.\n\nIt's particularly useful for creating transactions that can be proposed to Squads or Kronus vaults via their respective UIs.\n\n## Prerequisites\n\n- [Bun](https://bun.sh) installed (v1.1.18 or later)\n- A Solana wallet with some SOL\n- A Squads or Kronus vault address\n\n## Installation\n\n```bash\nbun install\n```\n\n## Configuration\n\nThe toolkit provides two examples for different types of transfers:\n\n### 1. SOL Transfer (`src/serialize-transaction-to-base58.ts`)\n\nBefore running the SOL transfer example, configure:\n\n```typescript\nconst RPC_ENDPOINT = \"https://api.mainnet-alpha.sonic.game\"; // Your Solana RPC endpoint\nconst FEE_PAYER_PUBKEY = \"YOUR_VAULT_PUBKEY\"; // Your Squads / Kronus vault address\nconst RECIPIENT_PUBKEY = new PublicKey(\"RECIPIENT_ADDRESS\"); // The address that will receive the SOL transfer\n```\n\n### 2. SPL Token Transfer (`src/transfers/transfer-spl-token.ts`)\n\nBefore running the SPL token transfer example, configure:\n\n```typescript\nconst RPC_ENDPOINT = \"https://api.mainnet-alpha.sonic.game\"; // Your Solana RPC endpoint\nconst FEE_PAYER_PUBKEY = \"YOUR_VAULT_PUBKEY\"; // Your Squads / Kronus vault address\nconst RECIPIENT_PUBKEY = new PublicKey(\"RECIPIENT_ADDRESS\"); // The address that will receive the tokens\nconst TOKEN_MINT = new PublicKey(\"YOUR_TOKEN_MINT_ADDRESS\"); // The mint address of the token you want to transfer\n```\n\nImportant: You need to know which token program your token uses:\n\n- Legacy Token Program: `TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA`\n- Token-2022 Program: `TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb`\n\nThe example uses Token-2022 by default, which is used by $SONIC on Sonic Mainnet. If your token uses the Legacy Token Program, you'll need to:\n\n1. Import `TOKEN_PROGRAM_ID` instead of `TOKEN_2022_PROGRAM_ID`\n2. Update the program ID in `getAssociatedTokenAddress` and `createTransferInstruction` calls\n\n## Usage\n\n### SOL Transfer Example\n\nTo run the SOL transfer example:\n\n```bash\nbun run src/serialize-transaction-to-base58.ts\n```\n\nThis will:\n\n1. Create a transaction that transfers 0.001 SOL from your vault to the specified recipient\n2. Serialize it to Base64\n3. Convert it to Base58 format for Squads/Kronus\n\n### SPL Token Transfer Example\n\nTo run the SPL token transfer example:\n\n```bash\nbun run src/transfers/transfer-spl-token.ts\n```\n\nThis will:\n\n1. Create a transaction that transfers SPL tokens from your vault to the specified recipient\n2. Automatically create an associated token account for the recipient if it doesn't exist\n3. Serialize it to Base64\n4. Convert it to Base58 format for Squads/Kronus\n\n## Output\n\nWhen you run either script, you'll see:\n\n1. The Base64 transaction string\n2. The Base58 transaction string\n3. A reminder of which vault address to use when proposing the transaction\n\n## Using the Output\n\n1. Copy the Base58 transaction string\n2. Go to your Squads or Kronus interface\n3. Use the \"Propose Transaction\" feature\n4. Paste the Base58 transaction string\n5. Select your vault (the one you configured in `FEE_PAYER_PUBKEY`)\n6. Submit the proposal\n\n## Customizing Transactions\n\nTo create different types of transactions:\n\n1. Modify the transfer instructions in the respective script\n2. You can add more instructions using the `instructions` array\n3. The scripts will automatically handle the serialization\n\n## Troubleshooting\n\nIf you encounter issues:\n\n1. Make sure your RPC endpoint is working\n2. Verify your vault address is correct\n3. Ensure your vault has enough SOL for the transaction\n4. Check that you have the correct permissions on the vault\n5. For SPL token transfers, verify that:\n   - The token mint address is correct\n   - You're using the correct token program (Legacy or Token-2022)\n   - The source token account exists and has enough tokens\n   - The fee payer has permission to transfer from the source account\n\n## Contributing\n\nFeel free to submit issues and enhancement requests!\n\n## License\n\nThis project is open source and available under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodebender828%2Fsvm-transaction-serializer-toolkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodebender828%2Fsvm-transaction-serializer-toolkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodebender828%2Fsvm-transaction-serializer-toolkit/lists"}