@send-fun/sdk 1.0.1 → 1.2.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.
Files changed (72) hide show
  1. package/README.md +13 -5
  2. package/dist/index.cjs +797 -369
  3. package/dist/index.cjs.map +1 -1
  4. package/dist/index.d.cts +596 -94
  5. package/dist/index.d.cts.map +1 -1
  6. package/dist/index.d.mts +596 -94
  7. package/dist/index.d.mts.map +1 -1
  8. package/dist/index.mjs +527 -99
  9. package/dist/index.mjs.map +1 -1
  10. package/package.json +4 -6
  11. package/src/dex/generated/accounts/globalConfig.ts +39 -2
  12. package/src/dex/generated/accounts/pool.ts +41 -2
  13. package/src/dex/generated/accounts/rewardAccrual.ts +39 -2
  14. package/src/dex/generated/index.ts +1 -0
  15. package/src/dex/generated/instructions/buyExactIn.ts +1 -1
  16. package/src/dex/generated/instructions/buyExactOut.ts +1 -1
  17. package/src/dex/generated/instructions/claimCreatorFees.ts +1 -1
  18. package/src/dex/generated/instructions/claimProtocolFees.ts +1 -1
  19. package/src/dex/generated/instructions/sellExactIn.ts +1 -1
  20. package/src/dex/generated/instructions/sellExactOut.ts +1 -1
  21. package/src/dex/generated/plugins/sendDex.ts +1 -1
  22. package/src/dex/generated/shared/index.ts +52 -0
  23. package/src/dex/trade.ts +12 -13
  24. package/src/launchpad/create.ts +8 -8
  25. package/src/launchpad/generated/accounts/bondingCurve.ts +39 -2
  26. package/src/launchpad/generated/accounts/globalConfig.ts +39 -2
  27. package/src/launchpad/generated/accounts/rewardAccrual.ts +39 -2
  28. package/src/launchpad/generated/index.ts +1 -0
  29. package/src/launchpad/generated/instructions/buyExactIn.ts +1 -1
  30. package/src/launchpad/generated/instructions/buyExactOut.ts +1 -1
  31. package/src/launchpad/generated/instructions/claimCreatorFees.ts +1 -1
  32. package/src/launchpad/generated/instructions/claimProtocolFees.ts +1 -1
  33. package/src/launchpad/generated/instructions/createToken.ts +1 -1
  34. package/src/launchpad/generated/instructions/migrate.ts +1 -1
  35. package/src/launchpad/generated/instructions/sellExactIn.ts +1 -1
  36. package/src/launchpad/generated/instructions/sellExactOut.ts +1 -1
  37. package/src/launchpad/generated/plugins/sendLaunchpad.ts +1 -1
  38. package/src/launchpad/generated/shared/index.ts +52 -0
  39. package/src/launchpad/migrate.ts +1 -1
  40. package/src/launchpad/trade.ts +15 -15
  41. package/src/math/amm.ts +40 -33
  42. package/src/math/fee-decay.ts +3 -2
  43. package/src/math/fees.ts +4 -2
  44. package/src/math/internal.ts +1 -1
  45. package/src/nexus/fee-helpers.ts +5 -3
  46. package/src/nexus/generated/accounts/altRegistry.ts +41 -2
  47. package/src/nexus/generated/accounts/creatorFeeConfig.ts +39 -2
  48. package/src/nexus/generated/accounts/feePreset.ts +41 -2
  49. package/src/nexus/generated/accounts/globalConfig.ts +39 -2
  50. package/src/nexus/generated/accounts/partnerConfig.ts +39 -2
  51. package/src/nexus/generated/accounts/partnerMetadata.ts +39 -2
  52. package/src/nexus/generated/accounts/rewardState.ts +41 -2
  53. package/src/nexus/generated/accounts/stakingConfig.ts +39 -2
  54. package/src/nexus/generated/accounts/userRewardDebt.ts +39 -2
  55. package/src/nexus/generated/accounts/userStakePosition.ts +39 -2
  56. package/src/nexus/generated/index.ts +1 -0
  57. package/src/nexus/generated/instructions/claim.ts +1 -1
  58. package/src/nexus/generated/instructions/createUserRewardDebt.ts +1 -1
  59. package/src/nexus/generated/instructions/settle.ts +1 -1
  60. package/src/nexus/generated/instructions/stake.ts +1 -1
  61. package/src/nexus/generated/instructions/unstake.ts +1 -1
  62. package/src/nexus/generated/plugins/sendNexus.ts +1 -1
  63. package/src/nexus/generated/shared/index.ts +52 -0
  64. package/src/nexus/staking.ts +45 -41
  65. package/src/platform.ts +2 -2
  66. package/src/transfer-fee.ts +19 -17
  67. package/src/utils/chunk.ts +1 -1
  68. package/src/utils/creator-hash.ts +6 -3
  69. package/src/utils/index.ts +2 -0
  70. package/src/utils/mint-info.ts +8 -7
  71. package/src/utils/partner.ts +1 -1
  72. package/src/utils/pda.ts +1 -1
package/dist/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Account, AccountMeta, AccountSignerMeta, Address, ClientWithPayer, ClientWithRpc, ClientWithTransactionPlanning, ClientWithTransactionSending, Codec, Commitment, Decoder, EncodedAccount, Encoder, ExtendedClient, FetchAccountConfig, FetchAccountsConfig, FixedSizeCodec, FixedSizeDecoder, FixedSizeEncoder, GetAccountInfoApi, GetEpochInfoApi, GetMultipleAccountsApi, GetProgramAccountsApi, Instruction, InstructionWithAccounts, InstructionWithData, MaybeAccount, MaybeEncodedAccount, ProgramDerivedAddress, ReadonlyAccount, ReadonlySignerAccount, ReadonlyUint8Array, Rpc, SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM, SolanaError, TransactionSigner, WritableAccount, WritableSignerAccount, fetchEncodedAccount, fetchEncodedAccounts } from "@solana/kit";
2
- import { SelfFetchFunctions, SelfPlanAndSendFunctions } from "@solana/program-client-core";
2
+ import { SelfFetchFunctions, SelfPlanAndSendFunctions } from "@solana/kit/program-client-core";
3
3
  //#region src/dex/generated/programs/sendDex.d.ts
4
4
  declare const SEND_DEX_PROGRAM_ADDRESS: Address<"84qj5FPZZdXkQy8mfowyg6RBZ3XKuTds6XS4ZYT1sfDX">;
5
5
  //#endregion
@@ -47,11 +47,39 @@ declare function getGlobalConfigEncoder$2(): FixedSizeEncoder<GlobalConfigArgs$2
47
47
  declare function getGlobalConfigDecoder$2(): FixedSizeDecoder<GlobalConfig$2>;
48
48
  /** Gets the codec for {@link GlobalConfig} account data. */
49
49
  declare function getGlobalConfigCodec$2(): FixedSizeCodec<GlobalConfigArgs$2, GlobalConfig$2>;
50
+ /**
51
+ * Decodes a `GlobalConfig` account, throwing when another program owns it or its discriminator
52
+ * does not match.
53
+ *
54
+ * Unlike {@link fetchMaybeGlobalConfig}, this throws for an address that only holds lamports rather
55
+ * than returning the non-existing variant: an account passed as existing must never come back as that
56
+ * variant typed as an `Account`. Apply {@link accountIsCreated} first to accounts fetched another way.
57
+ */
50
58
  declare function decodeGlobalConfig$2<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<GlobalConfig$2, TAddress>;
59
+ /**
60
+ * Decodes a `GlobalConfig` account, throwing when another program owns it or its discriminator
61
+ * does not match.
62
+ *
63
+ * Unlike {@link fetchMaybeGlobalConfig}, this throws for an address that only holds lamports rather
64
+ * than returning the non-existing variant: an account passed as existing must never come back as that
65
+ * variant typed as an `Account`. Apply {@link accountIsCreated} first to accounts fetched another way.
66
+ */
51
67
  declare function decodeGlobalConfig$2<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<GlobalConfig$2, TAddress>;
68
+ /** Fetches a `GlobalConfig` account, throwing when it does not exist or only holds lamports. */
52
69
  declare function fetchGlobalConfig$2<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<GlobalConfig$2, TAddress>>;
70
+ /**
71
+ * Fetches a `GlobalConfig` account, or the non-existing variant when the address holds no
72
+ * account or only lamports (see {@link accountIsCreated}).
73
+ * {@link decodeGlobalConfig} throws for a lamports-only account instead.
74
+ */
53
75
  declare function fetchMaybeGlobalConfig$2<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<GlobalConfig$2, TAddress>>;
76
+ /** Fetches `GlobalConfig` accounts, throwing when any does not exist or only holds lamports. */
54
77
  declare function fetchAllGlobalConfig$2(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<GlobalConfig$2>[]>;
78
+ /**
79
+ * Fetches `GlobalConfig` accounts, with the non-existing variant for each address that holds
80
+ * no account or only lamports (see {@link accountIsCreated}).
81
+ * {@link decodeGlobalConfig} throws for a lamports-only account instead.
82
+ */
55
83
  declare function fetchAllMaybeGlobalConfig$2(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<GlobalConfig$2>[]>;
56
84
  declare function getGlobalConfigSize$1(): number;
57
85
  //#endregion
@@ -134,11 +162,39 @@ declare function getPoolEncoder(): FixedSizeEncoder<PoolArgs>;
134
162
  declare function getPoolDecoder(): FixedSizeDecoder<Pool>;
135
163
  /** Gets the codec for {@link Pool} account data. */
136
164
  declare function getPoolCodec(): FixedSizeCodec<PoolArgs, Pool>;
165
+ /**
166
+ * Decodes a `Pool` account, throwing when another program owns it or its discriminator
167
+ * does not match.
168
+ *
169
+ * Unlike {@link fetchMaybePool}, this throws for an address that only holds lamports rather
170
+ * than returning the non-existing variant: an account passed as existing must never come back as that
171
+ * variant typed as an `Account`. Apply {@link accountIsCreated} first to accounts fetched another way.
172
+ */
137
173
  declare function decodePool<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<Pool, TAddress>;
174
+ /**
175
+ * Decodes a `Pool` account, throwing when another program owns it or its discriminator
176
+ * does not match.
177
+ *
178
+ * Unlike {@link fetchMaybePool}, this throws for an address that only holds lamports rather
179
+ * than returning the non-existing variant: an account passed as existing must never come back as that
180
+ * variant typed as an `Account`. Apply {@link accountIsCreated} first to accounts fetched another way.
181
+ */
138
182
  declare function decodePool<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<Pool, TAddress>;
183
+ /** Fetches a `Pool` account, throwing when it does not exist or only holds lamports. */
139
184
  declare function fetchPool<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<Pool, TAddress>>;
185
+ /**
186
+ * Fetches a `Pool` account, or the non-existing variant when the address holds no
187
+ * account or only lamports (see {@link accountIsCreated}).
188
+ * {@link decodePool} throws for a lamports-only account instead.
189
+ */
140
190
  declare function fetchMaybePool<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<Pool, TAddress>>;
191
+ /** Fetches `Pool` accounts, throwing when any does not exist or only holds lamports. */
141
192
  declare function fetchAllPool(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<Pool>[]>;
193
+ /**
194
+ * Fetches `Pool` accounts, with the non-existing variant for each address that holds
195
+ * no account or only lamports (see {@link accountIsCreated}).
196
+ * {@link decodePool} throws for a lamports-only account instead.
197
+ */
142
198
  declare function fetchAllMaybePool(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<Pool>[]>;
143
199
  declare function getPoolSize(): number;
144
200
  //#endregion
@@ -168,11 +224,39 @@ declare function getRewardAccrualEncoder$1(): FixedSizeEncoder<RewardAccrualArgs
168
224
  declare function getRewardAccrualDecoder$1(): FixedSizeDecoder<RewardAccrual$1>;
169
225
  /** Gets the codec for {@link RewardAccrual} account data. */
170
226
  declare function getRewardAccrualCodec$1(): FixedSizeCodec<RewardAccrualArgs$1, RewardAccrual$1>;
227
+ /**
228
+ * Decodes a `RewardAccrual` account, throwing when another program owns it or its discriminator
229
+ * does not match.
230
+ *
231
+ * Unlike {@link fetchMaybeRewardAccrual}, this throws for an address that only holds lamports rather
232
+ * than returning the non-existing variant: an account passed as existing must never come back as that
233
+ * variant typed as an `Account`. Apply {@link accountIsCreated} first to accounts fetched another way.
234
+ */
171
235
  declare function decodeRewardAccrual$1<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<RewardAccrual$1, TAddress>;
236
+ /**
237
+ * Decodes a `RewardAccrual` account, throwing when another program owns it or its discriminator
238
+ * does not match.
239
+ *
240
+ * Unlike {@link fetchMaybeRewardAccrual}, this throws for an address that only holds lamports rather
241
+ * than returning the non-existing variant: an account passed as existing must never come back as that
242
+ * variant typed as an `Account`. Apply {@link accountIsCreated} first to accounts fetched another way.
243
+ */
172
244
  declare function decodeRewardAccrual$1<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<RewardAccrual$1, TAddress>;
245
+ /** Fetches a `RewardAccrual` account, throwing when it does not exist or only holds lamports. */
173
246
  declare function fetchRewardAccrual$1<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<RewardAccrual$1, TAddress>>;
247
+ /**
248
+ * Fetches a `RewardAccrual` account, or the non-existing variant when the address holds no
249
+ * account or only lamports (see {@link accountIsCreated}).
250
+ * {@link decodeRewardAccrual} throws for a lamports-only account instead.
251
+ */
174
252
  declare function fetchMaybeRewardAccrual$1<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<RewardAccrual$1, TAddress>>;
253
+ /** Fetches `RewardAccrual` accounts, throwing when any does not exist or only holds lamports. */
175
254
  declare function fetchAllRewardAccrual$1(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<RewardAccrual$1>[]>;
255
+ /**
256
+ * Fetches `RewardAccrual` accounts, with the non-existing variant for each address that holds
257
+ * no account or only lamports (see {@link accountIsCreated}).
258
+ * {@link decodeRewardAccrual} throws for a lamports-only account instead.
259
+ */
176
260
  declare function fetchAllMaybeRewardAccrual$1(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<RewardAccrual$1>[]>;
177
261
  declare function getRewardAccrualSize$1(): number;
178
262
  //#endregion
@@ -1214,27 +1298,29 @@ declare namespace index_d_exports$19 {
1214
1298
  declare namespace amm_d_exports {
1215
1299
  export { BuyQuote, MintFee, SellQuote, TradeQuote, TransferFeeNotSettleableError, amountAfterFee, buyExactIn$2 as buyExactIn, buyExactOut$2 as buyExactOut, calculateInitialLp, calculateInputForOutput, calculateMarketCap, calculateOutput, calculatePrice, calculateSlippageDown, calculateSlippageUp, feeOn, grossUp, sellExactIn$2 as sellExactIn, sellExactOut$2 as sellExactOut };
1216
1300
  }
1217
- /** Token-2022 `TransferFeeConfig` for the epoch the trade lands in; a stale one misprices the trade. */
1301
+ /** A Token-2022 transfer fee for one epoch. Use the fee for the epoch the trade lands in. */
1218
1302
  interface MintFee {
1219
1303
  /** 0 to 10_000. */
1220
1304
  bps: number;
1221
- /** Cap on the withheld amount, in the mint's raw units. */
1305
+ /** Maximum fee per transfer, in the mint's raw units. */
1222
1306
  maximumFee: bigint;
1223
1307
  }
1224
- /** No transfer lands exactly the requested amount; approximating one hands the program a bound it rejects. */
1308
+ /** Thrown when no transfer delivers exactly `amount` after the transfer fee. */
1225
1309
  declare class TransferFeeNotSettleableError extends RangeError {
1226
1310
  readonly amount: bigint;
1227
1311
  readonly mintFee: MintFee;
1228
1312
  constructor(amount: bigint, mintFee: MintFee);
1229
1313
  }
1230
- /** Rounds up, then caps (SPL's order); swapping them lets a split booking over-credit. */
1314
+ /** Returns the transfer fee on `amount`. Rounds up, then caps at `maximumFee`, in SPL's order.
1315
+ * Returns 0 without `fee`. Throws `RangeError` if `fee` is out of range. */
1231
1316
  declare function feeOn(amount: bigint, fee?: MintFee): bigint;
1232
- /** What lands when `amount` is sent; use `grossUp` to land an exact amount. */
1317
+ /** Returns what the recipient receives when `amount` is sent. `grossUp` is the inverse. */
1233
1318
  declare function amountAfterFee(amount: bigint, fee?: MintFee): bigint;
1234
- /** What must be sent for exactly `amount` to land; throws {@link TransferFeeNotSettleableError} if none does. */
1319
+ /** Returns the amount to send so that exactly `amount` arrives. Returns `amount` without `fee`.
1320
+ * Throws {@link TransferFeeNotSettleableError} if no such amount exists. */
1235
1321
  declare function grossUp(amount: bigint, fee?: MintFee): bigint;
1236
- /** `baseAmount`/`quoteAmount` are the user's transfers, as in on-chain `TradeResult`. Read the net
1237
- * fields on {@link BuyQuote}/{@link SellQuote}; re-deriving them drifts from the program by a rounding step. */
1322
+ /** `baseAmount` and `quoteAmount` are the user's transfers.
1323
+ * Read the net amounts from the fields of {@link BuyQuote} and {@link SellQuote}. Do not calculate them again. */
1238
1324
  interface TradeQuote {
1239
1325
  /** Base sent: vault to user on a buy, user to vault on a sell. */
1240
1326
  baseAmount: bigint;
@@ -1246,24 +1332,26 @@ interface TradeQuote {
1246
1332
  quoteTransferFee: bigint;
1247
1333
  }
1248
1334
  interface BuyQuote extends TradeQuote {
1249
- /** Priced on the quote reaching the vault. */
1335
+ /** Priced on the quote that reaches the vault. */
1250
1336
  fee: bigint;
1251
- /** Base credited to the buyer, after the base mint's cut. */
1337
+ /** Base the buyer receives, after the base mint's transfer fee. */
1252
1338
  baseToUser: bigint;
1253
1339
  /** Equals `quoteAmount`. */
1254
1340
  quoteFromUser: bigint;
1255
1341
  }
1256
1342
  interface SellQuote extends TradeQuote {
1257
- /** Priced on the quote leaving the vault. */
1343
+ /** Priced on the AMM's quote output, before this fee. */
1258
1344
  fee: bigint;
1259
1345
  /** Equals `baseAmount`. */
1260
1346
  baseFromUser: bigint;
1261
- /** Quote credited to the seller, after the quote mint's cut. */
1347
+ /** Quote the seller receives, after the quote mint's transfer fee. */
1262
1348
  quoteToUser: bigint;
1263
1349
  }
1264
- /** Output rounds down (the new reserve rounds up), so `k` never shrinks. */
1350
+ /** Returns the constant-product output for `amountIn`, rounded down. Throws `RangeError` on a zero
1351
+ * reserve, a zero `amountIn`, a zero output, or an output past u64. */
1265
1352
  declare function calculateOutput(reserveIn: bigint, reserveOut: bigint, amountIn: bigint): bigint;
1266
- /** Required input rounds up so the user pays enough. */
1353
+ /** Returns the input needed for `amountOut`, rounded up. Throws `RangeError` on a zero reserve, a zero
1354
+ * `amountOut`, an `amountOut` not below `reserveOut`, or an input past u64. */
1267
1355
  declare function calculateInputForOutput(reserveIn: bigint, reserveOut: bigint, amountOut: bigint): bigint;
1268
1356
  interface BaseQuoteParams {
1269
1357
  reserveQuote: bigint;
@@ -1272,38 +1360,42 @@ interface BaseQuoteParams {
1272
1360
  quoteFee?: MintFee;
1273
1361
  baseFee?: MintFee;
1274
1362
  }
1275
- /** Launchpad only: `bondingCurve.realBaseReserves`. A DEX pool has no cap. */
1363
+ /** `baseReserveCap` is `bondingCurve.realBaseReserves`. A DEX pool has no cap. */
1276
1364
  interface BaseReserveCap {
1277
1365
  baseReserveCap?: bigint;
1278
1366
  }
1279
- /** Guard with `calculateSlippageUp(quoteAmount, bps)`; it already carries the quote mint's cut. */
1367
+ /** Quotes a buy where the buyer receives `baseAmountOut`. With `baseReserveCap`, the vault sends at
1368
+ * most the cap. Guard with `calculateSlippageUp(quoteAmount, bps)`. `quoteAmount` includes the quote
1369
+ * mint's transfer fee. */
1280
1370
  declare function buyExactOut$2(params: BaseQuoteParams & BaseReserveCap & {
1281
1371
  baseAmountOut: bigint;
1282
1372
  }): BuyQuote;
1283
- /** Guard with `calculateSlippageDown(baseToUser, bps)`, not `baseAmount`: the program bounds what the buyer nets. */
1373
+ /** Quotes a buy that spends `quoteAmountIn`. Guard with `calculateSlippageDown(baseToUser, bps)`, not
1374
+ * `baseAmount`. The program checks the minimum against what the buyer receives. */
1284
1375
  declare function buyExactIn$2(params: BaseQuoteParams & BaseReserveCap & {
1285
1376
  quoteAmountIn: bigint;
1286
1377
  }): BuyQuote;
1287
- /** Guard with `calculateSlippageDown(quoteToUser, bps)`, not `quoteAmount`. */
1378
+ /** Quotes a sell of `baseAmountIn`. Guard with `calculateSlippageDown(quoteToUser, bps)`, not `quoteAmount`. */
1288
1379
  declare function sellExactIn$2(params: BaseQuoteParams & {
1289
1380
  baseAmountIn: bigint;
1290
1381
  }): SellQuote;
1291
- /** Guard with `calculateSlippageUp(baseFromUser, bps)`, which already carries the base mint's cut. */
1382
+ /** Quotes a sell where the seller receives `quoteAmountOut`. Guard with
1383
+ * `calculateSlippageUp(baseFromUser, bps)`. `baseFromUser` includes the base mint's transfer fee. */
1292
1384
  declare function sellExactOut$2(params: BaseQuoteParams & {
1293
1385
  quoteAmountOut: bigint;
1294
1386
  }): SellQuote;
1295
1387
  declare function calculateSlippageUp(amount: bigint, slippageBps: number): bigint;
1296
1388
  declare function calculateSlippageDown(amount: bigint, slippageBps: number): bigint;
1297
- /** Floors, as the program's `isqrt` does. */
1389
+ /** Returns `sqrt(quoteAmount * baseAmount)`, rounded down. */
1298
1390
  declare function calculateInitialLp(quoteAmount: bigint, baseAmount: bigint): bigint;
1299
- /** Floating-point quote per base, for display only. */
1391
+ /** Returns the price of one base token in quote tokens, as a float. For display only. */
1300
1392
  declare function calculatePrice(params: {
1301
1393
  quoteReserves: bigint;
1302
1394
  baseReserves: bigint;
1303
1395
  quoteDecimals: number;
1304
1396
  baseDecimals: number;
1305
1397
  }): number;
1306
- /** Market cap in raw quote-token units. */
1398
+ /** Returns the market cap in raw quote units. */
1307
1399
  declare function calculateMarketCap(params: {
1308
1400
  quoteReserves: bigint;
1309
1401
  baseReserves: bigint;
@@ -1311,7 +1403,7 @@ declare function calculateMarketCap(params: {
1311
1403
  }): bigint;
1312
1404
  //#endregion
1313
1405
  //#region src/utils/partner.d.ts
1314
- /** Non-default partners must sign; only `DEFAULT_PARTNER` is valid as a bare address. */
1406
+ /** A partner signer, or `DEFAULT_PARTNER` as a bare address. Any other partner must sign. */
1315
1407
  type PartnerInput = TransactionSigner | typeof DEFAULT_PARTNER;
1316
1408
  declare namespace trade_d_exports$1 {
1317
1409
  export { DexInstructionParams, DexTradeParams, buildBuyExactInInstruction$1 as buildBuyExactInInstruction, buildBuyExactOutInstruction$1 as buildBuyExactOutInstruction, buildSellExactInInstruction$1 as buildSellExactInInstruction, buildSellExactOutInstruction$1 as buildSellExactOutInstruction, buyExactIn$1 as buyExactIn, buyExactOut$1 as buyExactOut, sellExactIn$1 as sellExactIn, sellExactOut$1 as sellExactOut };
@@ -1328,7 +1420,7 @@ interface DexTradeParams {
1328
1420
  partner: PartnerInput;
1329
1421
  platformConfig: Address;
1330
1422
  quoteTokenProgram: Address;
1331
- /** Token-2022 schedule for the epoch the trade lands in; stale or missing skews the slippage bounds. */
1423
+ /** The quote mint's transfer fee for the epoch the trade lands in. A missing or old fee gives wrong slippage bounds. */
1332
1424
  quoteFee?: MintFee;
1333
1425
  baseFee?: MintFee;
1334
1426
  /** {@inheritDoc DexInstructionParams.userQuoteAccount} */
@@ -1344,15 +1436,14 @@ interface DexInstructionParams {
1344
1436
  partner: PartnerInput;
1345
1437
  platformConfig: Address;
1346
1438
  quoteTokenProgram: Address;
1347
- /** Any user-owned quote-mint account. Defaults to the ATA, created mid-trade
1348
- * if missing (payer funds rent), which only rescues a sell. For WSOL,
1349
- * a throwaway `createAccountWithSeed` account is cheaper. */
1439
+ /** Any quote-mint token account that `user` owns. Defaults to the user's ATA.
1440
+ * The program creates a missing ATA, and `payer` pays the rent. */
1350
1441
  userQuoteAccount?: Address;
1351
- /** Any user-owned base-mint account. Defaults to the ATA, created mid-trade
1352
- * if missing (payer funds rent), which only rescues a buy. */
1442
+ /** Any base-mint token account that `user` owns. Defaults to the user's ATA.
1443
+ * The program creates a missing ATA, and `payer` pays the rent. */
1353
1444
  userBaseAccount?: Address;
1354
1445
  }
1355
- /** `baseAmountOut` is net to the buyer: the program reads `amount` as `base_to_user`. */
1446
+ /** `baseAmountOut` is the base the buyer receives, after the base mint's transfer fee. */
1356
1447
  declare function buyExactOut$1(params: DexTradeParams & {
1357
1448
  baseAmountOut: bigint;
1358
1449
  }): Promise<{
@@ -1371,7 +1462,7 @@ declare function sellExactIn$1(params: DexTradeParams & {
1371
1462
  instruction: Instruction;
1372
1463
  quote: SellQuote;
1373
1464
  }>;
1374
- /** `quoteAmountOut` is net to the seller: the program reads `amount` as `quote_to_user`. */
1465
+ /** `quoteAmountOut` is the quote the seller receives, after the quote mint's transfer fee. */
1375
1466
  declare function sellExactOut$1(params: DexTradeParams & {
1376
1467
  quoteAmountOut: bigint;
1377
1468
  }): Promise<{
@@ -1487,11 +1578,39 @@ declare function getBondingCurveEncoder(): FixedSizeEncoder<BondingCurveArgs>;
1487
1578
  declare function getBondingCurveDecoder(): FixedSizeDecoder<BondingCurve>;
1488
1579
  /** Gets the codec for {@link BondingCurve} account data. */
1489
1580
  declare function getBondingCurveCodec(): FixedSizeCodec<BondingCurveArgs, BondingCurve>;
1581
+ /**
1582
+ * Decodes a `BondingCurve` account, throwing when another program owns it or its discriminator
1583
+ * does not match.
1584
+ *
1585
+ * Unlike {@link fetchMaybeBondingCurve}, this throws for an address that only holds lamports rather
1586
+ * than returning the non-existing variant: an account passed as existing must never come back as that
1587
+ * variant typed as an `Account`. Apply {@link accountIsCreated} first to accounts fetched another way.
1588
+ */
1490
1589
  declare function decodeBondingCurve<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<BondingCurve, TAddress>;
1590
+ /**
1591
+ * Decodes a `BondingCurve` account, throwing when another program owns it or its discriminator
1592
+ * does not match.
1593
+ *
1594
+ * Unlike {@link fetchMaybeBondingCurve}, this throws for an address that only holds lamports rather
1595
+ * than returning the non-existing variant: an account passed as existing must never come back as that
1596
+ * variant typed as an `Account`. Apply {@link accountIsCreated} first to accounts fetched another way.
1597
+ */
1491
1598
  declare function decodeBondingCurve<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<BondingCurve, TAddress>;
1599
+ /** Fetches a `BondingCurve` account, throwing when it does not exist or only holds lamports. */
1492
1600
  declare function fetchBondingCurve<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<BondingCurve, TAddress>>;
1601
+ /**
1602
+ * Fetches a `BondingCurve` account, or the non-existing variant when the address holds no
1603
+ * account or only lamports (see {@link accountIsCreated}).
1604
+ * {@link decodeBondingCurve} throws for a lamports-only account instead.
1605
+ */
1493
1606
  declare function fetchMaybeBondingCurve<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<BondingCurve, TAddress>>;
1607
+ /** Fetches `BondingCurve` accounts, throwing when any does not exist or only holds lamports. */
1494
1608
  declare function fetchAllBondingCurve(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<BondingCurve>[]>;
1609
+ /**
1610
+ * Fetches `BondingCurve` accounts, with the non-existing variant for each address that holds
1611
+ * no account or only lamports (see {@link accountIsCreated}).
1612
+ * {@link decodeBondingCurve} throws for a lamports-only account instead.
1613
+ */
1495
1614
  declare function fetchAllMaybeBondingCurve(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<BondingCurve>[]>;
1496
1615
  declare function getBondingCurveSize(): number;
1497
1616
  //#endregion
@@ -1531,11 +1650,39 @@ declare function getGlobalConfigEncoder$1(): FixedSizeEncoder<GlobalConfigArgs$1
1531
1650
  declare function getGlobalConfigDecoder$1(): FixedSizeDecoder<GlobalConfig$1>;
1532
1651
  /** Gets the codec for {@link GlobalConfig} account data. */
1533
1652
  declare function getGlobalConfigCodec$1(): FixedSizeCodec<GlobalConfigArgs$1, GlobalConfig$1>;
1653
+ /**
1654
+ * Decodes a `GlobalConfig` account, throwing when another program owns it or its discriminator
1655
+ * does not match.
1656
+ *
1657
+ * Unlike {@link fetchMaybeGlobalConfig}, this throws for an address that only holds lamports rather
1658
+ * than returning the non-existing variant: an account passed as existing must never come back as that
1659
+ * variant typed as an `Account`. Apply {@link accountIsCreated} first to accounts fetched another way.
1660
+ */
1534
1661
  declare function decodeGlobalConfig$1<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<GlobalConfig$1, TAddress>;
1662
+ /**
1663
+ * Decodes a `GlobalConfig` account, throwing when another program owns it or its discriminator
1664
+ * does not match.
1665
+ *
1666
+ * Unlike {@link fetchMaybeGlobalConfig}, this throws for an address that only holds lamports rather
1667
+ * than returning the non-existing variant: an account passed as existing must never come back as that
1668
+ * variant typed as an `Account`. Apply {@link accountIsCreated} first to accounts fetched another way.
1669
+ */
1535
1670
  declare function decodeGlobalConfig$1<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<GlobalConfig$1, TAddress>;
1671
+ /** Fetches a `GlobalConfig` account, throwing when it does not exist or only holds lamports. */
1536
1672
  declare function fetchGlobalConfig$1<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<GlobalConfig$1, TAddress>>;
1673
+ /**
1674
+ * Fetches a `GlobalConfig` account, or the non-existing variant when the address holds no
1675
+ * account or only lamports (see {@link accountIsCreated}).
1676
+ * {@link decodeGlobalConfig} throws for a lamports-only account instead.
1677
+ */
1537
1678
  declare function fetchMaybeGlobalConfig$1<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<GlobalConfig$1, TAddress>>;
1679
+ /** Fetches `GlobalConfig` accounts, throwing when any does not exist or only holds lamports. */
1538
1680
  declare function fetchAllGlobalConfig$1(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<GlobalConfig$1>[]>;
1681
+ /**
1682
+ * Fetches `GlobalConfig` accounts, with the non-existing variant for each address that holds
1683
+ * no account or only lamports (see {@link accountIsCreated}).
1684
+ * {@link decodeGlobalConfig} throws for a lamports-only account instead.
1685
+ */
1539
1686
  declare function fetchAllMaybeGlobalConfig$1(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<GlobalConfig$1>[]>;
1540
1687
  declare function getGlobalConfigSize(): number;
1541
1688
  //#endregion
@@ -1565,11 +1712,39 @@ declare function getRewardAccrualEncoder(): FixedSizeEncoder<RewardAccrualArgs>;
1565
1712
  declare function getRewardAccrualDecoder(): FixedSizeDecoder<RewardAccrual>;
1566
1713
  /** Gets the codec for {@link RewardAccrual} account data. */
1567
1714
  declare function getRewardAccrualCodec(): FixedSizeCodec<RewardAccrualArgs, RewardAccrual>;
1715
+ /**
1716
+ * Decodes a `RewardAccrual` account, throwing when another program owns it or its discriminator
1717
+ * does not match.
1718
+ *
1719
+ * Unlike {@link fetchMaybeRewardAccrual}, this throws for an address that only holds lamports rather
1720
+ * than returning the non-existing variant: an account passed as existing must never come back as that
1721
+ * variant typed as an `Account`. Apply {@link accountIsCreated} first to accounts fetched another way.
1722
+ */
1568
1723
  declare function decodeRewardAccrual<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<RewardAccrual, TAddress>;
1724
+ /**
1725
+ * Decodes a `RewardAccrual` account, throwing when another program owns it or its discriminator
1726
+ * does not match.
1727
+ *
1728
+ * Unlike {@link fetchMaybeRewardAccrual}, this throws for an address that only holds lamports rather
1729
+ * than returning the non-existing variant: an account passed as existing must never come back as that
1730
+ * variant typed as an `Account`. Apply {@link accountIsCreated} first to accounts fetched another way.
1731
+ */
1569
1732
  declare function decodeRewardAccrual<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<RewardAccrual, TAddress>;
1733
+ /** Fetches a `RewardAccrual` account, throwing when it does not exist or only holds lamports. */
1570
1734
  declare function fetchRewardAccrual<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<RewardAccrual, TAddress>>;
1735
+ /**
1736
+ * Fetches a `RewardAccrual` account, or the non-existing variant when the address holds no
1737
+ * account or only lamports (see {@link accountIsCreated}).
1738
+ * {@link decodeRewardAccrual} throws for a lamports-only account instead.
1739
+ */
1571
1740
  declare function fetchMaybeRewardAccrual<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<RewardAccrual, TAddress>>;
1741
+ /** Fetches `RewardAccrual` accounts, throwing when any does not exist or only holds lamports. */
1572
1742
  declare function fetchAllRewardAccrual(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<RewardAccrual>[]>;
1743
+ /**
1744
+ * Fetches `RewardAccrual` accounts, with the non-existing variant for each address that holds
1745
+ * no account or only lamports (see {@link accountIsCreated}).
1746
+ * {@link decodeRewardAccrual} throws for a lamports-only account instead.
1747
+ */
1573
1748
  declare function fetchAllMaybeRewardAccrual(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<RewardAccrual>[]>;
1574
1749
  declare function getRewardAccrualSize(): number;
1575
1750
  //#endregion
@@ -1714,8 +1889,8 @@ interface CreateTokenParams {
1714
1889
  name: string;
1715
1890
  symbol: string;
1716
1891
  uri: string;
1717
- /** An enabled nexus auth platform (e.g. "wallet"), max 32 bytes; hashed with
1718
- * `creatorId` into the creator fee identity. Unrelated to `platformConfig`. */
1892
+ /** An enabled nexus auth platform, for example "wallet", of at most 32 bytes. It is hashed
1893
+ * with `creatorId` into the creator fee identity. It is not `platformConfig`. */
1719
1894
  creatorPlatform: string;
1720
1895
  creatorId: string;
1721
1896
  partner: PartnerInput;
@@ -1728,11 +1903,11 @@ interface CreateAndBuyParams extends CreateTokenParams {
1728
1903
  slippageBps: number;
1729
1904
  initialVirtualQuoteReserves: bigint;
1730
1905
  initialVirtualBaseReserves: bigint;
1731
- /** `globalConfig.initialRealBaseReserves`: caps the appended buy. */
1906
+ /** `globalConfig.initialRealBaseReserves`. Caps the buy. */
1732
1907
  initialRealBaseReserves: bigint;
1733
- /** Quote mint's Token-2022 schedule for the launch epoch; without it `minAmountOut`
1734
- * ignores the mint's cut, and a cut above `slippageBps` can revert the buy. No
1735
- * `baseFee`: this transaction creates the base mint without the extension. */
1908
+ /** The quote mint's transfer fee for the epoch the launch lands in. Without it, `minAmountOut`
1909
+ * ignores the mint's cut, and a cut above `slippageBps` can make the buy fail. The new base
1910
+ * mint has no transfer fee. */
1736
1911
  quoteFee?: MintFee;
1737
1912
  }
1738
1913
  declare function buildCreateTokenInstruction(params: CreateTokenParams): Promise<Instruction>;
@@ -2901,7 +3076,7 @@ interface MigrateParams {
2901
3076
  caller: TransactionSigner;
2902
3077
  baseMint: Address;
2903
3078
  quoteMint: Address;
2904
- /** `bondingCurve.creatorFeeConfig`; `migrate` rejects any other address. */
3079
+ /** `bondingCurve.creatorFeeConfig`. `migrate` rejects any other address. */
2905
3080
  creatorFeeConfig: Address;
2906
3081
  quoteTokenProgram: Address;
2907
3082
  }
@@ -2921,7 +3096,7 @@ interface LaunchpadTradeParams {
2921
3096
  partner: PartnerInput;
2922
3097
  platformConfig: Address;
2923
3098
  quoteTokenProgram: Address;
2924
- /** Token-2022 schedule for the epoch the trade lands in; stale or missing skews the slippage bounds. */
3099
+ /** The quote mint's transfer fee for the epoch the trade lands in. A missing or old fee gives wrong slippage bounds. */
2925
3100
  quoteFee?: MintFee;
2926
3101
  baseFee?: MintFee;
2927
3102
  /** {@inheritDoc LaunchpadInstructionParams.userQuoteAccount} */
@@ -2940,15 +3115,15 @@ interface LaunchpadInstructionParams {
2940
3115
  partner: PartnerInput;
2941
3116
  platformConfig: Address;
2942
3117
  quoteTokenProgram: Address;
2943
- /** Any user-owned quote-mint account. Defaults to the ATA, created mid-trade
2944
- * if missing (payer funds rent), which only rescues a sell. For WSOL,
2945
- * a throwaway `createAccountWithSeed` account is cheaper. */
3118
+ /** Any quote-mint token account that `user` owns. Defaults to the user's ATA.
3119
+ * The program creates a missing ATA, and `payer` pays the rent. */
2946
3120
  userQuoteAccount?: Address;
2947
- /** Any user-owned base-mint account. Defaults to the ATA, created mid-trade
2948
- * if missing (payer funds rent), which only rescues a buy. */
3121
+ /** Any base-mint token account that `user` owns. Defaults to the user's ATA.
3122
+ * The program creates a missing ATA, and `payer` pays the rent. */
2949
3123
  userBaseAccount?: Address;
2950
3124
  }
2951
- /** `baseAmountOut` is net to the buyer: the program reads `amount` as `base_to_user`. */
3125
+ /** `baseAmountOut` is the base the buyer receives, after the base mint's transfer fee.
3126
+ * The buy is capped at the curve's supply left. Read the result from `quote.baseToUser`. */
2952
3127
  declare function buyExactOut(params: LaunchpadBuyParams & {
2953
3128
  baseAmountOut: bigint;
2954
3129
  }): Promise<{
@@ -2967,7 +3142,7 @@ declare function sellExactIn(params: LaunchpadTradeParams & {
2967
3142
  instruction: Instruction;
2968
3143
  quote: SellQuote;
2969
3144
  }>;
2970
- /** `quoteAmountOut` is net to the seller: the program reads `amount` as `quote_to_user`. */
3145
+ /** `quoteAmountOut` is the quote the seller receives, after the quote mint's transfer fee. */
2971
3146
  declare function sellExactOut(params: LaunchpadTradeParams & {
2972
3147
  quoteAmountOut: bigint;
2973
3148
  }): Promise<{
@@ -2990,7 +3165,7 @@ declare function buildSellExactOutInstruction(params: LaunchpadInstructionParams
2990
3165
  amountOut: bigint;
2991
3166
  maxAmountIn: bigint;
2992
3167
  }): Promise<Instruction>;
2993
- /** Percent of the curve's real base sold (0-100); 100 is the migration threshold. */
3168
+ /** Returns the percent of the curve's real base sold, from 0 to 100. At 100 the curve can migrate. */
2994
3169
  declare function calculateBondingCurveProgress(params: {
2995
3170
  realBaseReserves: bigint;
2996
3171
  initialRealBase: bigint;
@@ -3001,7 +3176,8 @@ declare namespace index_d_exports$1 {
3001
3176
  declare namespace fee_decay_d_exports {
3002
3177
  export { calculateFeeDecayPremium };
3003
3178
  }
3004
- /** Premium in bps, rounded up. */
3179
+ /** Returns the fee decay premium in bps, rounded up. The premium falls quadratically from
3180
+ * `decayStartBps - standardFeeBps` at creation to 0 after `decaySeconds`. */
3005
3181
  declare function calculateFeeDecayPremium(params: {
3006
3182
  currentTimestamp: bigint;
3007
3183
  createdAtTimestamp: bigint;
@@ -3023,10 +3199,12 @@ interface FeeSplit {
3023
3199
  protocol: bigint;
3024
3200
  lp: bigint;
3025
3201
  creator: bigint;
3026
- /** Decay share already included in `protocol`, not a separate payout. */
3202
+ /** The decay premium share. `protocol` includes it. It is not a separate payout. */
3027
3203
  sniper: bigint;
3028
3204
  }
3029
- /** LP/creator round down; protocol absorbs the decay premium and all remainders. */
3205
+ /** Splits `feeAmount` into protocol, LP and creator shares. LP and creator round down. Protocol gets
3206
+ * the decay premium and all remainders. Throws `RangeError` on a negative or non-integer input,
3207
+ * a zero total bps, or `protocolBps + lpBps` above `baseTotalBps`. */
3030
3208
  declare function splitFeeAmount(args: FeeSplitArgs): FeeSplit;
3031
3209
  declare namespace index_d_exports$2 {
3032
3210
  export { amm_d_exports as amm, fee_decay_d_exports as feeDecay, fees_d_exports as fees };
@@ -3054,11 +3232,39 @@ declare function getAltRegistryEncoder(): FixedSizeEncoder<AltRegistryArgs>;
3054
3232
  declare function getAltRegistryDecoder(): FixedSizeDecoder<AltRegistry>;
3055
3233
  /** Gets the codec for {@link AltRegistry} account data. */
3056
3234
  declare function getAltRegistryCodec(): FixedSizeCodec<AltRegistryArgs, AltRegistry>;
3235
+ /**
3236
+ * Decodes a `AltRegistry` account, throwing when another program owns it or its discriminator
3237
+ * does not match.
3238
+ *
3239
+ * Unlike {@link fetchMaybeAltRegistry}, this throws for an address that only holds lamports rather
3240
+ * than returning the non-existing variant: an account passed as existing must never come back as that
3241
+ * variant typed as an `Account`. Apply {@link accountIsCreated} first to accounts fetched another way.
3242
+ */
3057
3243
  declare function decodeAltRegistry<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<AltRegistry, TAddress>;
3244
+ /**
3245
+ * Decodes a `AltRegistry` account, throwing when another program owns it or its discriminator
3246
+ * does not match.
3247
+ *
3248
+ * Unlike {@link fetchMaybeAltRegistry}, this throws for an address that only holds lamports rather
3249
+ * than returning the non-existing variant: an account passed as existing must never come back as that
3250
+ * variant typed as an `Account`. Apply {@link accountIsCreated} first to accounts fetched another way.
3251
+ */
3058
3252
  declare function decodeAltRegistry<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<AltRegistry, TAddress>;
3253
+ /** Fetches a `AltRegistry` account, throwing when it does not exist or only holds lamports. */
3059
3254
  declare function fetchAltRegistry<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<AltRegistry, TAddress>>;
3255
+ /**
3256
+ * Fetches a `AltRegistry` account, or the non-existing variant when the address holds no
3257
+ * account or only lamports (see {@link accountIsCreated}).
3258
+ * {@link decodeAltRegistry} throws for a lamports-only account instead.
3259
+ */
3060
3260
  declare function fetchMaybeAltRegistry<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<AltRegistry, TAddress>>;
3261
+ /** Fetches `AltRegistry` accounts, throwing when any does not exist or only holds lamports. */
3061
3262
  declare function fetchAllAltRegistry(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<AltRegistry>[]>;
3263
+ /**
3264
+ * Fetches `AltRegistry` accounts, with the non-existing variant for each address that holds
3265
+ * no account or only lamports (see {@link accountIsCreated}).
3266
+ * {@link decodeAltRegistry} throws for a lamports-only account instead.
3267
+ */
3062
3268
  declare function fetchAllMaybeAltRegistry(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<AltRegistry>[]>;
3063
3269
  declare function getAltRegistrySize(): number;
3064
3270
  //#endregion
@@ -3088,11 +3294,39 @@ declare function getCreatorFeeConfigEncoder(): FixedSizeEncoder<CreatorFeeConfig
3088
3294
  declare function getCreatorFeeConfigDecoder(): FixedSizeDecoder<CreatorFeeConfig>;
3089
3295
  /** Gets the codec for {@link CreatorFeeConfig} account data. */
3090
3296
  declare function getCreatorFeeConfigCodec(): FixedSizeCodec<CreatorFeeConfigArgs, CreatorFeeConfig>;
3297
+ /**
3298
+ * Decodes a `CreatorFeeConfig` account, throwing when another program owns it or its discriminator
3299
+ * does not match.
3300
+ *
3301
+ * Unlike {@link fetchMaybeCreatorFeeConfig}, this throws for an address that only holds lamports rather
3302
+ * than returning the non-existing variant: an account passed as existing must never come back as that
3303
+ * variant typed as an `Account`. Apply {@link accountIsCreated} first to accounts fetched another way.
3304
+ */
3091
3305
  declare function decodeCreatorFeeConfig<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<CreatorFeeConfig, TAddress>;
3306
+ /**
3307
+ * Decodes a `CreatorFeeConfig` account, throwing when another program owns it or its discriminator
3308
+ * does not match.
3309
+ *
3310
+ * Unlike {@link fetchMaybeCreatorFeeConfig}, this throws for an address that only holds lamports rather
3311
+ * than returning the non-existing variant: an account passed as existing must never come back as that
3312
+ * variant typed as an `Account`. Apply {@link accountIsCreated} first to accounts fetched another way.
3313
+ */
3092
3314
  declare function decodeCreatorFeeConfig<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<CreatorFeeConfig, TAddress>;
3315
+ /** Fetches a `CreatorFeeConfig` account, throwing when it does not exist or only holds lamports. */
3093
3316
  declare function fetchCreatorFeeConfig<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<CreatorFeeConfig, TAddress>>;
3317
+ /**
3318
+ * Fetches a `CreatorFeeConfig` account, or the non-existing variant when the address holds no
3319
+ * account or only lamports (see {@link accountIsCreated}).
3320
+ * {@link decodeCreatorFeeConfig} throws for a lamports-only account instead.
3321
+ */
3094
3322
  declare function fetchMaybeCreatorFeeConfig<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<CreatorFeeConfig, TAddress>>;
3323
+ /** Fetches `CreatorFeeConfig` accounts, throwing when any does not exist or only holds lamports. */
3095
3324
  declare function fetchAllCreatorFeeConfig(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<CreatorFeeConfig>[]>;
3325
+ /**
3326
+ * Fetches `CreatorFeeConfig` accounts, with the non-existing variant for each address that holds
3327
+ * no account or only lamports (see {@link accountIsCreated}).
3328
+ * {@link decodeCreatorFeeConfig} throws for a lamports-only account instead.
3329
+ */
3096
3330
  declare function fetchAllMaybeCreatorFeeConfig(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<CreatorFeeConfig>[]>;
3097
3331
  declare function getCreatorFeeConfigSize(): number;
3098
3332
  //#endregion
@@ -3206,11 +3440,39 @@ declare function getFeePresetEncoder(): Encoder<FeePresetArgs>;
3206
3440
  declare function getFeePresetDecoder(): Decoder<FeePreset>;
3207
3441
  /** Gets the codec for {@link FeePreset} account data. */
3208
3442
  declare function getFeePresetCodec(): Codec<FeePresetArgs, FeePreset>;
3443
+ /**
3444
+ * Decodes a `FeePreset` account, throwing when another program owns it or its discriminator
3445
+ * does not match.
3446
+ *
3447
+ * Unlike {@link fetchMaybeFeePreset}, this throws for an address that only holds lamports rather
3448
+ * than returning the non-existing variant: an account passed as existing must never come back as that
3449
+ * variant typed as an `Account`. Apply {@link accountIsCreated} first to accounts fetched another way.
3450
+ */
3209
3451
  declare function decodeFeePreset<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<FeePreset, TAddress>;
3452
+ /**
3453
+ * Decodes a `FeePreset` account, throwing when another program owns it or its discriminator
3454
+ * does not match.
3455
+ *
3456
+ * Unlike {@link fetchMaybeFeePreset}, this throws for an address that only holds lamports rather
3457
+ * than returning the non-existing variant: an account passed as existing must never come back as that
3458
+ * variant typed as an `Account`. Apply {@link accountIsCreated} first to accounts fetched another way.
3459
+ */
3210
3460
  declare function decodeFeePreset<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<FeePreset, TAddress>;
3461
+ /** Fetches a `FeePreset` account, throwing when it does not exist or only holds lamports. */
3211
3462
  declare function fetchFeePreset<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<FeePreset, TAddress>>;
3463
+ /**
3464
+ * Fetches a `FeePreset` account, or the non-existing variant when the address holds no
3465
+ * account or only lamports (see {@link accountIsCreated}).
3466
+ * {@link decodeFeePreset} throws for a lamports-only account instead.
3467
+ */
3212
3468
  declare function fetchMaybeFeePreset<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<FeePreset, TAddress>>;
3469
+ /** Fetches `FeePreset` accounts, throwing when any does not exist or only holds lamports. */
3213
3470
  declare function fetchAllFeePreset(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<FeePreset>[]>;
3471
+ /**
3472
+ * Fetches `FeePreset` accounts, with the non-existing variant for each address that holds
3473
+ * no account or only lamports (see {@link accountIsCreated}).
3474
+ * {@link decodeFeePreset} throws for a lamports-only account instead.
3475
+ */
3214
3476
  declare function fetchAllMaybeFeePreset(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<FeePreset>[]>;
3215
3477
  //#endregion
3216
3478
  //#region src/nexus/generated/accounts/globalConfig.d.ts
@@ -3239,11 +3501,39 @@ declare function getGlobalConfigEncoder(): Encoder<GlobalConfigArgs>;
3239
3501
  declare function getGlobalConfigDecoder(): Decoder<GlobalConfig>;
3240
3502
  /** Gets the codec for {@link GlobalConfig} account data. */
3241
3503
  declare function getGlobalConfigCodec(): Codec<GlobalConfigArgs, GlobalConfig>;
3504
+ /**
3505
+ * Decodes a `GlobalConfig` account, throwing when another program owns it or its discriminator
3506
+ * does not match.
3507
+ *
3508
+ * Unlike {@link fetchMaybeGlobalConfig}, this throws for an address that only holds lamports rather
3509
+ * than returning the non-existing variant: an account passed as existing must never come back as that
3510
+ * variant typed as an `Account`. Apply {@link accountIsCreated} first to accounts fetched another way.
3511
+ */
3242
3512
  declare function decodeGlobalConfig<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<GlobalConfig, TAddress>;
3513
+ /**
3514
+ * Decodes a `GlobalConfig` account, throwing when another program owns it or its discriminator
3515
+ * does not match.
3516
+ *
3517
+ * Unlike {@link fetchMaybeGlobalConfig}, this throws for an address that only holds lamports rather
3518
+ * than returning the non-existing variant: an account passed as existing must never come back as that
3519
+ * variant typed as an `Account`. Apply {@link accountIsCreated} first to accounts fetched another way.
3520
+ */
3243
3521
  declare function decodeGlobalConfig<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<GlobalConfig, TAddress>;
3522
+ /** Fetches a `GlobalConfig` account, throwing when it does not exist or only holds lamports. */
3244
3523
  declare function fetchGlobalConfig<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<GlobalConfig, TAddress>>;
3524
+ /**
3525
+ * Fetches a `GlobalConfig` account, or the non-existing variant when the address holds no
3526
+ * account or only lamports (see {@link accountIsCreated}).
3527
+ * {@link decodeGlobalConfig} throws for a lamports-only account instead.
3528
+ */
3245
3529
  declare function fetchMaybeGlobalConfig<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<GlobalConfig, TAddress>>;
3530
+ /** Fetches `GlobalConfig` accounts, throwing when any does not exist or only holds lamports. */
3246
3531
  declare function fetchAllGlobalConfig(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<GlobalConfig>[]>;
3532
+ /**
3533
+ * Fetches `GlobalConfig` accounts, with the non-existing variant for each address that holds
3534
+ * no account or only lamports (see {@link accountIsCreated}).
3535
+ * {@link decodeGlobalConfig} throws for a lamports-only account instead.
3536
+ */
3247
3537
  declare function fetchAllMaybeGlobalConfig(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<GlobalConfig>[]>;
3248
3538
  //#endregion
3249
3539
  //#region src/nexus/generated/accounts/partnerConfig.d.ts
@@ -3278,11 +3568,39 @@ declare function getPartnerConfigEncoder(): FixedSizeEncoder<PartnerConfigArgs>;
3278
3568
  declare function getPartnerConfigDecoder(): FixedSizeDecoder<PartnerConfig>;
3279
3569
  /** Gets the codec for {@link PartnerConfig} account data. */
3280
3570
  declare function getPartnerConfigCodec(): FixedSizeCodec<PartnerConfigArgs, PartnerConfig>;
3571
+ /**
3572
+ * Decodes a `PartnerConfig` account, throwing when another program owns it or its discriminator
3573
+ * does not match.
3574
+ *
3575
+ * Unlike {@link fetchMaybePartnerConfig}, this throws for an address that only holds lamports rather
3576
+ * than returning the non-existing variant: an account passed as existing must never come back as that
3577
+ * variant typed as an `Account`. Apply {@link accountIsCreated} first to accounts fetched another way.
3578
+ */
3281
3579
  declare function decodePartnerConfig<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<PartnerConfig, TAddress>;
3580
+ /**
3581
+ * Decodes a `PartnerConfig` account, throwing when another program owns it or its discriminator
3582
+ * does not match.
3583
+ *
3584
+ * Unlike {@link fetchMaybePartnerConfig}, this throws for an address that only holds lamports rather
3585
+ * than returning the non-existing variant: an account passed as existing must never come back as that
3586
+ * variant typed as an `Account`. Apply {@link accountIsCreated} first to accounts fetched another way.
3587
+ */
3282
3588
  declare function decodePartnerConfig<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<PartnerConfig, TAddress>;
3589
+ /** Fetches a `PartnerConfig` account, throwing when it does not exist or only holds lamports. */
3283
3590
  declare function fetchPartnerConfig<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<PartnerConfig, TAddress>>;
3591
+ /**
3592
+ * Fetches a `PartnerConfig` account, or the non-existing variant when the address holds no
3593
+ * account or only lamports (see {@link accountIsCreated}).
3594
+ * {@link decodePartnerConfig} throws for a lamports-only account instead.
3595
+ */
3284
3596
  declare function fetchMaybePartnerConfig<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<PartnerConfig, TAddress>>;
3597
+ /** Fetches `PartnerConfig` accounts, throwing when any does not exist or only holds lamports. */
3285
3598
  declare function fetchAllPartnerConfig(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<PartnerConfig>[]>;
3599
+ /**
3600
+ * Fetches `PartnerConfig` accounts, with the non-existing variant for each address that holds
3601
+ * no account or only lamports (see {@link accountIsCreated}).
3602
+ * {@link decodePartnerConfig} throws for a lamports-only account instead.
3603
+ */
3286
3604
  declare function fetchAllMaybePartnerConfig(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<PartnerConfig>[]>;
3287
3605
  declare function getPartnerConfigSize(): number;
3288
3606
  //#endregion
@@ -3318,11 +3636,39 @@ declare function getPartnerMetadataEncoder(): Encoder<PartnerMetadataArgs>;
3318
3636
  declare function getPartnerMetadataDecoder(): Decoder<PartnerMetadata>;
3319
3637
  /** Gets the codec for {@link PartnerMetadata} account data. */
3320
3638
  declare function getPartnerMetadataCodec(): Codec<PartnerMetadataArgs, PartnerMetadata>;
3639
+ /**
3640
+ * Decodes a `PartnerMetadata` account, throwing when another program owns it or its discriminator
3641
+ * does not match.
3642
+ *
3643
+ * Unlike {@link fetchMaybePartnerMetadata}, this throws for an address that only holds lamports rather
3644
+ * than returning the non-existing variant: an account passed as existing must never come back as that
3645
+ * variant typed as an `Account`. Apply {@link accountIsCreated} first to accounts fetched another way.
3646
+ */
3321
3647
  declare function decodePartnerMetadata<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<PartnerMetadata, TAddress>;
3648
+ /**
3649
+ * Decodes a `PartnerMetadata` account, throwing when another program owns it or its discriminator
3650
+ * does not match.
3651
+ *
3652
+ * Unlike {@link fetchMaybePartnerMetadata}, this throws for an address that only holds lamports rather
3653
+ * than returning the non-existing variant: an account passed as existing must never come back as that
3654
+ * variant typed as an `Account`. Apply {@link accountIsCreated} first to accounts fetched another way.
3655
+ */
3322
3656
  declare function decodePartnerMetadata<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<PartnerMetadata, TAddress>;
3657
+ /** Fetches a `PartnerMetadata` account, throwing when it does not exist or only holds lamports. */
3323
3658
  declare function fetchPartnerMetadata<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<PartnerMetadata, TAddress>>;
3659
+ /**
3660
+ * Fetches a `PartnerMetadata` account, or the non-existing variant when the address holds no
3661
+ * account or only lamports (see {@link accountIsCreated}).
3662
+ * {@link decodePartnerMetadata} throws for a lamports-only account instead.
3663
+ */
3324
3664
  declare function fetchMaybePartnerMetadata<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<PartnerMetadata, TAddress>>;
3665
+ /** Fetches `PartnerMetadata` accounts, throwing when any does not exist or only holds lamports. */
3325
3666
  declare function fetchAllPartnerMetadata(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<PartnerMetadata>[]>;
3667
+ /**
3668
+ * Fetches `PartnerMetadata` accounts, with the non-existing variant for each address that holds
3669
+ * no account or only lamports (see {@link accountIsCreated}).
3670
+ * {@link decodePartnerMetadata} throws for a lamports-only account instead.
3671
+ */
3326
3672
  declare function fetchAllMaybePartnerMetadata(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<PartnerMetadata>[]>;
3327
3673
  //#endregion
3328
3674
  //#region src/nexus/generated/accounts/rewardState.d.ts
@@ -3361,11 +3707,39 @@ declare function getRewardStateEncoder(): FixedSizeEncoder<RewardStateArgs>;
3361
3707
  declare function getRewardStateDecoder(): FixedSizeDecoder<RewardState>;
3362
3708
  /** Gets the codec for {@link RewardState} account data. */
3363
3709
  declare function getRewardStateCodec(): FixedSizeCodec<RewardStateArgs, RewardState>;
3710
+ /**
3711
+ * Decodes a `RewardState` account, throwing when another program owns it or its discriminator
3712
+ * does not match.
3713
+ *
3714
+ * Unlike {@link fetchMaybeRewardState}, this throws for an address that only holds lamports rather
3715
+ * than returning the non-existing variant: an account passed as existing must never come back as that
3716
+ * variant typed as an `Account`. Apply {@link accountIsCreated} first to accounts fetched another way.
3717
+ */
3364
3718
  declare function decodeRewardState<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<RewardState, TAddress>;
3719
+ /**
3720
+ * Decodes a `RewardState` account, throwing when another program owns it or its discriminator
3721
+ * does not match.
3722
+ *
3723
+ * Unlike {@link fetchMaybeRewardState}, this throws for an address that only holds lamports rather
3724
+ * than returning the non-existing variant: an account passed as existing must never come back as that
3725
+ * variant typed as an `Account`. Apply {@link accountIsCreated} first to accounts fetched another way.
3726
+ */
3365
3727
  declare function decodeRewardState<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<RewardState, TAddress>;
3728
+ /** Fetches a `RewardState` account, throwing when it does not exist or only holds lamports. */
3366
3729
  declare function fetchRewardState<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<RewardState, TAddress>>;
3730
+ /**
3731
+ * Fetches a `RewardState` account, or the non-existing variant when the address holds no
3732
+ * account or only lamports (see {@link accountIsCreated}).
3733
+ * {@link decodeRewardState} throws for a lamports-only account instead.
3734
+ */
3367
3735
  declare function fetchMaybeRewardState<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<RewardState, TAddress>>;
3736
+ /** Fetches `RewardState` accounts, throwing when any does not exist or only holds lamports. */
3368
3737
  declare function fetchAllRewardState(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<RewardState>[]>;
3738
+ /**
3739
+ * Fetches `RewardState` accounts, with the non-existing variant for each address that holds
3740
+ * no account or only lamports (see {@link accountIsCreated}).
3741
+ * {@link decodeRewardState} throws for a lamports-only account instead.
3742
+ */
3369
3743
  declare function fetchAllMaybeRewardState(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<RewardState>[]>;
3370
3744
  declare function getRewardStateSize(): number;
3371
3745
  //#endregion
@@ -3409,11 +3783,39 @@ declare function getStakingConfigEncoder(): FixedSizeEncoder<StakingConfigArgs>;
3409
3783
  declare function getStakingConfigDecoder(): FixedSizeDecoder<StakingConfig>;
3410
3784
  /** Gets the codec for {@link StakingConfig} account data. */
3411
3785
  declare function getStakingConfigCodec(): FixedSizeCodec<StakingConfigArgs, StakingConfig>;
3786
+ /**
3787
+ * Decodes a `StakingConfig` account, throwing when another program owns it or its discriminator
3788
+ * does not match.
3789
+ *
3790
+ * Unlike {@link fetchMaybeStakingConfig}, this throws for an address that only holds lamports rather
3791
+ * than returning the non-existing variant: an account passed as existing must never come back as that
3792
+ * variant typed as an `Account`. Apply {@link accountIsCreated} first to accounts fetched another way.
3793
+ */
3412
3794
  declare function decodeStakingConfig<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<StakingConfig, TAddress>;
3795
+ /**
3796
+ * Decodes a `StakingConfig` account, throwing when another program owns it or its discriminator
3797
+ * does not match.
3798
+ *
3799
+ * Unlike {@link fetchMaybeStakingConfig}, this throws for an address that only holds lamports rather
3800
+ * than returning the non-existing variant: an account passed as existing must never come back as that
3801
+ * variant typed as an `Account`. Apply {@link accountIsCreated} first to accounts fetched another way.
3802
+ */
3413
3803
  declare function decodeStakingConfig<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<StakingConfig, TAddress>;
3804
+ /** Fetches a `StakingConfig` account, throwing when it does not exist or only holds lamports. */
3414
3805
  declare function fetchStakingConfig<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<StakingConfig, TAddress>>;
3806
+ /**
3807
+ * Fetches a `StakingConfig` account, or the non-existing variant when the address holds no
3808
+ * account or only lamports (see {@link accountIsCreated}).
3809
+ * {@link decodeStakingConfig} throws for a lamports-only account instead.
3810
+ */
3415
3811
  declare function fetchMaybeStakingConfig<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<StakingConfig, TAddress>>;
3812
+ /** Fetches `StakingConfig` accounts, throwing when any does not exist or only holds lamports. */
3416
3813
  declare function fetchAllStakingConfig(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<StakingConfig>[]>;
3814
+ /**
3815
+ * Fetches `StakingConfig` accounts, with the non-existing variant for each address that holds
3816
+ * no account or only lamports (see {@link accountIsCreated}).
3817
+ * {@link decodeStakingConfig} throws for a lamports-only account instead.
3818
+ */
3417
3819
  declare function fetchAllMaybeStakingConfig(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<StakingConfig>[]>;
3418
3820
  declare function getStakingConfigSize(): number;
3419
3821
  //#endregion
@@ -3453,11 +3855,39 @@ declare function getUserRewardDebtEncoder(): FixedSizeEncoder<UserRewardDebtArgs
3453
3855
  declare function getUserRewardDebtDecoder(): FixedSizeDecoder<UserRewardDebt>;
3454
3856
  /** Gets the codec for {@link UserRewardDebt} account data. */
3455
3857
  declare function getUserRewardDebtCodec(): FixedSizeCodec<UserRewardDebtArgs, UserRewardDebt>;
3858
+ /**
3859
+ * Decodes a `UserRewardDebt` account, throwing when another program owns it or its discriminator
3860
+ * does not match.
3861
+ *
3862
+ * Unlike {@link fetchMaybeUserRewardDebt}, this throws for an address that only holds lamports rather
3863
+ * than returning the non-existing variant: an account passed as existing must never come back as that
3864
+ * variant typed as an `Account`. Apply {@link accountIsCreated} first to accounts fetched another way.
3865
+ */
3456
3866
  declare function decodeUserRewardDebt<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<UserRewardDebt, TAddress>;
3867
+ /**
3868
+ * Decodes a `UserRewardDebt` account, throwing when another program owns it or its discriminator
3869
+ * does not match.
3870
+ *
3871
+ * Unlike {@link fetchMaybeUserRewardDebt}, this throws for an address that only holds lamports rather
3872
+ * than returning the non-existing variant: an account passed as existing must never come back as that
3873
+ * variant typed as an `Account`. Apply {@link accountIsCreated} first to accounts fetched another way.
3874
+ */
3457
3875
  declare function decodeUserRewardDebt<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<UserRewardDebt, TAddress>;
3876
+ /** Fetches a `UserRewardDebt` account, throwing when it does not exist or only holds lamports. */
3458
3877
  declare function fetchUserRewardDebt<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<UserRewardDebt, TAddress>>;
3878
+ /**
3879
+ * Fetches a `UserRewardDebt` account, or the non-existing variant when the address holds no
3880
+ * account or only lamports (see {@link accountIsCreated}).
3881
+ * {@link decodeUserRewardDebt} throws for a lamports-only account instead.
3882
+ */
3459
3883
  declare function fetchMaybeUserRewardDebt<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<UserRewardDebt, TAddress>>;
3884
+ /** Fetches `UserRewardDebt` accounts, throwing when any does not exist or only holds lamports. */
3460
3885
  declare function fetchAllUserRewardDebt(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<UserRewardDebt>[]>;
3886
+ /**
3887
+ * Fetches `UserRewardDebt` accounts, with the non-existing variant for each address that holds
3888
+ * no account or only lamports (see {@link accountIsCreated}).
3889
+ * {@link decodeUserRewardDebt} throws for a lamports-only account instead.
3890
+ */
3461
3891
  declare function fetchAllMaybeUserRewardDebt(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<UserRewardDebt>[]>;
3462
3892
  declare function getUserRewardDebtSize(): number;
3463
3893
  //#endregion
@@ -3491,11 +3921,39 @@ declare function getUserStakePositionEncoder(): FixedSizeEncoder<UserStakePositi
3491
3921
  declare function getUserStakePositionDecoder(): FixedSizeDecoder<UserStakePosition>;
3492
3922
  /** Gets the codec for {@link UserStakePosition} account data. */
3493
3923
  declare function getUserStakePositionCodec(): FixedSizeCodec<UserStakePositionArgs, UserStakePosition>;
3924
+ /**
3925
+ * Decodes a `UserStakePosition` account, throwing when another program owns it or its discriminator
3926
+ * does not match.
3927
+ *
3928
+ * Unlike {@link fetchMaybeUserStakePosition}, this throws for an address that only holds lamports rather
3929
+ * than returning the non-existing variant: an account passed as existing must never come back as that
3930
+ * variant typed as an `Account`. Apply {@link accountIsCreated} first to accounts fetched another way.
3931
+ */
3494
3932
  declare function decodeUserStakePosition<TAddress extends string = string>(encodedAccount: EncodedAccount<TAddress>): Account<UserStakePosition, TAddress>;
3933
+ /**
3934
+ * Decodes a `UserStakePosition` account, throwing when another program owns it or its discriminator
3935
+ * does not match.
3936
+ *
3937
+ * Unlike {@link fetchMaybeUserStakePosition}, this throws for an address that only holds lamports rather
3938
+ * than returning the non-existing variant: an account passed as existing must never come back as that
3939
+ * variant typed as an `Account`. Apply {@link accountIsCreated} first to accounts fetched another way.
3940
+ */
3495
3941
  declare function decodeUserStakePosition<TAddress extends string = string>(encodedAccount: MaybeEncodedAccount<TAddress>): MaybeAccount<UserStakePosition, TAddress>;
3942
+ /** Fetches a `UserStakePosition` account, throwing when it does not exist or only holds lamports. */
3496
3943
  declare function fetchUserStakePosition<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<Account<UserStakePosition, TAddress>>;
3944
+ /**
3945
+ * Fetches a `UserStakePosition` account, or the non-existing variant when the address holds no
3946
+ * account or only lamports (see {@link accountIsCreated}).
3947
+ * {@link decodeUserStakePosition} throws for a lamports-only account instead.
3948
+ */
3497
3949
  declare function fetchMaybeUserStakePosition<TAddress extends string = string>(rpc: Parameters<typeof fetchEncodedAccount>[0], address: Address<TAddress>, config?: FetchAccountConfig): Promise<MaybeAccount<UserStakePosition, TAddress>>;
3950
+ /** Fetches `UserStakePosition` accounts, throwing when any does not exist or only holds lamports. */
3498
3951
  declare function fetchAllUserStakePosition(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<Account<UserStakePosition>[]>;
3952
+ /**
3953
+ * Fetches `UserStakePosition` accounts, with the non-existing variant for each address that holds
3954
+ * no account or only lamports (see {@link accountIsCreated}).
3955
+ * {@link decodeUserStakePosition} throws for a lamports-only account instead.
3956
+ */
3499
3957
  declare function fetchAllMaybeUserStakePosition(rpc: Parameters<typeof fetchEncodedAccounts>[0], addresses: Array<Address>, config?: FetchAccountsConfig): Promise<MaybeAccount<UserStakePosition>[]>;
3500
3958
  declare function getUserStakePositionSize(): number;
3501
3959
  declare namespace index_d_exports$10 {
@@ -4245,40 +4703,43 @@ declare namespace index_d_exports$5 {
4245
4703
  declare namespace fee_helpers_d_exports {
4246
4704
  export { effectiveFeeBps, fetchPartnerFees };
4247
4705
  }
4248
- /** Throws if the pair is unregistered. Take `platformConfig` from the market being priced: a partner's fees differ per platform. */
4706
+ /** Fetches the `PartnerConfig` of `partner` on `platformConfig`. Throws if it does not exist.
4707
+ * Use the `platformConfig` of the market you price. A partner's fees differ per platform. */
4249
4708
  declare function fetchPartnerFees(rpc: Rpc<GetAccountInfoApi>, partner: Address, platformConfig: Address): Promise<PartnerConfig>;
4250
- /** The `feeBps` a trade pays: the standard rate plus the decay premium from the market's
4251
- * `createdAt`. Pass `fees.launchpad` for a curve, `fees.dex` for a pool; times in unix seconds. */
4709
+ /** Returns the `feeBps` a trade pays: the standard rate plus the decay premium. `schedule` is the
4710
+ * `PartnerConfig`'s `launchpad` for a curve or `dex` for a pool. `createdAt` is the curve's or
4711
+ * pool's `createdAt`. Both times are in unix seconds. */
4252
4712
  declare function effectiveFeeBps(schedule: LaunchpadFees | DexFees, createdAt: bigint, now: bigint): number;
4253
4713
  declare namespace staking_d_exports {
4254
4714
  export { ClaimRewardsParams, PendingReward, PrepareStakingParams, RewardMintRpc, RewardMintSource, SettleParams, StakeParams, UnstakeParams, WithdrawFeesAccounts, buildClaimRewardsInstructions, buildSettleInstructions, buildStakeInstruction, buildStakingPreflightInstructions, buildUnstakeInstruction, buildWithdrawFeesAccounts, fetchMissingUserRewardDebts, fetchPendingRewards, fetchSendMint, fetchStakingConfigData, fetchUserStakePositionData, getRewardMints, isFullySettled, isStakingMintBound };
4255
4715
  }
4256
- /** `getProgramAccounts` is optional: many providers restrict it and LiteSVM lacks it, so pass `rewardMints` there. */
4716
+ /** An RPC with `getAccountInfo` and, optionally, `getProgramAccounts`. Without `getProgramAccounts`, pass `rewardMints`. */
4257
4717
  type RewardMintRpc = Rpc<GetAccountInfoApi> & Partial<Rpc<GetProgramAccountsApi>>;
4258
- /** Registered reward mints, sorted by address. Includes disabled mints: their accrued balance is
4259
- * still owed and the settle gate still counts them. Throws when the sweep disagrees with
4260
- * `StakingConfig.rewardCount` rather than settle a short list. */
4718
+ /** Returns every registered reward mint, disabled mints included, sorted by address.
4719
+ * Throws if the count differs from `StakingConfig.rewardCount`. */
4261
4720
  declare function getRewardMints(rpc: Rpc<GetAccountInfoApi> & Rpc<GetProgramAccountsApi>): Promise<readonly Address[]>;
4262
4721
  type RewardMintSource = readonly Address[] | RewardMintRpc;
4263
4722
  interface SettleParams {
4264
- /** `settle` is permissionless: the user does not sign. */
4723
+ /** Does not sign. `settle` is permissionless. */
4265
4724
  user: Address;
4266
4725
  payer: TransactionSigner;
4267
4726
  stakingMint: Address;
4268
4727
  }
4269
- /** One idempotent `settle` per mint; a partial mint list leaves `stake` and `unstake` failing `RewardsNotSettled`. */
4728
+ /** Builds one `settle` per reward mint. `source` is the mint list, or an RPC to read it from.
4729
+ * `settle` is idempotent. With a partial list, `stake` and `unstake` fail with `RewardsNotSettled`. */
4270
4730
  declare function buildSettleInstructions(source: RewardMintSource, params: SettleParams): Promise<Instruction[]>;
4271
4731
  declare function fetchMissingUserRewardDebts(rpc: RewardMintRpc & Rpc<GetMultipleAccountsApi>, user: Address, stakingMint: Address, knownRewardMints?: readonly Address[]): Promise<Address[]>;
4272
4732
  interface PrepareStakingParams {
4273
4733
  user: Address;
4274
4734
  payer: TransactionSigner;
4275
4735
  stakingMint: Address;
4276
- /** Must be the full registry when supplied; a subset leaves `stake` and `unstake` blocked. */
4736
+ /** If given, must hold every registered mint. With a subset, `stake` and `unstake` fail. */
4277
4737
  rewardMints?: readonly Address[];
4278
4738
  }
4279
- /** Opens missing `UserRewardDebt`s, then settles every mint; the user never signs, so the stake or unstake after is one wallet prompt. */
4739
+ /** Builds a `create_user_reward_debt` for each missing `UserRewardDebt`, then a `settle` for every
4740
+ * reward mint. The user does not sign these instructions. */
4280
4741
  declare function buildStakingPreflightInstructions(rpc: RewardMintRpc & Rpc<GetMultipleAccountsApi>, params: PrepareStakingParams): Promise<Instruction[]>;
4281
- /** True once `stake` and `unstake` will pass the `settledCount == rewardCount` gate. */
4742
+ /** Returns true if `stake` and `unstake` pass the `settledCount == rewardCount` check. */
4282
4743
  declare function isFullySettled(rpc: Rpc<GetAccountInfoApi>, user: Address, stakingMint: Address): Promise<boolean>;
4283
4744
  interface StakeParams {
4284
4745
  user: TransactionSigner;
@@ -4286,7 +4747,8 @@ interface StakeParams {
4286
4747
  stakingMint: Address;
4287
4748
  amount: bigint;
4288
4749
  }
4289
- /** Fails `RewardsNotSettled` until every mint is settled at the current `stakeVersion`; run `buildStakingPreflightInstructions` first. */
4750
+ /** The instruction fails with `RewardsNotSettled` until every mint is settled at the current
4751
+ * `stakeVersion`. Run `buildStakingPreflightInstructions` first. */
4290
4752
  declare function buildStakeInstruction(params: StakeParams): Promise<Instruction>;
4291
4753
  interface UnstakeParams {
4292
4754
  user: TransactionSigner;
@@ -4294,18 +4756,19 @@ interface UnstakeParams {
4294
4756
  stakingMint: Address;
4295
4757
  amount: bigint;
4296
4758
  }
4297
- /** Settle immediately before via `buildStakingPreflightInstructions`: the gate passes on a stale settle,
4298
- * and the window since it is then paid at the post-unstake amount, forfeiting accrual. */
4759
+ /** Run `buildStakingPreflightInstructions` immediately before. The check also passes on an older
4760
+ * settle. Rewards since that settle then accrue on the smaller post-unstake amount, and the
4761
+ * difference is lost. */
4299
4762
  declare function buildUnstakeInstruction(params: UnstakeParams): Promise<Instruction>;
4300
4763
  interface ClaimRewardsParams {
4301
4764
  user: TransactionSigner;
4302
4765
  payer?: TransactionSigner;
4303
4766
  stakingMint: Address;
4304
- /** Defaults to every registered mint; each claim settles its own mint, so a subset needs no preflight. */
4767
+ /** Defaults to every registered mint. A subset needs no preflight: each `claim` settles its own mint. */
4305
4768
  rewardMints?: readonly Address[];
4306
4769
  }
4307
- /** One `claim` per mint, preceded by `create_user_reward_debt` where the debt is missing:
4308
- * `Claim` requires the account to exist, so one missing debt fails the whole transaction. */
4770
+ /** Builds one `claim` per reward mint. A `create_user_reward_debt` comes before each `claim` whose
4771
+ * `UserRewardDebt` is missing: `claim` fails without it. Throws if a mint has no `RewardState`. */
4309
4772
  declare function buildClaimRewardsInstructions(rpc: RewardMintRpc & Rpc<GetMultipleAccountsApi>, params: ClaimRewardsParams): Promise<Instruction[]>;
4310
4773
  interface WithdrawFeesAccounts {
4311
4774
  rewardState: Address;
@@ -4314,28 +4777,29 @@ interface WithdrawFeesAccounts {
4314
4777
  destinationTokenAccount: Address;
4315
4778
  tokenProgram: Address;
4316
4779
  }
4317
- /** Accounts for one mint's `withdraw_fees`; call once per mint. */
4780
+ /** Returns the accounts of `withdraw_fees` for one reward mint. Without `tokenProgram`, reads it
4781
+ * from the mint account. Throws if that account does not exist. */
4318
4782
  declare function buildWithdrawFeesAccounts(rpc: Rpc<GetAccountInfoApi>, params: {
4319
4783
  rewardMint: Address;
4320
- /** Wallet, not token account: its ATA is derived. */
4784
+ /** A wallet, not a token account. The SDK derives its ATA. */
4321
4785
  destination: Address;
4322
4786
  tokenProgram?: Address;
4323
4787
  }): Promise<WithdrawFeesAccounts>;
4324
4788
  declare function fetchStakingConfigData(rpc: Rpc<GetAccountInfoApi>): Promise<StakingConfig>;
4325
4789
  declare function fetchUserStakePositionData(rpc: Rpc<GetAccountInfoApi>, user: Address, stakingMint: Address): Promise<UserStakePosition | null>;
4326
- /** Unbound reads as `Pubkey::default()` (the system program address), which `bind_staking_mint`
4327
- * can never store: it requires a token mint. */
4790
+ /** Returns false for the system program address, the value of an unbound staking mint. */
4328
4791
  declare function isStakingMintBound(stakingMint: Address): boolean;
4329
- /** The staking mint is immutable once bound, so this result is safe to cache. */
4792
+ /** Returns the staking mint. Throws if no staking mint is bound. A bound staking mint cannot change. */
4330
4793
  declare function fetchSendMint(rpc: Rpc<GetAccountInfoApi>): Promise<Address>;
4331
4794
  interface PendingReward {
4332
4795
  rewardMint: Address;
4333
- /** Base units of `rewardMint` debited at the vault (matches `ClaimEvent.amount`); a
4334
- * `TransferFeeConfig` mint delivers less -- net it with `transferFee.fetchMintFees`. */
4796
+ /** Amount the vault sends, in raw units of `rewardMint`. Equals `ClaimEvent.amount`. A mint with a
4797
+ * transfer fee delivers less. Get the fee with `transferFee.fetchMintFees`. */
4335
4798
  pending: bigint;
4336
4799
  }
4337
- /** One entry per reward mint, in `knownRewardMints` order, else sorted by address. Each amount is in
4338
- * its own mint's base units, so never sum them, and is the vault's debit, not the claimant's credit. */
4800
+ /** Returns one entry per reward mint, in `knownRewardMints` order, else sorted by address. Each amount
4801
+ * is in the raw units of its own mint. Do not add them together. Each amount is what the vault sends,
4802
+ * before the mint's transfer fee. */
4339
4803
  declare function fetchPendingRewards(rpc: RewardMintRpc & Rpc<GetMultipleAccountsApi>, user: Address, stakingMint: Address, knownRewardMints?: readonly Address[]): Promise<PendingReward[]>;
4340
4804
  declare namespace index_d_exports$3 {
4341
4805
  export { index_d_exports$10 as accounts, index_d_exports$8 as errors, index_d_exports$9 as events, fee_helpers_d_exports as feeHelpers, index_d_exports$7 as instructions, index_d_exports$6 as pda, index_d_exports$5 as plugins, staking_d_exports as staking, index_d_exports$11 as types };
@@ -4343,9 +4807,9 @@ declare namespace index_d_exports$3 {
4343
4807
  declare namespace platform_d_exports {
4344
4808
  export { PLATFORM_SEED, findPlatformAddress };
4345
4809
  }
4346
- /** A platform is only a key, with no on-chain account; it is a PDA so a platform account can later `init` at it. */
4810
+ /** Seed of the platform PDA. A platform has no on-chain account. */
4347
4811
  declare const PLATFORM_SEED = "platform";
4348
- /** The name is the platform's identity: renaming one orphans every market and partner config under the old key. */
4812
+ /** Derives the platform key for `name` under the nexus program. Each name gives a different platform. */
4349
4813
  declare function findPlatformAddress(name: string): Promise<ProgramDerivedAddress>;
4350
4814
  declare namespace transfer_fee_d_exports {
4351
4815
  export { TransferFeeConfig, TransferFeeEntry, decodeTransferFeeConfig, fetchMintFees, mintFeeAtEpoch, transferFeeAtEpoch };
@@ -4356,50 +4820,88 @@ interface TransferFeeEntry {
4356
4820
  readonly basisPoints: number;
4357
4821
  }
4358
4822
  interface TransferFeeConfig {
4359
- /** `undefined` when the authority is unset: the schedule is frozen forever. */
4823
+ /** `undefined` if the config has no authority. Then the schedule cannot change. */
4360
4824
  readonly authority: Address | undefined;
4361
4825
  readonly older: TransferFeeEntry;
4362
4826
  readonly newer: TransferFeeEntry;
4363
4827
  }
4364
- /** `owner` is the account's program. `undefined` means no fee extension; anything
4365
- * unparseable throws `RangeError` rather than pricing a charging mint free. */
4828
+ /** Decodes the `TransferFeeConfig` extension of a mint. `owner` is the program that owns the account.
4829
+ * Returns `undefined` if the mint has no such extension. Throws `RangeError` if `owner` is not a
4830
+ * token program or `data` is not a valid mint. */
4366
4831
  declare function decodeTransferFeeConfig(data: Uint8Array, owner: Address): TransferFeeConfig | undefined;
4367
- /** Mirrors SPL `get_epoch_fee`: the newer entry is live from its own epoch on. */
4832
+ /** Returns the fee for `epoch`, as SPL `get_epoch_fee` does. The newer entry applies from its own epoch on. */
4368
4833
  declare function transferFeeAtEpoch(config: TransferFeeConfig, epoch: bigint): MintFee;
4369
4834
  declare function mintFeeAtEpoch(data: Uint8Array, owner: Address, epoch: bigint): MintFee | undefined;
4370
- /** A missing account throws, never reads as fee-free. Valid only for `epoch`, which defaults to
4371
- * the cluster's (a second call). */
4835
+ /** Reads the transfer fee of each mint for `epoch`. The result is valid only for that epoch.
4836
+ * `epoch` defaults to the current cluster epoch, read with `getEpochInfo`. A mint without a
4837
+ * transfer fee maps to `undefined`. Throws if a mint account is missing or does not decode. */
4372
4838
  declare function fetchMintFees(rpc: Rpc<GetMultipleAccountsApi & GetEpochInfoApi>, mints: readonly Address[], options?: {
4373
4839
  epoch?: bigint;
4374
4840
  commitment?: Commitment;
4375
4841
  }): Promise<Map<Address, MintFee | undefined>>;
4376
4842
  //#endregion
4843
+ //#region src/nexus/generated/shared/index.d.ts
4844
+ /**
4845
+ * Whether an encoded account was created on-chain, rather than merely sent lamports.
4846
+ *
4847
+ * Anyone can send lamports to an address before its account is created, which leaves it on-chain,
4848
+ * owned by the System Program, with no data. This returns `false` for that shape, as it does for an
4849
+ * account that does not exist. Any other existing account counts as created, whoever owns it; the
4850
+ * `decode*` functions still check the owner.
4851
+ *
4852
+ * The generated `fetchMaybe*` and `fetchAllMaybe*` helpers apply this rule themselves. Apply it to
4853
+ * accounts you fetch or receive another way (subscriptions, batch loaders, caches) before passing
4854
+ * them to a `decode*` function, which throws for a lamports-only account: an account passed to it as
4855
+ * existing must never come back as the non-existing variant typed as an `Account`.
4856
+ *
4857
+ * Only a `true` result narrows the type. A lamports-only account is still `exists: true` at runtime,
4858
+ * so a `false` result leaves the type unchanged instead of narrowing it to the non-existing variant.
4859
+ * The `uncreated` property in the narrowed type is never present; it exists only to prevent that.
4860
+ *
4861
+ * @example
4862
+ * ```ts
4863
+ * const maybeAccount = decodeMyAccount(
4864
+ * accountIsCreated(encodedAccount) ? encodedAccount : { address: encodedAccount.address, exists: false },
4865
+ * );
4866
+ * ```
4867
+ */
4868
+ declare function accountIsCreated<TAccount extends EncodedAccount | MaybeEncodedAccount>(account: TAccount): account is Exclude<TAccount, {
4869
+ readonly exists: false;
4870
+ }> & {
4871
+ readonly uncreated?: never;
4872
+ };
4873
+ //#endregion
4377
4874
  //#region src/utils/creator-hash.d.ts
4378
- /** SHA-256 of the LE-u32-length-prefixed platform and id. Frozen: it seeds live PDAs. */
4875
+ /** Returns the SHA-256 of `creatorPlatform` and `creatorId`, each prefixed with its byte length as a
4876
+ * little-endian u32. Throws `RangeError` if `creatorPlatform` is more than 32 bytes. */
4379
4877
  declare function creatorHashFromId(creatorPlatform: string, creatorId: string): Promise<Address>;
4380
- /** NUL-pads `text` to `length` bytes, the on-chain `CreatorFeeConfig.platformId` form; throws RangeError if longer. */
4878
+ /** Pads `text` with NUL bytes to `length` bytes, the form of `CreatorFeeConfig.platformId`.
4879
+ * Throws `RangeError` if `text` is longer. */
4381
4880
  declare function encodeCreatorId(text: string, length: number): Uint8Array;
4382
- /** Strips NUL padding. Pass this, never the padded array, to {@link creatorHashFromId}: the hash is length-prefixed. */
4881
+ /** Removes the trailing NUL bytes and decodes the rest as UTF-8. Pass the result, not the padded
4882
+ * bytes, to {@link creatorHashFromId}. */
4383
4883
  declare function decodeCreatorId(bytes: ReadonlyUint8Array): string;
4384
4884
  //#endregion
4385
4885
  //#region src/utils/mint-info.d.ts
4386
4886
  interface QuoteMintInfo {
4387
4887
  mint: Address;
4388
- /** Immutable: safe to cache. */
4888
+ /** Cannot change after the mint is created. */
4389
4889
  decimals: number;
4390
4890
  /** The account's owner: `TOKEN_PROGRAM_ADDRESS` or `TOKEN_2022_PROGRAM_ADDRESS`. */
4391
4891
  tokenProgram: Address;
4392
4892
  }
4393
- /** Throws when the mint does not exist or is not owned by a token program. */
4893
+ /** Reads the decimals and token program of `mint`. Throws if the account does not exist, a token
4894
+ * program does not own it, or it is too short for a mint. */
4394
4895
  declare function fetchQuoteMintInfo(rpc: Rpc<GetAccountInfoApi>, mint: Address, commitment?: Commitment): Promise<QuoteMintInfo>;
4395
- /** One round trip per 100 mints; results follow `mints` order. */
4896
+ /** Reads the decimals and token program of each mint. Results follow `mints` order. Throws as
4897
+ * {@link fetchQuoteMintInfo} does. */
4396
4898
  declare function fetchQuoteMintInfos(rpc: Rpc<GetMultipleAccountsApi>, mints: readonly Address[], commitment?: Commitment): Promise<QuoteMintInfo[]>;
4397
4899
  //#endregion
4398
4900
  //#region src/utils/pda.d.ts
4399
- /** Seed order is [wallet, tokenProgram, mint], not the parameter order. */
4901
+ /** Derives the associated token account of `wallet` for `mint` under `tokenProgram`. */
4400
4902
  declare function findAssociatedTokenPda(wallet: Address, mint: Address, tokenProgram?: Address): Promise<ProgramDerivedAddress>;
4401
4903
  declare namespace index_d_exports$4 {
4402
- export { PartnerInput, QuoteMintInfo, creatorHashFromId, decodeCreatorId, encodeCreatorId, fetchQuoteMintInfo, fetchQuoteMintInfos, findAssociatedTokenPda };
4904
+ export { PartnerInput, QuoteMintInfo, accountIsCreated, creatorHashFromId, decodeCreatorId, encodeCreatorId, fetchQuoteMintInfo, fetchQuoteMintInfos, findAssociatedTokenPda };
4403
4905
  }
4404
4906
  //#endregion
4405
4907
  export { constants_d_exports as constants, index_d_exports as dex, index_d_exports$1 as launchpad, index_d_exports$2 as math, index_d_exports$3 as nexus, platform_d_exports as platform, transfer_fee_d_exports as transferFee, index_d_exports$4 as utils };