View createStakePool.ts
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
import { connectionFor, executeTransaction } from "@cardinal/common"; | |
import { utils, Wallet } from "@coral-xyz/anchor"; | |
import type { Cluster } from "@solana/web3.js"; | |
import { Keypair, SystemProgram, Transaction } from "@solana/web3.js"; | |
import dotenv from "dotenv"; | |
import { | |
findStakePoolId, | |
rewardsCenterProgram, | |
SOL_PAYMENT_INFO, |
View createPayemntInfo.ts
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
import { executeTransaction } from "@cardinal/common"; | |
import type { Wallet } from "@coral-xyz/anchor"; | |
import { BN } from "@coral-xyz/anchor"; | |
import type { Connection } from "@solana/web3.js"; | |
import { PublicKey, Transaction } from "@solana/web3.js"; | |
import { findPaymentInfoId, rewardsCenterProgram } from "../../sdk"; | |
export const commandName = "createPaymentInfo"; | |
export const description = "Create a payment info object"; |
View raffle.test.ts
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
import type { CardinalProvider } from "@cardinal/common"; | |
import { | |
executeTransaction, | |
executeTransactions, | |
getTestProvider, | |
} from "@cardinal/common"; | |
import { beforeAll, expect, test } from "@jest/globals"; | |
import type { PublicKey } from "@solana/web3.js"; | |
import { Keypair, SystemProgram, Transaction } from "@solana/web3.js"; | |
import { BN } from "bn.js"; |
View auction-bid.test.ts
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
import type { CardinalProvider } from "@cardinal/common"; | |
import { | |
executeTransaction, | |
executeTransactions, | |
getTestProvider, | |
tryGetAccount, | |
} from "@cardinal/common"; | |
import { beforeAll, expect, test } from "@jest/globals"; | |
import { getAccount, getAssociatedTokenAddressSync } from "@solana/spl-token"; | |
import type { PublicKey } from "@solana/web3.js"; |
View gist:6b80629481a7c14988d1ee3e98fd7aa6
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
export const withWrapToken = async ( | |
transaction: Transaction, | |
connection: Connection, | |
wallet: Wallet, | |
mintId: PublicKey, | |
listingAuthorityName?: string, | |
payer = wallet.publicKey | |
): Promise<[Transaction, PublicKey]> => { | |
const [tokenManagerId] = await findTokenManagerAddress(mintId); | |
const checkTokenManager = await tryGetAccount(() => |