@pyron-finance/pyron-client 2.8.0 → 2.8.1

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 CHANGED
@@ -11392,13 +11392,13 @@ async function makePulseHealthIx(ldProgram, accounts, remainingAccounts = []) {
11392
11392
  lendrAccount: accounts.lendrAccount
11393
11393
  }).remainingAccounts(remainingAccounts).instruction();
11394
11394
  }
11395
- async function makeHandleBankruptcyIx(ldProgram, accounts) {
11395
+ async function makeHandleBankruptcyIx(ldProgram, accounts, remainingAccounts = []) {
11396
11396
  const { bank, lendrAccount, tokenProgram, ...optionalAccounts } = accounts;
11397
11397
  return ldProgram.methods.lendingPoolHandleBankruptcy().accounts({
11398
11398
  bank,
11399
11399
  lendrAccount,
11400
11400
  tokenProgram
11401
- }).accountsPartial(optionalAccounts).instruction();
11401
+ }).accountsPartial(optionalAccounts).remainingAccounts(remainingAccounts).instruction();
11402
11402
  }
11403
11403
  var instructions = {
11404
11404
  makeDepositIx,
@@ -26513,12 +26513,25 @@ var LendrAccountWrapper = class _LendrAccountWrapper {
26513
26513
  if (!bank) throw Error(`Bank ${bankAddress.toBase58()} not found`);
26514
26514
  const mintData = this.client.mintDatas.get(bankAddress.toBase58());
26515
26515
  if (!mintData) throw Error(`Mint data for bank ${bankAddress.toBase58()} not found`);
26516
- const ix = await instructions_default.makeHandleBankruptcyIx(this._program, {
26517
- bank: bankAddress,
26518
- lendrAccount: this.address,
26519
- tokenProgram: mintData.tokenProgram,
26520
- group: this.client.group.address
26521
- });
26516
+ const remainingAccounts = [];
26517
+ for (const balance of this.activeBalances) {
26518
+ const balBank = this.client.getBankByPk(balance.bankPk);
26519
+ if (!balBank) continue;
26520
+ remainingAccounts.push(
26521
+ { pubkey: balBank.address, isSigner: false, isWritable: false },
26522
+ { pubkey: balBank.config.oracleKeys[0], isSigner: false, isWritable: false }
26523
+ );
26524
+ }
26525
+ const ix = await instructions_default.makeHandleBankruptcyIx(
26526
+ this._program,
26527
+ {
26528
+ bank: bankAddress,
26529
+ lendrAccount: this.address,
26530
+ tokenProgram: mintData.tokenProgram,
26531
+ group: this.client.group.address
26532
+ },
26533
+ remainingAccounts
26534
+ );
26522
26535
  return {
26523
26536
  instructions: [ix],
26524
26537
  keys: []
package/dist/index.d.cts CHANGED
@@ -3041,7 +3041,7 @@ declare function makeHandleBankruptcyIx(ldProgram: LendrProgram, accounts: {
3041
3041
  liquidityVault?: PublicKey;
3042
3042
  insuranceVault?: PublicKey;
3043
3043
  insuranceVaultAuthority?: PublicKey;
3044
- }): Promise<_solana_web3_js.TransactionInstruction>;
3044
+ }, remainingAccounts?: AccountMeta[]): Promise<_solana_web3_js.TransactionInstruction>;
3045
3045
  declare const instructions: {
3046
3046
  makeDepositIx: typeof makeDepositIx;
3047
3047
  makeDepositWithSessionIx: typeof makeDepositWithSessionIx;
package/dist/index.d.ts CHANGED
@@ -3041,7 +3041,7 @@ declare function makeHandleBankruptcyIx(ldProgram: LendrProgram, accounts: {
3041
3041
  liquidityVault?: PublicKey;
3042
3042
  insuranceVault?: PublicKey;
3043
3043
  insuranceVaultAuthority?: PublicKey;
3044
- }): Promise<_solana_web3_js.TransactionInstruction>;
3044
+ }, remainingAccounts?: AccountMeta[]): Promise<_solana_web3_js.TransactionInstruction>;
3045
3045
  declare const instructions: {
3046
3046
  makeDepositIx: typeof makeDepositIx;
3047
3047
  makeDepositWithSessionIx: typeof makeDepositWithSessionIx;
package/dist/index.js CHANGED
@@ -11181,13 +11181,13 @@ async function makePulseHealthIx(ldProgram, accounts, remainingAccounts = []) {
11181
11181
  lendrAccount: accounts.lendrAccount
11182
11182
  }).remainingAccounts(remainingAccounts).instruction();
11183
11183
  }
11184
- async function makeHandleBankruptcyIx(ldProgram, accounts) {
11184
+ async function makeHandleBankruptcyIx(ldProgram, accounts, remainingAccounts = []) {
11185
11185
  const { bank, lendrAccount, tokenProgram, ...optionalAccounts } = accounts;
11186
11186
  return ldProgram.methods.lendingPoolHandleBankruptcy().accounts({
11187
11187
  bank,
11188
11188
  lendrAccount,
11189
11189
  tokenProgram
11190
- }).accountsPartial(optionalAccounts).instruction();
11190
+ }).accountsPartial(optionalAccounts).remainingAccounts(remainingAccounts).instruction();
11191
11191
  }
11192
11192
  var instructions = {
11193
11193
  makeDepositIx,
@@ -26355,12 +26355,25 @@ var LendrAccountWrapper = class _LendrAccountWrapper {
26355
26355
  if (!bank) throw Error(`Bank ${bankAddress.toBase58()} not found`);
26356
26356
  const mintData = this.client.mintDatas.get(bankAddress.toBase58());
26357
26357
  if (!mintData) throw Error(`Mint data for bank ${bankAddress.toBase58()} not found`);
26358
- const ix = await instructions_default.makeHandleBankruptcyIx(this._program, {
26359
- bank: bankAddress,
26360
- lendrAccount: this.address,
26361
- tokenProgram: mintData.tokenProgram,
26362
- group: this.client.group.address
26363
- });
26358
+ const remainingAccounts = [];
26359
+ for (const balance of this.activeBalances) {
26360
+ const balBank = this.client.getBankByPk(balance.bankPk);
26361
+ if (!balBank) continue;
26362
+ remainingAccounts.push(
26363
+ { pubkey: balBank.address, isSigner: false, isWritable: false },
26364
+ { pubkey: balBank.config.oracleKeys[0], isSigner: false, isWritable: false }
26365
+ );
26366
+ }
26367
+ const ix = await instructions_default.makeHandleBankruptcyIx(
26368
+ this._program,
26369
+ {
26370
+ bank: bankAddress,
26371
+ lendrAccount: this.address,
26372
+ tokenProgram: mintData.tokenProgram,
26373
+ group: this.client.group.address
26374
+ },
26375
+ remainingAccounts
26376
+ );
26364
26377
  return {
26365
26378
  instructions: [ix],
26366
26379
  keys: []
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pyron-finance/pyron-client",
3
- "version": "2.8.0",
3
+ "version": "2.8.1",
4
4
  "keywords": [],
5
5
  "license": "MIT",
6
6
  "type": "module",