Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/examples/genesis/add_launch_pool_bucket_v2/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions src/examples/genesis/add_launch_pool_bucket_v2/umi.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ await addLaunchPoolBucketV2(umi, {
// Optional: Minimum deposit
minimumDepositAmount: null, // or { amount: sol(0.1).basisPoints }

// Required since @metaplex-foundation/genesis 0.42.0: pass null for no soft cap,
// or { amount: sol(100).basisPoints } to cap the quote tokens kept
Comment thread
tonyboylehub marked this conversation as resolved.
softCap: null,

// Where collected SOL goes after transition
endBehaviors: [
{
Expand Down
32 changes: 32 additions & 0 deletions src/examples/genesis/refund_launch_pool_v2/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/**
* Example: refund_launch_pool_v2
*
*
*
* This file is auto-generated by scripts/build-examples.js
* Edit the native .js/.ts and .rs files, then run: node scripts/build-examples.js
*/

const umiSections = {
"imports": "import {\n genesis,\n refundLaunchPoolV2,\n} from '@metaplex-foundation/genesis'\nimport { mplToolbox } from '@metaplex-foundation/mpl-toolbox'\nimport { createUmi } from '@metaplex-foundation/umi-bundle-defaults'",
"setup": "const umi = createUmi('https://api.mainnet-beta.solana.com')\n .use(mplToolbox())\n .use(genesis())\n\n// umi.use(keypairIdentity(yourKeypair));\n\n// Assumes genesisAccount, launchPoolBucket, and baseMint from previous steps.\n// Only valid after the deposit window closed AND either the\n// minimumQuoteTokenThreshold was missed or the softCap was exceeded.",
"main": "// The program computes the refundable amount, so there is no amount argument.\n// A missed threshold refunds the full deposit; an exceeded soft cap refunds\n// only the excess, leaving the depositor's token allocation intact.\nawait refundLaunchPoolV2(umi, {\n genesisAccount,\n bucket: launchPoolBucket,\n baseMint: baseMint.publicKey,\n recipient: umi.identity.publicKey,\n}).sendAndConfirm(umi)",
"output": "",
"full": "// [IMPORTS]\nimport {\n genesis,\n refundLaunchPoolV2,\n} from '@metaplex-foundation/genesis'\nimport { mplToolbox } from '@metaplex-foundation/mpl-toolbox'\nimport { createUmi } from '@metaplex-foundation/umi-bundle-defaults'\n// [/IMPORTS]\n\n// [SETUP]\nconst umi = createUmi('https://api.mainnet-beta.solana.com')\n .use(mplToolbox())\n .use(genesis())\n\n// umi.use(keypairIdentity(yourKeypair));\n\n// Assumes genesisAccount, launchPoolBucket, and baseMint from previous steps.\n// Only valid after the deposit window closed AND either the\n// minimumQuoteTokenThreshold was missed or the softCap was exceeded.\n// [/SETUP]\n\n// [MAIN]\n// The program computes the refundable amount, so there is no amount argument.\n// A missed threshold refunds the full deposit; an exceeded soft cap refunds\n// only the excess, leaving the depositor's token allocation intact.\nawait refundLaunchPoolV2(umi, {\n genesisAccount,\n bucket: launchPoolBucket,\n baseMint: baseMint.publicKey,\n recipient: umi.identity.publicKey,\n}).sendAndConfirm(umi)\n// [/MAIN]\n\n// [OUTPUT]\n// [/OUTPUT]\n"
}

export const metadata = {
title: "refund_launch_pool_v2",
description: "",
tags: [],
}

export const examples = {
umi: {
framework: 'Umi',
language: 'javascript',
code: umiSections.full,
sections: umiSections,
},

}
35 changes: 35 additions & 0 deletions src/examples/genesis/refund_launch_pool_v2/umi.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// [IMPORTS]
import {
genesis,
refundLaunchPoolV2,
} from '@metaplex-foundation/genesis'
import { mplToolbox } from '@metaplex-foundation/mpl-toolbox'
import { createUmi } from '@metaplex-foundation/umi-bundle-defaults'
// [/IMPORTS]

// [SETUP]
const umi = createUmi('https://api.mainnet-beta.solana.com')
.use(mplToolbox())
.use(genesis())

// umi.use(keypairIdentity(yourKeypair));

// Assumes genesisAccount, launchPoolBucket, and baseMint from previous steps.
// Only valid after the deposit window closed AND either the
// minimumQuoteTokenThreshold was missed or the softCap was exceeded.
// [/SETUP]

// [MAIN]
// The program computes the refundable amount, so there is no amount argument.
// A missed threshold refunds the full deposit; an exceeded soft cap refunds
// only the excess, leaving the depositor's token allocation intact.
await refundLaunchPoolV2(umi, {
genesisAccount,
bucket: launchPoolBucket,
baseMint: baseMint.publicKey,
recipient: umi.identity.publicKey,
}).sendAndConfirm(umi)
// [/MAIN]

// [OUTPUT]
// [/OUTPUT]
Loading
Loading