@perena/vault-sdk 1.0.20 → 1.0.23

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/README.md CHANGED
@@ -105,6 +105,41 @@ const plan = await client.tx.executeDeposit.getTx({
105
105
  const sig = await client.sendTransaction(payer, plan);
106
106
  ```
107
107
 
108
+ ### Squads proposal routing
109
+
110
+ Browser integrations can map a connected Squads member wallet to a multisig and
111
+ vault index, then use the derived vault PDA while building the instruction:
112
+
113
+ ```typescript
114
+ import {
115
+ prepareVaultTransaction,
116
+ vaultAuthorityForWallet,
117
+ type SquadsWalletRouteConfig,
118
+ } from "@perena/vault-sdk";
119
+
120
+ const routes: SquadsWalletRouteConfig[] = [
121
+ { wallet: "MEMBER_WALLET", multisigPda: "MULTISIG_PDA", vaultIndex: 0 },
122
+ ];
123
+ const authority = vaultAuthorityForWallet(connectedWallet, routes);
124
+ const plan = await client.tx.setVaultConfig.getTx({
125
+ curator: address(authority.toBase58()),
126
+ // ...
127
+ });
128
+ const prepared = await prepareVaultTransaction({
129
+ connection,
130
+ proposer: connectedWallet,
131
+ instructions: plan.instructions.map(fromKitInstruction),
132
+ squadsRoutes: routes,
133
+ });
134
+ ```
135
+
136
+ When the wallet is configured, `prepared.transaction` creates a Squads vault
137
+ transaction and proposal. The member signs and submits that outer transaction;
138
+ the multisig must still approve and execute the proposal. When no route matches,
139
+ the helper returns the original instructions as a normal direct transaction.
140
+ The configured member must have Squads' `Initiate` permission, and the vault
141
+ program role must be assigned to the derived Squads vault PDA.
142
+
108
143
  `VaultTransactionPlan` contains:
109
144
 
110
145
  - `instructions` — ordered `@solana/kit` instructions (preamble + program ix)
package/dist/index.d.ts CHANGED
@@ -2,7 +2,7 @@ import * as _solana_kit from '@solana/kit';
2
2
  import { Address, ProgramDerivedAddressBump, Rpc, SolanaRpcApi, Instruction } from '@solana/kit';
3
3
  export { address } from '@solana/kit';
4
4
  import * as _solana_web3_js from '@solana/web3.js';
5
- import { PublicKey, Connection, Keypair, TransactionInstruction } from '@solana/web3.js';
5
+ import { PublicKey, Connection, Keypair, Transaction, TransactionInstruction } from '@solana/web3.js';
6
6
  import * as _anchor_lang_core from '@anchor-lang/core';
7
7
  import { Program, IdlAccounts, BN, AnchorProvider } from '@anchor-lang/core';
8
8
  import * as common from 'common';
@@ -9543,224 +9543,239 @@ type Bankineco = {
9543
9543
  ];
9544
9544
  "errors": [
9545
9545
  {
9546
- "code": 6000;
9547
- "name": "mintSupplyNonZero";
9548
- "msg": "Supplied share mint already has non-zero supply";
9546
+ "code": 14001;
9547
+ "name": "unauthorized";
9548
+ "msg": "You are not authorized to perform this action.";
9549
9549
  },
9550
9550
  {
9551
- "code": 6001;
9552
- "name": "invalidAssetMint";
9553
- "msg": "Supplied mint is not accepted by this vault";
9551
+ "code": 14002;
9552
+ "name": "invalidBankMint";
9553
+ "msg": "Invalid mint";
9554
9554
  },
9555
9555
  {
9556
- "code": 6002;
9557
- "name": "zeroDepositAmount";
9558
- "msg": "Deposit amount must be greater than zero";
9556
+ "code": 14003;
9557
+ "name": "accountingIssue";
9558
+ "msg": "Accounting issue";
9559
9559
  },
9560
9560
  {
9561
- "code": 6003;
9562
- "name": "exceedsTvlLimit";
9563
- "msg": "Deposit would exceed the vault's TVL limit";
9561
+ "code": 14004;
9562
+ "name": "vaultAccountingIssue";
9563
+ "msg": "Vault accounting issue";
9564
9564
  },
9565
9565
  {
9566
- "code": 6004;
9567
- "name": "zeroBurnAmount";
9568
- "msg": "Burn amount must be greater than zero";
9566
+ "code": 14005;
9567
+ "name": "bankAccountingIssue";
9568
+ "msg": "Bank accounting issue";
9569
9569
  },
9570
9570
  {
9571
- "code": 6005;
9572
- "name": "zeroAssetAmount";
9573
- "msg": "Asset amount must be greater than zero";
9571
+ "code": 14006;
9572
+ "name": "onchainAccountingIssue";
9573
+ "msg": "Onchain accounting issue";
9574
9574
  },
9575
9575
  {
9576
- "code": 6006;
9577
- "name": "insufficientVaultLiquidity";
9578
- "msg": "Insufficient vault liquidity to satisfy withdrawal";
9576
+ "code": 14007;
9577
+ "name": "externalAccountingIssue";
9578
+ "msg": "External accounting issue";
9579
9579
  },
9580
9580
  {
9581
- "code": 6007;
9582
- "name": "mintAuthorityNotCurator";
9583
- "msg": "Mint authority is not the curator";
9581
+ "code": 14008;
9582
+ "name": "mintSlippage";
9583
+ "msg": "Minting failed due to slippage.";
9584
9584
  },
9585
9585
  {
9586
- "code": 6008;
9587
- "name": "zeroTotalSupply";
9588
- "msg": "Vault total supply is zero";
9586
+ "code": 14009;
9587
+ "name": "burningSlippage";
9588
+ "msg": "Burning failed due to slippage.";
9589
9589
  },
9590
9590
  {
9591
- "code": 6009;
9591
+ "code": 14010;
9592
+ "name": "teamAccountAlreadyExists";
9593
+ "msg": "Team account already exists";
9594
+ },
9595
+ {
9596
+ "code": 14011;
9597
+ "name": "oracleAccountAlreadyExists";
9598
+ "msg": "Oracle account already exists";
9599
+ },
9600
+ {
9601
+ "code": 14012;
9592
9602
  "name": "staleOracle";
9593
- "msg": "Vault oracle is stale";
9603
+ "msg": "Stale oracle";
9594
9604
  },
9595
9605
  {
9596
- "code": 6010;
9597
- "name": "invalidOracleUpdate";
9598
- "msg": "Invalid oracle update";
9606
+ "code": 14013;
9607
+ "name": "localSignificantPriceChange";
9608
+ "msg": "Price change is too large locally";
9599
9609
  },
9600
9610
  {
9601
- "code": 6011;
9602
- "name": "invalidInitialMintSharePrice";
9603
- "msg": "Initial mint share price must be greater than zero";
9611
+ "code": 14014;
9612
+ "name": "significantPriceChange";
9613
+ "msg": "Price change is too large";
9604
9614
  },
9605
9615
  {
9606
- "code": 6012;
9607
- "name": "maxApyExceeded";
9608
- "msg": "Oracle NAV update exceeds the vault's maximum acceptable APY";
9616
+ "code": 14015;
9617
+ "name": "roundingImpact";
9618
+ "msg": "Rounding impacts the protocol";
9609
9619
  },
9610
9620
  {
9611
- "code": 6013;
9612
- "name": "invalidApyConfig";
9613
- "msg": "Invalid APY configuration";
9621
+ "code": 14016;
9622
+ "name": "bankIsHalted";
9623
+ "msg": "Bank is halted";
9614
9624
  },
9615
9625
  {
9616
- "code": 6014;
9617
- "name": "invalidFeeConfig";
9618
- "msg": "Invalid fee configuration";
9626
+ "code": 14017;
9627
+ "name": "vaultIsHalted";
9628
+ "msg": "Vault is halted";
9619
9629
  },
9620
9630
  {
9621
- "code": 6015;
9622
- "name": "vaultHasLiveAssets";
9623
- "msg": "Vault has live supply, TVL, or holdings";
9631
+ "code": 14018;
9632
+ "name": "conversionOverflow";
9633
+ "msg": "Conversion Overflow";
9624
9634
  },
9625
9635
  {
9626
- "code": 6016;
9627
- "name": "depositMintsZeroShares";
9628
- "msg": "Deposit would mint zero shares";
9636
+ "code": 14019;
9637
+ "name": "reserved8019";
9638
+ "msg": "reserved";
9629
9639
  },
9630
9640
  {
9631
- "code": 6017;
9632
- "name": "insufficientAccruedApyBalance";
9633
- "msg": "Insufficient accrued APY balance";
9641
+ "code": 14020;
9642
+ "name": "invalidArgument";
9643
+ "msg": "Invalid argument";
9634
9644
  },
9635
9645
  {
9636
- "code": 6018;
9637
- "name": "invalidRole";
9638
- "msg": "Invalid role configuration";
9646
+ "code": 14021;
9647
+ "name": "userSanityCheck";
9648
+ "msg": "User Sanity Check";
9639
9649
  },
9640
9650
  {
9641
- "code": 6019;
9642
- "name": "invalidProtocolInteraction";
9643
- "msg": "Invalid protocol interaction CPI";
9651
+ "code": 14022;
9652
+ "name": "mathOverflow";
9653
+ "msg": "Math overflow";
9644
9654
  },
9645
9655
  {
9646
- "code": 6020;
9647
- "name": "reserved7020";
9648
- "msg": "reserved";
9656
+ "code": 14023;
9657
+ "name": "invalidMarginFiAccount";
9658
+ "msg": "Invalid MarginFi account - must be correct PDA for this vault";
9649
9659
  },
9650
9660
  {
9651
- "code": 6021;
9652
- "name": "invalidExternalLiquidity";
9653
- "msg": "Invalid external liquidity configuration";
9661
+ "code": 14024;
9662
+ "name": "invalidStartMarker";
9663
+ "msg": "Invalid start marker";
9654
9664
  },
9655
9665
  {
9656
- "code": 6022;
9657
- "name": "swapBalanceUnchanged";
9658
- "msg": "Swap did not change both source and destination balances";
9666
+ "code": 14025;
9667
+ "name": "oracleUpdateOnEmptyReserve";
9668
+ "msg": "Unable to push oracle update on an empty vault reserve";
9659
9669
  },
9660
9670
  {
9661
- "code": 6023;
9662
- "name": "protocolBalanceUnchanged";
9663
- "msg": "Protocol interaction did not change the affected token balance";
9671
+ "code": 14026;
9672
+ "name": "invalidRemainingAccountsLength";
9673
+ "msg": "Invalid remaining accounts length";
9664
9674
  },
9665
9675
  {
9666
- "code": 6024;
9667
- "name": "excessiveSwapSlippage";
9668
- "msg": "Swap TVL loss exceeds the allowed slippage";
9676
+ "code": 14027;
9677
+ "name": "withdrawalExceedsBalance";
9678
+ "msg": "Specified withdrawal exceeds available balance";
9669
9679
  },
9670
9680
  {
9671
- "code": 6025;
9672
- "name": "tranchingNotEnabled";
9673
- "msg": "Vault tranching is not enabled";
9681
+ "code": 14028;
9682
+ "name": "insufficientPendingYield";
9683
+ "msg": "Insufficient pending yield";
9674
9684
  },
9675
9685
  {
9676
- "code": 6026;
9677
- "name": "tranchingAlreadyEnabled";
9678
- "msg": "Vault tranching is already enabled";
9686
+ "code": 14029;
9687
+ "name": "notSupported";
9688
+ "msg": "Not supported";
9679
9689
  },
9680
9690
  {
9681
- "code": 6027;
9682
- "name": "trancheStateRequired";
9683
- "msg": "Tranche state account is required";
9691
+ "code": 14030;
9692
+ "name": "exceedsMaxYieldingTvl";
9693
+ "msg": "Exceeds maximum yielding TVL";
9684
9694
  },
9685
9695
  {
9686
- "code": 6028;
9687
- "name": "invalidTrancheConfig";
9688
- "msg": "Invalid tranche configuration";
9696
+ "code": 14031;
9697
+ "name": "tranchingNotEnabled";
9698
+ "msg": "Tranching is not enabled for this bank";
9689
9699
  },
9690
9700
  {
9691
- "code": 6029;
9692
- "name": "invalidTrancheMint";
9693
- "msg": "Invalid tranche mint";
9701
+ "code": 14032;
9702
+ "name": "invalidLeverageFactor";
9703
+ "msg": "Invalid leverage factor - must be at least 10000 (1x)";
9694
9704
  },
9695
9705
  {
9696
- "code": 6030;
9697
- "name": "lossesDisabled";
9698
- "msg": "Vault losses are not enabled";
9706
+ "code": 14033;
9707
+ "name": "insufficientStakedAmount";
9708
+ "msg": "Insufficient staked amount";
9699
9709
  },
9700
9710
  {
9701
- "code": 6031;
9702
- "name": "withdrawalQueueNotExpired";
9703
- "msg": "Withdrawal queue is not yet expired";
9711
+ "code": 14034;
9712
+ "name": "juniorTrancheEmpty";
9713
+ "msg": "Junior tranche has no value";
9704
9714
  },
9705
9715
  {
9706
- "code": 6032;
9707
- "name": "invalidWithdrawalQueue";
9708
- "msg": "Invalid withdrawal queue";
9716
+ "code": 14035;
9717
+ "name": "invalidTrancheConfig";
9718
+ "msg": "Invalid tranche config parameter";
9709
9719
  },
9710
9720
  {
9711
- "code": 6033;
9712
- "name": "assetPriceNotSet";
9713
- "msg": "Destination asset has no price set; a consensus oracle price is required before swapping";
9721
+ "code": 14036;
9722
+ "name": "withdrawalQueueNotExpired";
9723
+ "msg": "Withdrawal queue lockup period has not expired";
9714
9724
  },
9715
9725
  {
9716
- "code": 6034;
9717
- "name": "assetHoldingNotEmpty";
9718
- "msg": "Asset holding still has a balance and cannot be removed";
9726
+ "code": 14037;
9727
+ "name": "invalidWithdrawalQueue";
9728
+ "msg": "Withdrawal queue entry is not in a valid state";
9729
+ },
9730
+ {
9731
+ "code": 14038;
9732
+ "name": "invalidAccount";
9733
+ "msg": "Account does not belong to the expected parent";
9719
9734
  },
9720
9735
  {
9721
- "code": 6035;
9722
- "name": "cannotRemoveBaseHolding";
9723
- "msg": "The base asset holding cannot be removed";
9736
+ "code": 14039;
9737
+ "name": "missingAccount";
9738
+ "msg": "Required optional account is missing";
9724
9739
  },
9725
9740
  {
9726
- "code": 6036;
9727
- "name": "unauthorizedPriceUpdater";
9728
- "msg": "Caller is not authorized to trigger an asset price update";
9741
+ "code": 14040;
9742
+ "name": "trancheWipedOut";
9743
+ "msg": "Junior tranche is wiped out and cannot accept new stakes";
9729
9744
  },
9730
9745
  {
9731
- "code": 6037;
9732
- "name": "invalidStalenessConfig";
9733
- "msg": "Invalid asset-price staleness threshold";
9746
+ "code": 14041;
9747
+ "name": "vaultLossNotAccepted";
9748
+ "msg": "Vault does not accept losses — enable losses_accepted before retrying";
9734
9749
  },
9735
9750
  {
9736
- "code": 6038;
9737
- "name": "assetRebalanceRateLimitExceeded";
9738
- "msg": "Asset was rebalanced too recently";
9751
+ "code": 14042;
9752
+ "name": "capitalLossExceedsReserve";
9753
+ "msg": "Capital loss exceeds available yielding reserve";
9739
9754
  },
9740
9755
  {
9741
- "code": 6039;
9742
- "name": "invalidShareTokenProgram";
9743
- "msg": "Share token program does not match the vault/tranche mint configuration";
9756
+ "code": 14043;
9757
+ "name": "rollingWithdrawalLimitExceeded";
9758
+ "msg": "Rolling withdrawal limit exceeded";
9744
9759
  },
9745
9760
  {
9746
- "code": 6040;
9747
- "name": "unauthorizedVaultCreator";
9748
- "msg": "Caller is not on the vault-creator whitelist";
9761
+ "code": 14044;
9762
+ "name": "vaultAlreadyMigrated";
9763
+ "msg": "Legacy vault has already been migrated";
9749
9764
  },
9750
9765
  {
9751
- "code": 6041;
9752
- "name": "invalidShareMintDecimals";
9753
- "msg": "Share mint decimals must match the deposit asset mint decimals";
9766
+ "code": 14045;
9767
+ "name": "invalidMigrationState";
9768
+ "msg": "Legacy vault migration is incomplete or invalid";
9754
9769
  },
9755
9770
  {
9756
- "code": 6042;
9757
- "name": "invalidFeeExemption";
9758
- "msg": "Invalid fee-exemption PDA signer or seeds";
9771
+ "code": 14046;
9772
+ "name": "invalidMigrationMintAuthority";
9773
+ "msg": "Mint authority does not match the expected migration source";
9759
9774
  },
9760
9775
  {
9761
- "code": 6043;
9762
- "name": "exceedsJuniorDepositCap";
9763
- "msg": "Deposit would exceed the junior tranche deposit cap";
9776
+ "code": 14047;
9777
+ "name": "bankMigrationIncomplete";
9778
+ "msg": "Legacy bank or tranche migration is incomplete — source accounting and escrow must be fully drained before mint authority transfer";
9764
9779
  }
9765
9780
  ];
9766
9781
  "types": [
@@ -15397,6 +15412,68 @@ declare function makeProvider(connection: Connection, payer: Keypair): AnchorPro
15397
15412
 
15398
15413
  declare function createRpcFromConnection(connection: Connection): Rpc<SolanaRpcApi>;
15399
15414
 
15415
+ /**
15416
+ * Maps a transaction-proposing wallet to the Squads vault it operates.
15417
+ *
15418
+ * The member wallet pays for and signs proposal creation. The derived Squads
15419
+ * vault PDA is the authority that signs the instructions when the proposal is
15420
+ * eventually executed.
15421
+ */
15422
+ interface SquadsWalletRouteConfig {
15423
+ wallet: string;
15424
+ multisigPda: string;
15425
+ vaultIndex: number;
15426
+ memo?: string;
15427
+ }
15428
+ interface ResolvedSquadsWalletRoute {
15429
+ wallet: PublicKey;
15430
+ multisigPda: PublicKey;
15431
+ vaultIndex: number;
15432
+ vaultPda: PublicKey;
15433
+ memo?: string;
15434
+ }
15435
+ interface PreparedDirectTransaction {
15436
+ kind: "direct";
15437
+ transaction: Transaction;
15438
+ authority: PublicKey;
15439
+ }
15440
+ interface PreparedSquadsTransaction {
15441
+ kind: "squads";
15442
+ transaction: Transaction;
15443
+ authority: PublicKey;
15444
+ multisigPda: PublicKey;
15445
+ vaultIndex: number;
15446
+ transactionIndex: bigint;
15447
+ proposalPda: PublicKey;
15448
+ vaultTransactionPda: PublicKey;
15449
+ }
15450
+ type PreparedVaultTransaction = PreparedDirectTransaction | PreparedSquadsTransaction;
15451
+ /** Resolve and validate a configured wallet route, including its vault PDA. */
15452
+ declare function resolveSquadsWalletRoute(route: SquadsWalletRouteConfig): ResolvedSquadsWalletRoute;
15453
+ /** Find the optional Squads route for a connected proposer wallet. */
15454
+ declare function findSquadsWalletRoute(wallet: PublicKey | string, routes: readonly SquadsWalletRouteConfig[]): ResolvedSquadsWalletRoute | undefined;
15455
+ /** Fail fast on ambiguous wallet mappings or malformed route values. */
15456
+ declare function validateSquadsWalletRoutes(routes: readonly SquadsWalletRouteConfig[]): void;
15457
+ /**
15458
+ * Return the authority that should be used while building vault instructions.
15459
+ * For a configured member wallet this is the Squads vault PDA; otherwise it is
15460
+ * the wallet itself.
15461
+ */
15462
+ declare function vaultAuthorityForWallet(wallet: PublicKey | string, routes: readonly SquadsWalletRouteConfig[]): PublicKey;
15463
+ /**
15464
+ * Build either a normal transaction or a Squads proposal-creation transaction,
15465
+ * based on whether `proposer` has a configured wallet route.
15466
+ *
15467
+ * The returned Squads transaction creates both the vault transaction and its
15468
+ * proposal. It does not approve or execute the proposal.
15469
+ */
15470
+ declare function prepareVaultTransaction(args: {
15471
+ connection: Connection;
15472
+ proposer: PublicKey;
15473
+ instructions: readonly TransactionInstruction[];
15474
+ squadsRoutes?: readonly SquadsWalletRouteConfig[];
15475
+ }): Promise<PreparedVaultTransaction>;
15476
+
15400
15477
  interface CreateTokenMintIxs {
15401
15478
  mint: Keypair;
15402
15479
  ixs: TransactionInstruction[];
@@ -15784,38 +15861,22 @@ interface YieldAccountSnapshot {
15784
15861
  accrualStart: Date;
15785
15862
  accrualEnd: Date;
15786
15863
  }
15864
+ /** Payment state used to interlock oracle publication with yield settlement. */
15865
+ interface YieldPaymentSnapshot {
15866
+ id: string;
15867
+ /** Only `confirmed` is safe; present or future intermediate states block. */
15868
+ status: string;
15869
+ }
15787
15870
  /**
15788
- * Queries accrued yield for named accounts. Mirrors the method surface of the
15789
- * real HTTP client (`yieldApi.ts`) so a production implementation can be dropped
15790
- * in without touching {@link ConsensusOracleService}.
15871
+ * Read-only yield-tracker surface required by the oracle. The live implementation
15872
+ * delegates to the HTTP API; the in-memory implementation also exposes mutation
15873
+ * helpers for tests and local operation.
15791
15874
  */
15792
15875
  interface YieldTracker {
15793
- getYield(accountName: string, start?: Date, end?: Date): Promise<YieldAccountSnapshot>;
15794
- /** Sum of `totalYield` (UI amount) across the named accounts. */
15795
- getTotalYield(accountNames: string[], start?: Date, end?: Date): Promise<number>;
15876
+ /** All payments for an account, including payments not yet confirmed. */
15877
+ getYieldPayments(accountName: string): Promise<YieldPaymentSnapshot[]>;
15796
15878
  /** Sum of oracle-safe outstanding yield across the named accounts. */
15797
15879
  getTotalOutstandingYield(accountNames: string[], start?: Date, end?: Date): Promise<number>;
15798
- /** Current balance (principal + outstanding yield), UI amount. */
15799
- getBalance(accountName: string, atTime?: Date): Promise<number>;
15800
- addCashflow(params: {
15801
- accountName: string;
15802
- amount: number;
15803
- date?: Date;
15804
- cashflowType: "deposit" | "withdraw";
15805
- }): Promise<void>;
15806
- /** Register an expected payment. Pending payments remain outstanding. */
15807
- createYieldPayment(params: {
15808
- accountName: string;
15809
- paymentId: string;
15810
- amount: number;
15811
- effectiveAt: Date;
15812
- }): Promise<void>;
15813
- /** Confirm only after the payment is observable in the destination wallet. */
15814
- confirmYieldPayment(params: {
15815
- accountName: string;
15816
- paymentId: string;
15817
- transactionSignature: string;
15818
- }): Promise<void>;
15819
15880
  }
15820
15881
  /** Injectable wall clock (ms since epoch). Lets tests pin time deterministically. */
15821
15882
  interface Clock {
@@ -16074,6 +16135,7 @@ declare class MockYieldTracker implements YieldTracker {
16074
16135
  /** Register (or replace) a tracked account. */
16075
16136
  setAccount(name: string, cfg: MockYieldAccountConfig): void;
16076
16137
  private require;
16138
+ getYieldPayments(accountName: string): Promise<YieldPaymentSnapshot[]>;
16077
16139
  getYield(accountName: string, start?: Date, end?: Date): Promise<YieldAccountSnapshot>;
16078
16140
  getTotalYield(accountNames: string[], start?: Date, end?: Date): Promise<number>;
16079
16141
  getTotalOutstandingYield(accountNames: string[], start?: Date, end?: Date): Promise<number>;
@@ -16105,6 +16167,12 @@ declare class ConsensusOracleService {
16105
16167
  constructor(client: VaultClient, deps: ConsensusOracleDeps);
16106
16168
  /** Drive one vault: source prices/balances, push consensus update, crank NAV. */
16107
16169
  runOnce(signer: Keypair, target: ConsensusOracleTarget, opts?: RunOptions): Promise<VaultOracleResult>;
16170
+ /**
16171
+ * Fail closed while any configured yield account has an unsettled payment.
16172
+ * The payout must be confirmed only after it is visible in the same wallet
16173
+ * balance source used by this service. Until then, no oracle update is safe.
16174
+ */
16175
+ private assertNoUnconfirmedYieldPayments;
16108
16176
  /**
16109
16177
  * Drive several vaults in sequence. Non-fatal: a failure on one vault is
16110
16178
  * recorded and the rest still run (mirrors the oracle-updater daemon).
@@ -16187,4 +16255,4 @@ declare class ExternalLiquidityIntegrityService {
16187
16255
  private depositIntoMarginfi;
16188
16256
  }
16189
16257
 
16190
- export { ASSET_DECIMALS, type AccountBalanceResponse, AccountClient, type AccountYieldResponse, ActivateCircuitBreakerBuilder, type ActivateCircuitBreakerIxArgs, type ActivateCircuitBreakerTxArgs, type AssetPriceOracleConfigIxArgs, type AssetPriceOracleConfigTxArgs, type AssetPriceRefreshTarget, type AssetRefreshResult, type Bankineco, type BasicAuthCredentials, type Bigintish, CancelJuniorTrancheWithdrawBuilder, type CancelJuniorTrancheWithdrawIxArgs, type CancelJuniorTrancheWithdrawTxArgs, type Clock, type ConsensusAssetUpdate, type ConsensusHoldingEntry, type ConsensusOracleDeps, type ConsensusOracleHoldingConfig, ConsensusOracleService, type ConsensusOracleTarget, CrankNavBuilder, type CrankNavIxArgs, type CrankNavTxArgs, CrankPerformanceFeesBuilder, type CrankPerformanceFeesIxArgs, type CrankPerformanceFeesTxArgs, type CreateAccountParams, CreateAssetHoldingBuilder, type CreateAssetHoldingIxArgs, type CreateAssetHoldingTxArgs, type CreateTokenMintIxs, CreateTrancheStateBuilder, type CreateTrancheStateIxArgs, type CreateTrancheStateTxArgs, CreateVaultBuilder, type CreateVaultClientOptions, type CreateVaultIxArgs, type CreateVaultParams, type CreateVaultTxArgs, type CreateYieldPaymentParams, DEFAULT_JUNIOR_EARLY_UNSTAKE_FEE_BPS, DEFAULT_JUNIOR_STANDARD_UNSTAKE_FEE_BPS, DEFAULT_JUNIOR_WITHDRAWAL_LOCKUP_SECS, DEFAULT_MAX_ACCEPTABLE_APY_BPS, DEFAULT_ORACLE_STALENESS_THRESHOLD_SECS, DEFAULT_PRICE_ORACLE_ACCOUNT, DEFAULT_PRICE_STALENESS_THRESHOLD_SECS, DEFAULT_VAULT_ID, type DecodedHolding, type DecodedVault, type DeleteAccountParams, DisableCircuitBreakerBuilder, type DisableCircuitBreakerIxArgs, type DisableCircuitBreakerTxArgs, ExecuteDepositBuilder, type ExecuteDepositIxArgs, type ExecuteDepositTxArgs, ExecuteShareSwapBuilder, type ExecuteShareSwapIxArgs, type ExecuteShareSwapTxArgs, ExecuteTrancheDepositBuilder, type ExecuteTrancheDepositIxArgs, type ExecuteTrancheDepositTxArgs, ExecuteTrancheWithdrawBuilder, type ExecuteTrancheWithdrawIxArgs, type ExecuteTrancheWithdrawTxArgs, ExecuteWithdrawBuilder, type ExecuteWithdrawIxArgs, type ExecuteWithdrawTxArgs, type ExternalLiquidityIntegrityResult, ExternalLiquidityIntegrityService, type ExternalLiquidityIntegritySummary, type ExternalLiquiditySlot, type ExternalLiquiditySourceArgs, type ExternalPosition, type ExternalPositionContext, type ExternalPositionProvider, type ExternalPositionRef, ExternalPositionRegistry, FEE_VAULT_CACHE_CATEGORY, type FeeVaultAccountData, FulfillJuniorTrancheWithdrawBuilder, type FulfillJuniorTrancheWithdrawIxArgs, type FulfillJuniorTrancheWithdrawTxArgs, type FulfillSummary, type HoldingUpdatePreview, IDL, InitializeVaultRolesBuilder, type InitializeVaultRolesIxArgs, type InitializeVaultRolesTxArgs, type JuniorWithdrawalMode, JupiterBalanceSource, type JupiterBalanceSourceOptions, JupiterPriceSource, type JupiterPriceSourceOptions, JupiterSwapBuilder, type JupiterSwapIxArgs, type JupiterSwapTxArgs, KaminoPositionProvider, type LiveConsensusOracleDepsOptions, MAX_PRICE_STALENESS_THRESHOLD_SECS, ManagerRedepositAssetBuilder, type ManagerRedepositAssetIxArgs, type ManagerRedepositAssetTxArgs, ManagerWithdrawAssetBuilder, type ManagerWithdrawAssetIxArgs, type ManagerWithdrawAssetTxArgs, MarginfiPositionProvider, type MockYieldAccountConfig, MockYieldTracker, type MockYieldTrackerOptions, type NavCrankBlocker, type NavCrankBlockerReason, type NavCrankReadiness, type NavCrankResult, OracleService, PROGRAM_FEE_EXEMPT_OWNER_WHITELIST, PROTOCOL_ADMIN, PROTOCOL_FEE_RECIPIENT, PdaClient, type PriceOracleTypeArgs, type PriceSource, ProtocolInteractionBuilder, type ProtocolInteractionIxArgs, type ProtocolInteractionTxArgs, type QuoteFeeUnit, RemoveAssetHoldingBuilder, type RemoveAssetHoldingIxArgs, type RemoveAssetHoldingTxArgs, RequestJuniorTrancheWithdrawBuilder, type RequestJuniorTrancheWithdrawIxArgs, type RequestJuniorTrancheWithdrawTxArgs, type RollingLimitConfig, type RunLiveConsensusOracleOptions, type RunOptions, type RunSummary, SHARE_DECIMALS, SetAssetPriceOracleBuilder, type SetAssetPriceOracleIxArgs, type SetAssetPriceOracleTxArgs, SetExternalLiquidityBuilder, type SetExternalLiquidityIxArgs, type SetExternalLiquidityTxArgs, SetProtocolFeeBuilder, type SetProtocolFeeIxArgs, type SetProtocolFeeTxArgs, SetVaultConfigBuilder, type SetVaultConfigIxArgs, type SetVaultConfigTxArgs, StaticPositionProvider, TOKEN_PROGRAM, TOKEN_PROGRAM_ID, type TrancheKindArgs, type TransactionBuilder, TransactionClient, USDC_MINT, USD_STAR_JUNIOR_MINT, USD_STAR_MINT, USD_STAR_PRINCIPAL_MINT, type UpdateAccountParams, UpdateAssetPriceBuilder, type UpdateAssetPriceIxArgs, type UpdateAssetPriceTxArgs, UpdateConsensusOracleBuilder, type UpdateConsensusOracleIxArgs, type UpdateConsensusOracleTxArgs, UpdateConsensusSignersBuilder, type UpdateConsensusSignersIxArgs, type UpdateConsensusSignersTxArgs, type UpdateDynamicAprParams, UpdateTrancheConfigBuilder, type UpdateTrancheConfigIxArgs, type UpdateTrancheConfigTxArgs, VAULT_CACHE_CATEGORY, VAULT_CREATOR_WHITELIST, VAULT_ENVIRONMENTS, VAULT_ORACLE_CACHE_CATEGORY, VAULT_PROGRAM_ID, VAULT_PROGRAM_IDS, VAULT_PROGRAM_PUBLIC_KEY, VAULT_ROLE_UPDATE_TIMELOCK_SECS, VAULT_TRANCHE_STATE_CACHE_CATEGORY, VAULT_TRANCHE_WITHDRAWAL_QUEUE_CACHE_CATEGORY, type Vault, type VaultAccountData, VaultBuilderBase, type VaultBuilderContext, type VaultCacheInvalidation, VaultClient, type VaultClientBundle, type VaultEnv, type VaultOracleAccountData, type VaultOracleResult, type VaultPricingInputs, type VaultQuote, type VaultQuoteArgs, VaultQuoteClient, type VaultQuoteDirection, type VaultQuoteShareClass, VaultReallocationBuilder, type VaultReallocationIxArgs, type VaultReallocationTxArgs, type VaultTrancheStateAccountData, type VaultTrancheWithdrawalQueueAccountData, type VaultTransactionPlan, type WalletBalanceSource, type WithdrawProtocolFeesIxArgs, type WithdrawProtocolFeesTxArgs, type WithdrawTrancheFeesIxArgs, type WithdrawTrancheFeesTxArgs, WithdrawalQueueService, type WithdrawalQueueSnapshot, type YieldAccount, type YieldAccountSnapshot, type YieldCalculationLog, type YieldPaymentResponse, type YieldTracker, addCashflowUpdate, confirmYieldPayment, createAccount, createLiveConsensusOracleDeps, createRpcFromConnection, createTokenMint, createTokenMintIxs, createVaultClient, createYieldPayment, dateToStr, defaultKeypairPath, deleteAccount, fromUiAmount, getAccounts, getBalance, getCashflows, getRpcUrl, getTotalOutstandingYield, getTotalYield, getVaultProgramId, getYield, getYieldPayments, isVaultEnv, keypairAddress, loadKeypair, makeProvider, mintTokensTo, resolveKeypairPath, roundToNextUtcMidnight, runLiveConsensusOracle, systemClock, toUiAmount, updateAccount, updateDynamicApr };
16258
+ export { ASSET_DECIMALS, type AccountBalanceResponse, AccountClient, type AccountYieldResponse, ActivateCircuitBreakerBuilder, type ActivateCircuitBreakerIxArgs, type ActivateCircuitBreakerTxArgs, type AssetPriceOracleConfigIxArgs, type AssetPriceOracleConfigTxArgs, type AssetPriceRefreshTarget, type AssetRefreshResult, type Bankineco, type BasicAuthCredentials, type Bigintish, CancelJuniorTrancheWithdrawBuilder, type CancelJuniorTrancheWithdrawIxArgs, type CancelJuniorTrancheWithdrawTxArgs, type Clock, type ConsensusAssetUpdate, type ConsensusHoldingEntry, type ConsensusOracleDeps, type ConsensusOracleHoldingConfig, ConsensusOracleService, type ConsensusOracleTarget, CrankNavBuilder, type CrankNavIxArgs, type CrankNavTxArgs, CrankPerformanceFeesBuilder, type CrankPerformanceFeesIxArgs, type CrankPerformanceFeesTxArgs, type CreateAccountParams, CreateAssetHoldingBuilder, type CreateAssetHoldingIxArgs, type CreateAssetHoldingTxArgs, type CreateTokenMintIxs, CreateTrancheStateBuilder, type CreateTrancheStateIxArgs, type CreateTrancheStateTxArgs, CreateVaultBuilder, type CreateVaultClientOptions, type CreateVaultIxArgs, type CreateVaultParams, type CreateVaultTxArgs, type CreateYieldPaymentParams, DEFAULT_JUNIOR_EARLY_UNSTAKE_FEE_BPS, DEFAULT_JUNIOR_STANDARD_UNSTAKE_FEE_BPS, DEFAULT_JUNIOR_WITHDRAWAL_LOCKUP_SECS, DEFAULT_MAX_ACCEPTABLE_APY_BPS, DEFAULT_ORACLE_STALENESS_THRESHOLD_SECS, DEFAULT_PRICE_ORACLE_ACCOUNT, DEFAULT_PRICE_STALENESS_THRESHOLD_SECS, DEFAULT_VAULT_ID, type DecodedHolding, type DecodedVault, type DeleteAccountParams, DisableCircuitBreakerBuilder, type DisableCircuitBreakerIxArgs, type DisableCircuitBreakerTxArgs, ExecuteDepositBuilder, type ExecuteDepositIxArgs, type ExecuteDepositTxArgs, ExecuteShareSwapBuilder, type ExecuteShareSwapIxArgs, type ExecuteShareSwapTxArgs, ExecuteTrancheDepositBuilder, type ExecuteTrancheDepositIxArgs, type ExecuteTrancheDepositTxArgs, ExecuteTrancheWithdrawBuilder, type ExecuteTrancheWithdrawIxArgs, type ExecuteTrancheWithdrawTxArgs, ExecuteWithdrawBuilder, type ExecuteWithdrawIxArgs, type ExecuteWithdrawTxArgs, type ExternalLiquidityIntegrityResult, ExternalLiquidityIntegrityService, type ExternalLiquidityIntegritySummary, type ExternalLiquiditySlot, type ExternalLiquiditySourceArgs, type ExternalPosition, type ExternalPositionContext, type ExternalPositionProvider, type ExternalPositionRef, ExternalPositionRegistry, FEE_VAULT_CACHE_CATEGORY, type FeeVaultAccountData, FulfillJuniorTrancheWithdrawBuilder, type FulfillJuniorTrancheWithdrawIxArgs, type FulfillJuniorTrancheWithdrawTxArgs, type FulfillSummary, type HoldingUpdatePreview, IDL, InitializeVaultRolesBuilder, type InitializeVaultRolesIxArgs, type InitializeVaultRolesTxArgs, type JuniorWithdrawalMode, JupiterBalanceSource, type JupiterBalanceSourceOptions, JupiterPriceSource, type JupiterPriceSourceOptions, JupiterSwapBuilder, type JupiterSwapIxArgs, type JupiterSwapTxArgs, KaminoPositionProvider, type LiveConsensusOracleDepsOptions, MAX_PRICE_STALENESS_THRESHOLD_SECS, ManagerRedepositAssetBuilder, type ManagerRedepositAssetIxArgs, type ManagerRedepositAssetTxArgs, ManagerWithdrawAssetBuilder, type ManagerWithdrawAssetIxArgs, type ManagerWithdrawAssetTxArgs, MarginfiPositionProvider, type MockYieldAccountConfig, MockYieldTracker, type MockYieldTrackerOptions, type NavCrankBlocker, type NavCrankBlockerReason, type NavCrankReadiness, type NavCrankResult, OracleService, PROGRAM_FEE_EXEMPT_OWNER_WHITELIST, PROTOCOL_ADMIN, PROTOCOL_FEE_RECIPIENT, PdaClient, type PreparedDirectTransaction, type PreparedSquadsTransaction, type PreparedVaultTransaction, type PriceOracleTypeArgs, type PriceSource, ProtocolInteractionBuilder, type ProtocolInteractionIxArgs, type ProtocolInteractionTxArgs, type QuoteFeeUnit, RemoveAssetHoldingBuilder, type RemoveAssetHoldingIxArgs, type RemoveAssetHoldingTxArgs, RequestJuniorTrancheWithdrawBuilder, type RequestJuniorTrancheWithdrawIxArgs, type RequestJuniorTrancheWithdrawTxArgs, type ResolvedSquadsWalletRoute, type RollingLimitConfig, type RunLiveConsensusOracleOptions, type RunOptions, type RunSummary, SHARE_DECIMALS, SetAssetPriceOracleBuilder, type SetAssetPriceOracleIxArgs, type SetAssetPriceOracleTxArgs, SetExternalLiquidityBuilder, type SetExternalLiquidityIxArgs, type SetExternalLiquidityTxArgs, SetProtocolFeeBuilder, type SetProtocolFeeIxArgs, type SetProtocolFeeTxArgs, SetVaultConfigBuilder, type SetVaultConfigIxArgs, type SetVaultConfigTxArgs, type SquadsWalletRouteConfig, StaticPositionProvider, TOKEN_PROGRAM, TOKEN_PROGRAM_ID, type TrancheKindArgs, type TransactionBuilder, TransactionClient, USDC_MINT, USD_STAR_JUNIOR_MINT, USD_STAR_MINT, USD_STAR_PRINCIPAL_MINT, type UpdateAccountParams, UpdateAssetPriceBuilder, type UpdateAssetPriceIxArgs, type UpdateAssetPriceTxArgs, UpdateConsensusOracleBuilder, type UpdateConsensusOracleIxArgs, type UpdateConsensusOracleTxArgs, UpdateConsensusSignersBuilder, type UpdateConsensusSignersIxArgs, type UpdateConsensusSignersTxArgs, type UpdateDynamicAprParams, UpdateTrancheConfigBuilder, type UpdateTrancheConfigIxArgs, type UpdateTrancheConfigTxArgs, VAULT_CACHE_CATEGORY, VAULT_CREATOR_WHITELIST, VAULT_ENVIRONMENTS, VAULT_ORACLE_CACHE_CATEGORY, VAULT_PROGRAM_ID, VAULT_PROGRAM_IDS, VAULT_PROGRAM_PUBLIC_KEY, VAULT_ROLE_UPDATE_TIMELOCK_SECS, VAULT_TRANCHE_STATE_CACHE_CATEGORY, VAULT_TRANCHE_WITHDRAWAL_QUEUE_CACHE_CATEGORY, type Vault, type VaultAccountData, VaultBuilderBase, type VaultBuilderContext, type VaultCacheInvalidation, VaultClient, type VaultClientBundle, type VaultEnv, type VaultOracleAccountData, type VaultOracleResult, type VaultPricingInputs, type VaultQuote, type VaultQuoteArgs, VaultQuoteClient, type VaultQuoteDirection, type VaultQuoteShareClass, VaultReallocationBuilder, type VaultReallocationIxArgs, type VaultReallocationTxArgs, type VaultTrancheStateAccountData, type VaultTrancheWithdrawalQueueAccountData, type VaultTransactionPlan, type WalletBalanceSource, type WithdrawProtocolFeesIxArgs, type WithdrawProtocolFeesTxArgs, type WithdrawTrancheFeesIxArgs, type WithdrawTrancheFeesTxArgs, WithdrawalQueueService, type WithdrawalQueueSnapshot, type YieldAccount, type YieldAccountSnapshot, type YieldCalculationLog, type YieldPaymentResponse, type YieldPaymentSnapshot, type YieldTracker, addCashflowUpdate, confirmYieldPayment, createAccount, createLiveConsensusOracleDeps, createRpcFromConnection, createTokenMint, createTokenMintIxs, createVaultClient, createYieldPayment, dateToStr, defaultKeypairPath, deleteAccount, findSquadsWalletRoute, fromUiAmount, getAccounts, getBalance, getCashflows, getRpcUrl, getTotalOutstandingYield, getTotalYield, getVaultProgramId, getYield, getYieldPayments, isVaultEnv, keypairAddress, loadKeypair, makeProvider, mintTokensTo, prepareVaultTransaction, resolveKeypairPath, resolveSquadsWalletRoute, roundToNextUtcMidnight, runLiveConsensusOracle, systemClock, toUiAmount, updateAccount, updateDynamicApr, validateSquadsWalletRoutes, vaultAuthorityForWallet };