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