@reflectmoney/stable.ts 1.1.3 → 1.1.5
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/classes/ApiClient.d.ts +84 -0
- package/dist/classes/ApiClient.js +24 -2
- package/dist/classes/PdaClient.d.ts +131 -0
- package/dist/classes/Reflect.d.ts +7 -0
- package/dist/classes/ReflectKeeper.d.ts +105 -0
- package/dist/classes/ReflectKeeper.js +4 -3
- package/dist/classes/ReflectTokenisedBond.d.ts +75 -0
- package/dist/classes/Stablecoin.d.ts +219 -0
- package/dist/classes/index.d.ts +5 -0
- package/dist/classes/index.js +1 -0
- package/dist/constants/drift.d.ts +6 -0
- package/dist/constants/index.d.ts +8 -0
- package/dist/constants/jupiter.d.ts +4 -0
- package/dist/constants/lookupTables.d.ts +4 -0
- package/dist/constants/lookupTables.js +1 -1
- package/dist/constants/lst.d.ts +3 -0
- package/dist/constants/pyth.d.ts +1 -0
- package/dist/constants/usdc.d.ts +6 -0
- package/dist/constants/wsol.d.ts +6 -0
- package/dist/errors/ReflectError.d.ts +4 -0
- package/dist/generated/reflect_main/accounts/DriftJlpController.d.ts +114 -0
- package/dist/generated/reflect_main/accounts/DriftJlpController.js +1 -1
- package/dist/generated/reflect_main/accounts/DriftLstController.d.ts +108 -0
- package/dist/generated/reflect_main/accounts/DriftLstController.js +1 -1
- package/dist/generated/reflect_main/accounts/DriftUsdcController.d.ts +107 -0
- package/dist/generated/reflect_main/accounts/DriftUsdcController.js +8 -60
- package/dist/generated/reflect_main/accounts/Main.d.ts +110 -0
- package/dist/generated/reflect_main/accounts/Main.js +1 -1
- package/dist/generated/reflect_main/accounts/PerpMarket.d.ts +226 -0
- package/dist/generated/reflect_main/accounts/PerpMarket.js +1 -1
- package/dist/generated/reflect_main/accounts/PrelaunchOracle.d.ts +130 -0
- package/dist/generated/reflect_main/accounts/PrelaunchOracle.js +1 -1
- package/dist/generated/reflect_main/accounts/PythLazerOracle.d.ts +124 -0
- package/dist/generated/reflect_main/accounts/PythLazerOracle.js +1 -1
- package/dist/generated/reflect_main/accounts/RebalanceLst.d.ts +111 -0
- package/dist/generated/reflect_main/accounts/RebalanceLst.js +1 -1
- package/dist/generated/reflect_main/accounts/SpotMarket.d.ts +377 -0
- package/dist/generated/reflect_main/accounts/SpotMarket.js +1 -1
- package/dist/generated/reflect_main/accounts/User.d.ts +221 -0
- package/dist/generated/reflect_main/accounts/User.js +1 -1
- package/dist/generated/reflect_main/accounts/UserPermissions.d.ts +106 -0
- package/dist/generated/reflect_main/accounts/UserPermissions.js +1 -1
- package/dist/generated/reflect_main/accounts/UserStats.d.ts +211 -0
- package/dist/generated/reflect_main/accounts/UserStats.js +1 -1
- package/dist/generated/reflect_main/accounts/index.d.ts +38 -0
- package/dist/generated/reflect_main/errors/index.d.ts +969 -0
- package/dist/generated/reflect_main/errors/index.js +133 -133
- package/dist/generated/reflect_main/index.d.ts +19 -0
- package/dist/generated/reflect_main/index.js +1 -1
- package/dist/generated/reflect_main/instructions/addLstDrift.d.ts +49 -0
- package/dist/generated/reflect_main/instructions/addLstDrift.js +1 -1
- package/dist/generated/reflect_main/instructions/addSubAccount.d.ts +54 -0
- package/dist/generated/reflect_main/instructions/addSubAccount.js +1 -1
- package/dist/generated/reflect_main/instructions/captureSpreadDrift.d.ts +66 -0
- package/dist/generated/reflect_main/instructions/captureSpreadDrift.js +3 -3
- package/dist/generated/reflect_main/instructions/captureSpreadDriftS1.d.ts +58 -0
- package/dist/generated/reflect_main/instructions/createAdminAccount.d.ts +52 -0
- package/dist/generated/reflect_main/instructions/createAdminAccount.js +2 -1
- package/dist/generated/reflect_main/instructions/createUserStatsAccount.d.ts +52 -0
- package/dist/generated/reflect_main/instructions/createUserStatsAccount.js +1 -1
- package/dist/generated/reflect_main/instructions/depositDrift.d.ts +73 -0
- package/dist/generated/reflect_main/instructions/depositDrift.js +1 -1
- package/dist/generated/reflect_main/instructions/freezeProgram.d.ts +54 -0
- package/dist/generated/reflect_main/instructions/freezeProgram.js +1 -1
- package/dist/generated/reflect_main/instructions/freezeProtocolAction.d.ts +55 -0
- package/dist/generated/reflect_main/instructions/freezeProtocolAction.js +1 -1
- package/dist/generated/reflect_main/instructions/freezeStrategyAction.d.ts +58 -0
- package/dist/generated/reflect_main/instructions/freezeStrategyAction.js +1 -1
- package/dist/generated/reflect_main/instructions/increaseAdminSize.d.ts +51 -0
- package/dist/generated/reflect_main/instructions/increaseAdminSize.js +89 -0
- package/dist/generated/reflect_main/instructions/index.d.ts +34 -0
- package/dist/generated/reflect_main/instructions/index.js +1 -1
- package/dist/generated/reflect_main/instructions/initDriftAccountsS1.d.ts +54 -0
- package/dist/generated/reflect_main/instructions/initDriftAccountsS1.js +1 -1
- package/dist/generated/reflect_main/instructions/initDriftControllerS1.d.ts +58 -0
- package/dist/generated/reflect_main/instructions/initDriftControllerS1.js +1 -1
- package/dist/generated/reflect_main/instructions/initDriftControllerS3.d.ts +58 -0
- package/dist/generated/reflect_main/instructions/initDriftControllerS3.js +1 -1
- package/dist/generated/reflect_main/instructions/initMain.d.ts +43 -0
- package/dist/generated/reflect_main/instructions/initMain.js +1 -1
- package/dist/generated/reflect_main/instructions/mintDriftS1.d.ts +86 -0
- package/dist/generated/reflect_main/instructions/mintDriftS1.js +1 -1
- package/dist/generated/reflect_main/instructions/mintDriftS3.d.ts +86 -0
- package/dist/generated/reflect_main/instructions/mintDriftS3.js +1 -1
- package/dist/generated/reflect_main/instructions/processSwapDeposit.d.ts +69 -0
- package/dist/generated/reflect_main/instructions/processSwapDeposit.js +1 -1
- package/dist/generated/reflect_main/instructions/processSwapWithdraw.d.ts +69 -0
- package/dist/generated/reflect_main/instructions/processSwapWithdraw.js +1 -1
- package/dist/generated/reflect_main/instructions/redeemDriftS1.d.ts +87 -0
- package/dist/generated/reflect_main/instructions/redeemDriftS1.js +1 -1
- package/dist/generated/reflect_main/instructions/redeemDriftS3.d.ts +87 -0
- package/dist/generated/reflect_main/instructions/redeemDriftS3.js +1 -1
- package/dist/generated/reflect_main/instructions/settlePnl.d.ts +50 -0
- package/dist/generated/reflect_main/instructions/settlePnl.js +1 -10
- package/dist/generated/reflect_main/instructions/settlePnlMulti.d.ts +60 -0
- package/dist/generated/reflect_main/instructions/settlePnlMulti.js +1 -10
- package/dist/generated/reflect_main/instructions/suspendSplProtocol.d.ts +54 -0
- package/dist/generated/reflect_main/instructions/suspendSplProtocol.js +1 -1
- package/dist/generated/reflect_main/instructions/suspendSplStrategy.d.ts +56 -0
- package/dist/generated/reflect_main/instructions/suspendSplStrategy.js +1 -1
- package/dist/generated/reflect_main/instructions/swapOrca.d.ts +81 -0
- package/dist/generated/reflect_main/instructions/swapOrca.js +1 -1
- package/dist/generated/reflect_main/instructions/swapOrcaTwoHop.d.ts +101 -0
- package/dist/generated/reflect_main/instructions/swapOrcaTwoHop.js +1 -1
- package/dist/generated/reflect_main/instructions/updateActionRoleProtocol.d.ts +58 -0
- package/dist/generated/reflect_main/instructions/updateActionRoleProtocol.js +1 -1
- package/dist/generated/reflect_main/instructions/updateActionRoleStrategy.d.ts +60 -0
- package/dist/generated/reflect_main/instructions/updateActionRoleStrategy.js +1 -1
- package/dist/generated/reflect_main/instructions/updateAttenuation.d.ts +57 -0
- package/dist/generated/reflect_main/instructions/updateAttenuation.js +1 -1
- package/dist/generated/reflect_main/instructions/updateCap.d.ts +55 -0
- package/dist/generated/reflect_main/instructions/updateCap.js +1 -1
- package/dist/generated/reflect_main/instructions/updateRebalanceSlippage.d.ts +55 -0
- package/dist/generated/reflect_main/instructions/updateRebalanceSlippage.js +1 -1
- package/dist/generated/reflect_main/instructions/updateRecipients.d.ts +56 -0
- package/dist/generated/reflect_main/instructions/updateRecipients.js +1 -1
- package/dist/generated/reflect_main/instructions/updateRoleHolderProtocol.d.ts +60 -0
- package/dist/generated/reflect_main/instructions/updateRoleHolderProtocol.js +1 -1
- package/dist/generated/reflect_main/instructions/updateRoleHolderStrategy.d.ts +60 -0
- package/dist/generated/reflect_main/instructions/updateRoleHolderStrategy.js +1 -1
- package/dist/generated/reflect_main/types/AMM.d.ts +102 -0
- package/dist/generated/reflect_main/types/AccKey.d.ts +15 -0
- package/dist/generated/reflect_main/types/AccessControl.d.ts +18 -0
- package/dist/generated/reflect_main/types/AccessMap.d.ts +17 -0
- package/dist/generated/reflect_main/types/Action.d.ts +35 -0
- package/dist/generated/reflect_main/types/ActionMapping.d.ts +19 -0
- package/dist/generated/reflect_main/types/AssetTier.d.ts +23 -0
- package/dist/generated/reflect_main/types/Attenuation.d.ts +16 -0
- package/dist/generated/reflect_main/types/AutoCompound.d.ts +18 -0
- package/dist/generated/reflect_main/types/AutoCompound.js +43 -0
- package/dist/generated/reflect_main/types/BalanceType.d.ts +20 -0
- package/dist/generated/reflect_main/types/Capture.d.ts +19 -0
- package/dist/generated/reflect_main/types/Capture.js +2 -0
- package/dist/generated/reflect_main/types/ContractTier.d.ts +24 -0
- package/dist/generated/reflect_main/types/ContractType.d.ts +20 -0
- package/dist/generated/reflect_main/types/CorpAction.d.ts +19 -0
- package/dist/generated/reflect_main/types/CustodyInfo.d.ts +20 -0
- package/dist/generated/reflect_main/types/DirectionCollateral.d.ts +20 -0
- package/dist/generated/reflect_main/types/DirectionPosition.d.ts +20 -0
- package/dist/generated/reflect_main/types/DriftControllerBase.d.ts +15 -0
- package/dist/generated/reflect_main/types/DriftJlpControllerFixedAccounts.d.ts +18 -0
- package/dist/generated/reflect_main/types/DriftLstData.d.ts +17 -0
- package/dist/generated/reflect_main/types/Ema.d.ts +17 -0
- package/dist/generated/reflect_main/types/Externals.d.ts +16 -0
- package/dist/generated/reflect_main/types/FlowControl.d.ts +17 -0
- package/dist/generated/reflect_main/types/HistoricalIndexData.d.ts +19 -0
- package/dist/generated/reflect_main/types/HistoricalOracleData.d.ts +20 -0
- package/dist/generated/reflect_main/types/Holding.d.ts +21 -0
- package/dist/generated/reflect_main/types/Holdings.d.ts +17 -0
- package/dist/generated/reflect_main/types/InsuranceClaim.d.ts +19 -0
- package/dist/generated/reflect_main/types/InsuranceFund.d.ts +24 -0
- package/dist/generated/reflect_main/types/JlpRebalanceSettings.d.ts +15 -0
- package/dist/generated/reflect_main/types/KillSwitch.d.ts +15 -0
- package/dist/generated/reflect_main/types/LevelRoles.d.ts +16 -0
- package/dist/generated/reflect_main/types/MarketStatus.d.ts +27 -0
- package/dist/generated/reflect_main/types/MarketType.d.ts +20 -0
- package/dist/generated/reflect_main/types/ModifyOrderParams.d.ts +32 -0
- package/dist/generated/reflect_main/types/ModifyOrderPolicy.d.ts +20 -0
- package/dist/generated/reflect_main/types/Movements.d.ts +19 -0
- package/dist/generated/reflect_main/types/OracleGuardRails.d.ts +18 -0
- package/dist/generated/reflect_main/types/OracleSource.d.ts +34 -0
- package/dist/generated/reflect_main/types/OracleValidity.d.ts +25 -0
- package/dist/generated/reflect_main/types/Order.d.ts +43 -0
- package/dist/generated/reflect_main/types/OrderDirection.d.ts +20 -0
- package/dist/generated/reflect_main/types/OrderParams.d.ts +36 -0
- package/dist/generated/reflect_main/types/OrderParams.js +1 -1
- package/dist/generated/reflect_main/types/OrderStatus.d.ts +22 -0
- package/dist/generated/reflect_main/types/OrderTriggerCondition.d.ts +22 -0
- package/dist/generated/reflect_main/types/OrderType.d.ts +23 -0
- package/dist/generated/reflect_main/types/PermissionLevel.d.ts +45 -0
- package/dist/generated/reflect_main/types/PerpHedge.d.ts +17 -0
- package/dist/generated/reflect_main/types/PerpPosition.d.ts +29 -0
- package/dist/generated/reflect_main/types/PoolBalance.d.ts +17 -0
- package/dist/generated/reflect_main/types/Position.d.ts +20 -0
- package/dist/generated/reflect_main/types/PositionDirection.d.ts +20 -0
- package/dist/generated/reflect_main/types/PositionDrift.d.ts +18 -0
- package/dist/generated/reflect_main/types/PostOnlyParam.d.ts +22 -0
- package/dist/generated/reflect_main/types/Price.d.ts +41 -0
- package/dist/generated/reflect_main/types/PriceComp.d.ts +19 -0
- package/dist/generated/reflect_main/types/PriceDivergenceGuardRails.d.ts +16 -0
- package/dist/generated/reflect_main/types/PriceInfo.d.ts +21 -0
- package/dist/generated/reflect_main/types/PriceStatus.d.ts +22 -0
- package/dist/generated/reflect_main/types/PriceType.d.ts +20 -0
- package/dist/generated/reflect_main/types/Program.d.ts +19 -0
- package/dist/generated/reflect_main/types/ProgramStatus.d.ts +20 -0
- package/dist/generated/reflect_main/types/Recipient.d.ts +17 -0
- package/dist/generated/reflect_main/types/Recipients.d.ts +17 -0
- package/dist/generated/reflect_main/types/Role.d.ts +25 -0
- package/dist/generated/reflect_main/types/ShiftCollateral.d.ts +19 -0
- package/dist/generated/reflect_main/types/ShiftPosition.d.ts +17 -0
- package/dist/generated/reflect_main/types/ShortHolding.d.ts +17 -0
- package/dist/generated/reflect_main/types/SplBase.d.ts +17 -0
- package/dist/generated/reflect_main/types/SplMain.d.ts +22 -0
- package/dist/generated/reflect_main/types/Spls.d.ts +17 -0
- package/dist/generated/reflect_main/types/SpotBalanceType.d.ts +20 -0
- package/dist/generated/reflect_main/types/SpotPosition.d.ts +23 -0
- package/dist/generated/reflect_main/types/Status.d.ts +21 -0
- package/dist/generated/reflect_main/types/Strategy.d.ts +34 -0
- package/dist/generated/reflect_main/types/Strategy.js +2 -0
- package/dist/generated/reflect_main/types/StrategyPadding.d.ts +15 -0
- package/dist/generated/reflect_main/types/StrategyRoleEntry.d.ts +17 -0
- package/dist/generated/reflect_main/types/SubAccount.d.ts +17 -0
- package/dist/generated/reflect_main/types/Update.d.ts +20 -0
- package/dist/generated/reflect_main/types/UserFees.d.ts +20 -0
- package/dist/generated/reflect_main/types/ValidityGuardRails.d.ts +18 -0
- package/dist/generated/reflect_main/types/YieldDistribution.d.ts +20 -0
- package/dist/generated/reflect_main/types/YieldDistribution.js +47 -0
- package/dist/generated/reflect_main/types/index.d.ts +82 -0
- package/dist/generated/reflect_main/types/index.js +2 -0
- package/dist/generated/reflect_tokenised_bonds/accounts/Admin.d.ts +99 -0
- package/dist/generated/reflect_tokenised_bonds/accounts/Config.d.ts +106 -0
- package/dist/generated/reflect_tokenised_bonds/accounts/Vault.d.ts +114 -0
- package/dist/generated/reflect_tokenised_bonds/accounts/index.d.ts +11 -0
- package/dist/generated/reflect_tokenised_bonds/errors/index.d.ts +144 -0
- package/dist/generated/reflect_tokenised_bonds/index.d.ts +19 -0
- package/dist/generated/reflect_tokenised_bonds/instructions/createVault.d.ts +50 -0
- package/dist/generated/reflect_tokenised_bonds/instructions/deposit.d.ts +62 -0
- package/dist/generated/reflect_tokenised_bonds/instructions/index.d.ts +4 -0
- package/dist/generated/reflect_tokenised_bonds/instructions/initialize.d.ts +43 -0
- package/dist/generated/reflect_tokenised_bonds/instructions/withdraw.d.ts +62 -0
- package/dist/generated/reflect_tokenised_bonds/types/DepositArgs.d.ts +17 -0
- package/dist/generated/reflect_tokenised_bonds/types/Permissions.d.ts +21 -0
- package/dist/generated/reflect_tokenised_bonds/types/WithdrawArgs.d.ts +16 -0
- package/dist/generated/reflect_tokenised_bonds/types/index.d.ts +3 -0
- package/dist/helpers/getOrcaQuote.d.ts +3 -0
- package/dist/idl/perpetuals.d.ts +5771 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +1 -0
- package/dist/stablecoins/LstStablecoin.d.ts +103 -0
- package/dist/stablecoins/UsdcPlusStablecoin.d.ts +86 -0
- package/dist/stablecoins/UsdjStablecoin.d.ts +1 -0
- package/dist/stablecoins/index.d.ts +3 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/api.d.ts +1384 -0
- package/dist/types/api.js +6 -0
- package/dist/types/index.d.ts +81 -0
- package/dist/types/index.js +2 -0
- package/package.json +2 -2
package/dist/classes/index.js
CHANGED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PublicKey } from "@solana/web3.js";
|
|
2
|
+
declare const DRIFT_VAULT: PublicKey;
|
|
3
|
+
declare const DRIFT_PROGRAM_ID: PublicKey;
|
|
4
|
+
declare const REFERRAL_USER: PublicKey;
|
|
5
|
+
declare const REFERRAL_USER_STATS: PublicKey;
|
|
6
|
+
export { DRIFT_VAULT, REFERRAL_USER, REFERRAL_USER_STATS, DRIFT_PROGRAM_ID };
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.LST_LOOKUP_TABLE = exports.JLP_LOOKUP_TABLE = exports.USDC_PLUS_LOOKUP_TABLE = void 0;
|
|
4
4
|
const web3_js_1 = require("@solana/web3.js");
|
|
5
|
-
exports.USDC_PLUS_LOOKUP_TABLE = new web3_js_1.PublicKey(
|
|
5
|
+
exports.USDC_PLUS_LOOKUP_TABLE = new web3_js_1.PublicKey("3ucoeL8gcwaYS35WiCCEqXZDwoFTYT8PdC1PEw6omX3t");
|
|
6
6
|
exports.JLP_LOOKUP_TABLE = new web3_js_1.PublicKey(0);
|
|
7
7
|
exports.LST_LOOKUP_TABLE = new web3_js_1.PublicKey(0);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PYTH_API_URL = "https://hermes.pyth.network/api/latest_price_feeds?ids[]=";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PublicKey } from "@solana/web3.js";
|
|
2
|
+
export declare const USDC_MINT: PublicKey;
|
|
3
|
+
export declare const USDC_PUSH_ORACLE: PublicKey;
|
|
4
|
+
export declare const USDC_PULL_ORACLE: PublicKey;
|
|
5
|
+
export declare const USDC_SPOT_MARKET: PublicKey;
|
|
6
|
+
export declare const USDC_DRIFT_VAULT: PublicKey;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { PublicKey } from "@solana/web3.js";
|
|
2
|
+
export declare const WSOL_PUSH_ORACLE: PublicKey;
|
|
3
|
+
export declare const WSOL_PULL_ORACLE: PublicKey;
|
|
4
|
+
export declare const WSOL_SPOT_MARKET: PublicKey;
|
|
5
|
+
export declare const WSOL_PERP_MARKET: PublicKey;
|
|
6
|
+
export declare const WSOL_MINT: PublicKey;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was GENERATED using the solita package.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead rerun solita to update it or write a wrapper to add functionality.
|
|
4
|
+
*
|
|
5
|
+
* See: https://github.com/metaplex-foundation/solita
|
|
6
|
+
*/
|
|
7
|
+
import * as web3 from '@solana/web3.js';
|
|
8
|
+
import * as beet from '@metaplex-foundation/beet';
|
|
9
|
+
import * as beetSolana from '@metaplex-foundation/beet-solana';
|
|
10
|
+
import { Strategy } from '../types/Strategy';
|
|
11
|
+
import { DriftControllerBase } from '../types/DriftControllerBase';
|
|
12
|
+
import { PerpHedge } from '../types/PerpHedge';
|
|
13
|
+
import { JlpRebalanceSettings } from '../types/JlpRebalanceSettings';
|
|
14
|
+
/**
|
|
15
|
+
* Arguments used to create {@link DriftJlpController}
|
|
16
|
+
* @category Accounts
|
|
17
|
+
* @category generated
|
|
18
|
+
*/
|
|
19
|
+
export type DriftJlpControllerArgs = {
|
|
20
|
+
baseStrategy: Strategy;
|
|
21
|
+
baseDrift: DriftControllerBase;
|
|
22
|
+
jlpMarketIndex: number;
|
|
23
|
+
driftPerpMarketsHedge: PerpHedge[];
|
|
24
|
+
jlpMint: web3.PublicKey;
|
|
25
|
+
rebalanceSettings: JlpRebalanceSettings;
|
|
26
|
+
};
|
|
27
|
+
export declare const driftJlpControllerDiscriminator: number[];
|
|
28
|
+
/**
|
|
29
|
+
* Holds the data for the {@link DriftJlpController} Account and provides de/serialization
|
|
30
|
+
* functionality for that data
|
|
31
|
+
*
|
|
32
|
+
* @category Accounts
|
|
33
|
+
* @category generated
|
|
34
|
+
*/
|
|
35
|
+
export declare class DriftJlpController implements DriftJlpControllerArgs {
|
|
36
|
+
readonly baseStrategy: Strategy;
|
|
37
|
+
readonly baseDrift: DriftControllerBase;
|
|
38
|
+
readonly jlpMarketIndex: number;
|
|
39
|
+
readonly driftPerpMarketsHedge: PerpHedge[];
|
|
40
|
+
readonly jlpMint: web3.PublicKey;
|
|
41
|
+
readonly rebalanceSettings: JlpRebalanceSettings;
|
|
42
|
+
private constructor();
|
|
43
|
+
/**
|
|
44
|
+
* Creates a {@link DriftJlpController} instance from the provided args.
|
|
45
|
+
*/
|
|
46
|
+
static fromArgs(args: DriftJlpControllerArgs): DriftJlpController;
|
|
47
|
+
/**
|
|
48
|
+
* Deserializes the {@link DriftJlpController} from the data of the provided {@link web3.AccountInfo}.
|
|
49
|
+
* @returns a tuple of the account data and the offset up to which the buffer was read to obtain it.
|
|
50
|
+
*/
|
|
51
|
+
static fromAccountInfo(accountInfo: web3.AccountInfo<Buffer>, offset?: number): [DriftJlpController, number];
|
|
52
|
+
/**
|
|
53
|
+
* Retrieves the account info from the provided address and deserializes
|
|
54
|
+
* the {@link DriftJlpController} from its data.
|
|
55
|
+
*
|
|
56
|
+
* @throws Error if no account info is found at the address or if deserialization fails
|
|
57
|
+
*/
|
|
58
|
+
static fromAccountAddress(connection: web3.Connection, address: web3.PublicKey, commitmentOrConfig?: web3.Commitment | web3.GetAccountInfoConfig): Promise<DriftJlpController>;
|
|
59
|
+
/**
|
|
60
|
+
* Provides a {@link web3.Connection.getProgramAccounts} config builder,
|
|
61
|
+
* to fetch accounts matching filters that can be specified via that builder.
|
|
62
|
+
*
|
|
63
|
+
* @param programId - the program that owns the accounts we are filtering
|
|
64
|
+
*/
|
|
65
|
+
static gpaBuilder(programId?: web3.PublicKey): beetSolana.GpaBuilder<DriftJlpControllerArgs & {
|
|
66
|
+
accountDiscriminator: number[];
|
|
67
|
+
}>;
|
|
68
|
+
/**
|
|
69
|
+
* Deserializes the {@link DriftJlpController} from the provided data Buffer.
|
|
70
|
+
* @returns a tuple of the account data and the offset up to which the buffer was read to obtain it.
|
|
71
|
+
*/
|
|
72
|
+
static deserialize(buf: Buffer, offset?: number): [DriftJlpController, number];
|
|
73
|
+
/**
|
|
74
|
+
* Serializes the {@link DriftJlpController} into a Buffer.
|
|
75
|
+
* @returns a tuple of the created Buffer and the offset up to which the buffer was written to store it.
|
|
76
|
+
*/
|
|
77
|
+
serialize(): [Buffer, number];
|
|
78
|
+
/**
|
|
79
|
+
* Returns the byteSize of a {@link Buffer} holding the serialized data of
|
|
80
|
+
* {@link DriftJlpController} for the provided args.
|
|
81
|
+
*
|
|
82
|
+
* @param args need to be provided since the byte size for this account
|
|
83
|
+
* depends on them
|
|
84
|
+
*/
|
|
85
|
+
static byteSize(args: DriftJlpControllerArgs): number;
|
|
86
|
+
/**
|
|
87
|
+
* Fetches the minimum balance needed to exempt an account holding
|
|
88
|
+
* {@link DriftJlpController} data from rent
|
|
89
|
+
*
|
|
90
|
+
* @param args need to be provided since the byte size for this account
|
|
91
|
+
* depends on them
|
|
92
|
+
* @param connection used to retrieve the rent exemption information
|
|
93
|
+
*/
|
|
94
|
+
static getMinimumBalanceForRentExemption(args: DriftJlpControllerArgs, connection: web3.Connection, commitment?: web3.Commitment): Promise<number>;
|
|
95
|
+
/**
|
|
96
|
+
* Returns a readable version of {@link DriftJlpController} properties
|
|
97
|
+
* and can be used to convert to JSON and/or logging
|
|
98
|
+
*/
|
|
99
|
+
pretty(): {
|
|
100
|
+
baseStrategy: Strategy;
|
|
101
|
+
baseDrift: DriftControllerBase;
|
|
102
|
+
jlpMarketIndex: number;
|
|
103
|
+
driftPerpMarketsHedge: PerpHedge[];
|
|
104
|
+
jlpMint: string;
|
|
105
|
+
rebalanceSettings: JlpRebalanceSettings;
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* @category Accounts
|
|
110
|
+
* @category generated
|
|
111
|
+
*/
|
|
112
|
+
export declare const driftJlpControllerBeet: beet.FixableBeetStruct<DriftJlpController, DriftJlpControllerArgs & {
|
|
113
|
+
accountDiscriminator: number[];
|
|
114
|
+
}>;
|
|
@@ -97,7 +97,7 @@ class DriftJlpController {
|
|
|
97
97
|
*
|
|
98
98
|
* @param programId - the program that owns the accounts we are filtering
|
|
99
99
|
*/
|
|
100
|
-
static gpaBuilder(programId = new web3.PublicKey('
|
|
100
|
+
static gpaBuilder(programId = new web3.PublicKey('rf1ctRXK4bmG5XNttAMYfB3TKd2vQjFv5cfQhDBxdAQ')) {
|
|
101
101
|
return beetSolana.GpaBuilder.fromStruct(programId, exports.driftJlpControllerBeet);
|
|
102
102
|
}
|
|
103
103
|
/**
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was GENERATED using the solita package.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead rerun solita to update it or write a wrapper to add functionality.
|
|
4
|
+
*
|
|
5
|
+
* See: https://github.com/metaplex-foundation/solita
|
|
6
|
+
*/
|
|
7
|
+
import * as beet from '@metaplex-foundation/beet';
|
|
8
|
+
import * as web3 from '@solana/web3.js';
|
|
9
|
+
import * as beetSolana from '@metaplex-foundation/beet-solana';
|
|
10
|
+
import { Strategy } from '../types/Strategy';
|
|
11
|
+
import { DriftControllerBase } from '../types/DriftControllerBase';
|
|
12
|
+
import { DriftLstData } from '../types/DriftLstData';
|
|
13
|
+
import { SubAccount } from '../types/SubAccount';
|
|
14
|
+
/**
|
|
15
|
+
* Arguments used to create {@link DriftLstController}
|
|
16
|
+
* @category Accounts
|
|
17
|
+
* @category generated
|
|
18
|
+
*/
|
|
19
|
+
export type DriftLstControllerArgs = {
|
|
20
|
+
baseStrategy: Strategy;
|
|
21
|
+
baseDrift: DriftControllerBase;
|
|
22
|
+
lsts: DriftLstData[];
|
|
23
|
+
subAccounts: SubAccount[];
|
|
24
|
+
};
|
|
25
|
+
export declare const driftLstControllerDiscriminator: number[];
|
|
26
|
+
/**
|
|
27
|
+
* Holds the data for the {@link DriftLstController} Account and provides de/serialization
|
|
28
|
+
* functionality for that data
|
|
29
|
+
*
|
|
30
|
+
* @category Accounts
|
|
31
|
+
* @category generated
|
|
32
|
+
*/
|
|
33
|
+
export declare class DriftLstController implements DriftLstControllerArgs {
|
|
34
|
+
readonly baseStrategy: Strategy;
|
|
35
|
+
readonly baseDrift: DriftControllerBase;
|
|
36
|
+
readonly lsts: DriftLstData[];
|
|
37
|
+
readonly subAccounts: SubAccount[];
|
|
38
|
+
private constructor();
|
|
39
|
+
/**
|
|
40
|
+
* Creates a {@link DriftLstController} instance from the provided args.
|
|
41
|
+
*/
|
|
42
|
+
static fromArgs(args: DriftLstControllerArgs): DriftLstController;
|
|
43
|
+
/**
|
|
44
|
+
* Deserializes the {@link DriftLstController} from the data of the provided {@link web3.AccountInfo}.
|
|
45
|
+
* @returns a tuple of the account data and the offset up to which the buffer was read to obtain it.
|
|
46
|
+
*/
|
|
47
|
+
static fromAccountInfo(accountInfo: web3.AccountInfo<Buffer>, offset?: number): [DriftLstController, number];
|
|
48
|
+
/**
|
|
49
|
+
* Retrieves the account info from the provided address and deserializes
|
|
50
|
+
* the {@link DriftLstController} from its data.
|
|
51
|
+
*
|
|
52
|
+
* @throws Error if no account info is found at the address or if deserialization fails
|
|
53
|
+
*/
|
|
54
|
+
static fromAccountAddress(connection: web3.Connection, address: web3.PublicKey, commitmentOrConfig?: web3.Commitment | web3.GetAccountInfoConfig): Promise<DriftLstController>;
|
|
55
|
+
/**
|
|
56
|
+
* Provides a {@link web3.Connection.getProgramAccounts} config builder,
|
|
57
|
+
* to fetch accounts matching filters that can be specified via that builder.
|
|
58
|
+
*
|
|
59
|
+
* @param programId - the program that owns the accounts we are filtering
|
|
60
|
+
*/
|
|
61
|
+
static gpaBuilder(programId?: web3.PublicKey): beetSolana.GpaBuilder<DriftLstControllerArgs & {
|
|
62
|
+
accountDiscriminator: number[];
|
|
63
|
+
}>;
|
|
64
|
+
/**
|
|
65
|
+
* Deserializes the {@link DriftLstController} from the provided data Buffer.
|
|
66
|
+
* @returns a tuple of the account data and the offset up to which the buffer was read to obtain it.
|
|
67
|
+
*/
|
|
68
|
+
static deserialize(buf: Buffer, offset?: number): [DriftLstController, number];
|
|
69
|
+
/**
|
|
70
|
+
* Serializes the {@link DriftLstController} into a Buffer.
|
|
71
|
+
* @returns a tuple of the created Buffer and the offset up to which the buffer was written to store it.
|
|
72
|
+
*/
|
|
73
|
+
serialize(): [Buffer, number];
|
|
74
|
+
/**
|
|
75
|
+
* Returns the byteSize of a {@link Buffer} holding the serialized data of
|
|
76
|
+
* {@link DriftLstController} for the provided args.
|
|
77
|
+
*
|
|
78
|
+
* @param args need to be provided since the byte size for this account
|
|
79
|
+
* depends on them
|
|
80
|
+
*/
|
|
81
|
+
static byteSize(args: DriftLstControllerArgs): number;
|
|
82
|
+
/**
|
|
83
|
+
* Fetches the minimum balance needed to exempt an account holding
|
|
84
|
+
* {@link DriftLstController} data from rent
|
|
85
|
+
*
|
|
86
|
+
* @param args need to be provided since the byte size for this account
|
|
87
|
+
* depends on them
|
|
88
|
+
* @param connection used to retrieve the rent exemption information
|
|
89
|
+
*/
|
|
90
|
+
static getMinimumBalanceForRentExemption(args: DriftLstControllerArgs, connection: web3.Connection, commitment?: web3.Commitment): Promise<number>;
|
|
91
|
+
/**
|
|
92
|
+
* Returns a readable version of {@link DriftLstController} properties
|
|
93
|
+
* and can be used to convert to JSON and/or logging
|
|
94
|
+
*/
|
|
95
|
+
pretty(): {
|
|
96
|
+
baseStrategy: Strategy;
|
|
97
|
+
baseDrift: DriftControllerBase;
|
|
98
|
+
lsts: DriftLstData[];
|
|
99
|
+
subAccounts: SubAccount[];
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* @category Accounts
|
|
104
|
+
* @category generated
|
|
105
|
+
*/
|
|
106
|
+
export declare const driftLstControllerBeet: beet.FixableBeetStruct<DriftLstController, DriftLstControllerArgs & {
|
|
107
|
+
accountDiscriminator: number[];
|
|
108
|
+
}>;
|
|
@@ -97,7 +97,7 @@ class DriftLstController {
|
|
|
97
97
|
*
|
|
98
98
|
* @param programId - the program that owns the accounts we are filtering
|
|
99
99
|
*/
|
|
100
|
-
static gpaBuilder(programId = new web3.PublicKey('
|
|
100
|
+
static gpaBuilder(programId = new web3.PublicKey('rf1ctRXK4bmG5XNttAMYfB3TKd2vQjFv5cfQhDBxdAQ')) {
|
|
101
101
|
return beetSolana.GpaBuilder.fromStruct(programId, exports.driftLstControllerBeet);
|
|
102
102
|
}
|
|
103
103
|
/**
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was GENERATED using the solita package.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead rerun solita to update it or write a wrapper to add functionality.
|
|
4
|
+
*
|
|
5
|
+
* See: https://github.com/metaplex-foundation/solita
|
|
6
|
+
*/
|
|
7
|
+
import * as web3 from '@solana/web3.js';
|
|
8
|
+
import * as beet from '@metaplex-foundation/beet';
|
|
9
|
+
import * as beetSolana from '@metaplex-foundation/beet-solana';
|
|
10
|
+
import { Strategy } from '../types/Strategy';
|
|
11
|
+
import { DriftControllerBase } from '../types/DriftControllerBase';
|
|
12
|
+
import { AutoCompound } from '../types/AutoCompound';
|
|
13
|
+
/**
|
|
14
|
+
* Arguments used to create {@link DriftUsdcController}
|
|
15
|
+
* @category Accounts
|
|
16
|
+
* @category generated
|
|
17
|
+
*/
|
|
18
|
+
export type DriftUsdcControllerArgs = {
|
|
19
|
+
baseStrategy: Strategy;
|
|
20
|
+
baseDrift: DriftControllerBase;
|
|
21
|
+
compounder: AutoCompound;
|
|
22
|
+
};
|
|
23
|
+
export declare const driftUsdcControllerDiscriminator: number[];
|
|
24
|
+
/**
|
|
25
|
+
* Holds the data for the {@link DriftUsdcController} Account and provides de/serialization
|
|
26
|
+
* functionality for that data
|
|
27
|
+
*
|
|
28
|
+
* @category Accounts
|
|
29
|
+
* @category generated
|
|
30
|
+
*/
|
|
31
|
+
export declare class DriftUsdcController implements DriftUsdcControllerArgs {
|
|
32
|
+
readonly baseStrategy: Strategy;
|
|
33
|
+
readonly baseDrift: DriftControllerBase;
|
|
34
|
+
readonly compounder: AutoCompound;
|
|
35
|
+
private constructor();
|
|
36
|
+
/**
|
|
37
|
+
* Creates a {@link DriftUsdcController} instance from the provided args.
|
|
38
|
+
*/
|
|
39
|
+
static fromArgs(args: DriftUsdcControllerArgs): DriftUsdcController;
|
|
40
|
+
/**
|
|
41
|
+
* Deserializes the {@link DriftUsdcController} from the data of the provided {@link web3.AccountInfo}.
|
|
42
|
+
* @returns a tuple of the account data and the offset up to which the buffer was read to obtain it.
|
|
43
|
+
*/
|
|
44
|
+
static fromAccountInfo(accountInfo: web3.AccountInfo<Buffer>, offset?: number): [DriftUsdcController, number];
|
|
45
|
+
/**
|
|
46
|
+
* Retrieves the account info from the provided address and deserializes
|
|
47
|
+
* the {@link DriftUsdcController} from its data.
|
|
48
|
+
*
|
|
49
|
+
* @throws Error if no account info is found at the address or if deserialization fails
|
|
50
|
+
*/
|
|
51
|
+
static fromAccountAddress(connection: web3.Connection, address: web3.PublicKey, commitmentOrConfig?: web3.Commitment | web3.GetAccountInfoConfig): Promise<DriftUsdcController>;
|
|
52
|
+
/**
|
|
53
|
+
* Provides a {@link web3.Connection.getProgramAccounts} config builder,
|
|
54
|
+
* to fetch accounts matching filters that can be specified via that builder.
|
|
55
|
+
*
|
|
56
|
+
* @param programId - the program that owns the accounts we are filtering
|
|
57
|
+
*/
|
|
58
|
+
static gpaBuilder(programId?: web3.PublicKey): beetSolana.GpaBuilder<{
|
|
59
|
+
accountDiscriminator: any;
|
|
60
|
+
baseStrategy: any;
|
|
61
|
+
baseDrift: any;
|
|
62
|
+
compounder: any;
|
|
63
|
+
}>;
|
|
64
|
+
/**
|
|
65
|
+
* Deserializes the {@link DriftUsdcController} from the provided data Buffer.
|
|
66
|
+
* @returns a tuple of the account data and the offset up to which the buffer was read to obtain it.
|
|
67
|
+
*/
|
|
68
|
+
static deserialize(buf: Buffer, offset?: number): [DriftUsdcController, number];
|
|
69
|
+
/**
|
|
70
|
+
* Serializes the {@link DriftUsdcController} into a Buffer.
|
|
71
|
+
* @returns a tuple of the created Buffer and the offset up to which the buffer was written to store it.
|
|
72
|
+
*/
|
|
73
|
+
serialize(): [Buffer, number];
|
|
74
|
+
/**
|
|
75
|
+
* Returns the byteSize of a {@link Buffer} holding the serialized data of
|
|
76
|
+
* {@link DriftUsdcController}
|
|
77
|
+
*/
|
|
78
|
+
static get byteSize(): number;
|
|
79
|
+
/**
|
|
80
|
+
* Fetches the minimum balance needed to exempt an account holding
|
|
81
|
+
* {@link DriftUsdcController} data from rent
|
|
82
|
+
*
|
|
83
|
+
* @param connection used to retrieve the rent exemption information
|
|
84
|
+
*/
|
|
85
|
+
static getMinimumBalanceForRentExemption(connection: web3.Connection, commitment?: web3.Commitment): Promise<number>;
|
|
86
|
+
/**
|
|
87
|
+
* Determines if the provided {@link Buffer} has the correct byte size to
|
|
88
|
+
* hold {@link DriftUsdcController} data.
|
|
89
|
+
*/
|
|
90
|
+
static hasCorrectByteSize(buf: Buffer, offset?: number): boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Returns a readable version of {@link DriftUsdcController} properties
|
|
93
|
+
* and can be used to convert to JSON and/or logging
|
|
94
|
+
*/
|
|
95
|
+
pretty(): {
|
|
96
|
+
baseStrategy: Strategy;
|
|
97
|
+
baseDrift: DriftControllerBase;
|
|
98
|
+
compounder: AutoCompound;
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* @category Accounts
|
|
103
|
+
* @category generated
|
|
104
|
+
*/
|
|
105
|
+
export declare const driftUsdcControllerBeet: beet.BeetStruct<DriftUsdcController, DriftUsdcControllerArgs & {
|
|
106
|
+
accountDiscriminator: number[];
|
|
107
|
+
}>;
|
|
@@ -39,11 +39,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
39
39
|
};
|
|
40
40
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
41
|
exports.driftUsdcControllerBeet = exports.DriftUsdcController = exports.driftUsdcControllerDiscriminator = void 0;
|
|
42
|
-
const beet = __importStar(require("@metaplex-foundation/beet"));
|
|
43
42
|
const web3 = __importStar(require("@solana/web3.js"));
|
|
43
|
+
const beet = __importStar(require("@metaplex-foundation/beet"));
|
|
44
44
|
const beetSolana = __importStar(require("@metaplex-foundation/beet-solana"));
|
|
45
45
|
const Strategy_1 = require("../types/Strategy");
|
|
46
46
|
const DriftControllerBase_1 = require("../types/DriftControllerBase");
|
|
47
|
+
const AutoCompound_1 = require("../types/AutoCompound");
|
|
47
48
|
exports.driftUsdcControllerDiscriminator = [
|
|
48
49
|
148, 44, 102, 104, 86, 118, 225, 194,
|
|
49
50
|
];
|
|
@@ -55,19 +56,16 @@ exports.driftUsdcControllerDiscriminator = [
|
|
|
55
56
|
* @category generated
|
|
56
57
|
*/
|
|
57
58
|
class DriftUsdcController {
|
|
58
|
-
constructor(baseStrategy, baseDrift,
|
|
59
|
+
constructor(baseStrategy, baseDrift, compounder) {
|
|
59
60
|
this.baseStrategy = baseStrategy;
|
|
60
61
|
this.baseDrift = baseDrift;
|
|
61
|
-
this.
|
|
62
|
-
this.lastPoolValue = lastPoolValue;
|
|
63
|
-
this.effectiveSupply = effectiveSupply;
|
|
64
|
-
this.depositedVaultValue = depositedVaultValue;
|
|
62
|
+
this.compounder = compounder;
|
|
65
63
|
}
|
|
66
64
|
/**
|
|
67
65
|
* Creates a {@link DriftUsdcController} instance from the provided args.
|
|
68
66
|
*/
|
|
69
67
|
static fromArgs(args) {
|
|
70
|
-
return new DriftUsdcController(args.baseStrategy, args.baseDrift, args.
|
|
68
|
+
return new DriftUsdcController(args.baseStrategy, args.baseDrift, args.compounder);
|
|
71
69
|
}
|
|
72
70
|
/**
|
|
73
71
|
* Deserializes the {@link DriftUsdcController} from the data of the provided {@link web3.AccountInfo}.
|
|
@@ -97,7 +95,7 @@ class DriftUsdcController {
|
|
|
97
95
|
*
|
|
98
96
|
* @param programId - the program that owns the accounts we are filtering
|
|
99
97
|
*/
|
|
100
|
-
static gpaBuilder(programId = new web3.PublicKey('
|
|
98
|
+
static gpaBuilder(programId = new web3.PublicKey('rf1ctRXK4bmG5XNttAMYfB3TKd2vQjFv5cfQhDBxdAQ')) {
|
|
101
99
|
return beetSolana.GpaBuilder.fromStruct(programId, exports.driftUsdcControllerBeet);
|
|
102
100
|
}
|
|
103
101
|
/**
|
|
@@ -147,54 +145,7 @@ class DriftUsdcController {
|
|
|
147
145
|
return {
|
|
148
146
|
baseStrategy: this.baseStrategy,
|
|
149
147
|
baseDrift: this.baseDrift,
|
|
150
|
-
|
|
151
|
-
const x = this.netUserFlowSinceCapture;
|
|
152
|
-
if (typeof x.toNumber === 'function') {
|
|
153
|
-
try {
|
|
154
|
-
return x.toNumber();
|
|
155
|
-
}
|
|
156
|
-
catch (_) {
|
|
157
|
-
return x;
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
return x;
|
|
161
|
-
})(),
|
|
162
|
-
lastPoolValue: (() => {
|
|
163
|
-
const x = this.lastPoolValue;
|
|
164
|
-
if (typeof x.toNumber === 'function') {
|
|
165
|
-
try {
|
|
166
|
-
return x.toNumber();
|
|
167
|
-
}
|
|
168
|
-
catch (_) {
|
|
169
|
-
return x;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
return x;
|
|
173
|
-
})(),
|
|
174
|
-
effectiveSupply: (() => {
|
|
175
|
-
const x = this.effectiveSupply;
|
|
176
|
-
if (typeof x.toNumber === 'function') {
|
|
177
|
-
try {
|
|
178
|
-
return x.toNumber();
|
|
179
|
-
}
|
|
180
|
-
catch (_) {
|
|
181
|
-
return x;
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
return x;
|
|
185
|
-
})(),
|
|
186
|
-
depositedVaultValue: (() => {
|
|
187
|
-
const x = this.depositedVaultValue;
|
|
188
|
-
if (typeof x.toNumber === 'function') {
|
|
189
|
-
try {
|
|
190
|
-
return x.toNumber();
|
|
191
|
-
}
|
|
192
|
-
catch (_) {
|
|
193
|
-
return x;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
return x;
|
|
197
|
-
})(),
|
|
148
|
+
compounder: this.compounder,
|
|
198
149
|
};
|
|
199
150
|
}
|
|
200
151
|
}
|
|
@@ -207,8 +158,5 @@ exports.driftUsdcControllerBeet = new beet.BeetStruct([
|
|
|
207
158
|
['accountDiscriminator', beet.uniformFixedSizeArray(beet.u8, 8)],
|
|
208
159
|
['baseStrategy', Strategy_1.strategyBeet],
|
|
209
160
|
['baseDrift', DriftControllerBase_1.driftControllerBaseBeet],
|
|
210
|
-
['
|
|
211
|
-
['lastPoolValue', beet.u64],
|
|
212
|
-
['effectiveSupply', beet.u64],
|
|
213
|
-
['depositedVaultValue', beet.u64],
|
|
161
|
+
['compounder', AutoCompound_1.autoCompoundBeet],
|
|
214
162
|
], DriftUsdcController.fromArgs, 'DriftUsdcController');
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was GENERATED using the solita package.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead rerun solita to update it or write a wrapper to add functionality.
|
|
4
|
+
*
|
|
5
|
+
* See: https://github.com/metaplex-foundation/solita
|
|
6
|
+
*/
|
|
7
|
+
import * as beet from '@metaplex-foundation/beet';
|
|
8
|
+
import * as web3 from '@solana/web3.js';
|
|
9
|
+
import * as beetSolana from '@metaplex-foundation/beet-solana';
|
|
10
|
+
import { AccessControl } from '../types/AccessControl';
|
|
11
|
+
import { SplMain } from '../types/SplMain';
|
|
12
|
+
import { Externals } from '../types/Externals';
|
|
13
|
+
/**
|
|
14
|
+
* Arguments used to create {@link Main}
|
|
15
|
+
* @category Accounts
|
|
16
|
+
* @category generated
|
|
17
|
+
*/
|
|
18
|
+
export type MainArgs = {
|
|
19
|
+
bump: number;
|
|
20
|
+
accessControl: AccessControl;
|
|
21
|
+
lstsMain: SplMain[];
|
|
22
|
+
externals: Externals;
|
|
23
|
+
strategyCounter: number;
|
|
24
|
+
};
|
|
25
|
+
export declare const mainDiscriminator: number[];
|
|
26
|
+
/**
|
|
27
|
+
* Holds the data for the {@link Main} Account and provides de/serialization
|
|
28
|
+
* functionality for that data
|
|
29
|
+
*
|
|
30
|
+
* @category Accounts
|
|
31
|
+
* @category generated
|
|
32
|
+
*/
|
|
33
|
+
export declare class Main implements MainArgs {
|
|
34
|
+
readonly bump: number;
|
|
35
|
+
readonly accessControl: AccessControl;
|
|
36
|
+
readonly lstsMain: SplMain[];
|
|
37
|
+
readonly externals: Externals;
|
|
38
|
+
readonly strategyCounter: number;
|
|
39
|
+
private constructor();
|
|
40
|
+
/**
|
|
41
|
+
* Creates a {@link Main} instance from the provided args.
|
|
42
|
+
*/
|
|
43
|
+
static fromArgs(args: MainArgs): Main;
|
|
44
|
+
/**
|
|
45
|
+
* Deserializes the {@link Main} from the data of the provided {@link web3.AccountInfo}.
|
|
46
|
+
* @returns a tuple of the account data and the offset up to which the buffer was read to obtain it.
|
|
47
|
+
*/
|
|
48
|
+
static fromAccountInfo(accountInfo: web3.AccountInfo<Buffer>, offset?: number): [Main, number];
|
|
49
|
+
/**
|
|
50
|
+
* Retrieves the account info from the provided address and deserializes
|
|
51
|
+
* the {@link Main} from its data.
|
|
52
|
+
*
|
|
53
|
+
* @throws Error if no account info is found at the address or if deserialization fails
|
|
54
|
+
*/
|
|
55
|
+
static fromAccountAddress(connection: web3.Connection, address: web3.PublicKey, commitmentOrConfig?: web3.Commitment | web3.GetAccountInfoConfig): Promise<Main>;
|
|
56
|
+
/**
|
|
57
|
+
* Provides a {@link web3.Connection.getProgramAccounts} config builder,
|
|
58
|
+
* to fetch accounts matching filters that can be specified via that builder.
|
|
59
|
+
*
|
|
60
|
+
* @param programId - the program that owns the accounts we are filtering
|
|
61
|
+
*/
|
|
62
|
+
static gpaBuilder(programId?: web3.PublicKey): beetSolana.GpaBuilder<MainArgs & {
|
|
63
|
+
accountDiscriminator: number[];
|
|
64
|
+
}>;
|
|
65
|
+
/**
|
|
66
|
+
* Deserializes the {@link Main} from the provided data Buffer.
|
|
67
|
+
* @returns a tuple of the account data and the offset up to which the buffer was read to obtain it.
|
|
68
|
+
*/
|
|
69
|
+
static deserialize(buf: Buffer, offset?: number): [Main, number];
|
|
70
|
+
/**
|
|
71
|
+
* Serializes the {@link Main} into a Buffer.
|
|
72
|
+
* @returns a tuple of the created Buffer and the offset up to which the buffer was written to store it.
|
|
73
|
+
*/
|
|
74
|
+
serialize(): [Buffer, number];
|
|
75
|
+
/**
|
|
76
|
+
* Returns the byteSize of a {@link Buffer} holding the serialized data of
|
|
77
|
+
* {@link Main} for the provided args.
|
|
78
|
+
*
|
|
79
|
+
* @param args need to be provided since the byte size for this account
|
|
80
|
+
* depends on them
|
|
81
|
+
*/
|
|
82
|
+
static byteSize(args: MainArgs): number;
|
|
83
|
+
/**
|
|
84
|
+
* Fetches the minimum balance needed to exempt an account holding
|
|
85
|
+
* {@link Main} data from rent
|
|
86
|
+
*
|
|
87
|
+
* @param args need to be provided since the byte size for this account
|
|
88
|
+
* depends on them
|
|
89
|
+
* @param connection used to retrieve the rent exemption information
|
|
90
|
+
*/
|
|
91
|
+
static getMinimumBalanceForRentExemption(args: MainArgs, connection: web3.Connection, commitment?: web3.Commitment): Promise<number>;
|
|
92
|
+
/**
|
|
93
|
+
* Returns a readable version of {@link Main} properties
|
|
94
|
+
* and can be used to convert to JSON and/or logging
|
|
95
|
+
*/
|
|
96
|
+
pretty(): {
|
|
97
|
+
bump: number;
|
|
98
|
+
accessControl: AccessControl;
|
|
99
|
+
lstsMain: SplMain[];
|
|
100
|
+
externals: Externals;
|
|
101
|
+
strategyCounter: number;
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* @category Accounts
|
|
106
|
+
* @category generated
|
|
107
|
+
*/
|
|
108
|
+
export declare const mainBeet: beet.FixableBeetStruct<Main, MainArgs & {
|
|
109
|
+
accountDiscriminator: number[];
|
|
110
|
+
}>;
|
|
@@ -95,7 +95,7 @@ class Main {
|
|
|
95
95
|
*
|
|
96
96
|
* @param programId - the program that owns the accounts we are filtering
|
|
97
97
|
*/
|
|
98
|
-
static gpaBuilder(programId = new web3.PublicKey('
|
|
98
|
+
static gpaBuilder(programId = new web3.PublicKey('rf1ctRXK4bmG5XNttAMYfB3TKd2vQjFv5cfQhDBxdAQ')) {
|
|
99
99
|
return beetSolana.GpaBuilder.fromStruct(programId, exports.mainBeet);
|
|
100
100
|
}
|
|
101
101
|
/**
|