@elmntl/jlpd-sdk 1.0.9 → 1.0.10
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.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +9 -8
- package/dist/index.mjs +9 -8
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -578,10 +578,10 @@ interface InitOrUpdateJlpVaultParams {
|
|
|
578
578
|
baseAssetMints: PublicKey[] | null;
|
|
579
579
|
jlxAssetMints: PublicKey[] | null;
|
|
580
580
|
newAdmin: PublicKey | null;
|
|
581
|
-
manager
|
|
582
|
-
feeReceiver
|
|
583
|
-
flags
|
|
584
|
-
jlpSlippageBps
|
|
581
|
+
manager: PublicKey;
|
|
582
|
+
feeReceiver: PublicKey;
|
|
583
|
+
flags: number;
|
|
584
|
+
jlpSlippageBps: number;
|
|
585
585
|
oracleStalenessThreshold: BN | null;
|
|
586
586
|
}
|
|
587
587
|
interface InitializeStvParams {
|
package/dist/index.d.ts
CHANGED
|
@@ -578,10 +578,10 @@ interface InitOrUpdateJlpVaultParams {
|
|
|
578
578
|
baseAssetMints: PublicKey[] | null;
|
|
579
579
|
jlxAssetMints: PublicKey[] | null;
|
|
580
580
|
newAdmin: PublicKey | null;
|
|
581
|
-
manager
|
|
582
|
-
feeReceiver
|
|
583
|
-
flags
|
|
584
|
-
jlpSlippageBps
|
|
581
|
+
manager: PublicKey;
|
|
582
|
+
feeReceiver: PublicKey;
|
|
583
|
+
flags: number;
|
|
584
|
+
jlpSlippageBps: number;
|
|
585
585
|
oracleStalenessThreshold: BN | null;
|
|
586
586
|
}
|
|
587
587
|
interface InitializeStvParams {
|
package/dist/index.js
CHANGED
|
@@ -854,10 +854,10 @@ function createInitOrUpdateVaultInstruction(params, accounts, programId = JLPD_P
|
|
|
854
854
|
// jlxAssetMints - Option<[Pubkey; 5]>
|
|
855
855
|
params.jlxAssetMints ? Buffer.concat([Buffer.from([1]), ...params.jlxAssetMints.map((p) => p.toBuffer())]) : Buffer.from([0]),
|
|
856
856
|
serializeOptionPubkey(params.newAdmin),
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
857
|
+
params.manager.toBuffer(),
|
|
858
|
+
params.feeReceiver.toBuffer(),
|
|
859
|
+
serializeU16(params.flags),
|
|
860
|
+
serializeU16(params.jlpSlippageBps),
|
|
861
861
|
serializeOptionU64(params.oracleStalenessThreshold)
|
|
862
862
|
]);
|
|
863
863
|
const keys = [
|
|
@@ -1725,16 +1725,17 @@ var AdminContext = class {
|
|
|
1725
1725
|
}
|
|
1726
1726
|
// Initialize or update vault
|
|
1727
1727
|
async initOrUpdateVault(params) {
|
|
1728
|
+
const currentVault = await this.client.fetchVault();
|
|
1728
1729
|
const ix = createInitOrUpdateVaultInstruction(
|
|
1729
1730
|
{
|
|
1730
1731
|
jlpMint: params.jlpMint ?? null,
|
|
1731
1732
|
baseAssetMints: params.baseAssetMints ?? null,
|
|
1732
1733
|
jlxAssetMints: params.jlxAssetMints ?? null,
|
|
1733
1734
|
newAdmin: params.newAdmin ?? null,
|
|
1734
|
-
manager: params.manager,
|
|
1735
|
-
feeReceiver: params.feeReceiver,
|
|
1736
|
-
flags: params.flags,
|
|
1737
|
-
jlpSlippageBps: params.jlpSlippageBps,
|
|
1735
|
+
manager: params.manager ?? currentVault.manager,
|
|
1736
|
+
feeReceiver: params.feeReceiver ?? currentVault.feeReceiver,
|
|
1737
|
+
flags: params.flags ?? currentVault.flags,
|
|
1738
|
+
jlpSlippageBps: params.jlpSlippageBps ?? currentVault.jlpSlippageBps,
|
|
1738
1739
|
oracleStalenessThreshold: params.oracleStalenessThreshold ?? null
|
|
1739
1740
|
},
|
|
1740
1741
|
{
|
package/dist/index.mjs
CHANGED
|
@@ -765,10 +765,10 @@ function createInitOrUpdateVaultInstruction(params, accounts, programId = JLPD_P
|
|
|
765
765
|
// jlxAssetMints - Option<[Pubkey; 5]>
|
|
766
766
|
params.jlxAssetMints ? Buffer.concat([Buffer.from([1]), ...params.jlxAssetMints.map((p) => p.toBuffer())]) : Buffer.from([0]),
|
|
767
767
|
serializeOptionPubkey(params.newAdmin),
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
768
|
+
params.manager.toBuffer(),
|
|
769
|
+
params.feeReceiver.toBuffer(),
|
|
770
|
+
serializeU16(params.flags),
|
|
771
|
+
serializeU16(params.jlpSlippageBps),
|
|
772
772
|
serializeOptionU64(params.oracleStalenessThreshold)
|
|
773
773
|
]);
|
|
774
774
|
const keys = [
|
|
@@ -1636,16 +1636,17 @@ var AdminContext = class {
|
|
|
1636
1636
|
}
|
|
1637
1637
|
// Initialize or update vault
|
|
1638
1638
|
async initOrUpdateVault(params) {
|
|
1639
|
+
const currentVault = await this.client.fetchVault();
|
|
1639
1640
|
const ix = createInitOrUpdateVaultInstruction(
|
|
1640
1641
|
{
|
|
1641
1642
|
jlpMint: params.jlpMint ?? null,
|
|
1642
1643
|
baseAssetMints: params.baseAssetMints ?? null,
|
|
1643
1644
|
jlxAssetMints: params.jlxAssetMints ?? null,
|
|
1644
1645
|
newAdmin: params.newAdmin ?? null,
|
|
1645
|
-
manager: params.manager,
|
|
1646
|
-
feeReceiver: params.feeReceiver,
|
|
1647
|
-
flags: params.flags,
|
|
1648
|
-
jlpSlippageBps: params.jlpSlippageBps,
|
|
1646
|
+
manager: params.manager ?? currentVault.manager,
|
|
1647
|
+
feeReceiver: params.feeReceiver ?? currentVault.feeReceiver,
|
|
1648
|
+
flags: params.flags ?? currentVault.flags,
|
|
1649
|
+
jlpSlippageBps: params.jlpSlippageBps ?? currentVault.jlpSlippageBps,
|
|
1649
1650
|
oracleStalenessThreshold: params.oracleStalenessThreshold ?? null
|
|
1650
1651
|
},
|
|
1651
1652
|
{
|