index/classes/BundlerTransport.md
The only current launchpad transport: typed-data signing plus /bundle.
Constructors
Constructor
new BundlerTransport(
options):BundlerTransport
Create a bundler transport with an injectable requestor and socket.
Parameters
| Parameter | Type | Description |
|---|---|---|
options | { bundleBaseUrl: string; bundleSocketFactory?: SocketFactory; httpRequestor?: HttpRequestor; launchpadBaseUrl: string; signer: LaunchpadSigner; socketFactory?: SocketFactory; walletAddress: string; } | - |
options.bundleBaseUrl | string | - |
options.bundleSocketFactory? | SocketFactory | The app's own bundler socket (its reconnect settings, its lifecycle): called once per wait(), the transport only adds its listener for the bundle's event and removes it when the wait ends; it never disconnects that socket. Takes precedence over socketFactory. |
options.httpRequestor? | HttpRequestor | - |
options.launchpadBaseUrl | string | - |
options.signer | LaunchpadSigner | - |
options.socketFactory? | SocketFactory | Opens a socket for one wait(); the transport disconnects it when the wait ends (default: a socket.io websocket to bundleBaseUrl). |
options.walletAddress | string | - |
Returns
BundlerTransport
bundler transport bundle base url socket factory http requestor launchpad signer wallet address
Methods
attach()
attach(
attachment):BundleSubmission
A submission for a bundle sent earlier (a page that persisted { bundleId, method, uniqueKey, tokenName } and reloaded): its wait() confirms exactly as a fresh submission's does (the
bundle's socket event raced against the REST confirmation, which also answers for a bundle that
settled before this call). Nothing is signed or sent until wait().
Parameters
| Parameter | Type |
|---|---|
attachment | BundleAttachment |
Returns
Throws
LaunchpadSDKError INVALID_BUNDLE_ATTACHMENT (details.field): an empty bundleId or
uniqueKey, a method the bundler does not accept, a CreateSale without its tokenName.
Example
const submission = transport.attach({ bundleId, method: 'BuyWithNative', uniqueKey });
const result = await submission.wait();
bundle submission id unique key token name attachment invalid create sale
submit()
submit(
request):Promise<BundleSubmission>
Sign and submit one allowlisted launchpad write to the bundler.
Parameters
| Parameter | Type |
|---|---|
request | LaunchpadWriteRequest |
Returns
Promise<BundleSubmission>
Example
const submission = await transport.submit({ method: 'BuyWithNative', dto, stringsInstructions });
await submission.wait();
bundle submission launchpad write request