@forgedevv/core 0.1.0 → 0.3.0
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 +227 -4
- package/README.md +4 -3
- package/dist/addresses.d.ts +73 -7
- package/dist/addresses.js +96 -5
- package/dist/claims.d.ts +43 -6
- package/dist/claims.js +75 -16
- package/dist/config.d.ts +48 -37
- package/dist/config.js +282 -52
- package/dist/constants.d.ts +16 -0
- package/dist/constants.js +20 -0
- package/dist/index.d.ts +9 -5
- package/dist/index.js +15 -4
- package/dist/jupiter-referral.d.ts +334 -0
- package/dist/jupiter-referral.js +666 -0
- package/dist/launch-metadata.d.ts +5 -1
- package/dist/launch-metadata.js +2 -0
- package/dist/meteora-referral.d.ts +119 -0
- package/dist/meteora-referral.js +188 -0
- package/dist/payments.d.ts +17 -0
- package/dist/payments.js +20 -2
- package/dist/pool.d.ts +108 -17
- package/dist/pool.js +237 -60
- package/dist/position-claims.d.ts +215 -0
- package/dist/position-claims.js +457 -0
- package/dist/priority-fee.d.ts +202 -0
- package/dist/priority-fee.js +322 -0
- package/dist/reads.d.ts +20 -0
- package/dist/reads.js +39 -2
- package/dist/settings.d.ts +73 -0
- package/dist/settings.js +119 -0
- package/dist/swap.d.ts +95 -23
- package/dist/swap.js +144 -30
- package/dist/tx.d.ts +2 -0
- package/dist/tx.js +4 -2
- package/dist/validate.d.ts +14 -1
- package/dist/validate.js +86 -6
- package/package.json +3 -2
|
@@ -0,0 +1,334 @@
|
|
|
1
|
+
import { PublicKey, Transaction, TransactionInstruction, type AccountInfo, type Commitment, type Connection } from '@solana/web3.js';
|
|
2
|
+
import { type PriorityFeeQuote, type PriorityFeeSetting } from './priority-fee.js';
|
|
3
|
+
import { type RetryOptions } from './reads.js';
|
|
4
|
+
/** Jupiter referral program (mainnet-beta). */
|
|
5
|
+
export declare const JUPITER_REFERRAL_PROGRAM_ID: PublicKey;
|
|
6
|
+
/**
|
|
7
|
+
* Jupiter's Ultra project in the referral program (mainnet-beta). The Jupiter Plugin and Ultra
|
|
8
|
+
* `/order` only collect the referral fee into referral accounts of this project.
|
|
9
|
+
* @see https://developers.jup.ag/docs/ultra/add-fees-to-ultra.md
|
|
10
|
+
*/
|
|
11
|
+
export declare const JUPITER_ULTRA_REFERRAL_PROJECT: PublicKey;
|
|
12
|
+
export declare const JUPITER_REFERRAL_ACCOUNT_DISCRIMINATOR: Buffer;
|
|
13
|
+
export declare const JUPITER_PROJECT_DISCRIMINATOR: Buffer;
|
|
14
|
+
export declare const JUPITER_CLAIM_DISCRIMINATOR: Buffer;
|
|
15
|
+
export declare const JUPITER_CLAIM_V2_DISCRIMINATOR: Buffer;
|
|
16
|
+
export declare const JUPITER_CREATE_ADMIN_TOKEN_ACCOUNT_DISCRIMINATOR: Buffer;
|
|
17
|
+
export type JupiterReferralClaimVersion = 'v1' | 'v2';
|
|
18
|
+
export type JupiterReferralErrorCode = 'wrong_cluster' | 'invalid_params' | 'referral_account_not_found' | 'not_a_referral_account' | 'project_not_found' | 'not_a_project' | 'mint_not_found' | 'not_a_mint' | 'partner_mismatch'
|
|
19
|
+
/** The referral account belongs to another project than the expected one (Jupiter Ultra's). */
|
|
20
|
+
| 'project_mismatch'
|
|
21
|
+
/** Funds wait in the v2 collection account, but `claim_v2` needs a named referral account. */
|
|
22
|
+
| 'referral_account_unnamed'
|
|
23
|
+
/** Named, but not the PDA `["referral", project, name]` that `claim_v2` signs with. */
|
|
24
|
+
| 'referral_account_not_pda';
|
|
25
|
+
export declare class JupiterReferralError extends Error {
|
|
26
|
+
readonly code: JupiterReferralErrorCode;
|
|
27
|
+
constructor(code: JupiterReferralErrorCode, message: string, options?: {
|
|
28
|
+
cause?: unknown;
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
export interface JupiterReferralAccount {
|
|
32
|
+
/** Receives the claimed fees (FORGE: the revenue wallet, D34). */
|
|
33
|
+
partner: PublicKey;
|
|
34
|
+
project: PublicKey;
|
|
35
|
+
shareBps: number;
|
|
36
|
+
name: string | null;
|
|
37
|
+
}
|
|
38
|
+
export interface JupiterProject {
|
|
39
|
+
base: PublicKey;
|
|
40
|
+
admin: PublicKey;
|
|
41
|
+
name: string;
|
|
42
|
+
defaultShareBps: number;
|
|
43
|
+
}
|
|
44
|
+
/** `ReferralAccount { partner, project, share_bps: u16, name: Option<String> }`. */
|
|
45
|
+
export declare function decodeJupiterReferralAccount(data: Buffer): JupiterReferralAccount;
|
|
46
|
+
/** `Project { base, admin, name: String, default_share_bps: u16 }`. */
|
|
47
|
+
export declare function decodeJupiterProject(data: Buffer): JupiterProject;
|
|
48
|
+
/** Classic referral token account: PDA `["referral_ata", referral account, mint]`. */
|
|
49
|
+
export declare function deriveJupiterReferralTokenAccount(referralAccount: PublicKey, mint: PublicKey, programId?: PublicKey): PublicKey;
|
|
50
|
+
/**
|
|
51
|
+
* Named referral account: PDA `["referral", project, name]` (`initialize_referral_account_with_name`,
|
|
52
|
+
* and the signer seeds of `claim_v2`). Throws when the name is longer than a seed (32 bytes).
|
|
53
|
+
*/
|
|
54
|
+
export declare function deriveJupiterReferralAccount(project: PublicKey, name: string, programId?: PublicKey): PublicKey;
|
|
55
|
+
/** V2 referral token account: the associated token account of the referral account. */
|
|
56
|
+
export declare function deriveJupiterReferralTokenAccountV2(referralAccount: PublicKey, mint: PublicKey, tokenProgram: PublicKey): PublicKey;
|
|
57
|
+
/** Project authority: PDA `["project_authority", project.base]`. */
|
|
58
|
+
export declare function deriveJupiterProjectAuthority(base: PublicKey, programId?: PublicKey): PublicKey;
|
|
59
|
+
export interface JupiterClaimAccounts {
|
|
60
|
+
/** Signer, pays the network fee (and the partner token account rent, the first time). */
|
|
61
|
+
payer: PublicKey;
|
|
62
|
+
project: PublicKey;
|
|
63
|
+
admin: PublicKey;
|
|
64
|
+
projectAdminTokenAccount: PublicKey;
|
|
65
|
+
referralAccount: PublicKey;
|
|
66
|
+
referralTokenAccount: PublicKey;
|
|
67
|
+
partner: PublicKey;
|
|
68
|
+
partnerTokenAccount: PublicKey;
|
|
69
|
+
mint: PublicKey;
|
|
70
|
+
tokenProgram: PublicKey;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* `claim` (v1) or `claim_v2`: the IDL's accounts in the IDL's order. The two differ only in the
|
|
74
|
+
* position of the program accounts at the end (v1: associated token, system, token; v2: system,
|
|
75
|
+
* token, associated token). No arguments.
|
|
76
|
+
*/
|
|
77
|
+
export declare function buildJupiterReferralClaimIx(accounts: JupiterClaimAccounts, version: JupiterReferralClaimVersion, programId?: PublicKey): TransactionInstruction;
|
|
78
|
+
export interface JupiterCreateAdminTokenAccountAccounts {
|
|
79
|
+
project: PublicKey;
|
|
80
|
+
/** Pays the rent of the admin token account (PDA of the project). */
|
|
81
|
+
projectAuthority: PublicKey;
|
|
82
|
+
admin: PublicKey;
|
|
83
|
+
projectAdminTokenAccount: PublicKey;
|
|
84
|
+
mint: PublicKey;
|
|
85
|
+
tokenProgram: PublicKey;
|
|
86
|
+
}
|
|
87
|
+
/** `create_admin_token_account`: needed once per mint before the first claim of that mint. */
|
|
88
|
+
export declare function buildJupiterCreateAdminTokenAccountIx(accounts: JupiterCreateAdminTokenAccountAccounts, programId?: PublicKey): TransactionInstruction;
|
|
89
|
+
export interface BuildJupiterReferralClaimTxParams {
|
|
90
|
+
connection: Connection;
|
|
91
|
+
/** FORGE_JUPITER_REFERRAL_ACCOUNT (read through addresses.ts by the caller). */
|
|
92
|
+
referralAccount: PublicKey;
|
|
93
|
+
/** Currency to claim (e.g. wrapped SOL or USDC). */
|
|
94
|
+
mint: PublicKey;
|
|
95
|
+
/** Fee payer and only signer. */
|
|
96
|
+
payer: PublicKey;
|
|
97
|
+
/** When given, the referral account's partner must be this key (the revenue wallet, D34). */
|
|
98
|
+
expectedPartner?: PublicKey;
|
|
99
|
+
/**
|
|
100
|
+
* The referral account's project must be this key. Default: `JUPITER_ULTRA_REFERRAL_PROJECT`,
|
|
101
|
+
* the only project the Jupiter Plugin pays.
|
|
102
|
+
*/
|
|
103
|
+
expectedProject?: PublicKey;
|
|
104
|
+
commitment?: Commitment;
|
|
105
|
+
retry?: RetryOptions;
|
|
106
|
+
programId?: PublicKey;
|
|
107
|
+
/**
|
|
108
|
+
* Priority fee read from the cluster for the claim's writable accounts, bounded by this setting
|
|
109
|
+
* (priority-fee.ts): `setComputeUnitLimit` (`JUPITER_REFERRAL_CLAIM_COMPUTE_UNITS`) then
|
|
110
|
+
* `setComputeUnitPrice`, first. Default: none.
|
|
111
|
+
*/
|
|
112
|
+
priority?: PriorityFeeSetting;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Compute unit limit of a Jupiter referral claim with a priority fee: up to two token account
|
|
116
|
+
* creations and two claims (each a token transfer pair), with a wide margin.
|
|
117
|
+
*/
|
|
118
|
+
export declare const JUPITER_REFERRAL_CLAIM_COMPUTE_UNITS = 300000;
|
|
119
|
+
export interface JupiterReferralClaimItem {
|
|
120
|
+
version: JupiterReferralClaimVersion;
|
|
121
|
+
referralTokenAccount: PublicKey;
|
|
122
|
+
/** Raw units held by that referral token account when the transaction was built. */
|
|
123
|
+
amount: bigint;
|
|
124
|
+
}
|
|
125
|
+
export interface JupiterReferralClaimSummary {
|
|
126
|
+
referralAccount: PublicKey;
|
|
127
|
+
partner: PublicKey;
|
|
128
|
+
partnerTokenAccount: PublicKey;
|
|
129
|
+
project: PublicKey;
|
|
130
|
+
/** The project's admin (receives the project's share) and its authority PDA (pays its rent). */
|
|
131
|
+
admin: PublicKey;
|
|
132
|
+
projectAuthority: PublicKey;
|
|
133
|
+
mint: PublicKey;
|
|
134
|
+
tokenProgram: PublicKey;
|
|
135
|
+
/** The funded referral token accounts claimed by the transaction (empty: nothing to claim). */
|
|
136
|
+
claims: JupiterReferralClaimItem[];
|
|
137
|
+
/** True when the transaction also creates the partner's token account (rent paid by `payer`). */
|
|
138
|
+
createsPartnerTokenAccount: boolean;
|
|
139
|
+
/** True when the transaction also creates the project admin's token account (program-paid). */
|
|
140
|
+
createsAdminTokenAccount: boolean;
|
|
141
|
+
}
|
|
142
|
+
export interface JupiterReferralClaimTx {
|
|
143
|
+
/** Unsigned legacy transaction (fee payer and blockhash set), or null when nothing is claimable. */
|
|
144
|
+
transaction: Transaction | null;
|
|
145
|
+
lastValidBlockHeight: number | null;
|
|
146
|
+
summary: JupiterReferralClaimSummary;
|
|
147
|
+
/** The priority fee (price, fee, cap), or null without a `priority` setting or transaction. */
|
|
148
|
+
priorityFee: PriorityFeeQuote | null;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Reads the referral account, its project, the mint and the collection accounts, and builds the
|
|
152
|
+
* claim(s) of every funded collection account of `mint` to the partner's associated token account.
|
|
153
|
+
* Mainnet-beta only (genesis hash). Returns `transaction: null` when nothing is claimable.
|
|
154
|
+
* The referral account must belong to `expectedProject` (default: Jupiter's Ultra project), and a
|
|
155
|
+
* funded v2 collection account is only claimed for a named referral PDA (typed errors otherwise).
|
|
156
|
+
*/
|
|
157
|
+
export declare function buildJupiterReferralClaimTx(p: BuildJupiterReferralClaimTxParams): Promise<JupiterReferralClaimTx>;
|
|
158
|
+
export declare const JUPITER_INITIALIZE_REFERRAL_ACCOUNT_WITH_NAME_DISCRIMINATOR: Buffer;
|
|
159
|
+
/** `ReferralAccount::LEN` = 8 + 32 + 32 + 200 + 2: what the initialization allocates. */
|
|
160
|
+
export declare const JUPITER_REFERRAL_ACCOUNT_SIZE = 274;
|
|
161
|
+
/** `params.name.chars().count() < 20` in the program. */
|
|
162
|
+
export declare const JUPITER_REFERRAL_NAME_MAX_CHARS = 19;
|
|
163
|
+
/** The name is a PDA seed: at most 32 bytes. */
|
|
164
|
+
export declare const JUPITER_REFERRAL_NAME_MAX_BYTES = 32;
|
|
165
|
+
/**
|
|
166
|
+
* Compute unit limit of the setup transaction with a priority fee: one Anchor account
|
|
167
|
+
* initialization and up to a few associated token account creations, with a wide margin.
|
|
168
|
+
*/
|
|
169
|
+
export declare const JUPITER_REFERRAL_SETUP_COMPUTE_UNITS = 150000;
|
|
170
|
+
/**
|
|
171
|
+
* Checks a referral account name: 1 to 19 characters (code points, the program's rule), at most
|
|
172
|
+
* 32 UTF-8 bytes (a PDA seed), and FORGE's own restriction to printable characters without
|
|
173
|
+
* whitespace (a name goes into environment files and documentation). Returns the name.
|
|
174
|
+
* @throws JupiterReferralError `invalid_params`
|
|
175
|
+
*/
|
|
176
|
+
export declare function assertJupiterReferralName(name: string): string;
|
|
177
|
+
/** Borsh `String`: u32 little-endian byte length, then the UTF-8 bytes. */
|
|
178
|
+
export declare function encodeJupiterReferralName(name: string): Buffer;
|
|
179
|
+
export interface JupiterInitializeReferralAccountWithNameAccounts {
|
|
180
|
+
/** Signer: pays the network fee and the referral account rent. */
|
|
181
|
+
payer: PublicKey;
|
|
182
|
+
/** Receives the claimed fees (FORGE: the revenue wallet, D34). Does not sign. */
|
|
183
|
+
partner: PublicKey;
|
|
184
|
+
project: PublicKey;
|
|
185
|
+
/** Must be `deriveJupiterReferralAccount(project, name)`. */
|
|
186
|
+
referralAccount: PublicKey;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* `initialize_referral_account_with_name`: the IDL's accounts in the IDL's order, the Anchor
|
|
190
|
+
* discriminator then the Borsh-encoded `{ name }`. Refuses a referral account that is not the
|
|
191
|
+
* PDA of the project and the name, and a payer, partner, project or referral account that
|
|
192
|
+
* coincide.
|
|
193
|
+
*/
|
|
194
|
+
export declare function buildJupiterInitializeReferralAccountWithNameIx(accounts: JupiterInitializeReferralAccountWithNameAccounts, name: string, programId?: PublicKey): TransactionInstruction;
|
|
195
|
+
export interface JupiterReferralTokenAccountV2Params {
|
|
196
|
+
/** Signer: pays the rent of the token account. */
|
|
197
|
+
payer: PublicKey;
|
|
198
|
+
referralAccount: PublicKey;
|
|
199
|
+
mint: PublicKey;
|
|
200
|
+
/** The mint's program (classic SPL Token or Token-2022). */
|
|
201
|
+
tokenProgram: PublicKey;
|
|
202
|
+
}
|
|
203
|
+
export interface JupiterReferralTokenAccountV2Ix {
|
|
204
|
+
/** `deriveJupiterReferralTokenAccountV2(referralAccount, mint, tokenProgram)`. */
|
|
205
|
+
tokenAccount: PublicKey;
|
|
206
|
+
instruction: TransactionInstruction;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* The v2 collection account of `mint` (what the Jupiter Plugin pays and `claim_v2` empties): an
|
|
210
|
+
* idempotent creation of the referral account's associated token account, paid by `payer`
|
|
211
|
+
* (the SDK's `initializeReferralTokenAccountV2`). Idempotent on-chain: an existing account is
|
|
212
|
+
* left as it is.
|
|
213
|
+
*/
|
|
214
|
+
export declare function buildJupiterReferralTokenAccountV2Ix(p: JupiterReferralTokenAccountV2Params): JupiterReferralTokenAccountV2Ix;
|
|
215
|
+
export interface JupiterReferralSetupMint {
|
|
216
|
+
mint: PublicKey;
|
|
217
|
+
tokenProgram: PublicKey;
|
|
218
|
+
}
|
|
219
|
+
export interface BuildJupiterReferralSetupTxParams {
|
|
220
|
+
/** Fee payer and only signer. */
|
|
221
|
+
payer: PublicKey;
|
|
222
|
+
/** The referral account's partner: the revenue wallet. */
|
|
223
|
+
partner: PublicKey;
|
|
224
|
+
/** Default: `JUPITER_ULTRA_REFERRAL_PROJECT`, the only project the Jupiter Plugin pays. */
|
|
225
|
+
project?: PublicKey;
|
|
226
|
+
name: string;
|
|
227
|
+
/** False when the referral account already exists (only token accounts are then created). */
|
|
228
|
+
createReferralAccount: boolean;
|
|
229
|
+
/** The v2 collection accounts to create (those found absent), in this order. */
|
|
230
|
+
tokenAccounts: readonly JupiterReferralSetupMint[];
|
|
231
|
+
blockhash: string;
|
|
232
|
+
lastValidBlockHeight: number;
|
|
233
|
+
/**
|
|
234
|
+
* Priority fee quote of the caller (`JUPITER_REFERRAL_SETUP_COMPUTE_UNITS`): a unit limit then
|
|
235
|
+
* a unit price are put first when its price is not 0; nothing otherwise.
|
|
236
|
+
*/
|
|
237
|
+
priorityFee?: Pick<PriorityFeeQuote, 'computeUnitLimit' | 'microLamports'>;
|
|
238
|
+
programId?: PublicKey;
|
|
239
|
+
}
|
|
240
|
+
export interface JupiterReferralSetupTokenAccount extends JupiterReferralSetupMint {
|
|
241
|
+
tokenAccount: PublicKey;
|
|
242
|
+
}
|
|
243
|
+
export interface JupiterReferralSetupTx {
|
|
244
|
+
/** Unsigned legacy transaction (fee payer = payer, blockhash set). */
|
|
245
|
+
transaction: Transaction;
|
|
246
|
+
lastValidBlockHeight: number;
|
|
247
|
+
referralAccount: PublicKey;
|
|
248
|
+
project: PublicKey;
|
|
249
|
+
name: string;
|
|
250
|
+
/** The token accounts the transaction creates (same order as the input). */
|
|
251
|
+
tokenAccounts: JupiterReferralSetupTokenAccount[];
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Unsigned transaction setting up FORGE's Jupiter referral account: the optional compute budget,
|
|
255
|
+
* `initialize_referral_account_with_name` when `createReferralAccount`, then one v2 collection
|
|
256
|
+
* account creation per `tokenAccounts` entry. Refuses an empty plan and a duplicate mint. Does
|
|
257
|
+
* not read the chain: inspect first (`readJupiterReferralSetup`). Mainnet-beta is the only
|
|
258
|
+
* cluster where the program and the Ultra project exist; the read helper enforces it.
|
|
259
|
+
*/
|
|
260
|
+
export declare function buildJupiterReferralSetupTx(p: BuildJupiterReferralSetupTxParams): JupiterReferralSetupTx;
|
|
261
|
+
export type JupiterReferralAccountMismatch = 'not_a_referral_account' | 'partner_mismatch' | 'project_mismatch' | 'name_mismatch';
|
|
262
|
+
export type JupiterReferralAccountStatus = {
|
|
263
|
+
status: 'absent';
|
|
264
|
+
} | {
|
|
265
|
+
status: 'ready';
|
|
266
|
+
account: JupiterReferralAccount;
|
|
267
|
+
} | {
|
|
268
|
+
status: 'mismatch';
|
|
269
|
+
reason: JupiterReferralAccountMismatch;
|
|
270
|
+
detail: string;
|
|
271
|
+
};
|
|
272
|
+
export interface JupiterReferralAccountExpectation {
|
|
273
|
+
partner: PublicKey;
|
|
274
|
+
project: PublicKey;
|
|
275
|
+
name: string;
|
|
276
|
+
programId?: PublicKey;
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* What the referral account address holds, against the expected one: absent, ready (a referral
|
|
280
|
+
* account of `project` with `partner` and exactly `name`), or a mismatch with its reason. The
|
|
281
|
+
* caller derives the address as the PDA of the project and the name.
|
|
282
|
+
*/
|
|
283
|
+
export declare function inspectJupiterReferralAccount(info: AccountInfo<Buffer> | null, expected: JupiterReferralAccountExpectation): JupiterReferralAccountStatus;
|
|
284
|
+
export type JupiterReferralTokenAccountMismatch = 'not_a_token_account' | 'wrong_mint' | 'wrong_owner';
|
|
285
|
+
export type JupiterReferralTokenAccountStatus = {
|
|
286
|
+
status: 'absent';
|
|
287
|
+
} | {
|
|
288
|
+
status: 'ready';
|
|
289
|
+
amount: bigint;
|
|
290
|
+
} | {
|
|
291
|
+
status: 'mismatch';
|
|
292
|
+
reason: JupiterReferralTokenAccountMismatch;
|
|
293
|
+
detail: string;
|
|
294
|
+
};
|
|
295
|
+
/**
|
|
296
|
+
* What the v2 collection account address holds: absent, a token account of `mint` owned by the
|
|
297
|
+
* referral account, or not.
|
|
298
|
+
*/
|
|
299
|
+
export declare function inspectJupiterReferralTokenAccountV2(address: PublicKey, info: AccountInfo<Buffer> | null, expected: {
|
|
300
|
+
referralAccount: PublicKey;
|
|
301
|
+
mint: PublicKey;
|
|
302
|
+
tokenProgram: PublicKey;
|
|
303
|
+
}): JupiterReferralTokenAccountStatus;
|
|
304
|
+
export interface ReadJupiterReferralSetupParams {
|
|
305
|
+
connection: Connection;
|
|
306
|
+
partner: PublicKey;
|
|
307
|
+
name: string;
|
|
308
|
+
/** The currencies whose v2 collection accounts are wanted (e.g. wrapped SOL and USDC). */
|
|
309
|
+
mints: readonly PublicKey[];
|
|
310
|
+
/** Default: `JUPITER_ULTRA_REFERRAL_PROJECT`. */
|
|
311
|
+
project?: PublicKey;
|
|
312
|
+
programId?: PublicKey;
|
|
313
|
+
commitment?: Commitment;
|
|
314
|
+
retry?: RetryOptions;
|
|
315
|
+
}
|
|
316
|
+
export interface JupiterReferralSetupTokenAccountState extends JupiterReferralSetupTokenAccount {
|
|
317
|
+
status: JupiterReferralTokenAccountStatus;
|
|
318
|
+
}
|
|
319
|
+
export interface JupiterReferralSetupState {
|
|
320
|
+
project: PublicKey;
|
|
321
|
+
/** The project as decoded on-chain (its admin and default share). */
|
|
322
|
+
projectAccount: JupiterProject;
|
|
323
|
+
name: string;
|
|
324
|
+
referralAccount: PublicKey;
|
|
325
|
+
referral: JupiterReferralAccountStatus;
|
|
326
|
+
tokenAccounts: JupiterReferralSetupTokenAccountState[];
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Reads what the setup needs: the project (must exist and decode), the mints (their token
|
|
330
|
+
* program), the named referral account and its v2 collection accounts, each inspected. Mainnet
|
|
331
|
+
* only (`wrong_cluster` on any other cluster, before any read). The caller decides what to
|
|
332
|
+
* create (the absent ones) and refuses on any mismatch.
|
|
333
|
+
*/
|
|
334
|
+
export declare function readJupiterReferralSetup(p: ReadJupiterReferralSetupParams): Promise<JupiterReferralSetupState>;
|