@0dotxyz/p0-ts-sdk 2.11.0 → 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.
- package/dist/index.cjs +57 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -4
- package/dist/index.d.ts +14 -4
- package/dist/index.js +56 -4
- package/dist/index.js.map +1 -1
- package/dist/instructions.d.cts +1 -1
- package/dist/instructions.d.ts +1 -1
- package/dist/{types-BO-ZFk04.d.cts → types-BOPERR6x.d.cts} +4 -0
- package/dist/{types-DgVpJ2nB.d.ts → types-D2GhlUZp.d.ts} +4 -0
- package/dist/{types-Pjhu5XMK.d.cts → types-XDuGzb3S.d.cts} +37 -1
- package/dist/{types-Pjhu5XMK.d.ts → types-XDuGzb3S.d.ts} +37 -1
- package/dist/vendor.cjs +35 -0
- package/dist/vendor.cjs.map +1 -1
- package/dist/vendor.d.cts +7 -3
- package/dist/vendor.d.ts +7 -3
- package/dist/vendor.js +34 -1
- package/dist/vendor.js.map +1 -1
- package/package.json +1 -1
package/dist/instructions.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _solana_web3_js from '@solana/web3.js';
|
|
2
2
|
import { PublicKey, AccountMeta } from '@solana/web3.js';
|
|
3
3
|
import BN from 'bn.js';
|
|
4
|
-
import { M as MarginfiProgram, B as BankConfigCompactRaw, a as BankConfigFastRaw, b as BankConfigGovRaw, W as WrappedI80F48, O as OrderTrigger } from './types-
|
|
4
|
+
import { M as MarginfiProgram, B as BankConfigCompactRaw, a as BankConfigFastRaw, b as BankConfigGovRaw, W as WrappedI80F48, O as OrderTrigger } from './types-BOPERR6x.cjs';
|
|
5
5
|
import '@coral-xyz/anchor';
|
|
6
6
|
import 'bignumber.js';
|
|
7
7
|
import './dto-farm.types-6lrPBcZr.cjs';
|
package/dist/instructions.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as _solana_web3_js from '@solana/web3.js';
|
|
2
2
|
import { PublicKey, AccountMeta } from '@solana/web3.js';
|
|
3
3
|
import BN from 'bn.js';
|
|
4
|
-
import { M as MarginfiProgram, B as BankConfigCompactRaw, a as BankConfigFastRaw, b as BankConfigGovRaw, W as WrappedI80F48, O as OrderTrigger } from './types-
|
|
4
|
+
import { M as MarginfiProgram, B as BankConfigCompactRaw, a as BankConfigFastRaw, b as BankConfigGovRaw, W as WrappedI80F48, O as OrderTrigger } from './types-D2GhlUZp.js';
|
|
5
5
|
import '@coral-xyz/anchor';
|
|
6
6
|
import 'bignumber.js';
|
|
7
7
|
import './dto-farm.types-6lrPBcZr.js';
|
|
@@ -24532,9 +24532,13 @@ declare enum HealthCacheFlags {
|
|
|
24532
24532
|
*/
|
|
24533
24533
|
ORACLE_OK = 4
|
|
24534
24534
|
}
|
|
24535
|
+
/** Where an account's `healthCache` values come from. */
|
|
24535
24536
|
declare enum HealthCacheStatus {
|
|
24537
|
+
/** As stored on-chain, not refreshed since the account's last instruction */
|
|
24536
24538
|
UNSET = 0,
|
|
24539
|
+
/** Refreshed by a simulated `pulse_health`: values, prices and flags come from the program */
|
|
24537
24540
|
ONCHAIN = 1,
|
|
24541
|
+
/** Computed locally from balances and oracle prices after the simulation failed; no prices or flags */
|
|
24538
24542
|
COMPUTED = 2
|
|
24539
24543
|
}
|
|
24540
24544
|
interface HealthCacheType {
|
|
@@ -24532,9 +24532,13 @@ declare enum HealthCacheFlags {
|
|
|
24532
24532
|
*/
|
|
24533
24533
|
ORACLE_OK = 4
|
|
24534
24534
|
}
|
|
24535
|
+
/** Where an account's `healthCache` values come from. */
|
|
24535
24536
|
declare enum HealthCacheStatus {
|
|
24537
|
+
/** As stored on-chain, not refreshed since the account's last instruction */
|
|
24536
24538
|
UNSET = 0,
|
|
24539
|
+
/** Refreshed by a simulated `pulse_health`: values, prices and flags come from the program */
|
|
24537
24540
|
ONCHAIN = 1,
|
|
24541
|
+
/** Computed locally from balances and oracle prices after the simulation failed; no prices or flags */
|
|
24538
24542
|
COMPUTED = 2
|
|
24539
24543
|
}
|
|
24540
24544
|
interface HealthCacheType {
|
|
@@ -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,
|
|
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,
|
|
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;
|