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
/** | |
* Major modifications from V1: | |
* 1. Changed architecture to class-based | |
* 2. Added support for multiple mints | |
* 3. Added native SOL support | |
* 4. Handled 0 pre-balance token accounts | |
* 5. Handled optional accounts for Raydium's swap instructions | |
*/ | |
class AmmInstructionProcessor { |
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
// @ts-nocheck | |
import { AnchorIdl, rootNodeFromAnchor } from "@kinobi-so/nodes-from-anchor"; | |
import { createFromRoot, renderJavaScriptVisitor } from "@metaplex-foundation/kinobi"; | |
import { RootNode } from "@kinobi-so/node-types"; | |
import { renderJavaScriptUmiVisitor } from "@kinobi-so/renderers"; | |
import anchorIdl from "../target/idl/kinobi_test.json"; | |
function appendStringToDefinedTypeNames(rootNode: RootNode, appendString: string): RootNode { | |
const rootNodeCopy = JSON.parse(JSON.stringify(rootNode)); | |
rootNodeCopy.program.definedTypes.forEach(definedType => { |
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
// January 02, 2024 | |
import { Transaction, SystemProgram, Keypair, Connection, PublicKey, TransactionInstruction, AccountMeta } from "@solana/web3.js"; | |
import { createUmi } from "@metaplex-foundation/umi-bundle-defaults"; | |
import { CreateMetadataAccountV3InstructionAccounts, DataV2Args, createMetadataAccountV3 } from "@metaplex-foundation/mpl-token-metadata"; | |
import { fromWeb3JsKeypair, fromWeb3JsPublicKey, toWeb3JsPublicKey } from "@metaplex-foundation/umi-web3js-adapters"; | |
import { Instruction, TransactionBuilder, createSignerFromKeypair } from "@metaplex-foundation/umi"; | |
import { MINT_SIZE, TOKEN_PROGRAM_ID, createInitializeMintInstruction, getMinimumBalanceForRentExemptMint, getAssociatedTokenAddress, createAssociatedTokenAccountInstruction, createMintToInstruction } from '@solana/spl-token'; | |
import secret from '../wallets/authority.json'; |