@0dotxyz/p0-ts-sdk 2.11.1 → 2.12.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.
@@ -184,5 +184,41 @@ interface GammaWithdrawReceiptRaw {
184
184
  oldestPendingAt: BN;
185
185
  bump: number;
186
186
  }
187
+ /**
188
+ * Decoded Gamma `DepositPolicy` account — the vault's deposit cap and pause switch.
189
+ * One per vault, PDA `["deposit_policy", lpVault]`.
190
+ */
191
+ interface GammaDepositPolicyRaw {
192
+ pubkey: PublicKey;
193
+ lpVault: PublicKey;
194
+ /** Max vault NAV in asset-mint base units that deposits may fill up to. */
195
+ capacityAssets: BN;
196
+ /** When true the program rejects every deposit. */
197
+ depositsPaused: boolean;
198
+ bump: number;
199
+ }
200
+ /**
201
+ * Decoded Gamma `WithdrawalPolicy` account — the vault's withdrawal fee and rolling
202
+ * hourly/daily withdrawal caps. One per vault, PDA `["withdrawal_policy", lpVault]`.
203
+ */
204
+ interface GammaWithdrawalPolicyRaw {
205
+ pubkey: PublicKey;
206
+ lpVault: PublicKey;
207
+ /** Fee on withdrawn assets in basis points (10 = 0.1%). */
208
+ withdrawalFeeBps: number;
209
+ /** Max share of NAV withdrawable per hourly window, in basis points. */
210
+ hourlyWithdrawalCapBps: number;
211
+ /** Max share of NAV withdrawable per daily window, in basis points. */
212
+ dailyWithdrawalCapBps: number;
213
+ /** Asset-mint base units withdrawn in the current hourly window. */
214
+ hourlyWithdrawnAssets: BN;
215
+ /** Asset-mint base units withdrawn in the current daily window. */
216
+ dailyWithdrawnAssets: BN;
217
+ /** Unix timestamp (seconds) the current hourly window started. */
218
+ hourlyWindowStart: BN;
219
+ /** Unix timestamp (seconds) the current daily window started. */
220
+ dailyWindowStart: BN;
221
+ bump: number;
222
+ }
187
223
 
188
- export type { ExponentVault as E, GammaLpVaultRaw as G, ResolveExponentTradePtContextParams as R, ExponentCpiInterfaceContext as a, ExponentMarketTwo as b, ExponentTradePtContext as c, ExponentTradePtAccounts as d, GammaWithdrawReceiptRaw as e, ExponentMarketTwoCpiAccounts as f };
224
+ export type { ExponentVault as E, GammaLpVaultRaw as G, ResolveExponentTradePtContextParams as R, ExponentCpiInterfaceContext as a, ExponentMarketTwo as b, ExponentTradePtContext as c, ExponentTradePtAccounts as d, GammaWithdrawReceiptRaw as e, GammaDepositPolicyRaw as f, GammaWithdrawalPolicyRaw as g, ExponentMarketTwoCpiAccounts as h };
@@ -184,5 +184,41 @@ interface GammaWithdrawReceiptRaw {
184
184
  oldestPendingAt: BN;
185
185
  bump: number;
186
186
  }
187
+ /**
188
+ * Decoded Gamma `DepositPolicy` account — the vault's deposit cap and pause switch.
189
+ * One per vault, PDA `["deposit_policy", lpVault]`.
190
+ */
191
+ interface GammaDepositPolicyRaw {
192
+ pubkey: PublicKey;
193
+ lpVault: PublicKey;
194
+ /** Max vault NAV in asset-mint base units that deposits may fill up to. */
195
+ capacityAssets: BN;
196
+ /** When true the program rejects every deposit. */
197
+ depositsPaused: boolean;
198
+ bump: number;
199
+ }
200
+ /**
201
+ * Decoded Gamma `WithdrawalPolicy` account — the vault's withdrawal fee and rolling
202
+ * hourly/daily withdrawal caps. One per vault, PDA `["withdrawal_policy", lpVault]`.
203
+ */
204
+ interface GammaWithdrawalPolicyRaw {
205
+ pubkey: PublicKey;
206
+ lpVault: PublicKey;
207
+ /** Fee on withdrawn assets in basis points (10 = 0.1%). */
208
+ withdrawalFeeBps: number;
209
+ /** Max share of NAV withdrawable per hourly window, in basis points. */
210
+ hourlyWithdrawalCapBps: number;
211
+ /** Max share of NAV withdrawable per daily window, in basis points. */
212
+ dailyWithdrawalCapBps: number;
213
+ /** Asset-mint base units withdrawn in the current hourly window. */
214
+ hourlyWithdrawnAssets: BN;
215
+ /** Asset-mint base units withdrawn in the current daily window. */
216
+ dailyWithdrawnAssets: BN;
217
+ /** Unix timestamp (seconds) the current hourly window started. */
218
+ hourlyWindowStart: BN;
219
+ /** Unix timestamp (seconds) the current daily window started. */
220
+ dailyWindowStart: BN;
221
+ bump: number;
222
+ }
187
223
 
188
- export type { ExponentVault as E, GammaLpVaultRaw as G, ResolveExponentTradePtContextParams as R, ExponentCpiInterfaceContext as a, ExponentMarketTwo as b, ExponentTradePtContext as c, ExponentTradePtAccounts as d, GammaWithdrawReceiptRaw as e, ExponentMarketTwoCpiAccounts as f };
224
+ export type { ExponentVault as E, GammaLpVaultRaw as G, ResolveExponentTradePtContextParams as R, ExponentCpiInterfaceContext as a, ExponentMarketTwo as b, ExponentTradePtContext as c, ExponentTradePtAccounts as d, GammaWithdrawReceiptRaw as e, GammaDepositPolicyRaw as f, GammaWithdrawalPolicyRaw as g, ExponentMarketTwoCpiAccounts as h };
package/dist/vendor.cjs CHANGED
@@ -53306,6 +53306,8 @@ function deriveGammaAta(mint, owner, tokenProgram = TOKEN_PROGRAM_ID) {
53306
53306
  var GAMMA_ACCOUNTS_CODER = new anchor.BorshAccountsCoder(GAMMA_VAULT_IDL);
53307
53307
  var lpVaultDiscriminator = Buffer.from([189, 45, 167, 23, 91, 118, 105, 190]);
53308
53308
  var withdrawReceiptDiscriminator = Buffer.from([132, 238, 44, 182, 207, 9, 124, 140]);
53309
+ var depositPolicyDiscriminator = Buffer.from([159, 243, 65, 242, 81, 27, 41, 167]);
53310
+ var withdrawalPolicyDiscriminator = Buffer.from([52, 231, 68, 59, 247, 250, 119, 244]);
53309
53311
  var toBN = (v) => BN5__default.default.isBN(v) ? v : new BN5__default.default((v ?? 0).toString());
53310
53312
  function decodeGammaLpVaultData(data, pubkey) {
53311
53313
  if (!data.subarray(0, 8).equals(lpVaultDiscriminator)) {
@@ -53352,6 +53354,37 @@ function decodeGammaWithdrawReceiptData(data, pubkey) {
53352
53354
  bump: d.bump
53353
53355
  };
53354
53356
  }
53357
+ function decodeGammaDepositPolicyData(data, pubkey) {
53358
+ if (!data.subarray(0, 8).equals(depositPolicyDiscriminator)) {
53359
+ throw new Error("invalid Gamma DepositPolicy account discriminator");
53360
+ }
53361
+ const d = GAMMA_ACCOUNTS_CODER.decode("DepositPolicy", data);
53362
+ return {
53363
+ pubkey,
53364
+ lpVault: d.lp_vault ?? d.lpVault,
53365
+ capacityAssets: toBN(d.capacity_assets ?? d.capacityAssets),
53366
+ depositsPaused: d.deposits_paused ?? d.depositsPaused,
53367
+ bump: d.bump
53368
+ };
53369
+ }
53370
+ function decodeGammaWithdrawalPolicyData(data, pubkey) {
53371
+ if (!data.subarray(0, 8).equals(withdrawalPolicyDiscriminator)) {
53372
+ throw new Error("invalid Gamma WithdrawalPolicy account discriminator");
53373
+ }
53374
+ const d = GAMMA_ACCOUNTS_CODER.decode("WithdrawalPolicy", data);
53375
+ return {
53376
+ pubkey,
53377
+ lpVault: d.lp_vault ?? d.lpVault,
53378
+ withdrawalFeeBps: d.withdrawal_fee_bps ?? d.withdrawalFeeBps,
53379
+ hourlyWithdrawalCapBps: d.hourly_withdrawal_cap_bps ?? d.hourlyWithdrawalCapBps,
53380
+ dailyWithdrawalCapBps: d.daily_withdrawal_cap_bps ?? d.dailyWithdrawalCapBps,
53381
+ hourlyWithdrawnAssets: toBN(d.hourly_withdrawn_assets ?? d.hourlyWithdrawnAssets),
53382
+ dailyWithdrawnAssets: toBN(d.daily_withdrawn_assets ?? d.dailyWithdrawnAssets),
53383
+ hourlyWindowStart: toBN(d.hourly_window_start ?? d.hourlyWindowStart),
53384
+ dailyWindowStart: toBN(d.daily_window_start ?? d.dailyWindowStart),
53385
+ bump: d.bump
53386
+ };
53387
+ }
53355
53388
  var DEPOSIT_DISCRIMINATOR = Buffer.from([242, 35, 198, 137, 82, 225, 242, 182]);
53356
53389
  var WITHDRAW_DISCRIMINATOR = Buffer.from([183, 18, 70, 156, 148, 109, 161, 34]);
53357
53390
  var COMPLETE_WITHDRAWAL_DISCRIMINATOR = Buffer.from([107, 98, 134, 131, 74, 120, 174, 121]);
@@ -53621,8 +53654,10 @@ exports.decodeExponentMarketTwo = decodeExponentMarketTwo;
53621
53654
  exports.decodeExponentMarketVault = decodeExponentMarketVault;
53622
53655
  exports.decodeExponentVault = decodeExponentVault;
53623
53656
  exports.decodeFarmDataRaw = decodeFarmDataRaw;
53657
+ exports.decodeGammaDepositPolicyData = decodeGammaDepositPolicyData;
53624
53658
  exports.decodeGammaLpVaultData = decodeGammaLpVaultData;
53625
53659
  exports.decodeGammaWithdrawReceiptData = decodeGammaWithdrawReceiptData;
53660
+ exports.decodeGammaWithdrawalPolicyData = decodeGammaWithdrawalPolicyData;
53626
53661
  exports.decodeJupLendingRewardsRateModelData = decodeJupLendingRewardsRateModelData;
53627
53662
  exports.decodeJupLendingStateData = decodeJupLendingStateData;
53628
53663
  exports.decodeJupRateModelData = decodeJupRateModelData;