@gala-chain/launchpad-sdk 9.0.0-rc.0 → 9.0.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +500 -10
- package/EXAMPLES.md +1 -1
- package/MIGRATING-TO-9.0.md +43 -1
- package/README.md +1 -1
- package/dist/LaunchpadSDK.d.ts +414 -219
- package/dist/LaunchpadSDK.d.ts.map +1 -1
- package/dist/api/LaunchpadAPI.d.ts +2 -140
- package/dist/api/LaunchpadAPI.d.ts.map +1 -1
- package/dist/auth/SessionAuthService.d.ts +32 -2
- package/dist/auth/SessionAuthService.d.ts.map +1 -1
- package/dist/auth/session.d.ts +59 -0
- package/dist/auth/session.d.ts.map +1 -0
- package/dist/auth/types.d.ts +6 -1
- package/dist/auth/types.d.ts.map +1 -1
- package/dist/constants/endpoints.d.ts +19 -1
- package/dist/constants/endpoints.d.ts.map +1 -1
- package/dist/constants/enums.d.ts +19 -0
- package/dist/constants/enums.d.ts.map +1 -1
- package/dist/constants/version.generated.d.ts +1 -1
- package/dist/errors/LaunchpadSDKError.d.ts +18 -0
- package/dist/errors/LaunchpadSDKError.d.ts.map +1 -1
- package/dist/index.browser.d.ts +36 -27
- package/dist/index.browser.d.ts.map +1 -1
- package/dist/index.browser.esm.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/index.js +1 -1
- package/dist/launchpad/bundle-submission.d.ts +57 -2
- package/dist/launchpad/bundle-submission.d.ts.map +1 -1
- package/dist/launchpad/create-sale-validation.d.ts +19 -0
- package/dist/launchpad/create-sale-validation.d.ts.map +1 -0
- package/dist/launchpad/transport.d.ts +31 -1
- package/dist/launchpad/transport.d.ts.map +1 -1
- package/dist/launchpad/writes.d.ts +37 -11
- package/dist/launchpad/writes.d.ts.map +1 -1
- package/dist/native.cjs +1 -1
- package/dist/native.d.ts +1 -1
- package/dist/native.d.ts.map +1 -1
- package/dist/native.esm.js +1 -1
- package/dist/schemas/launchpad.d.ts +3 -2
- package/dist/schemas/launchpad.d.ts.map +1 -1
- package/dist/schemas/primitives.d.ts +12 -2
- package/dist/schemas/primitives.d.ts.map +1 -1
- package/dist/schemas/user.d.ts +3 -3
- package/dist/schemas/validators.d.ts +3 -3
- package/dist/services/ApiKeyService.d.ts +1 -1
- package/dist/services/BanService.d.ts +1 -1
- package/dist/services/ChartService.d.ts.map +1 -1
- package/dist/services/ContentReactionService.d.ts +6 -18
- package/dist/services/ContentReactionService.d.ts.map +1 -1
- package/dist/services/EventsQueryService.d.ts +47 -0
- package/dist/services/EventsQueryService.d.ts.map +1 -0
- package/dist/services/GalaChainLockService.d.ts.map +1 -1
- package/dist/services/GalaChainTransferService.d.ts.map +1 -1
- package/dist/services/HealthService.d.ts +33 -0
- package/dist/services/HealthService.d.ts.map +1 -0
- package/dist/services/ImageService.d.ts +3 -3
- package/dist/services/ImageService.d.ts.map +1 -1
- package/dist/services/LaunchpadPriceService.d.ts.map +1 -1
- package/dist/services/LaunchpadService.d.ts +34 -42
- package/dist/services/LaunchpadService.d.ts.map +1 -1
- package/dist/services/MessagesService.d.ts +12 -44
- package/dist/services/MessagesService.d.ts.map +1 -1
- package/dist/services/ModeratorService.d.ts +2 -2
- package/dist/services/ModeratorService.d.ts.map +1 -1
- package/dist/services/OverseerService.d.ts +3 -3
- package/dist/services/OverseerService.d.ts.map +1 -1
- package/dist/services/PlatformStatsService.d.ts +1 -2
- package/dist/services/PlatformStatsService.d.ts.map +1 -1
- package/dist/services/PoolService.d.ts +31 -65
- package/dist/services/PoolService.d.ts.map +1 -1
- package/dist/services/RestrictedNamesService.d.ts +1 -1
- package/dist/services/RestrictedNamesService.d.ts.map +1 -1
- package/dist/services/StreamChatService.d.ts +8 -19
- package/dist/services/StreamChatService.d.ts.map +1 -1
- package/dist/services/StreamTokenServiceBase.d.ts +2 -1
- package/dist/services/StreamTokenServiceBase.d.ts.map +1 -1
- package/dist/services/StreamWebSocketService.d.ts +423 -451
- package/dist/services/StreamWebSocketService.d.ts.map +1 -1
- package/dist/services/StreamingService.d.ts +14 -15
- package/dist/services/StreamingService.d.ts.map +1 -1
- package/dist/services/TokenBanService.d.ts +1 -1
- package/dist/services/TradeService.d.ts +13 -9
- package/dist/services/TradeService.d.ts.map +1 -1
- package/dist/services/TradingQuotesService.d.ts.map +1 -1
- package/dist/services/UserService.d.ts +64 -20
- package/dist/services/UserService.d.ts.map +1 -1
- package/dist/services/realtime/event-catalog.d.ts +456 -0
- package/dist/services/realtime/event-catalog.d.ts.map +1 -0
- package/dist/services/shared/pagination-helpers.d.ts +22 -5
- package/dist/services/shared/pagination-helpers.d.ts.map +1 -1
- package/dist/services/shared/service-validators.d.ts.map +1 -1
- package/dist/signing/signers.d.ts +57 -1
- package/dist/signing/signers.d.ts.map +1 -1
- package/dist/types/api-key.dto.d.ts +1 -1
- package/dist/types/ban.dto.d.ts +21 -16
- package/dist/types/ban.dto.d.ts.map +1 -1
- package/dist/types/chat-messages.dto.d.ts +10 -72
- package/dist/types/chat-messages.dto.d.ts.map +1 -1
- package/dist/types/comments.dto.d.ts +8 -78
- package/dist/types/comments.dto.d.ts.map +1 -1
- package/dist/types/common.d.ts +40 -62
- package/dist/types/common.d.ts.map +1 -1
- package/dist/types/constraints.d.ts +47 -23
- package/dist/types/constraints.d.ts.map +1 -1
- package/dist/types/content-flag.dto.d.ts +5 -1
- package/dist/types/content-flag.dto.d.ts.map +1 -1
- package/dist/types/content-reactions.dto.d.ts +0 -4
- package/dist/types/content-reactions.dto.d.ts.map +1 -1
- package/dist/types/engagement-stats.dto.d.ts +16 -27
- package/dist/types/engagement-stats.dto.d.ts.map +1 -1
- package/dist/types/events.dto.d.ts +89 -0
- package/dist/types/events.dto.d.ts.map +1 -1
- package/dist/types/global-feed.dto.d.ts +23 -164
- package/dist/types/global-feed.dto.d.ts.map +1 -1
- package/dist/types/health.dto.d.ts +32 -0
- package/dist/types/health.dto.d.ts.map +1 -0
- package/dist/types/launchpad.dto.d.ts +99 -66
- package/dist/types/launchpad.dto.d.ts.map +1 -1
- package/dist/types/messages.dto.d.ts +168 -118
- package/dist/types/messages.dto.d.ts.map +1 -1
- package/dist/types/moderator.dto.d.ts +1 -1
- package/dist/types/options.dto.d.ts +1 -3
- package/dist/types/options.dto.d.ts.map +1 -1
- package/dist/types/overseer.dto.d.ts +2 -1
- package/dist/types/overseer.dto.d.ts.map +1 -1
- package/dist/types/platform-stats.dto.d.ts +3 -3
- package/dist/types/realtime-events.dto.d.ts +340 -0
- package/dist/types/realtime-events.dto.d.ts.map +1 -0
- package/dist/types/restricted-names.dto.d.ts +2 -2
- package/dist/types/restricted-names.dto.d.ts.map +1 -1
- package/dist/types/stream-chat.dto.d.ts +15 -14
- package/dist/types/stream-chat.dto.d.ts.map +1 -1
- package/dist/types/streaming.dto.d.ts +73 -104
- package/dist/types/streaming.dto.d.ts.map +1 -1
- package/dist/types/token-ban.dto.d.ts.map +1 -1
- package/dist/types/token-config.dto.d.ts +34 -19
- package/dist/types/token-config.dto.d.ts.map +1 -1
- package/dist/types/trades-query.dto.d.ts +8 -24
- package/dist/types/trades-query.dto.d.ts.map +1 -1
- package/dist/types/user.dto.d.ts +126 -50
- package/dist/types/user.dto.d.ts.map +1 -1
- package/dist/types/websocket-events.dto.d.ts +5 -5
- package/dist/types/websocket-events.dto.d.ts.map +1 -1
- package/dist/utils/address-formatter.d.ts +15 -0
- package/dist/utils/address-formatter.d.ts.map +1 -1
- package/dist/utils/auto-pagination.d.ts +1 -1
- package/dist/utils/auto-pagination.d.ts.map +1 -1
- package/dist/utils/error-factories.d.ts +8 -7
- package/dist/utils/error-factories.d.ts.map +1 -1
- package/dist/utils/errors.d.ts +54 -11
- package/dist/utils/errors.d.ts.map +1 -1
- package/dist/utils/http.d.ts +24 -3
- package/dist/utils/http.d.ts.map +1 -1
- package/dist/utils/message-validators.d.ts.map +1 -1
- package/dist/utils/pagination-helpers.d.ts +17 -0
- package/dist/utils/pagination-helpers.d.ts.map +1 -1
- package/dist/utils/pagination-validation.d.ts +2 -2
- package/dist/utils/response-handlers.d.ts.map +1 -1
- package/dist/utils/service-validators.d.ts +6 -6
- package/dist/utils/service-validators.d.ts.map +1 -1
- package/dist/utils/validation-helpers.d.ts +18 -59
- package/dist/utils/validation-helpers.d.ts.map +1 -1
- package/dist/utils/validation.d.ts +4 -1
- package/dist/utils/validation.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/services/StreamingEventService.d.ts +0 -441
- package/dist/services/StreamingEventService.d.ts.map +0 -1
- package/dist/types/comment.dto.d.ts +0 -176
- package/dist/types/comment.dto.d.ts.map +0 -1
- package/dist/types/streaming-events.dto.d.ts +0 -605
- package/dist/types/streaming-events.dto.d.ts.map +0 -1
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type HttpRequestor } from '@gala-chain/gala-core-sdk';
|
|
2
2
|
import type { LaunchpadSigner } from '../signing/types.js';
|
|
3
|
+
import { type BundleAttachment } from './transport.js';
|
|
3
4
|
/** Result delivered by the bundle socket or its REST confirmation fallback. */
|
|
4
5
|
export interface BundleResult {
|
|
5
6
|
status: 'PROCESSED' | 'FAILED';
|
|
@@ -13,8 +14,19 @@ export interface BundleSocket {
|
|
|
13
14
|
export type SocketFactory = (url: string) => BundleSocket;
|
|
14
15
|
/** Options accepted by {@link BundleSubmission.wait}. */
|
|
15
16
|
export interface BundleWaitOptions {
|
|
17
|
+
/** How long to wait in all (default 60 s). The deadline ends the wait with `BUNDLE_CONFIRMATION_TIMEOUT`. */
|
|
16
18
|
timeoutMs?: number;
|
|
19
|
+
/** Pause between confirmation reads (default 2.5 s); a read that failed is repeated after it too. */
|
|
17
20
|
pollIntervalMs?: number;
|
|
21
|
+
/**
|
|
22
|
+
* Stop waiting. An aborted wait rejects with `LaunchpadSDKError` `BUNDLE_WAIT_ABORTED` and stops
|
|
23
|
+
* everything it started (its reads, their pause, its deadline timer, its socket listener; a
|
|
24
|
+
* socket the transport opened is disconnected, a borrowed `bundleSocketFactory` socket is not).
|
|
25
|
+
* Aborting stops WATCHING only: the bundle may still be processed, and `attach` resumes it. A
|
|
26
|
+
* signal that is already aborted rejects at once, before a socket is opened or a read is sent.
|
|
27
|
+
* @since 9.0.0
|
|
28
|
+
*/
|
|
29
|
+
signal?: AbortSignal;
|
|
18
30
|
}
|
|
19
31
|
/** A submitted launchpad bundle that can be confirmed through socket or REST. */
|
|
20
32
|
export declare class BundleSubmission {
|
|
@@ -56,7 +68,17 @@ export declare class BundlerTransport {
|
|
|
56
68
|
private readonly signer;
|
|
57
69
|
private readonly walletAddress;
|
|
58
70
|
private readonly socketFactory;
|
|
59
|
-
|
|
71
|
+
private readonly bundleSocketFactory;
|
|
72
|
+
/**
|
|
73
|
+
* Create a bundler transport with an injectable requestor and socket.
|
|
74
|
+
*
|
|
75
|
+
* @param options.socketFactory - Opens a socket for one `wait()`; the transport disconnects it when
|
|
76
|
+
* the wait ends (default: a socket.io websocket to `bundleBaseUrl`).
|
|
77
|
+
* @param options.bundleSocketFactory - The app's own bundler socket (its reconnect settings, its
|
|
78
|
+
* lifecycle): called once per `wait()`, the transport only adds its listener for the bundle's
|
|
79
|
+
* event and removes it when the wait ends; it never disconnects that socket. Takes precedence
|
|
80
|
+
* over `socketFactory`.
|
|
81
|
+
*/
|
|
60
82
|
constructor(options: {
|
|
61
83
|
bundleBaseUrl: string;
|
|
62
84
|
launchpadBaseUrl: string;
|
|
@@ -64,7 +86,23 @@ export declare class BundlerTransport {
|
|
|
64
86
|
walletAddress: string;
|
|
65
87
|
httpRequestor?: HttpRequestor;
|
|
66
88
|
socketFactory?: SocketFactory;
|
|
89
|
+
bundleSocketFactory?: SocketFactory | undefined;
|
|
67
90
|
});
|
|
91
|
+
/**
|
|
92
|
+
* A submission for a bundle sent earlier (a page that persisted `{ bundleId, method, uniqueKey,
|
|
93
|
+
* tokenName }` and reloaded): its `wait()` confirms exactly as a fresh submission's does (the
|
|
94
|
+
* bundle's socket event raced against the REST confirmation, which also answers for a bundle that
|
|
95
|
+
* settled before this call). Nothing is signed or sent until `wait()`.
|
|
96
|
+
*
|
|
97
|
+
* @throws LaunchpadSDKError `INVALID_BUNDLE_ATTACHMENT` (`details.field`): an empty `bundleId` or
|
|
98
|
+
* `uniqueKey`, a method the bundler does not accept, a `CreateSale` without its `tokenName`.
|
|
99
|
+
* @example
|
|
100
|
+
* ```typescript
|
|
101
|
+
* const submission = transport.attach({ bundleId, method: 'BuyWithNative', uniqueKey });
|
|
102
|
+
* const result = await submission.wait();
|
|
103
|
+
* ```
|
|
104
|
+
*/
|
|
105
|
+
attach(attachment: BundleAttachment): BundleSubmission;
|
|
68
106
|
/**
|
|
69
107
|
* Sign and submit one allowlisted launchpad write to the bundler.
|
|
70
108
|
* @example
|
|
@@ -74,7 +112,24 @@ export declare class BundlerTransport {
|
|
|
74
112
|
* ```
|
|
75
113
|
*/
|
|
76
114
|
submit(request: LaunchpadWriteRequest): Promise<BundleSubmission>;
|
|
115
|
+
/**
|
|
116
|
+
* One confirmation: the bundle's socket event raced against the REST read, until one of them
|
|
117
|
+
* delivers a terminal bundler result (PROCESSED / FAILED), the deadline passes, or the caller
|
|
118
|
+
* aborts. A read that fails (a network error, an HTTP error, an unreadable body) is not a
|
|
119
|
+
* verdict: the next read follows after `pollIntervalMs`, and the socket can still deliver, until
|
|
120
|
+
* the deadline. Whatever ends the wait stops the rest of it (the reads, their delay, the deadline
|
|
121
|
+
* timer, this wait's socket listener; an own socket is disconnected, a borrowed one is not).
|
|
122
|
+
*/
|
|
77
123
|
private waitForResult;
|
|
124
|
+
private confirmationUrl;
|
|
125
|
+
/**
|
|
126
|
+
* The REST leg of a wait. Resolves with the bundle's result, rejects with the bundle's FAILED
|
|
127
|
+
* verdict, and resolves `undefined` when it was stopped (`signal`) or the deadline passed with
|
|
128
|
+
* no verdict. A read that fails is reported through `onReadFailure` (and cleared by the next
|
|
129
|
+
* read that gets an answer) and retried; it never ends the wait.
|
|
130
|
+
*/
|
|
78
131
|
private pollConfirmation;
|
|
132
|
+
/** One confirmation read, as a verdict, "not yet", or a failed read. Never throws. */
|
|
133
|
+
private readConfirmation;
|
|
79
134
|
}
|
|
80
135
|
//# sourceMappingURL=bundle-submission.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle-submission.d.ts","sourceRoot":"","sources":["../../src/launchpad/bundle-submission.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"bundle-submission.d.ts","sourceRoot":"","sources":["../../src/launchpad/bundle-submission.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReverseBondingCurveConfiguration } from '../types/launchpad.dto.js';
|
|
2
|
+
/**
|
|
3
|
+
* Reverse bonding curve (sell fee) configuration a CreateSale carries when the caller names none:
|
|
4
|
+
* 10% at the start of the curve to 50% at the end, the documented defaults and the bundler's
|
|
5
|
+
* allowed range (min >= 0.1, max <= 0.5).
|
|
6
|
+
*/
|
|
7
|
+
export declare const DEFAULT_REVERSE_BONDING_CURVE_CONFIGURATION: Readonly<ReverseBondingCurveConfiguration>;
|
|
8
|
+
/**
|
|
9
|
+
* The canonical BigNumber string of a plain decimal (`5.` -> `5`, `05` -> `5`, `1.50` -> `1.5`), the
|
|
10
|
+
* only spelling the chain parses; `undefined` for anything that is not a plain non-negative decimal.
|
|
11
|
+
*/
|
|
12
|
+
export declare function canonicalDecimal(value: unknown): string | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* Refuse a CreateSale input the bundler or the chain would refuse, before anything is signed.
|
|
15
|
+
*
|
|
16
|
+
* @throws ValidationError (`VALIDATION_ERROR`, field `data`) listing every refused field.
|
|
17
|
+
*/
|
|
18
|
+
export declare function validateCreateSaleInput(input: unknown): void;
|
|
19
|
+
//# sourceMappingURL=create-sale-validation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-sale-validation.d.ts","sourceRoot":"","sources":["../../src/launchpad/create-sale-validation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,2BAA2B,CAAC;AAGlF;;;;GAIG;AACH,eAAO,MAAM,2CAA2C,EAAE,QAAQ,CAAC,gCAAgC,CAGlG,CAAC;AAqCF;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAInE;AAkCD;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CA4C5D"}
|
|
@@ -1,7 +1,27 @@
|
|
|
1
1
|
import type { HttpRequestor } from '@gala-chain/gala-core-sdk';
|
|
2
2
|
import type { BundleSubmission, BundleWaitOptions } from './bundle-submission.js';
|
|
3
|
+
/**
|
|
4
|
+
* The launchpad chaincode methods the bundler accepts (the allowlist), as a closed set.
|
|
5
|
+
*
|
|
6
|
+
* @since 9.0.0
|
|
7
|
+
*/
|
|
8
|
+
export declare const LAUNCHPAD_WRITE_METHODS: readonly ["CreateSale", "BuyWithNative", "BuyExactToken", "SellWithNative", "SellExactToken"];
|
|
3
9
|
/** Allowlisted launchpad chaincode methods accepted by the bundler. */
|
|
4
|
-
export type LaunchpadWriteMethod =
|
|
10
|
+
export type LaunchpadWriteMethod = (typeof LAUNCHPAD_WRITE_METHODS)[number];
|
|
11
|
+
/**
|
|
12
|
+
* A bundle submitted earlier (by this page before a reload, say) to confirm again: what
|
|
13
|
+
* `sdk.launchpad.attach` takes. `bundleId`, `method` and `uniqueKey` are the submission's
|
|
14
|
+
* (`BundleSubmission.bundleId` / `.method` / `.uniqueKey`); `tokenName` is the sale's token name
|
|
15
|
+
* and is required for `CreateSale`, which is confirmed by that token existing.
|
|
16
|
+
*
|
|
17
|
+
* @since 9.0.0
|
|
18
|
+
*/
|
|
19
|
+
export interface BundleAttachment {
|
|
20
|
+
bundleId: string;
|
|
21
|
+
method: LaunchpadWriteMethod;
|
|
22
|
+
uniqueKey: string;
|
|
23
|
+
tokenName?: string | undefined;
|
|
24
|
+
}
|
|
5
25
|
/** Transport seam for launchpad writes; signing belongs to the implementation. */
|
|
6
26
|
export interface LaunchpadWriteTransport {
|
|
7
27
|
/**
|
|
@@ -17,6 +37,16 @@ export interface LaunchpadWriteTransport {
|
|
|
17
37
|
dto: Record<string, unknown>;
|
|
18
38
|
stringsInstructions: string[];
|
|
19
39
|
}): Promise<BundleSubmission>;
|
|
40
|
+
/**
|
|
41
|
+
* A submission for a bundle sent earlier, whose `wait()` confirms it exactly as the submission
|
|
42
|
+
* `submit` returned would. Nothing is signed or sent until `wait()`.
|
|
43
|
+
* @example
|
|
44
|
+
* ```typescript
|
|
45
|
+
* const submission = transport.attach({ bundleId, method: 'BuyWithNative', uniqueKey });
|
|
46
|
+
* await submission.wait();
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
attach(attachment: BundleAttachment): BundleSubmission;
|
|
20
50
|
}
|
|
21
51
|
/** Narrow options shared by the concrete bundler transport factory. */
|
|
22
52
|
export interface LaunchpadTransportOptions {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../src/launchpad/transport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAElF,uEAAuE;AACvE,MAAM,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../src/launchpad/transport.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAElF;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,+FAM1B,CAAC;AAEX,uEAAuE;AACvE,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5E;;;;;;;GAOG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,oBAAoB,CAAC;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAChC;AAED,kFAAkF;AAClF,MAAM,WAAW,uBAAuB;IACtC;;;;;;;OAOG;IACH,MAAM,CAAC,OAAO,EAAE;QACd,MAAM,EAAE,oBAAoB,CAAC;QAC7B,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC7B,mBAAmB,EAAE,MAAM,EAAE,CAAC;KAC/B,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;IAE9B;;;;;;;;OAQG;IACH,MAAM,CAAC,UAAU,EAAE,gBAAgB,GAAG,gBAAgB,CAAC;CACxD;AAED,uEAAuE;AACvE,MAAM,WAAW,yBAAyB;IACxC,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,WAAW,CAAC,EAAE,iBAAiB,CAAC;CACjC"}
|
|
@@ -1,21 +1,26 @@
|
|
|
1
|
-
import type { LaunchTokenData
|
|
1
|
+
import type { LaunchTokenData } from '../types/launchpad.dto.js';
|
|
2
2
|
import type { BundleSubmission } from './bundle-submission.js';
|
|
3
3
|
import type { SellFeeCeilingResolver } from './sell-fee-ceiling.js';
|
|
4
|
-
import type { LaunchpadWriteTransport } from './transport.js';
|
|
4
|
+
import type { BundleAttachment, LaunchpadWriteTransport } from './transport.js';
|
|
5
5
|
/** Common fee fields copied into every frontend trade DTO. */
|
|
6
6
|
export interface LaunchpadExtraFees {
|
|
7
7
|
maxAcceptableReverseBondingCurveFee: string;
|
|
8
8
|
}
|
|
9
|
-
/**
|
|
9
|
+
/**
|
|
10
|
+
* Input for a bundler launchpad trade (`buyWithNative`, `buyExactToken`, `sellWithNative`,
|
|
11
|
+
* `sellExactToken`).
|
|
12
|
+
* @since 9.0.0
|
|
13
|
+
*/
|
|
10
14
|
export interface LaunchpadTradeInput {
|
|
11
15
|
vaultAddress: string;
|
|
12
16
|
quantity: string;
|
|
13
17
|
expectedAmount: string;
|
|
14
18
|
/**
|
|
15
|
-
* The most reverse-bonding-curve fee (GALA) a
|
|
19
|
+
* The most reverse-bonding-curve fee (GALA) a trade may pay. Omit it on a sell and the SDK quotes
|
|
16
20
|
* the fee and allows it plus the SDK fee slippage; pass it to take over (an explicit `'0'` means
|
|
17
|
-
* "reject any fee", which the chain does for every sell on a pool that charges one).
|
|
18
|
-
* such fee
|
|
21
|
+
* "reject any fee", which the chain does for every sell on a pool that charges one). Omit it on a
|
|
22
|
+
* buy and `'0'` is sent (a buy pays no such fee); a value passed on a buy is sent as given, in the
|
|
23
|
+
* signed `extraFees`.
|
|
19
24
|
*/
|
|
20
25
|
extraFees?: LaunchpadExtraFees;
|
|
21
26
|
/** The launchpad token name of `vaultAddress`; saves the SDK one lookup when it quotes a sell. */
|
|
@@ -23,12 +28,13 @@ export interface LaunchpadTradeInput {
|
|
|
23
28
|
uniqueKey?: string;
|
|
24
29
|
}
|
|
25
30
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
31
|
+
* Input for a CreateSale bundler write (`createSale`). The pre-flight refuses only what the deployed
|
|
32
|
+
* bundler or the chain refuses (see `create-sale-validation.ts`): a name of letters and digits, a
|
|
33
|
+
* symbol of letters and digits in any case (the chain upper-cases it), a plain decimal pre-buy and
|
|
34
|
+
* curve portions (signed in their canonical spelling), a non-empty description (at most 1000
|
|
35
|
+
* characters) and image (at most 500).
|
|
36
|
+
* @since 9.0.0
|
|
29
37
|
*/
|
|
30
|
-
export declare const DEFAULT_REVERSE_BONDING_CURVE_CONFIGURATION: Readonly<ReverseBondingCurveConfiguration>;
|
|
31
|
-
/** Input for a CreateSale bundler write. */
|
|
32
38
|
export interface CreateSaleInput extends Omit<LaunchTokenData, 'tokenImage'> {
|
|
33
39
|
tokenImage: string;
|
|
34
40
|
uniqueKey?: string;
|
|
@@ -58,6 +64,26 @@ export declare class LaunchpadWrites {
|
|
|
58
64
|
* ```
|
|
59
65
|
*/
|
|
60
66
|
createSale(input: CreateSaleInput): Promise<BundleSubmission>;
|
|
67
|
+
/**
|
|
68
|
+
* Resume a bundle submitted earlier: persist `{ bundleId, method, uniqueKey }` of a submission
|
|
69
|
+
* (plus `tokenName` for a `CreateSale`), and after a reload `attach` returns a submission whose
|
|
70
|
+
* `wait()` confirms it exactly as the original one would have. Nothing is signed or sent until
|
|
71
|
+
* `wait()`.
|
|
72
|
+
*
|
|
73
|
+
* @throws LaunchpadSDKError `INVALID_BUNDLE_ATTACHMENT` (see `BundlerTransport.attach`).
|
|
74
|
+
* @since 9.0.0
|
|
75
|
+
* @example
|
|
76
|
+
* ```typescript
|
|
77
|
+
* const submission = await sdk.launchpad.buyWithNative({ vaultAddress, quantity: '1', expectedAmount: '2' });
|
|
78
|
+
* sessionStorage.setItem('pendingBundle', JSON.stringify({
|
|
79
|
+
* bundleId: submission.bundleId, method: submission.method, uniqueKey: submission.uniqueKey,
|
|
80
|
+
* }));
|
|
81
|
+
* // after a reload
|
|
82
|
+
* const resumed = sdk.launchpad.attach(JSON.parse(sessionStorage.getItem('pendingBundle') ?? '{}'));
|
|
83
|
+
* const result = await resumed.wait();
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
attach(attachment: BundleAttachment): BundleSubmission;
|
|
61
87
|
/**
|
|
62
88
|
* Buy an exact native quantity through BuyWithNative.
|
|
63
89
|
* @example
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writes.d.ts","sourceRoot":"","sources":["../../src/launchpad/writes.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"writes.d.ts","sourceRoot":"","sources":["../../src/launchpad/writes.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAoC,MAAM,2BAA2B,CAAC;AAEnG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAM/D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAEpE,OAAO,KAAK,EAAE,gBAAgB,EAAwB,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAEtG,8DAA8D;AAC9D,MAAM,WAAW,kBAAkB;IACjC,mCAAmC,EAAE,MAAM,CAAC;CAC7C;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,kBAAkB,CAAC;IAC/B,kGAAkG;IAClG,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,eAAe,EAAE,YAAY,CAAC;IAC1E,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wFAAwF;AACxF,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA0B;IACpD,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;IACvC,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAqC;IAEpE;;;;;OAKG;gBACgB,OAAO,EAAE;QAC1B,SAAS,EAAE,uBAAuB,CAAC;QACnC,aAAa,EAAE,MAAM,CAAC;QACtB,cAAc,CAAC,EAAE,sBAAsB,CAAC;KACzC;IAMD;;;;;;;OAOG;IACI,UAAU,CAAC,KAAK,EAAE,eAAe,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAapE;;;;;;;;;;;;;;;;;;OAkBG;IACI,MAAM,CAAC,UAAU,EAAE,gBAAgB,GAAG,gBAAgB;IAI7D;;;;;;;OAOG;IACI,aAAa,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAO3E;;;;;;OAMG;IACI,aAAa,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAO3E;;;;;;OAMG;IACI,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAO5E;;;;;;OAMG;IACI,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,gBAAgB,CAAC;YAO9D,WAAW;IAkBzB;;;;OAIG;YACW,gBAAgB;CAsB/B"}
|