Skip to main content

index/classes/LaunchpadWrites.md

Public launchpad write facade; callers only build inputs and receive submissions.

Constructors​

Constructor​

new LaunchpadWrites(options): LaunchpadWrites

Construct launchpad write methods around an injected transport.

sellFeeCeiling supplies the fee ceiling of a sell that names no extraFees; without it such a sell is refused instead of being sent with a ceiling the chain would reject.

Parameters​

ParameterType
options{ sellFeeCeiling?: SellFeeCeilingResolver; transport: LaunchpadWriteTransport; walletAddress: string; }
options.sellFeeCeiling?SellFeeCeilingResolver
options.transportLaunchpadWriteTransport
options.walletAddressstring

Returns​

LaunchpadWrites

Methods​

attach()​

attach(attachment): BundleSubmission

Resume a bundle submitted earlier: persist { bundleId, method, uniqueKey } of a submission (plus tokenName for a CreateSale), and after a reload attach returns a submission whose wait() confirms it exactly as the original one would have. Nothing is signed or sent until wait().

Parameters​

ParameterType
attachmentBundleAttachment

Returns​

BundleSubmission

Throws​

LaunchpadSDKError INVALID_BUNDLE_ATTACHMENT (see BundlerTransport.attach).

Since​

9.0.0

Example​

const submission = await sdk.launchpad.buyWithNative({ vaultAddress, quantity: '1', expectedAmount: '2' });
sessionStorage.setItem('pendingBundle', JSON.stringify({
bundleId: submission.bundleId, method: submission.method, uniqueKey: submission.uniqueKey,
}));
// after a reload
const resumed = sdk.launchpad.attach(JSON.parse(sessionStorage.getItem('pendingBundle') ?? '{}'));
const result = await resumed.wait();

buyExactToken()​

buyExactToken(input): Promise<BundleSubmission>

Buy an exact token quantity through BuyExactToken.

Parameters​

ParameterType
inputLaunchpadTradeInput

Returns​

Promise<BundleSubmission>

Example​

await sdk.launchpad.buyExactToken({ vaultAddress, quantity: '1', expectedAmount: '2' });

buyWithNative()​

buyWithNative(input): Promise<BundleSubmission>

Buy an exact native quantity through BuyWithNative.

Parameters​

ParameterType
inputLaunchpadTradeInput

Returns​

Promise<BundleSubmission>

Example​

const submission = await sdk.launchpad.buyWithNative({ vaultAddress, quantity: '1', expectedAmount: '2' });
await submission.wait();

createSale()​

createSale(input): Promise<BundleSubmission>

Create a sale using the frontend's CreateSale DTO and instruction set.

Parameters​

ParameterType
inputCreateSaleInput

Returns​

Promise<BundleSubmission>

Example​

const submission = await sdk.launchpad.createSale({ tokenName: 'anime', tokenSymbol: 'ANIME', tokenImage: 'https://example.test/anime.png' });
await submission.wait();

sellExactToken()​

sellExactToken(input): Promise<BundleSubmission>

Sell an exact token quantity through SellExactToken.

Parameters​

ParameterType
inputLaunchpadTradeInput

Returns​

Promise<BundleSubmission>

Example​

await sdk.launchpad.sellExactToken({ vaultAddress, quantity: '1', expectedAmount: '2' });

sellWithNative()​

sellWithNative(input): Promise<BundleSubmission>

Sell an exact native output through SellWithNative.

Parameters​

ParameterType
inputLaunchpadTradeInput

Returns​

Promise<BundleSubmission>

Example​

await sdk.launchpad.sellWithNative({ vaultAddress, quantity: '1', expectedAmount: '2' });