Skip to main content

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​

ParameterTypeDescription
options{ bundleBaseUrl: string; bundleSocketFactory?: SocketFactory; httpRequestor?: HttpRequestor; launchpadBaseUrl: string; signer: LaunchpadSigner; socketFactory?: SocketFactory; walletAddress: string; }-
options.bundleBaseUrlstring-
options.bundleSocketFactory?SocketFactoryThe 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.launchpadBaseUrlstring-
options.signerLaunchpadSigner-
options.socketFactory?SocketFactoryOpens a socket for one wait(); the transport disconnects it when the wait ends (default: a socket.io websocket to bundleBaseUrl).
options.walletAddressstring-

Returns​

BundlerTransport

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​

ParameterType
attachmentBundleAttachment

Returns​

BundleSubmission

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();

submit()​

submit(request): Promise<BundleSubmission>

Sign and submit one allowlisted launchpad write to the bundler.

Parameters​

ParameterType
requestLaunchpadWriteRequest

Returns​

Promise<BundleSubmission>

Example​

const submission = await transport.submit({ method: 'BuyWithNative', dto, stringsInstructions });
await submission.wait();