@reflectmoney/stable.ts 1.1.1 → 1.1.3

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.
Files changed (176) hide show
  1. package/dist/index.js +1 -0
  2. package/package.json +1 -1
  3. package/dist/classes/PdaClient.d.ts +0 -131
  4. package/dist/classes/Reflect.d.ts +0 -7
  5. package/dist/classes/ReflectAdmin.d.ts +0 -104
  6. package/dist/classes/ReflectAdmin.js +0 -219
  7. package/dist/classes/ReflectKeeper.d.ts +0 -107
  8. package/dist/classes/ReflectTokenisedBond.d.ts +0 -75
  9. package/dist/classes/Stablecoin.d.ts +0 -187
  10. package/dist/classes/index.d.ts +0 -4
  11. package/dist/constants/drift.d.ts +0 -6
  12. package/dist/constants/index.d.ts +0 -7
  13. package/dist/constants/jupiter.d.ts +0 -4
  14. package/dist/constants/lookupTables.d.ts +0 -4
  15. package/dist/constants/lst.d.ts +0 -3
  16. package/dist/constants/pyth.d.ts +0 -1
  17. package/dist/constants/usdc.d.ts +0 -6
  18. package/dist/constants/wsol.d.ts +0 -6
  19. package/dist/errors/ReflectError.d.ts +0 -4
  20. package/dist/generated/reflect_main/accounts/DriftJlpController.d.ts +0 -116
  21. package/dist/generated/reflect_main/accounts/DriftLstController.d.ts +0 -110
  22. package/dist/generated/reflect_main/accounts/DriftUsdcController.d.ts +0 -136
  23. package/dist/generated/reflect_main/accounts/Main.d.ts +0 -112
  24. package/dist/generated/reflect_main/accounts/PerpMarket.d.ts +0 -228
  25. package/dist/generated/reflect_main/accounts/PrelaunchOracle.d.ts +0 -132
  26. package/dist/generated/reflect_main/accounts/PythLazerOracle.d.ts +0 -126
  27. package/dist/generated/reflect_main/accounts/RebalanceLst.d.ts +0 -113
  28. package/dist/generated/reflect_main/accounts/SpotMarket.d.ts +0 -379
  29. package/dist/generated/reflect_main/accounts/User.d.ts +0 -223
  30. package/dist/generated/reflect_main/accounts/UserPermissions.d.ts +0 -108
  31. package/dist/generated/reflect_main/accounts/UserStats.d.ts +0 -213
  32. package/dist/generated/reflect_main/accounts/index.d.ts +0 -38
  33. package/dist/generated/reflect_main/errors/index.d.ts +0 -969
  34. package/dist/generated/reflect_main/index.d.ts +0 -19
  35. package/dist/generated/reflect_main/instructions/addLstDrift.d.ts +0 -49
  36. package/dist/generated/reflect_main/instructions/addSubAccount.d.ts +0 -54
  37. package/dist/generated/reflect_main/instructions/captureSpreadDrift.d.ts +0 -66
  38. package/dist/generated/reflect_main/instructions/captureSpreadDriftS1.d.ts +0 -58
  39. package/dist/generated/reflect_main/instructions/createAdminAccount.d.ts +0 -51
  40. package/dist/generated/reflect_main/instructions/createUserStatsAccount.d.ts +0 -52
  41. package/dist/generated/reflect_main/instructions/depositDrift.d.ts +0 -73
  42. package/dist/generated/reflect_main/instructions/freezeProgram.d.ts +0 -54
  43. package/dist/generated/reflect_main/instructions/freezeProtocolAction.d.ts +0 -55
  44. package/dist/generated/reflect_main/instructions/freezeStrategyAction.d.ts +0 -58
  45. package/dist/generated/reflect_main/instructions/index.d.ts +0 -34
  46. package/dist/generated/reflect_main/instructions/initDriftAccountsS1.d.ts +0 -54
  47. package/dist/generated/reflect_main/instructions/initDriftControllerS1.d.ts +0 -60
  48. package/dist/generated/reflect_main/instructions/initDriftControllerS3.d.ts +0 -58
  49. package/dist/generated/reflect_main/instructions/initMain.d.ts +0 -43
  50. package/dist/generated/reflect_main/instructions/mintDriftS1.d.ts +0 -86
  51. package/dist/generated/reflect_main/instructions/mintDriftS3.d.ts +0 -86
  52. package/dist/generated/reflect_main/instructions/processSwapDeposit.d.ts +0 -69
  53. package/dist/generated/reflect_main/instructions/processSwapWithdraw.d.ts +0 -69
  54. package/dist/generated/reflect_main/instructions/redeemDriftS1.d.ts +0 -87
  55. package/dist/generated/reflect_main/instructions/redeemDriftS3.d.ts +0 -87
  56. package/dist/generated/reflect_main/instructions/settlePnl.d.ts +0 -55
  57. package/dist/generated/reflect_main/instructions/settlePnlMulti.d.ts +0 -65
  58. package/dist/generated/reflect_main/instructions/suspendSplProtocol.d.ts +0 -54
  59. package/dist/generated/reflect_main/instructions/suspendSplStrategy.d.ts +0 -56
  60. package/dist/generated/reflect_main/instructions/swapOrca.d.ts +0 -81
  61. package/dist/generated/reflect_main/instructions/swapOrcaTwoHop.d.ts +0 -101
  62. package/dist/generated/reflect_main/instructions/updateActionRoleProtocol.d.ts +0 -58
  63. package/dist/generated/reflect_main/instructions/updateActionRoleStrategy.d.ts +0 -60
  64. package/dist/generated/reflect_main/instructions/updateAttenuation.d.ts +0 -57
  65. package/dist/generated/reflect_main/instructions/updateCap.d.ts +0 -55
  66. package/dist/generated/reflect_main/instructions/updateRebalanceSlippage.d.ts +0 -55
  67. package/dist/generated/reflect_main/instructions/updateRecipients.d.ts +0 -56
  68. package/dist/generated/reflect_main/instructions/updateRoleHolderProtocol.d.ts +0 -60
  69. package/dist/generated/reflect_main/instructions/updateRoleHolderStrategy.d.ts +0 -60
  70. package/dist/generated/reflect_main/types/AMM.d.ts +0 -102
  71. package/dist/generated/reflect_main/types/AccKey.d.ts +0 -15
  72. package/dist/generated/reflect_main/types/AccessControl.d.ts +0 -18
  73. package/dist/generated/reflect_main/types/AccessMap.d.ts +0 -17
  74. package/dist/generated/reflect_main/types/Action.d.ts +0 -35
  75. package/dist/generated/reflect_main/types/ActionMapping.d.ts +0 -19
  76. package/dist/generated/reflect_main/types/AssetTier.d.ts +0 -23
  77. package/dist/generated/reflect_main/types/Attenuation.d.ts +0 -16
  78. package/dist/generated/reflect_main/types/BalanceType.d.ts +0 -20
  79. package/dist/generated/reflect_main/types/Capture.d.ts +0 -17
  80. package/dist/generated/reflect_main/types/ContractTier.d.ts +0 -24
  81. package/dist/generated/reflect_main/types/ContractType.d.ts +0 -20
  82. package/dist/generated/reflect_main/types/CorpAction.d.ts +0 -19
  83. package/dist/generated/reflect_main/types/CustodyInfo.d.ts +0 -20
  84. package/dist/generated/reflect_main/types/DirectionCollateral.d.ts +0 -20
  85. package/dist/generated/reflect_main/types/DirectionPosition.d.ts +0 -20
  86. package/dist/generated/reflect_main/types/DriftControllerBase.d.ts +0 -15
  87. package/dist/generated/reflect_main/types/DriftJlpControllerFixedAccounts.d.ts +0 -18
  88. package/dist/generated/reflect_main/types/DriftLstData.d.ts +0 -17
  89. package/dist/generated/reflect_main/types/Ema.d.ts +0 -17
  90. package/dist/generated/reflect_main/types/Externals.d.ts +0 -16
  91. package/dist/generated/reflect_main/types/FlowControl.d.ts +0 -17
  92. package/dist/generated/reflect_main/types/HistoricalIndexData.d.ts +0 -19
  93. package/dist/generated/reflect_main/types/HistoricalOracleData.d.ts +0 -20
  94. package/dist/generated/reflect_main/types/Holding.d.ts +0 -21
  95. package/dist/generated/reflect_main/types/Holdings.d.ts +0 -17
  96. package/dist/generated/reflect_main/types/InsuranceClaim.d.ts +0 -19
  97. package/dist/generated/reflect_main/types/InsuranceFund.d.ts +0 -24
  98. package/dist/generated/reflect_main/types/JlpRebalanceSettings.d.ts +0 -15
  99. package/dist/generated/reflect_main/types/KillSwitch.d.ts +0 -15
  100. package/dist/generated/reflect_main/types/LevelRoles.d.ts +0 -16
  101. package/dist/generated/reflect_main/types/MarketStatus.d.ts +0 -27
  102. package/dist/generated/reflect_main/types/MarketType.d.ts +0 -20
  103. package/dist/generated/reflect_main/types/ModifyOrderParams.d.ts +0 -32
  104. package/dist/generated/reflect_main/types/ModifyOrderPolicy.d.ts +0 -20
  105. package/dist/generated/reflect_main/types/Movements.d.ts +0 -19
  106. package/dist/generated/reflect_main/types/OracleGuardRails.d.ts +0 -18
  107. package/dist/generated/reflect_main/types/OracleSource.d.ts +0 -34
  108. package/dist/generated/reflect_main/types/OracleValidity.d.ts +0 -25
  109. package/dist/generated/reflect_main/types/Order.d.ts +0 -43
  110. package/dist/generated/reflect_main/types/OrderDirection.d.ts +0 -20
  111. package/dist/generated/reflect_main/types/OrderParams.d.ts +0 -36
  112. package/dist/generated/reflect_main/types/OrderStatus.d.ts +0 -22
  113. package/dist/generated/reflect_main/types/OrderTriggerCondition.d.ts +0 -22
  114. package/dist/generated/reflect_main/types/OrderType.d.ts +0 -23
  115. package/dist/generated/reflect_main/types/PermissionLevel.d.ts +0 -51
  116. package/dist/generated/reflect_main/types/PerpHedge.d.ts +0 -17
  117. package/dist/generated/reflect_main/types/PerpPosition.d.ts +0 -29
  118. package/dist/generated/reflect_main/types/PoolBalance.d.ts +0 -17
  119. package/dist/generated/reflect_main/types/Position.d.ts +0 -20
  120. package/dist/generated/reflect_main/types/PositionDirection.d.ts +0 -20
  121. package/dist/generated/reflect_main/types/PositionDrift.d.ts +0 -18
  122. package/dist/generated/reflect_main/types/PostOnlyParam.d.ts +0 -22
  123. package/dist/generated/reflect_main/types/Price.d.ts +0 -41
  124. package/dist/generated/reflect_main/types/PriceComp.d.ts +0 -19
  125. package/dist/generated/reflect_main/types/PriceDivergenceGuardRails.d.ts +0 -16
  126. package/dist/generated/reflect_main/types/PriceInfo.d.ts +0 -21
  127. package/dist/generated/reflect_main/types/PriceStatus.d.ts +0 -22
  128. package/dist/generated/reflect_main/types/PriceType.d.ts +0 -20
  129. package/dist/generated/reflect_main/types/Program.d.ts +0 -19
  130. package/dist/generated/reflect_main/types/ProgramStatus.d.ts +0 -20
  131. package/dist/generated/reflect_main/types/Recipient.d.ts +0 -17
  132. package/dist/generated/reflect_main/types/Recipients.d.ts +0 -17
  133. package/dist/generated/reflect_main/types/Role.d.ts +0 -25
  134. package/dist/generated/reflect_main/types/ShiftCollateral.d.ts +0 -19
  135. package/dist/generated/reflect_main/types/ShiftPosition.d.ts +0 -17
  136. package/dist/generated/reflect_main/types/ShortHolding.d.ts +0 -17
  137. package/dist/generated/reflect_main/types/SplBase.d.ts +0 -17
  138. package/dist/generated/reflect_main/types/SplMain.d.ts +0 -22
  139. package/dist/generated/reflect_main/types/Spls.d.ts +0 -17
  140. package/dist/generated/reflect_main/types/SpotBalanceType.d.ts +0 -20
  141. package/dist/generated/reflect_main/types/SpotPosition.d.ts +0 -23
  142. package/dist/generated/reflect_main/types/Status.d.ts +0 -21
  143. package/dist/generated/reflect_main/types/Strategy.d.ts +0 -32
  144. package/dist/generated/reflect_main/types/StrategyPadding.d.ts +0 -15
  145. package/dist/generated/reflect_main/types/StrategyRoleEntry.d.ts +0 -17
  146. package/dist/generated/reflect_main/types/SubAccount.d.ts +0 -17
  147. package/dist/generated/reflect_main/types/Update.d.ts +0 -20
  148. package/dist/generated/reflect_main/types/UserFees.d.ts +0 -20
  149. package/dist/generated/reflect_main/types/ValidityGuardRails.d.ts +0 -18
  150. package/dist/generated/reflect_main/types/index.d.ts +0 -80
  151. package/dist/generated/reflect_tokenised_bonds/accounts/Admin.d.ts +0 -101
  152. package/dist/generated/reflect_tokenised_bonds/accounts/Config.d.ts +0 -108
  153. package/dist/generated/reflect_tokenised_bonds/accounts/Vault.d.ts +0 -116
  154. package/dist/generated/reflect_tokenised_bonds/accounts/index.d.ts +0 -11
  155. package/dist/generated/reflect_tokenised_bonds/errors/index.d.ts +0 -144
  156. package/dist/generated/reflect_tokenised_bonds/index.d.ts +0 -19
  157. package/dist/generated/reflect_tokenised_bonds/instructions/createVault.d.ts +0 -50
  158. package/dist/generated/reflect_tokenised_bonds/instructions/deposit.d.ts +0 -62
  159. package/dist/generated/reflect_tokenised_bonds/instructions/index.d.ts +0 -4
  160. package/dist/generated/reflect_tokenised_bonds/instructions/initialize.d.ts +0 -43
  161. package/dist/generated/reflect_tokenised_bonds/instructions/withdraw.d.ts +0 -62
  162. package/dist/generated/reflect_tokenised_bonds/types/DepositArgs.d.ts +0 -17
  163. package/dist/generated/reflect_tokenised_bonds/types/Permissions.d.ts +0 -21
  164. package/dist/generated/reflect_tokenised_bonds/types/WithdrawArgs.d.ts +0 -16
  165. package/dist/generated/reflect_tokenised_bonds/types/index.d.ts +0 -3
  166. package/dist/helpers/getOrcaQuote.d.ts +0 -3
  167. package/dist/idl/perpetuals.d.ts +0 -5771
  168. package/dist/index.d.ts +0 -8
  169. package/dist/stablecoins/JlpStablecoin.d.ts +0 -1
  170. package/dist/stablecoins/JlpStablecoin.js +0 -44
  171. package/dist/stablecoins/LstStablecoin.d.ts +0 -65
  172. package/dist/stablecoins/UsdcPlusStablecoin.d.ts +0 -68
  173. package/dist/stablecoins/UsdcStablecoin.d.ts +0 -64
  174. package/dist/stablecoins/UsdcStablecoin.js +0 -145
  175. package/dist/stablecoins/UsdjStablecoin.d.ts +0 -1
  176. package/dist/stablecoins/index.d.ts +0 -3
package/dist/index.d.ts DELETED
@@ -1,8 +0,0 @@
1
- export * from "./stablecoins";
2
- export * from "./classes";
3
- export { PROGRAM_ID as DELTA_NEUTRAL_PROGRAM_ID, } from "./generated/reflect_main";
4
- export { PROGRAM_ID as TOKENISED_BONDS_PROGRAM_ID, } from "./generated/reflect_tokenised_bonds";
5
- export * from "./generated/reflect_main/accounts";
6
- export * from "./generated/reflect_main/errors";
7
- export * from "./generated/reflect_main/instructions";
8
- export * from "./generated/reflect_main/types";
@@ -1 +0,0 @@
1
- export {};
@@ -1,44 +0,0 @@
1
- "use strict";
2
- // import {Stablecoin} from "../classes/Stablecoin";
3
- // import {PdaClient} from "../classes/PdaClient";
4
- // import {
5
- // createInitDriftControllerS2Instruction,
6
- // createMintDriftS2Instruction,
7
- // createRebalanceJlpInstruction,
8
- // createRedeemDriftS2Instruction,
9
- // createRedeem2DriftS2Instruction,
10
- // DriftJlpController,
11
- // MintDriftS2InstructionAccounts, PerpHedge,
12
- // PROGRAM_ID
13
- // } from "../generated/reflect_main";
14
- // import {
15
- // AccountMeta,
16
- // Connection,
17
- // Keypair,
18
- // PublicKey,
19
- // SystemProgram,
20
- // Transaction,
21
- // TransactionInstruction
22
- // } from "@solana/web3.js";
23
- // import {JLP_MINT, DRIFT_PROGRAM_ID, JUPITER_PROGRAM_ID, USDC_MINT} from "../constants";
24
- // import {getAccount, getAssociatedTokenAddressSync, getMint, TOKEN_PROGRAM_ID} from "@solana/spl-token";
25
- // import {
26
- // getDriftSignerPublicKey,
27
- // getDriftStateAccountPublicKey,
28
- // getPerpMarketPublicKeySync,
29
- // getSpotMarketPublicKey,
30
- // getSpotMarketPublicKeySync, getSpotMarketVaultPublicKey,
31
- // getUserAccountPublicKeySync,
32
- // getUserStatsAccountPublicKey,
33
- // PerpMarkets,
34
- // SpotMarkets,
35
- // MarginCategory,
36
- // getTokenAmount,
37
- // SpotBalanceType
38
- // } from "@drift-labs/sdk";
39
- // import BN, { min } from "bn.js";
40
- // import {AnchorProvider, Program} from "@coral-xyz/anchor";
41
- // import {type Perpetuals, IDL} from "../idl/perpetuals";
42
- // import NodeWallet from "@coral-xyz/anchor/dist/cjs/nodewallet";
43
- // import { JlpPoolInfo, JlpComponent } from "../types";
44
- Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,65 +0,0 @@
1
- import { Stablecoin } from "../classes/Stablecoin";
2
- import { Connection, PublicKey, TransactionInstruction } from "@solana/web3.js";
3
- import { DriftLstController, DriftLstData } from "../generated/reflect_main";
4
- import BN from "bn.js";
5
- /**
6
- * LST (Liquid Staking Token) Delta-Neutral Stablecoin implementation.
7
- * Extends the base Stablecoin class to provide LST-specific functionality
8
- * including delta-neutral strategies with perpetual hedging.
9
- *
10
- * This stablecoin allows users to mint stablecoins against LST collateral
11
- * while maintaining delta-neutral exposure through perpetual futures hedging.
12
- * Strategy ID: 2
13
- */
14
- export declare class LstStablecoin extends Stablecoin<DriftLstController> {
15
- /** Array of LST data containing market indices and sub-account mappings */
16
- lstMap: DriftLstData[];
17
- /**
18
- * Creates a new LST Stablecoin instance.
19
- *
20
- * @param connection - Solana connection instance for RPC communication
21
- * @param stablecoinMintOverride - Optional override for the stablecoin mint address
22
- * @param collateralMintsOverride - Optional override for collateral mint addresses
23
- */
24
- constructor(connection: Connection, stablecoinMintOverride?: PublicKey, collateralMintsOverride?: PublicKey[]);
25
- /**
26
- * Loads the LST controller data from the blockchain.
27
- * Updates the stablecoin mint and LST mapping information.
28
- */
29
- load(): Promise<void>;
30
- /**
31
- * Initializes the LST stablecoin with the specified parameters.
32
- * Sets up the controller with cap, mint, and recipient information.
33
- *
34
- * @param signer - Public key of the signer/initializer
35
- * @param cap - Maximum supply cap as a BN
36
- * @param mint - Public key of the stablecoin mint
37
- * @param recipientAddresses - Array of recipient public keys for fee distribution
38
- * @param recipientCuts - Array of fee cuts (percentages) corresponding to each recipient
39
- * @returns Promise resolving to an array of TransactionInstruction objects
40
- */
41
- initialize(signer: PublicKey, cap: BN, mint: PublicKey, recipientAddresses: PublicKey[], recipientCuts: number[]): Promise<TransactionInstruction[]>;
42
- /**
43
- * Constructs the required accounts for LST mint/redeem transactions.
44
- *
45
- * @param signer - Public key of the transaction signer
46
- * @param lst - Public key of the LST being used as collateral
47
- * @returns Promise resolving to the constructed accounts object of type T
48
- */
49
- constructAccounts<T>(signer: PublicKey, lst: PublicKey): Promise<T>;
50
- /**
51
- * Constructs remaining accounts for LST transactions.
52
- * Includes USDC spot market, SOL oracle, and SOL perpetual market accounts.
53
- *
54
- * @returns Promise resolving to an array of AccountMeta objects
55
- */
56
- constructRemainingAccounts(): Promise<{
57
- pubkey: PublicKey;
58
- isWritable: boolean;
59
- isSigner: boolean;
60
- }[]>;
61
- mint(signer: PublicKey, amount: BN | number, minimumReceived: number | BN, lst: PublicKey): Promise<TransactionInstruction[]>;
62
- redeem(signer: PublicKey, amount: BN | number, minimumReceived: number | BN, lst: PublicKey): Promise<TransactionInstruction[]>;
63
- rebalance(): Promise<TransactionInstruction[]>;
64
- whitelistCollateral(signer: PublicKey, mint: PublicKey): Promise<TransactionInstruction[]>;
65
- }
@@ -1,68 +0,0 @@
1
- import { Stablecoin } from "../classes/Stablecoin";
2
- import { AccountMeta, Connection, PublicKey, TransactionInstruction } from "@solana/web3.js";
3
- import { DriftUsdcController } from "../generated/reflect_main";
4
- import BN from "bn.js";
5
- /**
6
- * USDC+ Stablecoin implementation for the Reflect protocol.
7
- * Extends the base Stablecoin class to provide USDC-specific functionality
8
- * including initialization, minting, redemption, and rebalancing operations.
9
- */
10
- export declare class UsdcPlusStablecoin extends Stablecoin<DriftUsdcController> {
11
- /**
12
- * Creates a new USDC+ Stablecoin instance.
13
- *
14
- * @param connection - Solana connection instance for RPC communication
15
- * @param stablecoinMintOverride - Optional override for the stablecoin mint address
16
- */
17
- constructor(connection: Connection, stablecoinMintOverride?: PublicKey);
18
- load(): Promise<void>;
19
- /**
20
- * Initializes the USDC stablecoin with the specified parameters.
21
- * Creates receipt tokens, initializes vault, and initializes the stablecoin.
22
- *
23
- * @param signer - Public key of the signer/initializer
24
- * @param mint - Public key of the mint to be used for the stablecoin
25
- * @param cap - Maximum supply cap as a BN (Big Number)
26
- * @param recipientAddresses - Array of recipient public keys for fee distribution
27
- * @param recipientCuts - Array of fee cuts (percentages) corresponding to each recipient
28
- * @returns Promise resolving to an array of TransactionInstruction objects
29
- */
30
- initialize(signer: PublicKey, mint: PublicKey, cap: BN, recipientAddresses: PublicKey[], recipientCuts: number[]): Promise<TransactionInstruction[]>;
31
- /**
32
- * Constructs the required accounts for the InitDriftControllerS1 instruction.
33
- *
34
- * @param signer - Public key of the signer
35
- * @returns Promise resolving to the constructed accounts object of type T
36
- */
37
- constructAccounts<T>(signer: PublicKey): Promise<T>;
38
- /**
39
- * Constructs remaining accounts for transactions.
40
- * Currently returns an empty array as no additional accounts are needed.
41
- *
42
- * @returns Promise resolving to an empty array of AccountMeta objects
43
- */
44
- constructRemainingAccounts(): Promise<AccountMeta[]>;
45
- /**
46
- * Creates a mint instruction for the USDC+ stablecoin.
47
- *
48
- * @param signer - Public key of the signer
49
- * @param amount - Amount of USDC to deposit
50
- * @param minimumReceived - Minimum amount of USDC+ stablecoins to receive (slippage protection)
51
- * @returns Promise resolving to an array containing a single TransactionInstruction
52
- */
53
- mint(signer: PublicKey, amount: BN | number, minimumReceived: BN | number): Promise<TransactionInstruction[]>;
54
- /**
55
- * Creates a redeem instruction for the USDC stablecoin.
56
- * Currently returns a placeholder instruction - implementation needed.
57
- *
58
- * @returns Promise resolving to an array containing a single TransactionInstruction
59
- */
60
- redeem(signer: PublicKey, amount: BN | number, minimumReceived: BN | number): Promise<TransactionInstruction[]>;
61
- /**
62
- * Creates a rebalance instruction for the USDC+ stablecoin.
63
- * Currently returns an empty instruction, as the rebalance is unnecessary.
64
- *
65
- * @returns Promise resolving to an array containing a single, empty TransactionInstruction.
66
- */
67
- rebalance(): Promise<TransactionInstruction[]>;
68
- }
@@ -1,64 +0,0 @@
1
- import { Stablecoin } from "../classes/Stablecoin";
2
- import { AccountMeta, Connection, PublicKey, TransactionInstruction } from "@solana/web3.js";
3
- import BN from "bn.js";
4
- /**
5
- * USDC+ Stablecoin implementation for the Reflect protocol.
6
- * Extends the base Stablecoin class to provide USDC-specific functionality
7
- * including initialization, minting, redemption, and rebalancing operations.
8
- */
9
- export declare class UsdcStablecoin extends Stablecoin {
10
- /**
11
- * Creates a new USDC+ Stablecoin instance.
12
- *
13
- * @param connection - Solana connection instance for RPC communication
14
- * @param stablecoinMintOverride - Optional override for the stablecoin mint address
15
- */
16
- constructor(connection: Connection, stablecoinMintOverride?: PublicKey);
17
- /**
18
- * Initializes the USDC stablecoin with the specified parameters.
19
- * Creates receipt tokens, initializes vault, and initializes the stablecoin.
20
- *
21
- * @param signer - Public key of the signer/initializer
22
- * @param mint - Public key of the mint to be used for the stablecoin
23
- * @param cap - Maximum supply cap as a BN (Big Number)
24
- * @param recipientAddresses - Array of recipient public keys for fee distribution
25
- * @param recipientCuts - Array of fee cuts (percentages) corresponding to each recipient
26
- * @returns Promise resolving to an array of TransactionInstruction objects
27
- */
28
- initialize(signer: PublicKey, mint: PublicKey, cap: BN, recipientAddresses: PublicKey[], recipientCuts: number[]): Promise<TransactionInstruction[]>;
29
- /**
30
- * Constructs the required accounts for the InitDriftControllerS1 instruction.
31
- *
32
- * @param signer - Public key of the signer
33
- * @returns Promise resolving to the constructed accounts object of type T
34
- */
35
- constructAccounts<T>(signer: PublicKey): Promise<T>;
36
- /**
37
- * Constructs remaining accounts for transactions.
38
- * Currently returns an empty array as no additional accounts are needed.
39
- *
40
- * @returns Promise resolving to an empty array of AccountMeta objects
41
- */
42
- constructRemainingAccounts(): Promise<AccountMeta[]>;
43
- /**
44
- * Creates a mint instruction for the USDC stablecoin.
45
- * Currently returns a placeholder instruction - implementation needed.
46
- *
47
- * @returns Promise resolving to an array containing a single TransactionInstruction
48
- */
49
- mint(): Promise<TransactionInstruction[]>;
50
- /**
51
- * Creates a redeem instruction for the USDC stablecoin.
52
- * Currently returns a placeholder instruction - implementation needed.
53
- *
54
- * @returns Promise resolving to an array containing a single TransactionInstruction
55
- */
56
- redeem(): Promise<TransactionInstruction[]>;
57
- /**
58
- * Creates a rebalance instruction for the USDC stablecoin.
59
- * Currently returns a placeholder instruction - implementation needed.
60
- *
61
- * @returns Promise resolving to an array containing a single TransactionInstruction
62
- */
63
- rebalance(): Promise<TransactionInstruction[]>;
64
- }
@@ -1,145 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.UsdcStablecoin = void 0;
13
- const Stablecoin_1 = require("../classes/Stablecoin");
14
- const web3_js_1 = require("@solana/web3.js");
15
- const classes_1 = require("../classes");
16
- const constants_1 = require("../constants");
17
- const reflect_main_1 = require("../generated/reflect_main");
18
- const ReflectTokenisedBond_1 = require("../classes/ReflectTokenisedBond");
19
- /**
20
- * USDC+ Stablecoin implementation for the Reflect protocol.
21
- * Extends the base Stablecoin class to provide USDC-specific functionality
22
- * including initialization, minting, redemption, and rebalancing operations.
23
- */
24
- class UsdcStablecoin extends Stablecoin_1.Stablecoin {
25
- /**
26
- * Creates a new USDC+ Stablecoin instance.
27
- *
28
- * @param connection - Solana connection instance for RPC communication
29
- * @param stablecoinMintOverride - Optional override for the stablecoin mint address
30
- */
31
- constructor(connection, stablecoinMintOverride) {
32
- super(0, "USDC Money Market", connection);
33
- this.collaterals = [{ mint: constants_1.USDC_MINT, oracle: "" }];
34
- // Otherwise has to be loaded first.
35
- if (stablecoinMintOverride)
36
- this.stablecoinMint = stablecoinMintOverride;
37
- }
38
- /**
39
- * Initializes the USDC stablecoin with the specified parameters.
40
- * Creates receipt tokens, initializes vault, and initializes the stablecoin.
41
- *
42
- * @param signer - Public key of the signer/initializer
43
- * @param mint - Public key of the mint to be used for the stablecoin
44
- * @param cap - Maximum supply cap as a BN (Big Number)
45
- * @param recipientAddresses - Array of recipient public keys for fee distribution
46
- * @param recipientCuts - Array of fee cuts (percentages) corresponding to each recipient
47
- * @returns Promise resolving to an array of TransactionInstruction objects
48
- */
49
- initialize(signer, mint, cap, recipientAddresses, recipientCuts) {
50
- return __awaiter(this, void 0, void 0, function* () {
51
- const vault = classes_1.PdaClient.deriveLpVault(0);
52
- const lp = new ReflectTokenisedBond_1.ReflectTokenisedBond(this.connection);
53
- const { instructions: receiptIx, signers: [receiptKeypair] } = yield lp.createReceiptToken(this.connection, signer, vault);
54
- const vaultIx = yield lp.initializeVault(signer, mint, receiptKeypair.publicKey);
55
- const ix = (0, reflect_main_1.createInitDriftControllerS1Instruction)(Object.assign({}, (yield this.constructAccounts(signer))), {
56
- mint,
57
- cap,
58
- recipientAddresses,
59
- recipientCuts,
60
- lpReciptMint: receiptKeypair.publicKey,
61
- vault
62
- }, reflect_main_1.PROGRAM_ID);
63
- return [...receiptIx, vaultIx, ix];
64
- });
65
- }
66
- /**
67
- * Constructs the required accounts for the InitDriftControllerS1 instruction.
68
- *
69
- * @param signer - Public key of the signer
70
- * @returns Promise resolving to the constructed accounts object of type T
71
- */
72
- constructAccounts(signer) {
73
- return __awaiter(this, void 0, void 0, function* () {
74
- const accounts = {
75
- admin: signer,
76
- adminPermissions: classes_1.PdaClient.derivePermissions(signer),
77
- main: classes_1.PdaClient.deriveMain(),
78
- driftUsdcController: this.controller,
79
- systemProgram: web3_js_1.SystemProgram.programId,
80
- };
81
- return accounts;
82
- });
83
- }
84
- /**
85
- * Constructs remaining accounts for transactions.
86
- * Currently returns an empty array as no additional accounts are needed.
87
- *
88
- * @returns Promise resolving to an empty array of AccountMeta objects
89
- */
90
- constructRemainingAccounts() {
91
- return __awaiter(this, void 0, void 0, function* () {
92
- return [];
93
- });
94
- }
95
- ;
96
- /**
97
- * Creates a mint instruction for the USDC stablecoin.
98
- * Currently returns a placeholder instruction - implementation needed.
99
- *
100
- * @returns Promise resolving to an array containing a single TransactionInstruction
101
- */
102
- mint() {
103
- return __awaiter(this, void 0, void 0, function* () {
104
- const ix = new web3_js_1.TransactionInstruction({
105
- programId: web3_js_1.Keypair.generate().publicKey,
106
- data: Buffer.from(""),
107
- keys: []
108
- });
109
- return [ix];
110
- });
111
- }
112
- /**
113
- * Creates a redeem instruction for the USDC stablecoin.
114
- * Currently returns a placeholder instruction - implementation needed.
115
- *
116
- * @returns Promise resolving to an array containing a single TransactionInstruction
117
- */
118
- redeem() {
119
- return __awaiter(this, void 0, void 0, function* () {
120
- const ix = new web3_js_1.TransactionInstruction({
121
- programId: web3_js_1.Keypair.generate().publicKey,
122
- data: Buffer.from(""),
123
- keys: []
124
- });
125
- return [ix];
126
- });
127
- }
128
- /**
129
- * Creates a rebalance instruction for the USDC stablecoin.
130
- * Currently returns a placeholder instruction - implementation needed.
131
- *
132
- * @returns Promise resolving to an array containing a single TransactionInstruction
133
- */
134
- rebalance() {
135
- return __awaiter(this, void 0, void 0, function* () {
136
- const ix = new web3_js_1.TransactionInstruction({
137
- programId: web3_js_1.Keypair.generate().publicKey,
138
- data: Buffer.from(""),
139
- keys: []
140
- });
141
- return [ix];
142
- });
143
- }
144
- }
145
- exports.UsdcStablecoin = UsdcStablecoin;
@@ -1 +0,0 @@
1
- export {};
@@ -1,3 +0,0 @@
1
- export * from "./UsdjStablecoin";
2
- export * from "./LstStablecoin";
3
- export * from "./UsdcPlusStablecoin";