@xitadel-fi/sdk 0.1.7 → 0.1.9
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.
|
@@ -33,6 +33,15 @@ export declare class XitadelProgram {
|
|
|
33
33
|
* @returns Transaction instruction for transferring manager authority
|
|
34
34
|
*/
|
|
35
35
|
transferManager(currentManager: PublicKey, newManager: PublicKey): Promise<TransactionInstruction>;
|
|
36
|
+
/**
|
|
37
|
+
* Set circuit breaker (pause or unpause the program).
|
|
38
|
+
* Config must be V2 (manager + bump + paused). For legacy configs, run migrate_config first.
|
|
39
|
+
*
|
|
40
|
+
* @param manager The config manager's public key (must sign the transaction)
|
|
41
|
+
* @param paused True to activate circuit breaker (pause), false to deactivate (unpause)
|
|
42
|
+
* @returns Transaction instruction for set_circuit_breaker
|
|
43
|
+
*/
|
|
44
|
+
setCircuitBreaker(manager: PublicKey, paused: boolean): Promise<TransactionInstruction>;
|
|
36
45
|
/**
|
|
37
46
|
* Helper method to get LTT configuration PDA
|
|
38
47
|
* @param lttId The LTT ID (Pubkey)
|
package/dist/sdk/src/program.js
CHANGED
|
@@ -79,6 +79,24 @@ class XitadelProgram {
|
|
|
79
79
|
})
|
|
80
80
|
.instruction();
|
|
81
81
|
}
|
|
82
|
+
/**
|
|
83
|
+
* Set circuit breaker (pause or unpause the program).
|
|
84
|
+
* Config must be V2 (manager + bump + paused). For legacy configs, run migrate_config first.
|
|
85
|
+
*
|
|
86
|
+
* @param manager The config manager's public key (must sign the transaction)
|
|
87
|
+
* @param paused True to activate circuit breaker (pause), false to deactivate (unpause)
|
|
88
|
+
* @returns Transaction instruction for set_circuit_breaker
|
|
89
|
+
*/
|
|
90
|
+
async setCircuitBreaker(manager, paused) {
|
|
91
|
+
const configPda = this.getConfigPda();
|
|
92
|
+
return this.program.methods
|
|
93
|
+
.setCircuitBreaker(paused)
|
|
94
|
+
.accountsPartial({
|
|
95
|
+
config: configPda,
|
|
96
|
+
manager,
|
|
97
|
+
})
|
|
98
|
+
.instruction();
|
|
99
|
+
}
|
|
82
100
|
/**
|
|
83
101
|
* Helper method to get LTT configuration PDA
|
|
84
102
|
* @param lttId The LTT ID (Pubkey)
|
|
@@ -466,10 +484,6 @@ class XitadelProgram {
|
|
|
466
484
|
if (positionNftAccountInfo == null) {
|
|
467
485
|
instructions.push((0, spl_token_1.createAssociatedTokenAccountInstruction)(signer, positionNftAccount, lpAuthority, positionNftMint, spl_token_1.TOKEN_2022_PROGRAM_ID));
|
|
468
486
|
}
|
|
469
|
-
console.log('harvestVaultPositionNftAta', harvestVaultPositionNftAta.toBase58());
|
|
470
|
-
console.log('harvestVaultFundingAta', harvestVaultFundingAta.toBase58());
|
|
471
|
-
console.log('harvestVaultCollateralAta', harvestVaultCollateralAta.toBase58());
|
|
472
|
-
console.log('positionNftAccount', positionNftAccount.toBase58());
|
|
473
487
|
// Add the main deactivate instruction
|
|
474
488
|
instructions.push(await this.program.methods
|
|
475
489
|
.deactivateLtt()
|
|
@@ -571,7 +585,6 @@ class XitadelProgram {
|
|
|
571
585
|
lttConfigPda,
|
|
572
586
|
poolAuthority,
|
|
573
587
|
pool,
|
|
574
|
-
poolb,
|
|
575
588
|
lpMint,
|
|
576
589
|
ammConfig,
|
|
577
590
|
ammConfigB,
|
|
@@ -584,8 +597,6 @@ class XitadelProgram {
|
|
|
584
597
|
stableVaultAtaB,
|
|
585
598
|
payerLttTokenAccount,
|
|
586
599
|
payerStableCoinTokenAccount,
|
|
587
|
-
positionNftMintKeypair.publicKey,
|
|
588
|
-
positionNftMintKeypairB.publicKey,
|
|
589
600
|
positionNftAccount,
|
|
590
601
|
positionNftAccountB,
|
|
591
602
|
position,
|
|
@@ -597,12 +608,13 @@ class XitadelProgram {
|
|
|
597
608
|
spl_token_1.TOKEN_2022_PROGRAM_ID,
|
|
598
609
|
eventAuthority,
|
|
599
610
|
params.cpAmmProgramId,
|
|
611
|
+
poolb,
|
|
600
612
|
web3_js_1.SYSVAR_RENT_PUBKEY,
|
|
601
613
|
];
|
|
602
|
-
const uniqueAddressesStr = new Set(allAddresses.map(
|
|
603
|
-
const uniqueAddresses = Array.from(uniqueAddressesStr).map(
|
|
614
|
+
const uniqueAddressesStr = new Set(allAddresses.map(a => a.toBase58()));
|
|
615
|
+
const uniqueAddresses = Array.from(uniqueAddressesStr).map(a => new web3_js_1.PublicKey(a));
|
|
604
616
|
const extendLookupTableIxs = [];
|
|
605
|
-
const chunkSize =
|
|
617
|
+
const chunkSize = 15;
|
|
606
618
|
for (let i = 0; i < uniqueAddresses.length; i += chunkSize) {
|
|
607
619
|
extendLookupTableIxs.push(web3_js_1.AddressLookupTableProgram.extendLookupTable({
|
|
608
620
|
payer: signer,
|
|
@@ -4064,6 +4064,51 @@
|
|
|
4064
4064
|
}
|
|
4065
4065
|
]
|
|
4066
4066
|
},
|
|
4067
|
+
{
|
|
4068
|
+
"name": "set_circuit_breaker",
|
|
4069
|
+
"discriminator": [
|
|
4070
|
+
135,
|
|
4071
|
+
207,
|
|
4072
|
+
46,
|
|
4073
|
+
31,
|
|
4074
|
+
152,
|
|
4075
|
+
94,
|
|
4076
|
+
123,
|
|
4077
|
+
247
|
|
4078
|
+
],
|
|
4079
|
+
"accounts": [
|
|
4080
|
+
{
|
|
4081
|
+
"name": "config",
|
|
4082
|
+
"writable": true,
|
|
4083
|
+
"pda": {
|
|
4084
|
+
"seeds": [
|
|
4085
|
+
{
|
|
4086
|
+
"kind": "const",
|
|
4087
|
+
"value": [
|
|
4088
|
+
99,
|
|
4089
|
+
111,
|
|
4090
|
+
110,
|
|
4091
|
+
102,
|
|
4092
|
+
105,
|
|
4093
|
+
103
|
|
4094
|
+
]
|
|
4095
|
+
}
|
|
4096
|
+
]
|
|
4097
|
+
}
|
|
4098
|
+
},
|
|
4099
|
+
{
|
|
4100
|
+
"name": "manager",
|
|
4101
|
+
"writable": true,
|
|
4102
|
+
"signer": true
|
|
4103
|
+
}
|
|
4104
|
+
],
|
|
4105
|
+
"args": [
|
|
4106
|
+
{
|
|
4107
|
+
"name": "paused",
|
|
4108
|
+
"type": "bool"
|
|
4109
|
+
}
|
|
4110
|
+
]
|
|
4111
|
+
},
|
|
4067
4112
|
{
|
|
4068
4113
|
"name": "stop_liquidation",
|
|
4069
4114
|
"discriminator": [
|
|
@@ -5408,6 +5453,10 @@
|
|
|
5408
5453
|
{
|
|
5409
5454
|
"name": "bump",
|
|
5410
5455
|
"type": "u8"
|
|
5456
|
+
},
|
|
5457
|
+
{
|
|
5458
|
+
"name": "paused",
|
|
5459
|
+
"type": "bool"
|
|
5411
5460
|
}
|
|
5412
5461
|
]
|
|
5413
5462
|
}
|
|
@@ -4070,6 +4070,51 @@ export type Xitadel = {
|
|
|
4070
4070
|
}
|
|
4071
4071
|
];
|
|
4072
4072
|
},
|
|
4073
|
+
{
|
|
4074
|
+
"name": "setCircuitBreaker";
|
|
4075
|
+
"discriminator": [
|
|
4076
|
+
135,
|
|
4077
|
+
207,
|
|
4078
|
+
46,
|
|
4079
|
+
31,
|
|
4080
|
+
152,
|
|
4081
|
+
94,
|
|
4082
|
+
123,
|
|
4083
|
+
247
|
|
4084
|
+
];
|
|
4085
|
+
"accounts": [
|
|
4086
|
+
{
|
|
4087
|
+
"name": "config";
|
|
4088
|
+
"writable": true;
|
|
4089
|
+
"pda": {
|
|
4090
|
+
"seeds": [
|
|
4091
|
+
{
|
|
4092
|
+
"kind": "const";
|
|
4093
|
+
"value": [
|
|
4094
|
+
99,
|
|
4095
|
+
111,
|
|
4096
|
+
110,
|
|
4097
|
+
102,
|
|
4098
|
+
105,
|
|
4099
|
+
103
|
|
4100
|
+
];
|
|
4101
|
+
}
|
|
4102
|
+
];
|
|
4103
|
+
};
|
|
4104
|
+
},
|
|
4105
|
+
{
|
|
4106
|
+
"name": "manager";
|
|
4107
|
+
"writable": true;
|
|
4108
|
+
"signer": true;
|
|
4109
|
+
}
|
|
4110
|
+
];
|
|
4111
|
+
"args": [
|
|
4112
|
+
{
|
|
4113
|
+
"name": "paused";
|
|
4114
|
+
"type": "bool";
|
|
4115
|
+
}
|
|
4116
|
+
];
|
|
4117
|
+
},
|
|
4073
4118
|
{
|
|
4074
4119
|
"name": "stopLiquidation";
|
|
4075
4120
|
"discriminator": [
|
|
@@ -5414,6 +5459,10 @@ export type Xitadel = {
|
|
|
5414
5459
|
{
|
|
5415
5460
|
"name": "bump";
|
|
5416
5461
|
"type": "u8";
|
|
5462
|
+
},
|
|
5463
|
+
{
|
|
5464
|
+
"name": "paused";
|
|
5465
|
+
"type": "bool";
|
|
5417
5466
|
}
|
|
5418
5467
|
];
|
|
5419
5468
|
};
|