@streamflow/launchpad 7.5.3-alpha.p284.d53d644 → 7.5.3
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/dist/cjs/index.js +34 -0
- package/dist/cjs/solana/client.js +261 -0
- package/dist/cjs/solana/constants.js +20 -0
- package/dist/cjs/solana/descriptor/idl/streamflow_launchpad.json +1468 -0
- package/dist/cjs/solana/descriptor/streamflow_launchpad.js +2 -0
- package/dist/cjs/solana/lib/derive-accounts.js +22 -0
- package/dist/cjs/solana/types.js +2 -0
- package/dist/esm/index.d.ts +4 -148
- package/dist/esm/index.js +4 -1492
- package/dist/esm/solana/client.d.ts +62 -0
- package/dist/esm/solana/client.js +261 -0
- package/dist/esm/solana/constants.d.ts +12 -0
- package/dist/esm/solana/constants.js +17 -0
- package/dist/esm/solana/descriptor/idl/streamflow_launchpad.json +1391 -930
- package/dist/esm/solana/descriptor/streamflow_launchpad.d.ts +1 -3
- package/dist/esm/solana/descriptor/streamflow_launchpad.js +1 -3
- package/dist/esm/solana/lib/derive-accounts.d.ts +4 -0
- package/dist/esm/solana/lib/derive-accounts.js +13 -0
- package/dist/esm/solana/types.d.ts +61 -0
- package/dist/esm/solana/types.js +1 -0
- package/package.json +18 -38
- package/dist/cjs/index.cjs +0 -1502
- package/dist/cjs/index.cjs.map +0 -1
- package/dist/cjs/index.d.cts +0 -148
- package/dist/cjs/solana/descriptor/streamflow_launchpad.cjs +0 -4
- package/dist/cjs/solana/descriptor/streamflow_launchpad.cjs.map +0 -1
- package/dist/cjs/solana/descriptor/streamflow_launchpad.d.cts +0 -1135
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/solana/descriptor/streamflow_launchpad.js.map +0 -1
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
19
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
20
|
+
};
|
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
22
|
+
if (mod && mod.__esModule) return mod;
|
|
23
|
+
var result = {};
|
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
25
|
+
__setModuleDefault(result, mod);
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.constants = exports.SolanaLaunchpadClient = void 0;
|
|
30
|
+
var client_js_1 = require("./solana/client.js");
|
|
31
|
+
Object.defineProperty(exports, "SolanaLaunchpadClient", { enumerable: true, get: function () { return client_js_1.SolanaLaunchpadClient; } });
|
|
32
|
+
__exportStar(require("./solana/types.js"), exports);
|
|
33
|
+
__exportStar(require("./solana/lib/derive-accounts.js"), exports);
|
|
34
|
+
exports.constants = __importStar(require("./solana/constants.js"));
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.SolanaLaunchpadClient = void 0;
|
|
7
|
+
const anchor_1 = require("@coral-xyz/anchor");
|
|
8
|
+
const spl_token_1 = require("@solana/spl-token");
|
|
9
|
+
const web3_js_1 = require("@solana/web3.js");
|
|
10
|
+
const common_1 = require("@streamflow/common");
|
|
11
|
+
const solana_1 = require("@streamflow/common/solana");
|
|
12
|
+
const solana_2 = require("@streamflow/stream/solana");
|
|
13
|
+
const bn_js_1 = __importDefault(require("bn.js"));
|
|
14
|
+
const constants_js_1 = require("./constants.js");
|
|
15
|
+
const streamflow_launchpad_json_1 = __importDefault(require("./descriptor/idl/streamflow_launchpad.json"));
|
|
16
|
+
const derive_accounts_js_1 = require("./lib/derive-accounts.js");
|
|
17
|
+
class SolanaLaunchpadClient {
|
|
18
|
+
constructor({ clusterUrl, cluster = common_1.ICluster.Mainnet, commitment = "confirmed", programIds, sendRate = 1, sendThrottler, }) {
|
|
19
|
+
this.commitment = commitment;
|
|
20
|
+
if (!clusterUrl) {
|
|
21
|
+
switch (cluster) {
|
|
22
|
+
case common_1.ICluster.Mainnet:
|
|
23
|
+
clusterUrl = (0, web3_js_1.clusterApiUrl)("mainnet-beta");
|
|
24
|
+
break;
|
|
25
|
+
case common_1.ICluster.Local:
|
|
26
|
+
clusterUrl = "http://localhost:8899";
|
|
27
|
+
break;
|
|
28
|
+
default:
|
|
29
|
+
clusterUrl = (0, web3_js_1.clusterApiUrl)(cluster);
|
|
30
|
+
break;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
this.connection = new web3_js_1.Connection(clusterUrl, this.commitment);
|
|
34
|
+
this.cluster = cluster;
|
|
35
|
+
this.sendThrottler = sendThrottler ?? (0, solana_1.buildSendThrottler)(sendRate);
|
|
36
|
+
const launchpadIdl = {
|
|
37
|
+
...streamflow_launchpad_json_1.default,
|
|
38
|
+
address: programIds?.launchpad ?? constants_js_1.PROGRAM_ID[cluster] ?? streamflow_launchpad_json_1.default.address,
|
|
39
|
+
};
|
|
40
|
+
this.program = new anchor_1.Program(launchpadIdl, {
|
|
41
|
+
connection: this.connection,
|
|
42
|
+
});
|
|
43
|
+
this.dynamicVestingId = (0, solana_1.pk)(programIds?.dynamicVesting ? programIds.dynamicVesting : solana_2.constants.ALIGNED_UNLOCKS_PROGRAM_ID[cluster]);
|
|
44
|
+
this.vestingId = (0, solana_1.pk)(programIds?.vesting ? programIds.vesting : solana_2.constants.PROGRAM_ID[cluster]);
|
|
45
|
+
}
|
|
46
|
+
getCurrentProgramId() {
|
|
47
|
+
(0, common_1.invariant)(this.program, `Program is not found`);
|
|
48
|
+
return this.program.programId;
|
|
49
|
+
}
|
|
50
|
+
getCommitment() {
|
|
51
|
+
return typeof this.commitment == "string" ? this.commitment : this.commitment.commitment;
|
|
52
|
+
}
|
|
53
|
+
getLaunchpad(id) {
|
|
54
|
+
return this.program.account.launchpad.fetch(id);
|
|
55
|
+
}
|
|
56
|
+
searchLaunchpads(criteria = {}) {
|
|
57
|
+
return this.program.account.launchpad.all((0, solana_1.getFilters)(criteria, constants_js_1.LAUNCHPAD_BYTE_OFFSETS));
|
|
58
|
+
}
|
|
59
|
+
getDepositAccount(id) {
|
|
60
|
+
return this.program.account.depositAccount.fetch(id);
|
|
61
|
+
}
|
|
62
|
+
async createLaunchpad(data, extParams) {
|
|
63
|
+
const { ixs, publicKey } = await this.prepareCreateLaunchpadInstructions(data, extParams);
|
|
64
|
+
const { signature } = await this.execute(ixs, extParams);
|
|
65
|
+
return {
|
|
66
|
+
ixs,
|
|
67
|
+
txId: signature,
|
|
68
|
+
metadataId: publicKey,
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
async prepareCreateLaunchpadInstructions({ baseMint: baseMintKey, quoteMint: quoteMintKey, receiver, priceOracle, nonce, price, individualDepositingCap, maxDepositingCap, depositingStartTs, depositingEndTs, vestingStartTs, vestingEndTs, vestingPeriod, oracleType, minPrice, maxPrice, minPercentage, maxPercentage, tickSize, skipInitial, isMemoRequired, tokenProgramId = spl_token_1.TOKEN_PROGRAM_ID, }, extParams) {
|
|
72
|
+
baseMintKey = (0, solana_1.pk)(baseMintKey);
|
|
73
|
+
quoteMintKey = (0, solana_1.pk)(quoteMintKey);
|
|
74
|
+
const authority = extParams.invoker.publicKey;
|
|
75
|
+
(0, common_1.invariant)(authority, "Undefined creator publicKey");
|
|
76
|
+
if (!priceOracle && oracleType && !["none", "test"].includes(oracleType)) {
|
|
77
|
+
throw new Error("Price oracle is required for the specified oracle type");
|
|
78
|
+
}
|
|
79
|
+
receiver = receiver ?? (0, spl_token_1.getAssociatedTokenAddressSync)(quoteMintKey, authority);
|
|
80
|
+
const oracle = priceOracle ?? (0, solana_2.deriveTestOraclePDA)(this.dynamicVestingId, baseMintKey, authority);
|
|
81
|
+
const launchpadPDA = (0, derive_accounts_js_1.deriveLaunchpadPDA)(this.program.programId, baseMintKey, nonce);
|
|
82
|
+
const createIx = await this.program.methods
|
|
83
|
+
.createLaunchpad({
|
|
84
|
+
nonce,
|
|
85
|
+
price,
|
|
86
|
+
individualDepositingCap,
|
|
87
|
+
maxDepositingCap,
|
|
88
|
+
depositingStartTs: new bn_js_1.default(depositingStartTs),
|
|
89
|
+
depositingEndTs: new bn_js_1.default(depositingEndTs),
|
|
90
|
+
vestingStartTs: new bn_js_1.default(vestingStartTs),
|
|
91
|
+
vestingEndTs: new bn_js_1.default(vestingEndTs),
|
|
92
|
+
vestingPeriod: new bn_js_1.default(vestingPeriod),
|
|
93
|
+
oracleType: (!!oracleType ? { [oracleType]: {} } : { none: {} }),
|
|
94
|
+
minPrice: (0, common_1.getBN)(minPrice, solana_2.constants.ALIGNED_PRECISION_FACTOR_POW),
|
|
95
|
+
maxPrice: (0, common_1.getBN)(maxPrice, solana_2.constants.ALIGNED_PRECISION_FACTOR_POW),
|
|
96
|
+
minPercentage: (0, common_1.getBN)(minPercentage, solana_2.constants.ALIGNED_PRECISION_FACTOR_POW),
|
|
97
|
+
maxPercentage: (0, common_1.getBN)(maxPercentage, solana_2.constants.ALIGNED_PRECISION_FACTOR_POW),
|
|
98
|
+
tickSize: (0, common_1.getBN)(tickSize, solana_2.constants.ALIGNED_PRECISION_FACTOR_POW),
|
|
99
|
+
skipInitial,
|
|
100
|
+
isMemoRequired,
|
|
101
|
+
})
|
|
102
|
+
.accounts({
|
|
103
|
+
authority,
|
|
104
|
+
baseMint: baseMintKey,
|
|
105
|
+
quoteMint: quoteMintKey,
|
|
106
|
+
receiver: receiver,
|
|
107
|
+
priceOracle: oracle,
|
|
108
|
+
tokenProgram: tokenProgramId,
|
|
109
|
+
})
|
|
110
|
+
.instruction();
|
|
111
|
+
return { ixs: [createIx], publicKey: launchpadPDA };
|
|
112
|
+
}
|
|
113
|
+
async fundLaunchpad(data, extParams) {
|
|
114
|
+
const { ixs } = await this.prepareFundLaunchpadInstructions(data, extParams);
|
|
115
|
+
const { signature } = await this.execute(ixs, extParams);
|
|
116
|
+
return {
|
|
117
|
+
ixs,
|
|
118
|
+
txId: signature,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
async prepareFundLaunchpadInstructions({ launchpad: launchpadKey, amount, baseMint: baseMintKey, tokenProgramId = spl_token_1.TOKEN_PROGRAM_ID }, extParams) {
|
|
122
|
+
const authority = extParams.invoker.publicKey;
|
|
123
|
+
(0, common_1.invariant)(authority, "Undefined authority publicKey");
|
|
124
|
+
if (!baseMintKey) {
|
|
125
|
+
baseMintKey = (await this.getLaunchpad(launchpadKey)).baseMint;
|
|
126
|
+
}
|
|
127
|
+
const { mint } = await (0, solana_1.getMintAndProgram)(this.connection, (0, solana_1.pk)(baseMintKey));
|
|
128
|
+
return {
|
|
129
|
+
ixs: [
|
|
130
|
+
...(await (0, solana_1.checkOrCreateAtaBatch)(this.connection, [(0, solana_1.pk)(launchpadKey)], (0, solana_1.pk)(baseMintKey), extParams.invoker, (0, solana_1.pk)(tokenProgramId))),
|
|
131
|
+
(0, spl_token_1.createTransferCheckedInstruction)((0, spl_token_1.getAssociatedTokenAddressSync)(mint.address, authority, true, (0, solana_1.pk)(tokenProgramId)), mint.address, (0, spl_token_1.getAssociatedTokenAddressSync)(mint.address, (0, solana_1.pk)(launchpadKey), true, (0, solana_1.pk)(tokenProgramId)), authority, BigInt(amount.toString()), mint.decimals, undefined, (0, solana_1.pk)(tokenProgramId)),
|
|
132
|
+
],
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
async deposit(data, extParams) {
|
|
136
|
+
const { ixs } = await this.prepareDepositInstructions(data, extParams);
|
|
137
|
+
const { signature } = await this.execute(ixs, extParams);
|
|
138
|
+
return {
|
|
139
|
+
ixs,
|
|
140
|
+
txId: signature,
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
async prepareDepositInstructions({ launchpad: launchpadKey, quoteMint: quoteMintKey, amount, autoCap = false, memo, owner, tokenProgramId = spl_token_1.TOKEN_PROGRAM_ID, }, extParams) {
|
|
144
|
+
const payer = extParams.invoker.publicKey;
|
|
145
|
+
(0, common_1.invariant)(payer, "Undefined payer publicKey");
|
|
146
|
+
owner = (0, solana_1.pk)(owner ?? payer);
|
|
147
|
+
if (!quoteMintKey) {
|
|
148
|
+
quoteMintKey = (await this.getLaunchpad(launchpadKey)).quoteMint;
|
|
149
|
+
}
|
|
150
|
+
const depositPDA = (0, derive_accounts_js_1.deriveDepositPDA)(this.program.programId, (0, solana_1.pk)(launchpadKey), owner);
|
|
151
|
+
const ixs = [];
|
|
152
|
+
if (memo) {
|
|
153
|
+
ixs.push(new web3_js_1.TransactionInstruction({
|
|
154
|
+
keys: [{ pubkey: payer, isSigner: true, isWritable: true }],
|
|
155
|
+
data: Buffer.from(memo, "utf-8"),
|
|
156
|
+
programId: new web3_js_1.PublicKey("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr"),
|
|
157
|
+
}));
|
|
158
|
+
}
|
|
159
|
+
ixs.push(await this.program.methods
|
|
160
|
+
.deposit({ amount, autoCap })
|
|
161
|
+
.accounts({
|
|
162
|
+
payer,
|
|
163
|
+
owner: owner,
|
|
164
|
+
from: (0, spl_token_1.getAssociatedTokenAddressSync)((0, solana_1.pk)(quoteMintKey), payer, true, (0, solana_1.pk)(tokenProgramId)),
|
|
165
|
+
launchpad: launchpadKey,
|
|
166
|
+
tokenProgram: tokenProgramId,
|
|
167
|
+
})
|
|
168
|
+
.instruction());
|
|
169
|
+
return { ixs, publicKey: depositPDA };
|
|
170
|
+
}
|
|
171
|
+
async claimDeposits(data, extParams) {
|
|
172
|
+
const { ixs } = await this.prepareClaimDepositsInstructions(data, extParams);
|
|
173
|
+
const { signature } = await this.execute(ixs, extParams);
|
|
174
|
+
return {
|
|
175
|
+
ixs,
|
|
176
|
+
txId: signature,
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
async prepareClaimDepositsInstructions({ launchpad: launchpadKey, tokenProgramId = spl_token_1.TOKEN_PROGRAM_ID }, extParams) {
|
|
180
|
+
const authority = extParams.invoker.publicKey;
|
|
181
|
+
(0, common_1.invariant)(authority, "Undefined authority publicKey");
|
|
182
|
+
return {
|
|
183
|
+
ixs: [
|
|
184
|
+
await this.program.methods
|
|
185
|
+
.claimDeposits()
|
|
186
|
+
.accounts({
|
|
187
|
+
authority,
|
|
188
|
+
launchpad: launchpadKey,
|
|
189
|
+
tokenProgram: tokenProgramId,
|
|
190
|
+
})
|
|
191
|
+
.instruction(),
|
|
192
|
+
],
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
async claimAllocatedVested(data, extParams) {
|
|
196
|
+
if (!extParams.computeLimit) {
|
|
197
|
+
extParams.computeLimit = 280000;
|
|
198
|
+
}
|
|
199
|
+
const { ixs, streamKeypair } = await this.prepareClaimAllocatedVestedInstructions(data, extParams);
|
|
200
|
+
const { signature } = await this.execute(ixs, extParams, streamKeypair);
|
|
201
|
+
return {
|
|
202
|
+
ixs,
|
|
203
|
+
txId: signature,
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
async prepareClaimAllocatedVestedInstructions({ launchpad: launchpadKey, baseMint: baseMintKey, owner, tokenProgramId = spl_token_1.TOKEN_PROGRAM_ID }, extParams) {
|
|
207
|
+
const payer = extParams.invoker.publicKey;
|
|
208
|
+
(0, common_1.invariant)(payer, "Undefined payer publicKey");
|
|
209
|
+
owner = (0, solana_1.pk)(owner ?? payer);
|
|
210
|
+
if (!baseMintKey) {
|
|
211
|
+
baseMintKey = (await this.getLaunchpad(launchpadKey)).baseMint;
|
|
212
|
+
}
|
|
213
|
+
const streamKeypair = web3_js_1.Keypair.generate();
|
|
214
|
+
const streamKey = streamKeypair.publicKey;
|
|
215
|
+
const proxyMetadataKey = (0, solana_2.deriveContractPDA)(this.dynamicVestingId, streamKeypair.publicKey);
|
|
216
|
+
const proxyTokensKey = (0, spl_token_1.getAssociatedTokenAddressSync)((0, solana_1.pk)(baseMintKey), proxyMetadataKey, true);
|
|
217
|
+
const escrowKey = (0, solana_2.deriveEscrowPDA)(this.vestingId, streamKeypair.publicKey);
|
|
218
|
+
const depositKey = (0, derive_accounts_js_1.deriveDepositPDA)(this.program.programId, (0, solana_1.pk)(launchpadKey), owner);
|
|
219
|
+
const ix = await this.program.methods
|
|
220
|
+
.claimAllocatedVested()
|
|
221
|
+
.accounts({
|
|
222
|
+
depositAccount: depositKey,
|
|
223
|
+
payer,
|
|
224
|
+
proxyMetadata: proxyMetadataKey,
|
|
225
|
+
proxyTokens: proxyTokensKey,
|
|
226
|
+
streamMetadata: streamKey,
|
|
227
|
+
escrowTokens: escrowKey,
|
|
228
|
+
withdrawor: solana_2.constants.WITHDRAWOR_PUBLIC_KEY,
|
|
229
|
+
feeOracle: solana_2.constants.FEE_ORACLE_PUBLIC_KEY,
|
|
230
|
+
tokenProgram: tokenProgramId,
|
|
231
|
+
})
|
|
232
|
+
.accountsPartial({
|
|
233
|
+
streamflowProgram: this.vestingId,
|
|
234
|
+
proxyProgram: this.dynamicVestingId,
|
|
235
|
+
})
|
|
236
|
+
.instruction();
|
|
237
|
+
return { ixs: [ix], streamKeypair };
|
|
238
|
+
}
|
|
239
|
+
async execute(ixs, extParams, ...partialSigners) {
|
|
240
|
+
ixs = [...(0, solana_1.prepareBaseInstructions)(this.connection, extParams), ...ixs];
|
|
241
|
+
const { tx, hash, context } = await (0, solana_1.prepareTransaction)(this.connection, ixs, extParams.invoker.publicKey, this.getCommitment(), ...partialSigners);
|
|
242
|
+
try {
|
|
243
|
+
const signature = await (0, solana_1.signAndExecuteTransaction)(this.connection, extParams.invoker, tx, {
|
|
244
|
+
hash,
|
|
245
|
+
context,
|
|
246
|
+
commitment: this.getCommitment(),
|
|
247
|
+
}, { sendThrottler: this.sendThrottler });
|
|
248
|
+
return { signature };
|
|
249
|
+
}
|
|
250
|
+
catch (err) {
|
|
251
|
+
if (err instanceof Error) {
|
|
252
|
+
const parsed = (0, anchor_1.translateError)(err, (0, anchor_1.parseIdlErrors)(this.program.idl));
|
|
253
|
+
if (parsed) {
|
|
254
|
+
throw new common_1.ContractError(err, parsed.name, parsed.message);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
throw err;
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
exports.SolanaLaunchpadClient = SolanaLaunchpadClient;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PROGRAM_ID = exports.LAUNCHPAD_BYTE_OFFSETS = exports.LAUNCHPAD_QUOTE_MINT_OFFSET = exports.LAUNCHPAD_BASE_MINT_OFFSET = exports.ANCHOR_DISCRIMINATOR_OFFSET = exports.DEPOSIT_PREFIX = exports.VAULT_PREFIX = exports.LAUNCHPAD_PREFIX = void 0;
|
|
4
|
+
const common_1 = require("@streamflow/common");
|
|
5
|
+
exports.LAUNCHPAD_PREFIX = Buffer.from("launchpad", "utf-8");
|
|
6
|
+
exports.VAULT_PREFIX = Buffer.from("vault", "utf-8");
|
|
7
|
+
exports.DEPOSIT_PREFIX = Buffer.from("deposit", "utf-8");
|
|
8
|
+
exports.ANCHOR_DISCRIMINATOR_OFFSET = 8;
|
|
9
|
+
exports.LAUNCHPAD_BASE_MINT_OFFSET = exports.ANCHOR_DISCRIMINATOR_OFFSET + 8;
|
|
10
|
+
exports.LAUNCHPAD_QUOTE_MINT_OFFSET = exports.ANCHOR_DISCRIMINATOR_OFFSET + 32;
|
|
11
|
+
exports.LAUNCHPAD_BYTE_OFFSETS = {
|
|
12
|
+
baseMint: exports.LAUNCHPAD_BASE_MINT_OFFSET,
|
|
13
|
+
quoteMint: exports.LAUNCHPAD_QUOTE_MINT_OFFSET,
|
|
14
|
+
};
|
|
15
|
+
exports.PROGRAM_ID = {
|
|
16
|
+
[common_1.ICluster.Mainnet]: "BUYfFzeTWeRW5JrPjCutbsvzjA5ERS8EnGujJjfmnJu6",
|
|
17
|
+
[common_1.ICluster.Devnet]: "BUYfFzeTWeRW5JrPjCutbsvzjA5ERS8EnGujJjfmnJu6",
|
|
18
|
+
[common_1.ICluster.Testnet]: "BUYfFzeTWeRW5JrPjCutbsvzjA5ERS8EnGujJjfmnJu6",
|
|
19
|
+
[common_1.ICluster.Local]: "BUYfFzeTWeRW5JrPjCutbsvzjA5ERS8EnGujJjfmnJu6",
|
|
20
|
+
};
|