@reflectmoney/stable.ts 1.1.2 → 1.1.4
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 +56 -0
- 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/ReflectTokenisedBond.d.ts +75 -0
- package/dist/classes/Stablecoin.d.ts +219 -0
- package/dist/classes/index.d.ts +4 -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/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/DriftLstController.d.ts +108 -0
- package/dist/generated/reflect_main/accounts/DriftUsdcController.d.ts +126 -0
- package/dist/generated/reflect_main/accounts/Main.d.ts +110 -0
- package/dist/generated/reflect_main/accounts/PerpMarket.d.ts +226 -0
- package/dist/generated/reflect_main/accounts/PrelaunchOracle.d.ts +130 -0
- package/dist/generated/reflect_main/accounts/PythLazerOracle.d.ts +124 -0
- package/dist/generated/reflect_main/accounts/RebalanceLst.d.ts +111 -0
- package/dist/generated/reflect_main/accounts/SpotMarket.d.ts +377 -0
- package/dist/generated/reflect_main/accounts/User.d.ts +221 -0
- package/dist/generated/reflect_main/accounts/UserPermissions.d.ts +106 -0
- package/dist/generated/reflect_main/accounts/UserStats.d.ts +211 -0
- 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/index.d.ts +19 -0
- package/dist/generated/reflect_main/instructions/addLstDrift.d.ts +49 -0
- package/dist/generated/reflect_main/instructions/addSubAccount.d.ts +54 -0
- package/dist/generated/reflect_main/instructions/captureSpreadDrift.d.ts +66 -0
- package/dist/generated/reflect_main/instructions/captureSpreadDriftS1.d.ts +58 -0
- package/dist/generated/reflect_main/instructions/createAdminAccount.d.ts +51 -0
- package/dist/generated/reflect_main/instructions/createUserStatsAccount.d.ts +52 -0
- package/dist/generated/reflect_main/instructions/depositDrift.d.ts +73 -0
- package/dist/generated/reflect_main/instructions/freezeProgram.d.ts +54 -0
- package/dist/generated/reflect_main/instructions/freezeProtocolAction.d.ts +55 -0
- package/dist/generated/reflect_main/instructions/freezeStrategyAction.d.ts +58 -0
- package/dist/generated/reflect_main/instructions/index.d.ts +34 -0
- package/dist/generated/reflect_main/instructions/initDriftAccountsS1.d.ts +54 -0
- package/dist/generated/reflect_main/instructions/initDriftControllerS1.d.ts +58 -0
- package/dist/generated/reflect_main/instructions/initDriftControllerS3.d.ts +58 -0
- package/dist/generated/reflect_main/instructions/initMain.d.ts +43 -0
- package/dist/generated/reflect_main/instructions/mintDriftS1.d.ts +86 -0
- package/dist/generated/reflect_main/instructions/mintDriftS3.d.ts +86 -0
- package/dist/generated/reflect_main/instructions/processSwapDeposit.d.ts +69 -0
- package/dist/generated/reflect_main/instructions/processSwapWithdraw.d.ts +69 -0
- package/dist/generated/reflect_main/instructions/redeemDriftS1.d.ts +87 -0
- package/dist/generated/reflect_main/instructions/redeemDriftS3.d.ts +87 -0
- package/dist/generated/reflect_main/instructions/settlePnl.d.ts +55 -0
- package/dist/generated/reflect_main/instructions/settlePnlMulti.d.ts +65 -0
- package/dist/generated/reflect_main/instructions/suspendSplProtocol.d.ts +54 -0
- package/dist/generated/reflect_main/instructions/suspendSplStrategy.d.ts +56 -0
- package/dist/generated/reflect_main/instructions/swapOrca.d.ts +81 -0
- package/dist/generated/reflect_main/instructions/swapOrcaTwoHop.d.ts +101 -0
- package/dist/generated/reflect_main/instructions/updateActionRoleProtocol.d.ts +58 -0
- package/dist/generated/reflect_main/instructions/updateActionRoleStrategy.d.ts +60 -0
- package/dist/generated/reflect_main/instructions/updateAttenuation.d.ts +57 -0
- package/dist/generated/reflect_main/instructions/updateCap.d.ts +55 -0
- package/dist/generated/reflect_main/instructions/updateRebalanceSlippage.d.ts +55 -0
- package/dist/generated/reflect_main/instructions/updateRecipients.d.ts +56 -0
- package/dist/generated/reflect_main/instructions/updateRoleHolderProtocol.d.ts +60 -0
- package/dist/generated/reflect_main/instructions/updateRoleHolderStrategy.d.ts +60 -0
- 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/BalanceType.d.ts +20 -0
- package/dist/generated/reflect_main/types/Capture.d.ts +17 -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/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 +32 -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/index.d.ts +80 -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 +9 -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/types/api.d.ts +1172 -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 +1 -1
|
@@ -0,0 +1,377 @@
|
|
|
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 { HistoricalOracleData } from '../types/HistoricalOracleData';
|
|
11
|
+
import { HistoricalIndexData } from '../types/HistoricalIndexData';
|
|
12
|
+
import { PoolBalance } from '../types/PoolBalance';
|
|
13
|
+
import { InsuranceFund } from '../types/InsuranceFund';
|
|
14
|
+
import { OracleSource } from '../types/OracleSource';
|
|
15
|
+
import { MarketStatus } from '../types/MarketStatus';
|
|
16
|
+
import { AssetTier } from '../types/AssetTier';
|
|
17
|
+
/**
|
|
18
|
+
* Arguments used to create {@link SpotMarket}
|
|
19
|
+
* @category Accounts
|
|
20
|
+
* @category generated
|
|
21
|
+
*/
|
|
22
|
+
export type SpotMarketArgs = {
|
|
23
|
+
pubkey: web3.PublicKey;
|
|
24
|
+
oracle: web3.PublicKey;
|
|
25
|
+
mint: web3.PublicKey;
|
|
26
|
+
vault: web3.PublicKey;
|
|
27
|
+
name: number[];
|
|
28
|
+
historicalOracleData: HistoricalOracleData;
|
|
29
|
+
historicalIndexData: HistoricalIndexData;
|
|
30
|
+
revenuePool: PoolBalance;
|
|
31
|
+
spotFeePool: PoolBalance;
|
|
32
|
+
insuranceFund: InsuranceFund;
|
|
33
|
+
totalSpotFee: beet.bignum;
|
|
34
|
+
depositBalance: beet.bignum;
|
|
35
|
+
borrowBalance: beet.bignum;
|
|
36
|
+
cumulativeDepositInterest: beet.bignum;
|
|
37
|
+
cumulativeBorrowInterest: beet.bignum;
|
|
38
|
+
totalSocialLoss: beet.bignum;
|
|
39
|
+
totalQuoteSocialLoss: beet.bignum;
|
|
40
|
+
withdrawGuardThreshold: beet.bignum;
|
|
41
|
+
maxTokenDeposits: beet.bignum;
|
|
42
|
+
depositTokenTwap: beet.bignum;
|
|
43
|
+
borrowTokenTwap: beet.bignum;
|
|
44
|
+
utilizationTwap: beet.bignum;
|
|
45
|
+
lastInterestTs: beet.bignum;
|
|
46
|
+
lastTwapTs: beet.bignum;
|
|
47
|
+
expiryTs: beet.bignum;
|
|
48
|
+
orderStepSize: beet.bignum;
|
|
49
|
+
orderTickSize: beet.bignum;
|
|
50
|
+
minOrderSize: beet.bignum;
|
|
51
|
+
maxPositionSize: beet.bignum;
|
|
52
|
+
nextFillRecordId: beet.bignum;
|
|
53
|
+
nextDepositRecordId: beet.bignum;
|
|
54
|
+
initialAssetWeight: number;
|
|
55
|
+
maintenanceAssetWeight: number;
|
|
56
|
+
initialLiabilityWeight: number;
|
|
57
|
+
maintenanceLiabilityWeight: number;
|
|
58
|
+
imfFactor: number;
|
|
59
|
+
liquidatorFee: number;
|
|
60
|
+
ifLiquidationFee: number;
|
|
61
|
+
optimalUtilization: number;
|
|
62
|
+
optimalBorrowRate: number;
|
|
63
|
+
maxBorrowRate: number;
|
|
64
|
+
decimals: number;
|
|
65
|
+
marketIndex: number;
|
|
66
|
+
ordersEnabled: boolean;
|
|
67
|
+
oracleSource: OracleSource;
|
|
68
|
+
status: MarketStatus;
|
|
69
|
+
assetTier: AssetTier;
|
|
70
|
+
pausedOperations: number;
|
|
71
|
+
ifPausedOperations: number;
|
|
72
|
+
feeAdjustment: number;
|
|
73
|
+
maxTokenBorrowsFraction: number;
|
|
74
|
+
flashLoanAmount: beet.bignum;
|
|
75
|
+
flashLoanInitialTokenAmount: beet.bignum;
|
|
76
|
+
totalSwapFee: beet.bignum;
|
|
77
|
+
scaleInitialAssetWeightStart: beet.bignum;
|
|
78
|
+
minBorrowRate: number;
|
|
79
|
+
padding: number[];
|
|
80
|
+
};
|
|
81
|
+
export declare const spotMarketDiscriminator: number[];
|
|
82
|
+
/**
|
|
83
|
+
* Holds the data for the {@link SpotMarket} Account and provides de/serialization
|
|
84
|
+
* functionality for that data
|
|
85
|
+
*
|
|
86
|
+
* @category Accounts
|
|
87
|
+
* @category generated
|
|
88
|
+
*/
|
|
89
|
+
export declare class SpotMarket implements SpotMarketArgs {
|
|
90
|
+
readonly pubkey: web3.PublicKey;
|
|
91
|
+
readonly oracle: web3.PublicKey;
|
|
92
|
+
readonly mint: web3.PublicKey;
|
|
93
|
+
readonly vault: web3.PublicKey;
|
|
94
|
+
readonly name: number[];
|
|
95
|
+
readonly historicalOracleData: HistoricalOracleData;
|
|
96
|
+
readonly historicalIndexData: HistoricalIndexData;
|
|
97
|
+
readonly revenuePool: PoolBalance;
|
|
98
|
+
readonly spotFeePool: PoolBalance;
|
|
99
|
+
readonly insuranceFund: InsuranceFund;
|
|
100
|
+
readonly totalSpotFee: beet.bignum;
|
|
101
|
+
readonly depositBalance: beet.bignum;
|
|
102
|
+
readonly borrowBalance: beet.bignum;
|
|
103
|
+
readonly cumulativeDepositInterest: beet.bignum;
|
|
104
|
+
readonly cumulativeBorrowInterest: beet.bignum;
|
|
105
|
+
readonly totalSocialLoss: beet.bignum;
|
|
106
|
+
readonly totalQuoteSocialLoss: beet.bignum;
|
|
107
|
+
readonly withdrawGuardThreshold: beet.bignum;
|
|
108
|
+
readonly maxTokenDeposits: beet.bignum;
|
|
109
|
+
readonly depositTokenTwap: beet.bignum;
|
|
110
|
+
readonly borrowTokenTwap: beet.bignum;
|
|
111
|
+
readonly utilizationTwap: beet.bignum;
|
|
112
|
+
readonly lastInterestTs: beet.bignum;
|
|
113
|
+
readonly lastTwapTs: beet.bignum;
|
|
114
|
+
readonly expiryTs: beet.bignum;
|
|
115
|
+
readonly orderStepSize: beet.bignum;
|
|
116
|
+
readonly orderTickSize: beet.bignum;
|
|
117
|
+
readonly minOrderSize: beet.bignum;
|
|
118
|
+
readonly maxPositionSize: beet.bignum;
|
|
119
|
+
readonly nextFillRecordId: beet.bignum;
|
|
120
|
+
readonly nextDepositRecordId: beet.bignum;
|
|
121
|
+
readonly initialAssetWeight: number;
|
|
122
|
+
readonly maintenanceAssetWeight: number;
|
|
123
|
+
readonly initialLiabilityWeight: number;
|
|
124
|
+
readonly maintenanceLiabilityWeight: number;
|
|
125
|
+
readonly imfFactor: number;
|
|
126
|
+
readonly liquidatorFee: number;
|
|
127
|
+
readonly ifLiquidationFee: number;
|
|
128
|
+
readonly optimalUtilization: number;
|
|
129
|
+
readonly optimalBorrowRate: number;
|
|
130
|
+
readonly maxBorrowRate: number;
|
|
131
|
+
readonly decimals: number;
|
|
132
|
+
readonly marketIndex: number;
|
|
133
|
+
readonly ordersEnabled: boolean;
|
|
134
|
+
readonly oracleSource: OracleSource;
|
|
135
|
+
readonly status: MarketStatus;
|
|
136
|
+
readonly assetTier: AssetTier;
|
|
137
|
+
readonly pausedOperations: number;
|
|
138
|
+
readonly ifPausedOperations: number;
|
|
139
|
+
readonly feeAdjustment: number;
|
|
140
|
+
readonly maxTokenBorrowsFraction: number;
|
|
141
|
+
readonly flashLoanAmount: beet.bignum;
|
|
142
|
+
readonly flashLoanInitialTokenAmount: beet.bignum;
|
|
143
|
+
readonly totalSwapFee: beet.bignum;
|
|
144
|
+
readonly scaleInitialAssetWeightStart: beet.bignum;
|
|
145
|
+
readonly minBorrowRate: number;
|
|
146
|
+
readonly padding: number[];
|
|
147
|
+
private constructor();
|
|
148
|
+
/**
|
|
149
|
+
* Creates a {@link SpotMarket} instance from the provided args.
|
|
150
|
+
*/
|
|
151
|
+
static fromArgs(args: SpotMarketArgs): SpotMarket;
|
|
152
|
+
/**
|
|
153
|
+
* Deserializes the {@link SpotMarket} from the data of the provided {@link web3.AccountInfo}.
|
|
154
|
+
* @returns a tuple of the account data and the offset up to which the buffer was read to obtain it.
|
|
155
|
+
*/
|
|
156
|
+
static fromAccountInfo(accountInfo: web3.AccountInfo<Buffer>, offset?: number): [SpotMarket, number];
|
|
157
|
+
/**
|
|
158
|
+
* Retrieves the account info from the provided address and deserializes
|
|
159
|
+
* the {@link SpotMarket} from its data.
|
|
160
|
+
*
|
|
161
|
+
* @throws Error if no account info is found at the address or if deserialization fails
|
|
162
|
+
*/
|
|
163
|
+
static fromAccountAddress(connection: web3.Connection, address: web3.PublicKey, commitmentOrConfig?: web3.Commitment | web3.GetAccountInfoConfig): Promise<SpotMarket>;
|
|
164
|
+
/**
|
|
165
|
+
* Provides a {@link web3.Connection.getProgramAccounts} config builder,
|
|
166
|
+
* to fetch accounts matching filters that can be specified via that builder.
|
|
167
|
+
*
|
|
168
|
+
* @param programId - the program that owns the accounts we are filtering
|
|
169
|
+
*/
|
|
170
|
+
static gpaBuilder(programId?: web3.PublicKey): beetSolana.GpaBuilder<{
|
|
171
|
+
status: any;
|
|
172
|
+
mint: any;
|
|
173
|
+
marketIndex: any;
|
|
174
|
+
accountDiscriminator: any;
|
|
175
|
+
oracle: any;
|
|
176
|
+
padding: any;
|
|
177
|
+
historicalOracleData: any;
|
|
178
|
+
totalSocialLoss: any;
|
|
179
|
+
orderStepSize: any;
|
|
180
|
+
orderTickSize: any;
|
|
181
|
+
minOrderSize: any;
|
|
182
|
+
maxPositionSize: any;
|
|
183
|
+
oracleSource: any;
|
|
184
|
+
pubkey: any;
|
|
185
|
+
name: any;
|
|
186
|
+
expiryTs: any;
|
|
187
|
+
nextFillRecordId: any;
|
|
188
|
+
imfFactor: any;
|
|
189
|
+
liquidatorFee: any;
|
|
190
|
+
ifLiquidationFee: any;
|
|
191
|
+
pausedOperations: any;
|
|
192
|
+
feeAdjustment: any;
|
|
193
|
+
vault: any;
|
|
194
|
+
historicalIndexData: any;
|
|
195
|
+
revenuePool: any;
|
|
196
|
+
spotFeePool: any;
|
|
197
|
+
insuranceFund: any;
|
|
198
|
+
totalSpotFee: any;
|
|
199
|
+
depositBalance: any;
|
|
200
|
+
borrowBalance: any;
|
|
201
|
+
cumulativeDepositInterest: any;
|
|
202
|
+
cumulativeBorrowInterest: any;
|
|
203
|
+
totalQuoteSocialLoss: any;
|
|
204
|
+
withdrawGuardThreshold: any;
|
|
205
|
+
maxTokenDeposits: any;
|
|
206
|
+
depositTokenTwap: any;
|
|
207
|
+
borrowTokenTwap: any;
|
|
208
|
+
utilizationTwap: any;
|
|
209
|
+
lastInterestTs: any;
|
|
210
|
+
lastTwapTs: any;
|
|
211
|
+
nextDepositRecordId: any;
|
|
212
|
+
initialAssetWeight: any;
|
|
213
|
+
maintenanceAssetWeight: any;
|
|
214
|
+
initialLiabilityWeight: any;
|
|
215
|
+
maintenanceLiabilityWeight: any;
|
|
216
|
+
optimalUtilization: any;
|
|
217
|
+
optimalBorrowRate: any;
|
|
218
|
+
maxBorrowRate: any;
|
|
219
|
+
decimals: any;
|
|
220
|
+
ordersEnabled: any;
|
|
221
|
+
assetTier: any;
|
|
222
|
+
ifPausedOperations: any;
|
|
223
|
+
maxTokenBorrowsFraction: any;
|
|
224
|
+
flashLoanAmount: any;
|
|
225
|
+
flashLoanInitialTokenAmount: any;
|
|
226
|
+
totalSwapFee: any;
|
|
227
|
+
scaleInitialAssetWeightStart: any;
|
|
228
|
+
minBorrowRate: any;
|
|
229
|
+
}>;
|
|
230
|
+
/**
|
|
231
|
+
* Deserializes the {@link SpotMarket} from the provided data Buffer.
|
|
232
|
+
* @returns a tuple of the account data and the offset up to which the buffer was read to obtain it.
|
|
233
|
+
*/
|
|
234
|
+
static deserialize(buf: Buffer, offset?: number): [SpotMarket, number];
|
|
235
|
+
/**
|
|
236
|
+
* Serializes the {@link SpotMarket} into a Buffer.
|
|
237
|
+
* @returns a tuple of the created Buffer and the offset up to which the buffer was written to store it.
|
|
238
|
+
*/
|
|
239
|
+
serialize(): [Buffer, number];
|
|
240
|
+
/**
|
|
241
|
+
* Returns the byteSize of a {@link Buffer} holding the serialized data of
|
|
242
|
+
* {@link SpotMarket}
|
|
243
|
+
*/
|
|
244
|
+
static get byteSize(): number;
|
|
245
|
+
/**
|
|
246
|
+
* Fetches the minimum balance needed to exempt an account holding
|
|
247
|
+
* {@link SpotMarket} data from rent
|
|
248
|
+
*
|
|
249
|
+
* @param connection used to retrieve the rent exemption information
|
|
250
|
+
*/
|
|
251
|
+
static getMinimumBalanceForRentExemption(connection: web3.Connection, commitment?: web3.Commitment): Promise<number>;
|
|
252
|
+
/**
|
|
253
|
+
* Determines if the provided {@link Buffer} has the correct byte size to
|
|
254
|
+
* hold {@link SpotMarket} data.
|
|
255
|
+
*/
|
|
256
|
+
static hasCorrectByteSize(buf: Buffer, offset?: number): boolean;
|
|
257
|
+
/**
|
|
258
|
+
* Returns a readable version of {@link SpotMarket} properties
|
|
259
|
+
* and can be used to convert to JSON and/or logging
|
|
260
|
+
*/
|
|
261
|
+
pretty(): {
|
|
262
|
+
pubkey: string;
|
|
263
|
+
oracle: string;
|
|
264
|
+
mint: string;
|
|
265
|
+
vault: string;
|
|
266
|
+
name: number[];
|
|
267
|
+
historicalOracleData: HistoricalOracleData;
|
|
268
|
+
historicalIndexData: HistoricalIndexData;
|
|
269
|
+
revenuePool: PoolBalance;
|
|
270
|
+
spotFeePool: PoolBalance;
|
|
271
|
+
insuranceFund: InsuranceFund;
|
|
272
|
+
totalSpotFee: number | {
|
|
273
|
+
toNumber: () => number;
|
|
274
|
+
};
|
|
275
|
+
depositBalance: number | {
|
|
276
|
+
toNumber: () => number;
|
|
277
|
+
};
|
|
278
|
+
borrowBalance: number | {
|
|
279
|
+
toNumber: () => number;
|
|
280
|
+
};
|
|
281
|
+
cumulativeDepositInterest: number | {
|
|
282
|
+
toNumber: () => number;
|
|
283
|
+
};
|
|
284
|
+
cumulativeBorrowInterest: number | {
|
|
285
|
+
toNumber: () => number;
|
|
286
|
+
};
|
|
287
|
+
totalSocialLoss: number | {
|
|
288
|
+
toNumber: () => number;
|
|
289
|
+
};
|
|
290
|
+
totalQuoteSocialLoss: number | {
|
|
291
|
+
toNumber: () => number;
|
|
292
|
+
};
|
|
293
|
+
withdrawGuardThreshold: number | {
|
|
294
|
+
toNumber: () => number;
|
|
295
|
+
};
|
|
296
|
+
maxTokenDeposits: number | {
|
|
297
|
+
toNumber: () => number;
|
|
298
|
+
};
|
|
299
|
+
depositTokenTwap: number | {
|
|
300
|
+
toNumber: () => number;
|
|
301
|
+
};
|
|
302
|
+
borrowTokenTwap: number | {
|
|
303
|
+
toNumber: () => number;
|
|
304
|
+
};
|
|
305
|
+
utilizationTwap: number | {
|
|
306
|
+
toNumber: () => number;
|
|
307
|
+
};
|
|
308
|
+
lastInterestTs: number | {
|
|
309
|
+
toNumber: () => number;
|
|
310
|
+
};
|
|
311
|
+
lastTwapTs: number | {
|
|
312
|
+
toNumber: () => number;
|
|
313
|
+
};
|
|
314
|
+
expiryTs: number | {
|
|
315
|
+
toNumber: () => number;
|
|
316
|
+
};
|
|
317
|
+
orderStepSize: number | {
|
|
318
|
+
toNumber: () => number;
|
|
319
|
+
};
|
|
320
|
+
orderTickSize: number | {
|
|
321
|
+
toNumber: () => number;
|
|
322
|
+
};
|
|
323
|
+
minOrderSize: number | {
|
|
324
|
+
toNumber: () => number;
|
|
325
|
+
};
|
|
326
|
+
maxPositionSize: number | {
|
|
327
|
+
toNumber: () => number;
|
|
328
|
+
};
|
|
329
|
+
nextFillRecordId: number | {
|
|
330
|
+
toNumber: () => number;
|
|
331
|
+
};
|
|
332
|
+
nextDepositRecordId: number | {
|
|
333
|
+
toNumber: () => number;
|
|
334
|
+
};
|
|
335
|
+
initialAssetWeight: number;
|
|
336
|
+
maintenanceAssetWeight: number;
|
|
337
|
+
initialLiabilityWeight: number;
|
|
338
|
+
maintenanceLiabilityWeight: number;
|
|
339
|
+
imfFactor: number;
|
|
340
|
+
liquidatorFee: number;
|
|
341
|
+
ifLiquidationFee: number;
|
|
342
|
+
optimalUtilization: number;
|
|
343
|
+
optimalBorrowRate: number;
|
|
344
|
+
maxBorrowRate: number;
|
|
345
|
+
decimals: number;
|
|
346
|
+
marketIndex: number;
|
|
347
|
+
ordersEnabled: boolean;
|
|
348
|
+
oracleSource: string;
|
|
349
|
+
status: string;
|
|
350
|
+
assetTier: string;
|
|
351
|
+
pausedOperations: number;
|
|
352
|
+
ifPausedOperations: number;
|
|
353
|
+
feeAdjustment: number;
|
|
354
|
+
maxTokenBorrowsFraction: number;
|
|
355
|
+
flashLoanAmount: number | {
|
|
356
|
+
toNumber: () => number;
|
|
357
|
+
};
|
|
358
|
+
flashLoanInitialTokenAmount: number | {
|
|
359
|
+
toNumber: () => number;
|
|
360
|
+
};
|
|
361
|
+
totalSwapFee: number | {
|
|
362
|
+
toNumber: () => number;
|
|
363
|
+
};
|
|
364
|
+
scaleInitialAssetWeightStart: number | {
|
|
365
|
+
toNumber: () => number;
|
|
366
|
+
};
|
|
367
|
+
minBorrowRate: number;
|
|
368
|
+
padding: number[];
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* @category Accounts
|
|
373
|
+
* @category generated
|
|
374
|
+
*/
|
|
375
|
+
export declare const spotMarketBeet: beet.BeetStruct<SpotMarket, SpotMarketArgs & {
|
|
376
|
+
accountDiscriminator: number[];
|
|
377
|
+
}>;
|
|
@@ -0,0 +1,221 @@
|
|
|
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 { SpotPosition } from '../types/SpotPosition';
|
|
11
|
+
import { PerpPosition } from '../types/PerpPosition';
|
|
12
|
+
import { Order } from '../types/Order';
|
|
13
|
+
/**
|
|
14
|
+
* Arguments used to create {@link User}
|
|
15
|
+
* @category Accounts
|
|
16
|
+
* @category generated
|
|
17
|
+
*/
|
|
18
|
+
export type UserArgs = {
|
|
19
|
+
authority: web3.PublicKey;
|
|
20
|
+
delegate: web3.PublicKey;
|
|
21
|
+
name: number[];
|
|
22
|
+
spotPositions: SpotPosition[];
|
|
23
|
+
perpPositions: PerpPosition[];
|
|
24
|
+
orders: Order[];
|
|
25
|
+
lastAddPerpLpSharesTs: beet.bignum;
|
|
26
|
+
totalDeposits: beet.bignum;
|
|
27
|
+
totalWithdraws: beet.bignum;
|
|
28
|
+
totalSocialLoss: beet.bignum;
|
|
29
|
+
settledPerpPnl: beet.bignum;
|
|
30
|
+
cumulativeSpotFees: beet.bignum;
|
|
31
|
+
cumulativePerpFunding: beet.bignum;
|
|
32
|
+
liquidationMarginFreed: beet.bignum;
|
|
33
|
+
lastActiveSlot: beet.bignum;
|
|
34
|
+
nextOrderId: number;
|
|
35
|
+
maxMarginRatio: number;
|
|
36
|
+
nextLiquidationId: number;
|
|
37
|
+
subAccountId: number;
|
|
38
|
+
status: number;
|
|
39
|
+
isMarginTradingEnabled: boolean;
|
|
40
|
+
idle: boolean;
|
|
41
|
+
openOrders: number;
|
|
42
|
+
hasOpenOrder: boolean;
|
|
43
|
+
openAuctions: number;
|
|
44
|
+
hasOpenAuction: boolean;
|
|
45
|
+
padding: number[];
|
|
46
|
+
};
|
|
47
|
+
export declare const userDiscriminator: number[];
|
|
48
|
+
/**
|
|
49
|
+
* Holds the data for the {@link User} Account and provides de/serialization
|
|
50
|
+
* functionality for that data
|
|
51
|
+
*
|
|
52
|
+
* @category Accounts
|
|
53
|
+
* @category generated
|
|
54
|
+
*/
|
|
55
|
+
export declare class User implements UserArgs {
|
|
56
|
+
readonly authority: web3.PublicKey;
|
|
57
|
+
readonly delegate: web3.PublicKey;
|
|
58
|
+
readonly name: number[];
|
|
59
|
+
readonly spotPositions: SpotPosition[];
|
|
60
|
+
readonly perpPositions: PerpPosition[];
|
|
61
|
+
readonly orders: Order[];
|
|
62
|
+
readonly lastAddPerpLpSharesTs: beet.bignum;
|
|
63
|
+
readonly totalDeposits: beet.bignum;
|
|
64
|
+
readonly totalWithdraws: beet.bignum;
|
|
65
|
+
readonly totalSocialLoss: beet.bignum;
|
|
66
|
+
readonly settledPerpPnl: beet.bignum;
|
|
67
|
+
readonly cumulativeSpotFees: beet.bignum;
|
|
68
|
+
readonly cumulativePerpFunding: beet.bignum;
|
|
69
|
+
readonly liquidationMarginFreed: beet.bignum;
|
|
70
|
+
readonly lastActiveSlot: beet.bignum;
|
|
71
|
+
readonly nextOrderId: number;
|
|
72
|
+
readonly maxMarginRatio: number;
|
|
73
|
+
readonly nextLiquidationId: number;
|
|
74
|
+
readonly subAccountId: number;
|
|
75
|
+
readonly status: number;
|
|
76
|
+
readonly isMarginTradingEnabled: boolean;
|
|
77
|
+
readonly idle: boolean;
|
|
78
|
+
readonly openOrders: number;
|
|
79
|
+
readonly hasOpenOrder: boolean;
|
|
80
|
+
readonly openAuctions: number;
|
|
81
|
+
readonly hasOpenAuction: boolean;
|
|
82
|
+
readonly padding: number[];
|
|
83
|
+
private constructor();
|
|
84
|
+
/**
|
|
85
|
+
* Creates a {@link User} instance from the provided args.
|
|
86
|
+
*/
|
|
87
|
+
static fromArgs(args: UserArgs): User;
|
|
88
|
+
/**
|
|
89
|
+
* Deserializes the {@link User} from the data of the provided {@link web3.AccountInfo}.
|
|
90
|
+
* @returns a tuple of the account data and the offset up to which the buffer was read to obtain it.
|
|
91
|
+
*/
|
|
92
|
+
static fromAccountInfo(accountInfo: web3.AccountInfo<Buffer>, offset?: number): [User, number];
|
|
93
|
+
/**
|
|
94
|
+
* Retrieves the account info from the provided address and deserializes
|
|
95
|
+
* the {@link User} from its data.
|
|
96
|
+
*
|
|
97
|
+
* @throws Error if no account info is found at the address or if deserialization fails
|
|
98
|
+
*/
|
|
99
|
+
static fromAccountAddress(connection: web3.Connection, address: web3.PublicKey, commitmentOrConfig?: web3.Commitment | web3.GetAccountInfoConfig): Promise<User>;
|
|
100
|
+
/**
|
|
101
|
+
* Provides a {@link web3.Connection.getProgramAccounts} config builder,
|
|
102
|
+
* to fetch accounts matching filters that can be specified via that builder.
|
|
103
|
+
*
|
|
104
|
+
* @param programId - the program that owns the accounts we are filtering
|
|
105
|
+
*/
|
|
106
|
+
static gpaBuilder(programId?: web3.PublicKey): beetSolana.GpaBuilder<{
|
|
107
|
+
status: any;
|
|
108
|
+
lastActiveSlot: any;
|
|
109
|
+
accountDiscriminator: any;
|
|
110
|
+
subAccountId: any;
|
|
111
|
+
padding: any;
|
|
112
|
+
totalSocialLoss: any;
|
|
113
|
+
name: any;
|
|
114
|
+
openOrders: any;
|
|
115
|
+
authority: any;
|
|
116
|
+
delegate: any;
|
|
117
|
+
spotPositions: any;
|
|
118
|
+
perpPositions: any;
|
|
119
|
+
orders: any;
|
|
120
|
+
lastAddPerpLpSharesTs: any;
|
|
121
|
+
totalDeposits: any;
|
|
122
|
+
totalWithdraws: any;
|
|
123
|
+
settledPerpPnl: any;
|
|
124
|
+
cumulativeSpotFees: any;
|
|
125
|
+
cumulativePerpFunding: any;
|
|
126
|
+
liquidationMarginFreed: any;
|
|
127
|
+
nextOrderId: any;
|
|
128
|
+
maxMarginRatio: any;
|
|
129
|
+
nextLiquidationId: any;
|
|
130
|
+
isMarginTradingEnabled: any;
|
|
131
|
+
idle: any;
|
|
132
|
+
hasOpenOrder: any;
|
|
133
|
+
openAuctions: any;
|
|
134
|
+
hasOpenAuction: any;
|
|
135
|
+
}>;
|
|
136
|
+
/**
|
|
137
|
+
* Deserializes the {@link User} from the provided data Buffer.
|
|
138
|
+
* @returns a tuple of the account data and the offset up to which the buffer was read to obtain it.
|
|
139
|
+
*/
|
|
140
|
+
static deserialize(buf: Buffer, offset?: number): [User, number];
|
|
141
|
+
/**
|
|
142
|
+
* Serializes the {@link User} into a Buffer.
|
|
143
|
+
* @returns a tuple of the created Buffer and the offset up to which the buffer was written to store it.
|
|
144
|
+
*/
|
|
145
|
+
serialize(): [Buffer, number];
|
|
146
|
+
/**
|
|
147
|
+
* Returns the byteSize of a {@link Buffer} holding the serialized data of
|
|
148
|
+
* {@link User}
|
|
149
|
+
*/
|
|
150
|
+
static get byteSize(): number;
|
|
151
|
+
/**
|
|
152
|
+
* Fetches the minimum balance needed to exempt an account holding
|
|
153
|
+
* {@link User} data from rent
|
|
154
|
+
*
|
|
155
|
+
* @param connection used to retrieve the rent exemption information
|
|
156
|
+
*/
|
|
157
|
+
static getMinimumBalanceForRentExemption(connection: web3.Connection, commitment?: web3.Commitment): Promise<number>;
|
|
158
|
+
/**
|
|
159
|
+
* Determines if the provided {@link Buffer} has the correct byte size to
|
|
160
|
+
* hold {@link User} data.
|
|
161
|
+
*/
|
|
162
|
+
static hasCorrectByteSize(buf: Buffer, offset?: number): boolean;
|
|
163
|
+
/**
|
|
164
|
+
* Returns a readable version of {@link User} properties
|
|
165
|
+
* and can be used to convert to JSON and/or logging
|
|
166
|
+
*/
|
|
167
|
+
pretty(): {
|
|
168
|
+
authority: string;
|
|
169
|
+
delegate: string;
|
|
170
|
+
name: number[];
|
|
171
|
+
spotPositions: SpotPosition[];
|
|
172
|
+
perpPositions: PerpPosition[];
|
|
173
|
+
orders: Order[];
|
|
174
|
+
lastAddPerpLpSharesTs: number | {
|
|
175
|
+
toNumber: () => number;
|
|
176
|
+
};
|
|
177
|
+
totalDeposits: number | {
|
|
178
|
+
toNumber: () => number;
|
|
179
|
+
};
|
|
180
|
+
totalWithdraws: number | {
|
|
181
|
+
toNumber: () => number;
|
|
182
|
+
};
|
|
183
|
+
totalSocialLoss: number | {
|
|
184
|
+
toNumber: () => number;
|
|
185
|
+
};
|
|
186
|
+
settledPerpPnl: number | {
|
|
187
|
+
toNumber: () => number;
|
|
188
|
+
};
|
|
189
|
+
cumulativeSpotFees: number | {
|
|
190
|
+
toNumber: () => number;
|
|
191
|
+
};
|
|
192
|
+
cumulativePerpFunding: number | {
|
|
193
|
+
toNumber: () => number;
|
|
194
|
+
};
|
|
195
|
+
liquidationMarginFreed: number | {
|
|
196
|
+
toNumber: () => number;
|
|
197
|
+
};
|
|
198
|
+
lastActiveSlot: number | {
|
|
199
|
+
toNumber: () => number;
|
|
200
|
+
};
|
|
201
|
+
nextOrderId: number;
|
|
202
|
+
maxMarginRatio: number;
|
|
203
|
+
nextLiquidationId: number;
|
|
204
|
+
subAccountId: number;
|
|
205
|
+
status: number;
|
|
206
|
+
isMarginTradingEnabled: boolean;
|
|
207
|
+
idle: boolean;
|
|
208
|
+
openOrders: number;
|
|
209
|
+
hasOpenOrder: boolean;
|
|
210
|
+
openAuctions: number;
|
|
211
|
+
hasOpenAuction: boolean;
|
|
212
|
+
padding: number[];
|
|
213
|
+
};
|
|
214
|
+
}
|
|
215
|
+
/**
|
|
216
|
+
* @category Accounts
|
|
217
|
+
* @category generated
|
|
218
|
+
*/
|
|
219
|
+
export declare const userBeet: beet.BeetStruct<User, UserArgs & {
|
|
220
|
+
accountDiscriminator: number[];
|
|
221
|
+
}>;
|
|
@@ -0,0 +1,106 @@
|
|
|
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 { LevelRoles } from '../types/LevelRoles';
|
|
11
|
+
import { StrategyRoleEntry } from '../types/StrategyRoleEntry';
|
|
12
|
+
/**
|
|
13
|
+
* Arguments used to create {@link UserPermissions}
|
|
14
|
+
* @category Accounts
|
|
15
|
+
* @category generated
|
|
16
|
+
*/
|
|
17
|
+
export type UserPermissionsArgs = {
|
|
18
|
+
bump: number;
|
|
19
|
+
authority: web3.PublicKey;
|
|
20
|
+
protocolRoles: LevelRoles;
|
|
21
|
+
strategyRoles: StrategyRoleEntry[];
|
|
22
|
+
};
|
|
23
|
+
export declare const userPermissionsDiscriminator: number[];
|
|
24
|
+
/**
|
|
25
|
+
* Holds the data for the {@link UserPermissions} Account and provides de/serialization
|
|
26
|
+
* functionality for that data
|
|
27
|
+
*
|
|
28
|
+
* @category Accounts
|
|
29
|
+
* @category generated
|
|
30
|
+
*/
|
|
31
|
+
export declare class UserPermissions implements UserPermissionsArgs {
|
|
32
|
+
readonly bump: number;
|
|
33
|
+
readonly authority: web3.PublicKey;
|
|
34
|
+
readonly protocolRoles: LevelRoles;
|
|
35
|
+
readonly strategyRoles: StrategyRoleEntry[];
|
|
36
|
+
private constructor();
|
|
37
|
+
/**
|
|
38
|
+
* Creates a {@link UserPermissions} instance from the provided args.
|
|
39
|
+
*/
|
|
40
|
+
static fromArgs(args: UserPermissionsArgs): UserPermissions;
|
|
41
|
+
/**
|
|
42
|
+
* Deserializes the {@link UserPermissions} from the data of the provided {@link web3.AccountInfo}.
|
|
43
|
+
* @returns a tuple of the account data and the offset up to which the buffer was read to obtain it.
|
|
44
|
+
*/
|
|
45
|
+
static fromAccountInfo(accountInfo: web3.AccountInfo<Buffer>, offset?: number): [UserPermissions, number];
|
|
46
|
+
/**
|
|
47
|
+
* Retrieves the account info from the provided address and deserializes
|
|
48
|
+
* the {@link UserPermissions} from its data.
|
|
49
|
+
*
|
|
50
|
+
* @throws Error if no account info is found at the address or if deserialization fails
|
|
51
|
+
*/
|
|
52
|
+
static fromAccountAddress(connection: web3.Connection, address: web3.PublicKey, commitmentOrConfig?: web3.Commitment | web3.GetAccountInfoConfig): Promise<UserPermissions>;
|
|
53
|
+
/**
|
|
54
|
+
* Provides a {@link web3.Connection.getProgramAccounts} config builder,
|
|
55
|
+
* to fetch accounts matching filters that can be specified via that builder.
|
|
56
|
+
*
|
|
57
|
+
* @param programId - the program that owns the accounts we are filtering
|
|
58
|
+
*/
|
|
59
|
+
static gpaBuilder(programId?: web3.PublicKey): beetSolana.GpaBuilder<UserPermissionsArgs & {
|
|
60
|
+
accountDiscriminator: number[];
|
|
61
|
+
}>;
|
|
62
|
+
/**
|
|
63
|
+
* Deserializes the {@link UserPermissions} from the provided data Buffer.
|
|
64
|
+
* @returns a tuple of the account data and the offset up to which the buffer was read to obtain it.
|
|
65
|
+
*/
|
|
66
|
+
static deserialize(buf: Buffer, offset?: number): [UserPermissions, number];
|
|
67
|
+
/**
|
|
68
|
+
* Serializes the {@link UserPermissions} into a Buffer.
|
|
69
|
+
* @returns a tuple of the created Buffer and the offset up to which the buffer was written to store it.
|
|
70
|
+
*/
|
|
71
|
+
serialize(): [Buffer, number];
|
|
72
|
+
/**
|
|
73
|
+
* Returns the byteSize of a {@link Buffer} holding the serialized data of
|
|
74
|
+
* {@link UserPermissions} for the provided args.
|
|
75
|
+
*
|
|
76
|
+
* @param args need to be provided since the byte size for this account
|
|
77
|
+
* depends on them
|
|
78
|
+
*/
|
|
79
|
+
static byteSize(args: UserPermissionsArgs): number;
|
|
80
|
+
/**
|
|
81
|
+
* Fetches the minimum balance needed to exempt an account holding
|
|
82
|
+
* {@link UserPermissions} data from rent
|
|
83
|
+
*
|
|
84
|
+
* @param args need to be provided since the byte size for this account
|
|
85
|
+
* depends on them
|
|
86
|
+
* @param connection used to retrieve the rent exemption information
|
|
87
|
+
*/
|
|
88
|
+
static getMinimumBalanceForRentExemption(args: UserPermissionsArgs, connection: web3.Connection, commitment?: web3.Commitment): Promise<number>;
|
|
89
|
+
/**
|
|
90
|
+
* Returns a readable version of {@link UserPermissions} properties
|
|
91
|
+
* and can be used to convert to JSON and/or logging
|
|
92
|
+
*/
|
|
93
|
+
pretty(): {
|
|
94
|
+
bump: number;
|
|
95
|
+
authority: string;
|
|
96
|
+
protocolRoles: LevelRoles;
|
|
97
|
+
strategyRoles: StrategyRoleEntry[];
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* @category Accounts
|
|
102
|
+
* @category generated
|
|
103
|
+
*/
|
|
104
|
+
export declare const userPermissionsBeet: beet.FixableBeetStruct<UserPermissions, UserPermissionsArgs & {
|
|
105
|
+
accountDiscriminator: number[];
|
|
106
|
+
}>;
|