@kamino-finance/klend-sdk 5.10.27 → 5.10.28-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/dist/classes/index.d.ts +3 -0
  2. package/dist/classes/index.d.ts.map +1 -1
  3. package/dist/classes/index.js +3 -0
  4. package/dist/classes/index.js.map +1 -1
  5. package/dist/classes/stakePool.d.ts +8 -0
  6. package/dist/classes/stakePool.d.ts.map +1 -0
  7. package/dist/classes/stakePool.js +18 -0
  8. package/dist/classes/stakePool.js.map +1 -0
  9. package/dist/classes/standardStakePool.d.ts +174 -0
  10. package/dist/classes/standardStakePool.d.ts.map +1 -0
  11. package/dist/classes/standardStakePool.js +275 -0
  12. package/dist/classes/standardStakePool.js.map +1 -0
  13. package/dist/classes/types.d.ts +13 -1
  14. package/dist/classes/types.d.ts.map +1 -1
  15. package/dist/classes/unstakingPool.d.ts +117 -0
  16. package/dist/classes/unstakingPool.d.ts.map +1 -0
  17. package/dist/classes/unstakingPool.js +448 -0
  18. package/dist/classes/unstakingPool.js.map +1 -0
  19. package/dist/idl_codegen_unstaking_pool/accounts/PoolState.d.ts +50 -0
  20. package/dist/idl_codegen_unstaking_pool/accounts/PoolState.d.ts.map +1 -0
  21. package/dist/idl_codegen_unstaking_pool/accounts/PoolState.js +156 -0
  22. package/dist/idl_codegen_unstaking_pool/accounts/PoolState.js.map +1 -0
  23. package/dist/idl_codegen_unstaking_pool/accounts/index.d.ts +3 -0
  24. package/dist/idl_codegen_unstaking_pool/accounts/index.d.ts.map +1 -0
  25. package/dist/idl_codegen_unstaking_pool/accounts/index.js +6 -0
  26. package/dist/idl_codegen_unstaking_pool/accounts/index.js.map +1 -0
  27. package/dist/idl_codegen_unstaking_pool/errors/anchor.d.ts +435 -0
  28. package/dist/idl_codegen_unstaking_pool/errors/anchor.d.ts.map +1 -0
  29. package/dist/idl_codegen_unstaking_pool/errors/anchor.js +767 -0
  30. package/dist/idl_codegen_unstaking_pool/errors/anchor.js.map +1 -0
  31. package/dist/idl_codegen_unstaking_pool/errors/custom.d.ts +163 -0
  32. package/dist/idl_codegen_unstaking_pool/errors/custom.d.ts.map +1 -0
  33. package/dist/idl_codegen_unstaking_pool/errors/custom.js +290 -0
  34. package/dist/idl_codegen_unstaking_pool/errors/custom.js.map +1 -0
  35. package/dist/idl_codegen_unstaking_pool/errors/index.d.ts +6 -0
  36. package/dist/idl_codegen_unstaking_pool/errors/index.d.ts.map +1 -0
  37. package/dist/idl_codegen_unstaking_pool/errors/index.js +75 -0
  38. package/dist/idl_codegen_unstaking_pool/errors/index.js.map +1 -0
  39. package/dist/idl_codegen_unstaking_pool/instructions/burn.d.ts +21 -0
  40. package/dist/idl_codegen_unstaking_pool/instructions/burn.d.ts.map +1 -0
  41. package/dist/idl_codegen_unstaking_pool/instructions/burn.js +73 -0
  42. package/dist/idl_codegen_unstaking_pool/instructions/burn.js.map +1 -0
  43. package/dist/idl_codegen_unstaking_pool/instructions/collect.d.ts +16 -0
  44. package/dist/idl_codegen_unstaking_pool/instructions/collect.d.ts.map +1 -0
  45. package/dist/idl_codegen_unstaking_pool/instructions/collect.js +29 -0
  46. package/dist/idl_codegen_unstaking_pool/instructions/collect.js.map +1 -0
  47. package/dist/idl_codegen_unstaking_pool/instructions/index.d.ts +11 -0
  48. package/dist/idl_codegen_unstaking_pool/instructions/index.d.ts.map +1 -0
  49. package/dist/idl_codegen_unstaking_pool/instructions/index.js +14 -0
  50. package/dist/idl_codegen_unstaking_pool/instructions/index.js.map +1 -0
  51. package/dist/idl_codegen_unstaking_pool/instructions/initializePool.d.ts +15 -0
  52. package/dist/idl_codegen_unstaking_pool/instructions/initializePool.d.ts.map +1 -0
  53. package/dist/idl_codegen_unstaking_pool/instructions/initializePool.js +28 -0
  54. package/dist/idl_codegen_unstaking_pool/instructions/initializePool.js.map +1 -0
  55. package/dist/idl_codegen_unstaking_pool/instructions/mint.d.ts +21 -0
  56. package/dist/idl_codegen_unstaking_pool/instructions/mint.d.ts.map +1 -0
  57. package/dist/idl_codegen_unstaking_pool/instructions/mint.js +77 -0
  58. package/dist/idl_codegen_unstaking_pool/instructions/mint.js.map +1 -0
  59. package/dist/idl_codegen_unstaking_pool/instructions/updatePoolConfig.d.ts +13 -0
  60. package/dist/idl_codegen_unstaking_pool/instructions/updatePoolConfig.d.ts.map +1 -0
  61. package/dist/idl_codegen_unstaking_pool/instructions/updatePoolConfig.js +58 -0
  62. package/dist/idl_codegen_unstaking_pool/instructions/updatePoolConfig.js.map +1 -0
  63. package/dist/idl_codegen_unstaking_pool/programId.d.ts +4 -0
  64. package/dist/idl_codegen_unstaking_pool/programId.d.ts.map +1 -0
  65. package/dist/idl_codegen_unstaking_pool/programId.js +9 -0
  66. package/dist/idl_codegen_unstaking_pool/programId.js.map +1 -0
  67. package/dist/idl_codegen_unstaking_pool/types/PoolConfigField.d.ts +32 -0
  68. package/dist/idl_codegen_unstaking_pool/types/PoolConfigField.d.ts.map +1 -0
  69. package/dist/idl_codegen_unstaking_pool/types/PoolConfigField.js +105 -0
  70. package/dist/idl_codegen_unstaking_pool/types/PoolConfigField.js.map +1 -0
  71. package/dist/idl_codegen_unstaking_pool/types/index.d.ts +5 -0
  72. package/dist/idl_codegen_unstaking_pool/types/index.d.ts.map +1 -0
  73. package/dist/idl_codegen_unstaking_pool/types/index.js +39 -0
  74. package/dist/idl_codegen_unstaking_pool/types/index.js.map +1 -0
  75. package/package.json +4 -1
  76. package/src/classes/index.ts +3 -0
  77. package/src/classes/stakePool.ts +21 -0
  78. package/src/classes/standardStakePool.ts +358 -0
  79. package/src/classes/types.ts +17 -1
  80. package/src/classes/unstakingPool.ts +577 -0
  81. package/src/idl_codegen_unstaking_pool/accounts/PoolState.ts +163 -0
  82. package/src/idl_codegen_unstaking_pool/accounts/index.ts +2 -0
  83. package/src/idl_codegen_unstaking_pool/errors/anchor.ts +764 -0
  84. package/src/idl_codegen_unstaking_pool/errors/custom.ts +288 -0
  85. package/src/idl_codegen_unstaking_pool/errors/index.ts +49 -0
  86. package/src/idl_codegen_unstaking_pool/instructions/burn.ts +60 -0
  87. package/src/idl_codegen_unstaking_pool/instructions/collect.ts +43 -0
  88. package/src/idl_codegen_unstaking_pool/instructions/index.ts +10 -0
  89. package/src/idl_codegen_unstaking_pool/instructions/initializePool.ts +41 -0
  90. package/src/idl_codegen_unstaking_pool/instructions/mint.ts +64 -0
  91. package/src/idl_codegen_unstaking_pool/instructions/updatePoolConfig.ts +40 -0
  92. package/src/idl_codegen_unstaking_pool/programId.ts +7 -0
  93. package/src/idl_codegen_unstaking_pool/types/PoolConfigField.ts +85 -0
  94. package/src/idl_codegen_unstaking_pool/types/index.ts +6 -0
  95. package/src/idl_unstaking_pool.json +456 -0
@@ -0,0 +1,117 @@
1
+ import { Connection, Keypair, PublicKey, TransactionInstruction } from '@solana/web3.js';
2
+ import { PoolState } from '../idl_codegen_unstaking_pool/accounts';
3
+ import { InitPoolIxs, MintIxs, SyncVaultLUTIxs, UpdatePoolConfigIxs } from './types';
4
+ import { PoolConfigFieldKind } from '../idl_codegen_unstaking_pool/types';
5
+ import BN from 'bn.js';
6
+ import { StakeAccount } from './standardStakePool';
7
+ export declare const unstakingPoolId: PublicKey;
8
+ export declare const unstakingPoolStagingId: PublicKey;
9
+ export declare const STAKE_PROGRAM_ID: PublicKey;
10
+ export declare const CLOCK_PROGRAM_ID: PublicKey;
11
+ /**
12
+ * KaminoPoolClient is a class that provides a high-level interface to interact with the Kamino Pool program.
13
+ */
14
+ export declare class UnstakingPoolClient {
15
+ private readonly _connection;
16
+ private readonly _unstakingPoolProgramId;
17
+ constructor(connection: Connection, unstakingPoolprogramId?: PublicKey);
18
+ getConnection(): Connection;
19
+ getProgramID(): PublicKey;
20
+ /**
21
+ * This method will create a pool with a given config. The config can be changed later on, but it is recommended to set it up correctly from the start
22
+ * @param poolConfig - the config object used to create a pool
23
+ * @returns pool - keypair, should be used to sign the transaction which creates the pool account
24
+ * @returns pool: the keypair of the pool, used to sign the initialization transaction; initPoolIxs: a struct with ixs to initialize the pool and its lookup table + populateLUTIxs, a list to populate the lookup table which has to be executed in a separate transaction
25
+ */
26
+ createPoolIxs(poolConfig: UnstakingPoolConfig): Promise<{
27
+ pool: Keypair;
28
+ initPoolIxs: InitPoolIxs;
29
+ }>;
30
+ /**
31
+ * Update pool configuration such as admin authority (or fees/minimum depositable in the future)
32
+ * @param poolState - the pool to update and set the LUT for if needed or only the pool pubkey if updating LUT is not needed
33
+ * @param admin - admin of the specified pool
34
+ * @param mode - what field to update for pool
35
+ * @param value - new value that is converted .toString()
36
+ * @returns a struct that contains a list of ix to update the pool config + a list of ixs to insert all new accounts in the LUT
37
+ */
38
+ updatePoolConfigIxs(poolState: UnstakingPool | PublicKey, admin: PublicKey, mode: PoolConfigFieldKind, value: string): Promise<UpdatePoolConfigIxs>;
39
+ /**
40
+ * Collect a stake account SOL if the needed epoch was reached
41
+ * @param poolState - the pool to collect SOL into
42
+ * @param payer - payer for the operation (ix is permissionless)
43
+ * @param stakeAccount - stake account that was deactivated this epoch and has base pool authority as owner
44
+ * @returns collect instruction
45
+ */
46
+ collectIx(poolState: UnstakingPool, payer: PublicKey, stakeAccount: PublicKey): Promise<TransactionInstruction>;
47
+ /**
48
+ * Burn a number of shares (USOL) in exchange for SOL
49
+ * @param poolState - the pool to burn USOL from
50
+ * @param user - user that burns (ix is not gated by action authority)
51
+ * @param sharesToBurn - number of shares that are equivalent 1:1 with SOL
52
+ * @returns burn instruction
53
+ */
54
+ burnIx(poolState: UnstakingPool, user: PublicKey, sharesToBurn: BN): Promise<TransactionInstruction>;
55
+ /**
56
+ * Mints a number of unstaking sol (USOL) in exchange for staked SOL
57
+ * NOTE: this ix is permissioned by action authority
58
+ * @param poolState - the pool to mint USOL from
59
+ * @param user - user that mints
60
+ * @param stakedSolMint - staked sol mint
61
+ * @param stakedSolToDeposit - staked sol to convert to USOL (at the pool ratio)
62
+ * @returns burn instruction
63
+ */
64
+ mintIx(poolState: UnstakingPool, user: PublicKey, stakedSolMint: PublicKey, stakedSolToDeposit: BN): Promise<MintIxs>;
65
+ /**
66
+ * Sync a pool for lookup table; create and set the LUT for the pool if needed and fill it with all the needed accounts
67
+ * @param pool the pool to sync and set the LUT for if needed
68
+ * @param poolReserves optional; the state of the reserves in the pool allocation
69
+ * @returns a struct that contains a list of ix to create the LUT and assign it to the pool if needed + a list of ixs to insert all the accounts in the LUT
70
+ */
71
+ syncPoolLookupTable(pool: UnstakingPool): Promise<SyncVaultLUTIxs>;
72
+ getInitLookupTableIx(payer: PublicKey, slot: number): [TransactionInstruction, PublicKey];
73
+ insertIntoLookupTableIxs(payer: PublicKey, lookupTable: PublicKey, keys: PublicKey[], accountsInLUT?: PublicKey[]): Promise<TransactionInstruction[]>;
74
+ /**
75
+ *
76
+ * @param connection
77
+ * @param lookupTable
78
+ * @returns
79
+ */
80
+ getAccountsInLUT(lookupTable: PublicKey): Promise<PublicKey[]>;
81
+ deactivateLookupTableIx(payer: PublicKey, lookupTable: PublicKey): TransactionInstruction;
82
+ closeLookupTableIx(payer: PublicKey, lookupTable: PublicKey): TransactionInstruction;
83
+ /**
84
+ * Get all pools
85
+ * @returns an array of all pools
86
+ */
87
+ getAllPools(): Promise<UnstakingPool[]>;
88
+ }
89
+ export declare class UnstakingPool {
90
+ readonly address: PublicKey;
91
+ state: PoolState | undefined | null;
92
+ programId: PublicKey;
93
+ constructor(poolAddress: PublicKey, state?: PoolState, programId?: PublicKey);
94
+ getState(connection: Connection): Promise<PoolState>;
95
+ reloadState(connection: Connection): Promise<PoolState>;
96
+ getStakeAccountsForPool(connection: Connection): Promise<Array<StakeAccountInfo>>;
97
+ }
98
+ export declare class StakeAccountInfo {
99
+ readonly pk: PublicKey;
100
+ readonly stakeAccount: StakeAccount;
101
+ readonly lamports: number;
102
+ constructor(pk: PublicKey, stakeAccount: StakeAccount, lamports: number);
103
+ }
104
+ /**
105
+ * Used to initialize a Kamino Pool
106
+ */
107
+ export declare class UnstakingPoolConfig {
108
+ /** The admin of the pool */
109
+ readonly admin: PublicKey;
110
+ /** Pubkey that can mint new tokens */
111
+ readonly actionAuthority: PublicKey | null;
112
+ constructor(args: {
113
+ admin: PublicKey;
114
+ actionAuthority: PublicKey | null;
115
+ });
116
+ }
117
+ //# sourceMappingURL=unstakingPool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unstakingPool.d.ts","sourceRoot":"","sources":["../../src/classes/unstakingPool.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,UAAU,EAEV,OAAO,EACP,SAAS,EAKT,sBAAsB,EACvB,MAAM,iBAAiB,CAAC;AAkBzB,OAAO,EAAE,SAAS,EAAE,MAAM,wCAAwC,CAAC;AAInE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AACrF,OAAO,EAAmB,mBAAmB,EAAE,MAAM,qCAAqC,CAAC;AAC3F,OAAO,EAAE,MAAM,OAAO,CAAC;AAGvB,OAAO,EAAwC,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACzF,eAAO,MAAM,eAAe,WAA+D,CAAC;AAC5F,eAAO,MAAM,sBAAsB,WAA+D,CAAC;AACnG,eAAO,MAAM,gBAAgB,WAA+D,CAAC;AAC7F,eAAO,MAAM,gBAAgB,WAA+D,CAAC;AAM7F;;GAEG;AACH,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAa;IACzC,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAAY;gBAExC,UAAU,EAAE,UAAU,EAAE,sBAAsB,CAAC,EAAE,SAAS;IAKtE,aAAa;IAIb,YAAY;IAIZ;;;;;OAKG;IACG,aAAa,CAAC,UAAU,EAAE,mBAAmB,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,OAAO,CAAC;QAAC,WAAW,EAAE,WAAW,CAAA;KAAE,CAAC;IAiF1G;;;;;;;OAOG;IACG,mBAAmB,CACvB,SAAS,E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CAoC9C;AAED,qBAAa,aAAa;IACxB,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;IAC5B,KAAK,EAAE,SAAS,GAAG,SAAS,GAAG,IAAI,CAAC;IACpC,SAAS,EAAE,SAAS,CAAC;gBAET,WAAW,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,SAAS,EAAE,SAAS,GAAE,SAA2B;IAMvF,QAAQ,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC;IAapD,WAAW,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,SAAS,CAAC;IAQvD,uBAAuB,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;CAqBxF;AAED,qBAAa,gBAAgB;IAC3B,QAAQ,CAAC,EAAE,EAAE,SAAS,CAAC;IACvB,QAAQ,CAAC,YAAY,EAAE,YAAY,CAAC;IACpC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;gBAEd,EAAE,EAAE,SAAS,EAAE,YAAY,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM;CAKxE;AAED;;GAEG;AACH,qBAAa,mBAAmB;IAC9B,4BAA4B;IAC5B,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,sCAAsC;IACtC,QAAQ,CAAC,eAAe,EAAE,SAAS,GAAG,IAAI,CAAC;gBAE/B,IAAI,EAAE;QAAE,KAAK,EAAE,SAAS,CAAC;QAAC,eAAe,EAAE,SAAS,GAAG,IAAI,CAAA;KAAE;CAI1E"}
@@ -0,0 +1,448 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.UnstakingPoolConfig = exports.StakeAccountInfo = exports.UnstakingPool = exports.UnstakingPoolClient = exports.CLOCK_PROGRAM_ID = exports.STAKE_PROGRAM_ID = exports.unstakingPoolStagingId = exports.unstakingPoolId = void 0;
7
+ const web3_js_1 = require("@solana/web3.js");
8
+ const instructions_1 = require("../idl_codegen_unstaking_pool/instructions");
9
+ const spl_token_1 = require("@solana/spl-token");
10
+ const lib_1 = require("../lib");
11
+ const accounts_1 = require("../idl_codegen_unstaking_pool/accounts");
12
+ const utils_1 = require("../utils");
13
+ const bs58_1 = __importDefault(require("bs58"));
14
+ const rpc_1 = require("../utils/rpc");
15
+ const types_1 = require("../idl_codegen_unstaking_pool/types");
16
+ const spl_stake_pool_1 = require("@solana/spl-stake-pool");
17
+ const stakePool_1 = require("./stakePool");
18
+ const standardStakePool_1 = require("./standardStakePool");
19
+ exports.unstakingPoolId = new web3_js_1.PublicKey('USo1uB8RsRuM8y8e8vbL3mwR22EzSTLyZqaJPoZvn3a');
20
+ exports.unstakingPoolStagingId = new web3_js_1.PublicKey('STuRAYCqtoJ15dASjaypTtgqDB7h7fLgiNBuWt17ZG5');
21
+ exports.STAKE_PROGRAM_ID = new web3_js_1.PublicKey('Stake11111111111111111111111111111111111111');
22
+ exports.CLOCK_PROGRAM_ID = new web3_js_1.PublicKey('SysvarC1ock11111111111111111111111111111111');
23
+ const STAKE_HISTORY_PROGRAM_ID = new web3_js_1.PublicKey('SysvarStakeHistory1111111111111111111111111');
24
+ const BASE_POOL_AUTHORITY_SEED = 'authority';
25
+ const UNSTAKING_SOL_MINT_SEED = 'unstaking_sol_mint';
26
+ /**
27
+ * KaminoPoolClient is a class that provides a high-level interface to interact with the Kamino Pool program.
28
+ */
29
+ class UnstakingPoolClient {
30
+ _connection;
31
+ _unstakingPoolProgramId;
32
+ constructor(connection, unstakingPoolprogramId) {
33
+ this._connection = connection;
34
+ this._unstakingPoolProgramId = unstakingPoolprogramId ? unstakingPoolprogramId : exports.unstakingPoolId;
35
+ }
36
+ getConnection() {
37
+ return this._connection;
38
+ }
39
+ getProgramID() {
40
+ return this._unstakingPoolProgramId;
41
+ }
42
+ /**
43
+ * This method will create a pool with a given config. The config can be changed later on, but it is recommended to set it up correctly from the start
44
+ * @param poolConfig - the config object used to create a pool
45
+ * @returns pool - keypair, should be used to sign the transaction which creates the pool account
46
+ * @returns pool: the keypair of the pool, used to sign the initialization transaction; initPoolIxs: a struct with ixs to initialize the pool and its lookup table + populateLUTIxs, a list to populate the lookup table which has to be executed in a separate transaction
47
+ */
48
+ async createPoolIxs(poolConfig) {
49
+ const poolState = web3_js_1.Keypair.generate();
50
+ const size = accounts_1.PoolState.layout.span + 8;
51
+ const createPoolIx = web3_js_1.SystemProgram.createAccount({
52
+ fromPubkey: poolConfig.admin,
53
+ newAccountPubkey: poolState.publicKey,
54
+ lamports: await this._connection.getMinimumBalanceForRentExemption(size),
55
+ space: size,
56
+ programId: this._unstakingPoolProgramId,
57
+ });
58
+ const unstakingSolMint = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from(UNSTAKING_SOL_MINT_SEED), poolState.publicKey.toBytes()], this._unstakingPoolProgramId)[0];
59
+ const basePoolAuthority = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from(BASE_POOL_AUTHORITY_SEED), poolState.publicKey.toBytes()], this._unstakingPoolProgramId)[0];
60
+ const wsolVault = (0, lib_1.getAssociatedTokenAddress)(lib_1.WRAPPED_SOL_MINT, basePoolAuthority);
61
+ const initPoolAccounts = {
62
+ admin: poolConfig.admin,
63
+ poolState: poolState.publicKey,
64
+ basePoolAuthority,
65
+ systemProgram: web3_js_1.SystemProgram.programId,
66
+ rent: web3_js_1.SYSVAR_RENT_PUBKEY,
67
+ tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
68
+ associatedTokenProgram: spl_token_1.ASSOCIATED_TOKEN_PROGRAM_ID,
69
+ unstakingSolMint,
70
+ wsolMint: lib_1.WRAPPED_SOL_MINT,
71
+ wsolVault,
72
+ };
73
+ const initPoolIx = (0, instructions_1.initializePool)(initPoolAccounts, this._unstakingPoolProgramId);
74
+ // create and set up the pool lookup table
75
+ const slot = await this._connection.getSlot();
76
+ const [createLUTIx, lut] = this.getInitLookupTableIx(poolConfig.admin, slot);
77
+ const allAccountsToBeInserted = [
78
+ poolState.publicKey,
79
+ basePoolAuthority,
80
+ wsolVault,
81
+ unstakingSolMint,
82
+ poolConfig.admin,
83
+ spl_token_1.NATIVE_MINT,
84
+ this._unstakingPoolProgramId,
85
+ web3_js_1.SystemProgram.programId,
86
+ web3_js_1.SYSVAR_RENT_PUBKEY,
87
+ spl_token_1.TOKEN_PROGRAM_ID,
88
+ spl_token_1.TOKEN_2022_PROGRAM_ID,
89
+ web3_js_1.SYSVAR_INSTRUCTIONS_PUBKEY,
90
+ web3_js_1.SYSVAR_CLOCK_PUBKEY,
91
+ exports.STAKE_PROGRAM_ID,
92
+ spl_stake_pool_1.STAKE_POOL_PROGRAM_ID,
93
+ ];
94
+ const insertIntoLUTIxs = await this.insertIntoLookupTableIxs(poolConfig.admin, lut, allAccountsToBeInserted, []);
95
+ const { updatePoolConfigIx: updateLUTIx } = await this.updatePoolConfigIxs(poolState.publicKey, poolConfig.admin, new types_1.PoolConfigField.LookupTable(), lut.toString());
96
+ const ixns = [createPoolIx, initPoolIx, createLUTIx, ...insertIntoLUTIxs, updateLUTIx];
97
+ if (poolConfig.actionAuthority) {
98
+ const { updatePoolConfigIx: updateActionAuthorityIx } = await this.updatePoolConfigIxs(poolState.publicKey, poolConfig.admin, new types_1.PoolConfigField.ActionAuthority(), poolConfig.actionAuthority.toString());
99
+ ixns.push(updateActionAuthorityIx);
100
+ }
101
+ return { pool: poolState, initPoolIxs: { initPoolIxs: ixns, populateLUTIxs: [] } };
102
+ }
103
+ /**
104
+ * Update pool configuration such as admin authority (or fees/minimum depositable in the future)
105
+ * @param poolState - the pool to update and set the LUT for if needed or only the pool pubkey if updating LUT is not needed
106
+ * @param admin - admin of the specified pool
107
+ * @param mode - what field to update for pool
108
+ * @param value - new value that is converted .toString()
109
+ * @returns a struct that contains a list of ix to update the pool config + a list of ixs to insert all new accounts in the LUT
110
+ */
111
+ async updatePoolConfigIxs(poolState, admin, mode, value) {
112
+ const updatePoolConfigAccounts = {
113
+ admin,
114
+ poolState: poolState instanceof UnstakingPool ? poolState.address : poolState,
115
+ };
116
+ const args = {
117
+ entry: mode,
118
+ data: Buffer.from([0]),
119
+ };
120
+ if (isNaN(+value)) {
121
+ const data = new web3_js_1.PublicKey(value);
122
+ args.data = data.toBuffer();
123
+ }
124
+ else {
125
+ const buffer = Buffer.alloc(8);
126
+ buffer.writeBigUInt64LE(BigInt(value.toString()));
127
+ args.data = buffer;
128
+ }
129
+ const updatePoolConfigIx = (0, instructions_1.updatePoolConfig)(args, updatePoolConfigAccounts, this._unstakingPoolProgramId);
130
+ const updateLUTIxs = [];
131
+ if (poolState instanceof UnstakingPool && poolState.state) {
132
+ if (mode.kind === new types_1.PoolConfigField.ActionAuthority().kind) {
133
+ const newPubkey = new web3_js_1.PublicKey(value);
134
+ const insertIntoLutIxs = await this.insertIntoLookupTableIxs(poolState.state.actionAuthority, poolState.state.poolLookupTable, [newPubkey]);
135
+ updateLUTIxs.push(...insertIntoLutIxs);
136
+ }
137
+ }
138
+ return { updatePoolConfigIx, updateLUTIxs };
139
+ }
140
+ /**
141
+ * Collect a stake account SOL if the needed epoch was reached
142
+ * @param poolState - the pool to collect SOL into
143
+ * @param payer - payer for the operation (ix is permissionless)
144
+ * @param stakeAccount - stake account that was deactivated this epoch and has base pool authority as owner
145
+ * @returns collect instruction
146
+ */
147
+ async collectIx(poolState, payer, stakeAccount) {
148
+ const pool = await poolState.getState(this.getConnection());
149
+ const accounts = {
150
+ poolState: poolState.address,
151
+ payer,
152
+ stakeAccount,
153
+ basePoolAuthority: pool.basePoolAuthority,
154
+ wsolVault: pool.wsolVault,
155
+ wsolMint: spl_token_1.NATIVE_MINT,
156
+ tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
157
+ systemProgram: web3_js_1.SystemProgram.programId,
158
+ clockProgramId: web3_js_1.SYSVAR_CLOCK_PUBKEY,
159
+ stakeProgramId: exports.STAKE_PROGRAM_ID,
160
+ stakeHistoryProgramId: STAKE_HISTORY_PROGRAM_ID,
161
+ };
162
+ return (0, instructions_1.collect)(accounts, this._unstakingPoolProgramId);
163
+ }
164
+ /**
165
+ * Burn a number of shares (USOL) in exchange for SOL
166
+ * @param poolState - the pool to burn USOL from
167
+ * @param user - user that burns (ix is not gated by action authority)
168
+ * @param sharesToBurn - number of shares that are equivalent 1:1 with SOL
169
+ * @returns burn instruction
170
+ */
171
+ async burnIx(poolState, user, sharesToBurn) {
172
+ const pool = await poolState.getState(this.getConnection());
173
+ const accounts = {
174
+ poolState: poolState.address,
175
+ basePoolAuthority: pool.basePoolAuthority,
176
+ wsolVault: pool.wsolVault,
177
+ wsolMint: spl_token_1.NATIVE_MINT,
178
+ systemProgram: web3_js_1.SystemProgram.programId,
179
+ user,
180
+ userWsolToken: (0, lib_1.getAssociatedTokenAddress)(spl_token_1.NATIVE_MINT, user),
181
+ userUnstakingSolToken: (0, lib_1.getAssociatedTokenAddress)(pool.unstakingSolMint, user),
182
+ unstakingSolMint: pool.unstakingSolMint,
183
+ unstakingSolTokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
184
+ wsolTokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
185
+ };
186
+ const args = {
187
+ sharesToBurn,
188
+ };
189
+ return (0, instructions_1.burn)(args, accounts, this._unstakingPoolProgramId);
190
+ }
191
+ /**
192
+ * Mints a number of unstaking sol (USOL) in exchange for staked SOL
193
+ * NOTE: this ix is permissioned by action authority
194
+ * @param poolState - the pool to mint USOL from
195
+ * @param user - user that mints
196
+ * @param stakedSolMint - staked sol mint
197
+ * @param stakedSolToDeposit - staked sol to convert to USOL (at the pool ratio)
198
+ * @returns burn instruction
199
+ */
200
+ async mintIx(poolState, user, stakedSolMint, stakedSolToDeposit) {
201
+ const pool = await poolState.getState(this.getConnection());
202
+ const [stakedSolPool, stakedSolPoolPk, stakePoolType] = await (0, stakePool_1.mapStakedSolMintToPool)(this.getConnection(), stakedSolMint);
203
+ const accounts = {
204
+ poolState: poolState.address,
205
+ basePoolAuthority: pool.basePoolAuthority,
206
+ systemProgram: web3_js_1.SystemProgram.programId,
207
+ unstakingSolMint: pool.unstakingSolMint,
208
+ unstakingSolTokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
209
+ user,
210
+ actionAuthority: pool.actionAuthority,
211
+ userStakedSolToken: (0, lib_1.getAssociatedTokenAddress)(stakedSolMint, user),
212
+ userUnstakingSolToken: (0, lib_1.getAssociatedTokenAddress)(pool.unstakingSolMint, user),
213
+ stakedSolMint,
214
+ stakedSolTokenProgram: stakedSolPool.tokenProgramId,
215
+ };
216
+ const args = {
217
+ stakedSolToDeposit,
218
+ };
219
+ const txn = (0, instructions_1.mint)(args, accounts, this._unstakingPoolProgramId);
220
+ let remainingAccounts = [];
221
+ let remainingSigners = [];
222
+ switch (stakePoolType) {
223
+ case stakePool_1.StakePoolType.Standard:
224
+ [remainingAccounts, remainingSigners] = await (0, standardStakePool_1.getStandardPoolMintRemainingAccounts)(this.getConnection(), stakedSolPool, stakedSolPoolPk, stakedSolToDeposit);
225
+ }
226
+ txn.keys = txn.keys.concat(remainingAccounts);
227
+ return { mintIx: txn, additionalSigners: remainingSigners };
228
+ }
229
+ /**
230
+ * Sync a pool for lookup table; create and set the LUT for the pool if needed and fill it with all the needed accounts
231
+ * @param pool the pool to sync and set the LUT for if needed
232
+ * @param poolReserves optional; the state of the reserves in the pool allocation
233
+ * @returns a struct that contains a list of ix to create the LUT and assign it to the pool if needed + a list of ixs to insert all the accounts in the LUT
234
+ */
235
+ async syncPoolLookupTable(pool) {
236
+ const poolState = await pool.getState(this._connection);
237
+ const allAccountsToBeInserted = [
238
+ pool.address,
239
+ poolState.basePoolAuthority,
240
+ poolState.wsolVault,
241
+ poolState.unstakingSolMint,
242
+ poolState.actionAuthority,
243
+ poolState.admin,
244
+ this._unstakingPoolProgramId,
245
+ web3_js_1.SystemProgram.programId,
246
+ web3_js_1.SYSVAR_RENT_PUBKEY,
247
+ spl_token_1.TOKEN_PROGRAM_ID,
248
+ spl_token_1.TOKEN_2022_PROGRAM_ID,
249
+ web3_js_1.SYSVAR_INSTRUCTIONS_PUBKEY,
250
+ web3_js_1.SYSVAR_CLOCK_PUBKEY,
251
+ exports.STAKE_PROGRAM_ID,
252
+ spl_stake_pool_1.STAKE_POOL_PROGRAM_ID,
253
+ ];
254
+ const setupLUTIfNeededIxs = [];
255
+ let lut = poolState.poolLookupTable;
256
+ if (lut.equals(web3_js_1.PublicKey.default)) {
257
+ const recentSlot = await this._connection.getSlot();
258
+ const [ixn, address] = this.getInitLookupTableIx(poolState.admin, recentSlot);
259
+ setupLUTIfNeededIxs.push(ixn);
260
+ lut = address;
261
+ // set the new LUT for the pool
262
+ const updatePoolConfigIxs = await this.updatePoolConfigIxs(pool, pool.address, new types_1.PoolConfigField.LookupTable(), lut.toString());
263
+ setupLUTIfNeededIxs.push(updatePoolConfigIxs.updatePoolConfigIx);
264
+ }
265
+ const ixns = [];
266
+ let overridenExistentAccounts = undefined;
267
+ if (poolState.poolLookupTable.equals(web3_js_1.PublicKey.default)) {
268
+ overridenExistentAccounts = [];
269
+ }
270
+ ixns.push(...(await this.insertIntoLookupTableIxs(poolState.admin, lut, allAccountsToBeInserted, overridenExistentAccounts)));
271
+ return {
272
+ setupLUTIfNeededIxs,
273
+ syncLUTIxs: ixns,
274
+ };
275
+ }
276
+ getInitLookupTableIx(payer, slot) {
277
+ const [ixn, address] = web3_js_1.AddressLookupTableProgram.createLookupTable({
278
+ authority: payer,
279
+ payer,
280
+ recentSlot: slot,
281
+ });
282
+ return [ixn, address];
283
+ }
284
+ async insertIntoLookupTableIxs(payer, lookupTable, keys, accountsInLUT) {
285
+ let lutContents = accountsInLUT;
286
+ if (!accountsInLUT) {
287
+ lutContents = await this.getAccountsInLUT(lookupTable);
288
+ }
289
+ else {
290
+ lutContents = accountsInLUT;
291
+ }
292
+ const missingAccounts = keys.filter((key) => !lutContents.includes(key) && !key.equals(web3_js_1.PublicKey.default));
293
+ // deduplicate missing accounts and remove default accounts and convert it back to an array
294
+ const missingAccountsList = new utils_1.PublicKeySet(missingAccounts).toArray();
295
+ const chunkSize = 20;
296
+ const ixns = [];
297
+ for (let i = 0; i < missingAccountsList.length; i += chunkSize) {
298
+ const chunk = missingAccountsList.slice(i, i + chunkSize);
299
+ const ixn = web3_js_1.AddressLookupTableProgram.extendLookupTable({
300
+ lookupTable,
301
+ authority: payer,
302
+ payer,
303
+ addresses: chunk,
304
+ });
305
+ ixns.push(ixn);
306
+ }
307
+ return ixns;
308
+ }
309
+ /**
310
+ *
311
+ * @param connection
312
+ * @param lookupTable
313
+ * @returns
314
+ */
315
+ async getAccountsInLUT(lookupTable) {
316
+ const lutState = await this._connection.getAddressLookupTable(lookupTable);
317
+ if (!lutState || !lutState.value) {
318
+ throw new Error(`Lookup table ${lookupTable.toString()} not found`);
319
+ }
320
+ return lutState.value.state.addresses;
321
+ }
322
+ deactivateLookupTableIx(payer, lookupTable) {
323
+ const ixn = web3_js_1.AddressLookupTableProgram.deactivateLookupTable({
324
+ authority: payer,
325
+ lookupTable: lookupTable,
326
+ });
327
+ return ixn;
328
+ }
329
+ /// this require the LUT to be deactivated at least 500 blocks before
330
+ closeLookupTableIx(payer, lookupTable) {
331
+ const ixn = web3_js_1.AddressLookupTableProgram.closeLookupTable({
332
+ authority: payer,
333
+ recipient: payer,
334
+ lookupTable: lookupTable,
335
+ });
336
+ return ixn;
337
+ }
338
+ /**
339
+ * Get all pools
340
+ * @returns an array of all pools
341
+ */
342
+ async getAllPools() {
343
+ const filters = [
344
+ {
345
+ dataSize: accounts_1.PoolState.layout.span + 8,
346
+ },
347
+ {
348
+ memcmp: {
349
+ offset: 0,
350
+ bytes: bs58_1.default.encode(accounts_1.PoolState.discriminator),
351
+ },
352
+ },
353
+ ];
354
+ const unstakingPools = await (0, rpc_1.getProgramAccounts)(this._connection, this._unstakingPoolProgramId, accounts_1.PoolState.layout.span + 8, {
355
+ commitment: this._connection.commitment ?? 'processed',
356
+ filters,
357
+ });
358
+ return unstakingPools.map((unstakingPool) => {
359
+ if (unstakingPool.account === null) {
360
+ throw new Error(`unstakingPool with pubkey ${unstakingPool.pubkey.toString()} does not exist`);
361
+ }
362
+ const unstakingPoolAccount = accounts_1.PoolState.decode(unstakingPool.account.data);
363
+ if (!unstakingPoolAccount) {
364
+ throw Error(`unstakingPool with pubkey ${unstakingPool.pubkey.toString()} could not be decoded`);
365
+ }
366
+ return new UnstakingPool(unstakingPool.pubkey, unstakingPoolAccount, this._unstakingPoolProgramId);
367
+ });
368
+ }
369
+ } // UnstakingPoolClient
370
+ exports.UnstakingPoolClient = UnstakingPoolClient;
371
+ class UnstakingPool {
372
+ address;
373
+ state;
374
+ programId;
375
+ constructor(poolAddress, state, programId = exports.unstakingPoolId) {
376
+ this.address = poolAddress;
377
+ this.state = state;
378
+ this.programId = programId;
379
+ }
380
+ async getState(connection) {
381
+ if (!this.state) {
382
+ const res = await accounts_1.PoolState.fetch(connection, this.address, this.programId);
383
+ if (!res) {
384
+ throw new Error(`Invalid pool ${this.address.toString()}`);
385
+ }
386
+ this.state = res;
387
+ return res;
388
+ }
389
+ else {
390
+ return this.state;
391
+ }
392
+ }
393
+ async reloadState(connection) {
394
+ this.state = await accounts_1.PoolState.fetch(connection, this.address, this.programId);
395
+ if (!this.state) {
396
+ throw new Error(`Could not fetch pool ${this.address.toString()}`);
397
+ }
398
+ return this.state;
399
+ }
400
+ async getStakeAccountsForPool(connection) {
401
+ if (!this.state) {
402
+ throw new Error('Need to have pool state to fetch stake accounts');
403
+ }
404
+ // Filter only accounts that have withdraw authority the base pool authority
405
+ // and are delegating
406
+ const results = await connection.getParsedProgramAccounts(exports.STAKE_PROGRAM_ID, {
407
+ filters: [
408
+ { memcmp: { offset: 0, bytes: bs58_1.default.encode([2]) } },
409
+ { memcmp: { offset: 44, bytes: this.state.basePoolAuthority.toBase58() } },
410
+ ],
411
+ });
412
+ return results
413
+ .filter((result) => 'parsed' in result.account.data)
414
+ .map((result) => {
415
+ if (!('parsed' in result.account.data)) {
416
+ throw new Error('Already filtered above for these, this error should not happen!');
417
+ }
418
+ return { stakeAccount: result.account.data.parsed, pk: result.pubkey, lamports: result.account.lamports };
419
+ });
420
+ }
421
+ }
422
+ exports.UnstakingPool = UnstakingPool;
423
+ class StakeAccountInfo {
424
+ pk;
425
+ stakeAccount;
426
+ lamports;
427
+ constructor(pk, stakeAccount, lamports) {
428
+ this.pk = pk;
429
+ this.stakeAccount = stakeAccount;
430
+ this.lamports = lamports;
431
+ }
432
+ }
433
+ exports.StakeAccountInfo = StakeAccountInfo;
434
+ /**
435
+ * Used to initialize a Kamino Pool
436
+ */
437
+ class UnstakingPoolConfig {
438
+ /** The admin of the pool */
439
+ admin;
440
+ /** Pubkey that can mint new tokens */
441
+ actionAuthority;
442
+ constructor(args) {
443
+ this.admin = args.admin;
444
+ this.actionAuthority = args.actionAuthority;
445
+ }
446
+ }
447
+ exports.UnstakingPoolConfig = UnstakingPoolConfig;
448
+ //# sourceMappingURL=unstakingPool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unstakingPool.js","sourceRoot":"","sources":["../../src/classes/unstakingPool.ts"],"names":[],"mappings":";;;;;;AAAA,6CAYyB;AACzB,6EAcoD;AACpD,iDAAsH;AACtH,gCAAqE;AACrE,qEAAmE;AACnE,oCAAwC;AACxC,gDAAwB;AACxB,sCAAkD;AAElD,+DAA2F;AAE3F,2DAA+D;AAC/D,2CAAoE;AACpE,2DAAyF;AAC5E,QAAA,eAAe,GAAG,IAAI,mBAAS,CAAC,6CAA6C,CAAC,CAAC;AAC/E,QAAA,sBAAsB,GAAG,IAAI,mBAAS,CAAC,6CAA6C,CAAC,CAAC;AACtF,QAAA,gBAAgB,GAAG,IAAI,mBAAS,CAAC,6CAA6C,CAAC,CAAC;AAChF,QAAA,gBAAgB,GAAG,IAAI,mBAAS,CAAC,6CAA6C,CAAC,CAAC;AAC7F,MAAM,wBAAwB,GAAG,IAAI,mB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CAAC;QACb,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;QACjC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAC3B,CAAC;CACF;AAVD,4CAUC;AAED;;GAEG;AACH,MAAa,mBAAmB;IAC9B,4BAA4B;IACnB,KAAK,CAAY;IAC1B,sCAAsC;IAC7B,eAAe,CAAmB;IAE3C,YAAY,IAA6D;QACvE,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACxB,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,eAAe,CAAC;IAC9C,CAAC;CACF;AAVD,kDAUC"}
@@ -0,0 +1,50 @@
1
+ import { PublicKey, Connection } from '@solana/web3.js';
2
+ import BN from 'bn.js';
3
+ export interface PoolStateFields {
4
+ admin: PublicKey;
5
+ basePoolAuthority: PublicKey;
6
+ basePoolAuthorityBump: BN;
7
+ unstakingSolMint: PublicKey;
8
+ wsolVault: PublicKey;
9
+ actionAuthority: PublicKey;
10
+ poolLookupTable: PublicKey;
11
+ sharesIssued: BN;
12
+ wsolInVault: BN;
13
+ padding0: BN;
14
+ padding: Array<BN>;
15
+ }
16
+ export interface PoolStateJSON {
17
+ admin: string;
18
+ basePoolAuthority: string;
19
+ basePoolAuthorityBump: string;
20
+ unstakingSolMint: string;
21
+ wsolVault: string;
22
+ actionAuthority: string;
23
+ poolLookupTable: string;
24
+ sharesIssued: string;
25
+ wsolInVault: string;
26
+ padding0: string;
27
+ padding: Array<string>;
28
+ }
29
+ export declare class PoolState {
30
+ readonly admin: PublicKey;
31
+ readonly basePoolAuthority: PublicKey;
32
+ readonly basePoolAuthorityBump: BN;
33
+ readonly unstakingSolMint: PublicKey;
34
+ readonly wsolVault: PublicKey;
35
+ readonly actionAuthority: PublicKey;
36
+ readonly poolLookupTable: PublicKey;
37
+ readonly sharesIssued: BN;
38
+ readonly wsolInVault: BN;
39
+ readonly padding0: BN;
40
+ readonly padding: Array<BN>;
41
+ static readonly discriminator: Buffer<ArrayBuffer>;
42
+ static readonly layout: any;
43
+ constructor(fields: PoolStateFields);
44
+ static fetch(c: Connection, address: PublicKey, programId?: PublicKey): Promise<PoolState | null>;
45
+ static fetchMultiple(c: Connection, addresses: PublicKey[], programId?: PublicKey): Promise<Array<PoolState | null>>;
46
+ static decode(data: Buffer): PoolState;
47
+ toJSON(): PoolStateJSON;
48
+ static fromJSON(obj: PoolStateJSON): PoolState;
49
+ }
50
+ //# sourceMappingURL=PoolState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PoolState.d.ts","sourceRoot":"","sources":["../../../src/idl_codegen_unstaking_pool/accounts/PoolState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,MAAM,OAAO,CAAC;AAKvB,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,SAAS,CAAC;IACjB,iBAAiB,EAAE,SAAS,CAAC;IAC7B,qBAAqB,EAAE,EAAE,CAAC;IAC1B,gBAAgB,EAAE,SAAS,CAAC;IAC5B,SAAS,EAAE,SAAS,CAAC;IACrB,eAAe,EAAE,SAAS,CAAC;IAC3B,eAAe,EAAE,SAAS,CAAC;IAC3B,YAAY,EAAE,EAAE,CAAC;IACjB,WAAW,EAAE,EAAE,CAAC;IAChB,QAAQ,EAAE,EAAE,CAAC;IACb,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,CAAC;CACpB;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,MAAM,CAAC;IAC1B,qBAAqB,EAAE,MAAM,CAAC;IAC9B,gBAAgB,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CA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