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