@kamino-finance/klend-sdk 5.0.3 → 5.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (230) hide show
  1. package/dist/classes/manager.d.ts +38 -4
  2. package/dist/classes/manager.d.ts.map +1 -1
  3. package/dist/classes/manager.js +98 -4
  4. package/dist/classes/manager.js.map +1 -1
  5. package/dist/classes/market.d.ts.map +1 -1
  6. package/dist/classes/market.js +2 -25
  7. package/dist/classes/market.js.map +1 -1
  8. package/dist/classes/vault.d.ts +12 -8
  9. package/dist/classes/vault.d.ts.map +1 -1
  10. package/dist/classes/vault.js +94 -66
  11. package/dist/classes/vault.js.map +1 -1
  12. package/dist/client_kamino_manager.d.ts.map +1 -1
  13. package/dist/client_kamino_manager.js +14 -0
  14. package/dist/client_kamino_manager.js.map +1 -1
  15. package/dist/idl_codegen_kamino_vault/accounts/Reserve.d.ts +3 -3
  16. package/dist/idl_codegen_kamino_vault/accounts/Reserve.d.ts.map +1 -1
  17. package/dist/idl_codegen_kamino_vault/accounts/Reserve.js +22 -18
  18. package/dist/idl_codegen_kamino_vault/accounts/Reserve.js.map +1 -1
  19. package/dist/idl_codegen_kamino_vault/accounts/VaultState.d.ts +45 -15
  20. package/dist/idl_codegen_kamino_vault/accounts/VaultState.d.ts.map +1 -1
  21. package/dist/idl_codegen_kamino_vault/accounts/VaultState.js +101 -39
  22. package/dist/idl_codegen_kamino_vault/accounts/VaultState.js.map +1 -1
  23. package/dist/idl_codegen_kamino_vault/accounts/index.d.ts +4 -4
  24. package/dist/idl_codegen_kamino_vault/accounts/index.d.ts.map +1 -1
  25. package/dist/idl_codegen_kamino_vault/accounts/index.js.map +1 -1
  26. package/dist/idl_codegen_kamino_vault/errors/anchor.d.ts.map +1 -1
  27. package/dist/idl_codegen_kamino_vault/errors/anchor.js +162 -162
  28. package/dist/idl_codegen_kamino_vault/errors/anchor.js.map +1 -1
  29. package/dist/idl_codegen_kamino_vault/errors/custom.d.ts +144 -32
  30. package/dist/idl_codegen_kamino_vault/errors/custom.d.ts.map +1 -1
  31. package/dist/idl_codegen_kamino_vault/errors/custom.js +305 -109
  32. package/dist/idl_codegen_kamino_vault/errors/custom.js.map +1 -1
  33. package/dist/idl_codegen_kamino_vault/errors/index.d.ts +3 -3
  34. package/dist/idl_codegen_kamino_vault/errors/index.d.ts.map +1 -1
  35. package/dist/idl_codegen_kamino_vault/errors/index.js +7 -2
  36. package/dist/idl_codegen_kamino_vault/errors/index.js.map +1 -1
  37. package/dist/idl_codegen_kamino_vault/instructions/deposit.d.ts +4 -2
  38. package/dist/idl_codegen_kamino_vault/instructions/deposit.d.ts.map +1 -1
  39. package/dist/idl_codegen_kamino_vault/instructions/deposit.js +3 -1
  40. package/dist/idl_codegen_kamino_vault/instructions/deposit.js.map +1 -1
  41. package/dist/idl_codegen_kamino_vault/instructions/giveUpPendingFees.d.ts +13 -0
  42. package/dist/idl_codegen_kamino_vault/instructions/giveUpPendingFees.d.ts.map +1 -0
  43. package/dist/idl_codegen_kamino_vault/instructions/giveUpPendingFees.js +47 -0
  44. package/dist/idl_codegen_kamino_vault/instructions/giveUpPendingFees.js.map +1 -0
  45. package/dist/idl_codegen_kamino_vault/instructions/index.d.ts +18 -10
  46. package/dist/idl_codegen_kamino_vault/instructions/index.d.ts.map +1 -1
  47. package/dist/idl_codegen_kamino_vault/instructions/index.js +9 -1
  48. package/dist/idl_codegen_kamino_vault/instructions/index.js.map +1 -1
  49. package/dist/idl_codegen_kamino_vault/instructions/initVault.d.ts +2 -1
  50. package/dist/idl_codegen_kamino_vault/instructions/initVault.d.ts.map +1 -1
  51. package/dist/idl_codegen_kamino_vault/instructions/initVault.js +1 -0
  52. package/dist/idl_codegen_kamino_vault/instructions/initVault.js.map +1 -1
  53. package/dist/idl_codegen_kamino_vault/instructions/invest.d.ts +6 -2
  54. package/dist/idl_codegen_kamino_vault/instructions/invest.d.ts.map +1 -1
  55. package/dist/idl_codegen_kamino_vault/instructions/invest.js +9 -1
  56. package/dist/idl_codegen_kamino_vault/instructions/invest.js.map +1 -1
  57. package/dist/idl_codegen_kamino_vault/instructions/updateAdmin.d.ts +7 -0
  58. package/dist/idl_codegen_kamino_vault/instructions/updateAdmin.d.ts.map +1 -0
  59. package/dist/idl_codegen_kamino_vault/instructions/updateAdmin.js +16 -0
  60. package/dist/idl_codegen_kamino_vault/instructions/updateAdmin.js.map +1 -0
  61. package/dist/idl_codegen_kamino_vault/instructions/updateReserveAllocation.d.ts +2 -2
  62. package/dist/idl_codegen_kamino_vault/instructions/updateReserveAllocation.d.ts.map +1 -1
  63. package/dist/idl_codegen_kamino_vault/instructions/updateReserveAllocation.js +1 -1
  64. package/dist/idl_codegen_kamino_vault/instructions/updateReserveAllocation.js.map +1 -1
  65. package/dist/idl_codegen_kamino_vault/instructions/updateVaultConfig.d.ts +14 -0
  66. package/dist/idl_codegen_kamino_vault/instructions/updateVaultConfig.d.ts.map +1 -0
  67. package/dist/idl_codegen_kamino_vault/instructions/updateVaultConfig.js +52 -0
  68. package/dist/idl_codegen_kamino_vault/instructions/updateVaultConfig.js.map +1 -0
  69. package/dist/idl_codegen_kamino_vault/instructions/withdraw.d.ts +4 -2
  70. package/dist/idl_codegen_kamino_vault/instructions/withdraw.d.ts.map +1 -1
  71. package/dist/idl_codegen_kamino_vault/instructions/withdraw.js +8 -2
  72. package/dist/idl_codegen_kamino_vault/instructions/withdraw.js.map +1 -1
  73. package/dist/idl_codegen_kamino_vault/instructions/withdrawPendingFees.d.ts +23 -0
  74. package/dist/idl_codegen_kamino_vault/instructions/withdrawPendingFees.d.ts.map +1 -0
  75. package/dist/idl_codegen_kamino_vault/instructions/withdrawPendingFees.js +51 -0
  76. package/dist/idl_codegen_kamino_vault/instructions/withdrawPendingFees.js.map +1 -0
  77. package/dist/idl_codegen_kamino_vault/programId.d.ts +1 -1
  78. package/dist/idl_codegen_kamino_vault/programId.d.ts.map +1 -1
  79. package/dist/idl_codegen_kamino_vault/programId.js +1 -1
  80. package/dist/idl_codegen_kamino_vault/programId.js.map +1 -1
  81. package/dist/idl_codegen_kamino_vault/types/BigFractionBytes.d.ts +2 -2
  82. package/dist/idl_codegen_kamino_vault/types/BigFractionBytes.d.ts.map +1 -1
  83. package/dist/idl_codegen_kamino_vault/types/BigFractionBytes.js +4 -1
  84. package/dist/idl_codegen_kamino_vault/types/BigFractionBytes.js.map +1 -1
  85. package/dist/idl_codegen_kamino_vault/types/BorrowRateCurve.d.ts +1 -1
  86. package/dist/idl_codegen_kamino_vault/types/BorrowRateCurve.d.ts.map +1 -1
  87. package/dist/idl_codegen_kamino_vault/types/BorrowRateCurve.js +1 -1
  88. package/dist/idl_codegen_kamino_vault/types/BorrowRateCurve.js.map +1 -1
  89. package/dist/idl_codegen_kamino_vault/types/CurvePoint.d.ts +1 -1
  90. package/dist/idl_codegen_kamino_vault/types/CurvePoint.d.ts.map +1 -1
  91. package/dist/idl_codegen_kamino_vault/types/CurvePoint.js +1 -1
  92. package/dist/idl_codegen_kamino_vault/types/CurvePoint.js.map +1 -1
  93. package/dist/idl_codegen_kamino_vault/types/LastUpdate.d.ts +2 -2
  94. package/dist/idl_codegen_kamino_vault/types/LastUpdate.d.ts.map +1 -1
  95. package/dist/idl_codegen_kamino_vault/types/LastUpdate.js +6 -1
  96. package/dist/idl_codegen_kamino_vault/types/LastUpdate.js.map +1 -1
  97. package/dist/idl_codegen_kamino_vault/types/PriceHeuristic.d.ts +2 -2
  98. package/dist/idl_codegen_kamino_vault/types/PriceHeuristic.d.ts.map +1 -1
  99. package/dist/idl_codegen_kamino_vault/types/PriceHeuristic.js +1 -1
  100. package/dist/idl_codegen_kamino_vault/types/PriceHeuristic.js.map +1 -1
  101. package/dist/idl_codegen_kamino_vault/types/PythConfiguration.d.ts +2 -2
  102. package/dist/idl_codegen_kamino_vault/types/PythConfiguration.d.ts.map +1 -1
  103. package/dist/idl_codegen_kamino_vault/types/PythConfiguration.js +1 -1
  104. package/dist/idl_codegen_kamino_vault/types/PythConfiguration.js.map +1 -1
  105. package/dist/idl_codegen_kamino_vault/types/ReserveCollateral.d.ts +3 -3
  106. package/dist/idl_codegen_kamino_vault/types/ReserveCollateral.d.ts.map +1 -1
  107. package/dist/idl_codegen_kamino_vault/types/ReserveCollateral.js +5 -5
  108. package/dist/idl_codegen_kamino_vault/types/ReserveCollateral.js.map +1 -1
  109. package/dist/idl_codegen_kamino_vault/types/ReserveConfig.d.ts +27 -24
  110. package/dist/idl_codegen_kamino_vault/types/ReserveConfig.d.ts.map +1 -1
  111. package/dist/idl_codegen_kamino_vault/types/ReserveConfig.js +59 -53
  112. package/dist/idl_codegen_kamino_vault/types/ReserveConfig.js.map +1 -1
  113. package/dist/idl_codegen_kamino_vault/types/ReserveFees.d.ts +2 -2
  114. package/dist/idl_codegen_kamino_vault/types/ReserveFees.d.ts.map +1 -1
  115. package/dist/idl_codegen_kamino_vault/types/ReserveFees.js +5 -1
  116. package/dist/idl_codegen_kamino_vault/types/ReserveFees.js.map +1 -1
  117. package/dist/idl_codegen_kamino_vault/types/ReserveLiquidity.d.ts +11 -3
  118. package/dist/idl_codegen_kamino_vault/types/ReserveLiquidity.d.ts.map +1 -1
  119. package/dist/idl_codegen_kamino_vault/types/ReserveLiquidity.js +25 -17
  120. package/dist/idl_codegen_kamino_vault/types/ReserveLiquidity.js.map +1 -1
  121. package/dist/idl_codegen_kamino_vault/types/ScopeConfiguration.d.ts +2 -2
  122. package/dist/idl_codegen_kamino_vault/types/ScopeConfiguration.d.ts.map +1 -1
  123. package/dist/idl_codegen_kamino_vault/types/ScopeConfiguration.js +3 -3
  124. package/dist/idl_codegen_kamino_vault/types/ScopeConfiguration.js.map +1 -1
  125. package/dist/idl_codegen_kamino_vault/types/SwitchboardConfiguration.d.ts +2 -2
  126. package/dist/idl_codegen_kamino_vault/types/SwitchboardConfiguration.d.ts.map +1 -1
  127. package/dist/idl_codegen_kamino_vault/types/SwitchboardConfiguration.js +1 -1
  128. package/dist/idl_codegen_kamino_vault/types/SwitchboardConfiguration.js.map +1 -1
  129. package/dist/idl_codegen_kamino_vault/types/TokenInfo.d.ts +3 -3
  130. package/dist/idl_codegen_kamino_vault/types/TokenInfo.d.ts.map +1 -1
  131. package/dist/idl_codegen_kamino_vault/types/TokenInfo.js +11 -11
  132. package/dist/idl_codegen_kamino_vault/types/TokenInfo.js.map +1 -1
  133. package/dist/idl_codegen_kamino_vault/types/VaultAllocation.d.ts +18 -8
  134. package/dist/idl_codegen_kamino_vault/types/VaultAllocation.d.ts.map +1 -1
  135. package/dist/idl_codegen_kamino_vault/types/VaultAllocation.js +27 -13
  136. package/dist/idl_codegen_kamino_vault/types/VaultAllocation.js.map +1 -1
  137. package/dist/idl_codegen_kamino_vault/types/VaultConfigField.d.ts +110 -0
  138. package/dist/idl_codegen_kamino_vault/types/VaultConfigField.d.ts.map +1 -0
  139. package/dist/idl_codegen_kamino_vault/types/VaultConfigField.js +242 -0
  140. package/dist/idl_codegen_kamino_vault/types/VaultConfigField.js.map +1 -0
  141. package/dist/idl_codegen_kamino_vault/types/index.d.ts +34 -30
  142. package/dist/idl_codegen_kamino_vault/types/index.d.ts.map +1 -1
  143. package/dist/idl_codegen_kamino_vault/types/index.js +26 -1
  144. package/dist/idl_codegen_kamino_vault/types/index.js.map +1 -1
  145. package/dist/lending_operations/repay_with_collateral_operations.d.ts.map +1 -1
  146. package/dist/lending_operations/repay_with_collateral_operations.js +6 -0
  147. package/dist/lending_operations/repay_with_collateral_operations.js.map +1 -1
  148. package/dist/leverage/calcs.d.ts +28 -1
  149. package/dist/leverage/calcs.d.ts.map +1 -1
  150. package/dist/leverage/calcs.js +204 -8
  151. package/dist/leverage/calcs.js.map +1 -1
  152. package/dist/leverage/index.d.ts +1 -0
  153. package/dist/leverage/index.d.ts.map +1 -1
  154. package/dist/leverage/index.js +1 -0
  155. package/dist/leverage/index.js.map +1 -1
  156. package/dist/leverage/operations.d.ts +14 -241
  157. package/dist/leverage/operations.d.ts.map +1 -1
  158. package/dist/leverage/operations.js +508 -776
  159. package/dist/leverage/operations.js.map +1 -1
  160. package/dist/leverage/types.d.ts +173 -0
  161. package/dist/leverage/types.d.ts.map +1 -0
  162. package/dist/leverage/types.js +3 -0
  163. package/dist/leverage/types.js.map +1 -0
  164. package/dist/leverage/utils.d.ts +5 -5
  165. package/dist/leverage/utils.d.ts.map +1 -1
  166. package/dist/leverage/utils.js +68 -33
  167. package/dist/leverage/utils.js.map +1 -1
  168. package/dist/utils/constants.d.ts +1 -0
  169. package/dist/utils/constants.d.ts.map +1 -1
  170. package/dist/utils/constants.js +2 -1
  171. package/dist/utils/constants.js.map +1 -1
  172. package/dist/utils/fuzz.d.ts +3 -0
  173. package/dist/utils/fuzz.d.ts.map +1 -0
  174. package/dist/utils/fuzz.js +11 -0
  175. package/dist/utils/fuzz.js.map +1 -0
  176. package/dist/utils/index.d.ts +1 -0
  177. package/dist/utils/index.d.ts.map +1 -1
  178. package/dist/utils/index.js +1 -0
  179. package/dist/utils/index.js.map +1 -1
  180. package/dist/utils/rpc.d.ts.map +1 -1
  181. package/dist/utils/rpc.js +2 -1
  182. package/dist/utils/rpc.js.map +1 -1
  183. package/package.json +2 -1
  184. package/src/classes/manager.ts +122 -4
  185. package/src/classes/market.ts +1 -1
  186. package/src/classes/vault.ts +123 -49
  187. package/src/client_kamino_manager.ts +18 -0
  188. package/src/idl_codegen_kamino_vault/accounts/Reserve.ts +132 -105
  189. package/src/idl_codegen_kamino_vault/accounts/VaultState.ts +217 -124
  190. package/src/idl_codegen_kamino_vault/accounts/index.ts +4 -4
  191. package/src/idl_codegen_kamino_vault/errors/anchor.ts +335 -326
  192. package/src/idl_codegen_kamino_vault/errors/custom.ts +353 -157
  193. package/src/idl_codegen_kamino_vault/errors/index.ts +35 -22
  194. package/src/idl_codegen_kamino_vault/instructions/deposit.ts +33 -25
  195. package/src/idl_codegen_kamino_vault/instructions/giveUpPendingFees.ts +40 -0
  196. package/src/idl_codegen_kamino_vault/instructions/index.ts +27 -10
  197. package/src/idl_codegen_kamino_vault/instructions/initVault.ts +25 -20
  198. package/src/idl_codegen_kamino_vault/instructions/invest.ts +40 -25
  199. package/src/idl_codegen_kamino_vault/instructions/updateAdmin.ts +24 -0
  200. package/src/idl_codegen_kamino_vault/instructions/updateReserveAllocation.ts +24 -24
  201. package/src/idl_codegen_kamino_vault/instructions/updateVaultConfig.ts +49 -0
  202. package/src/idl_codegen_kamino_vault/instructions/withdraw.ts +45 -33
  203. package/src/idl_codegen_kamino_vault/instructions/withdrawPendingFees.ts +75 -0
  204. package/src/idl_codegen_kamino_vault/programId.ts +5 -3
  205. package/src/idl_codegen_kamino_vault/types/BigFractionBytes.ts +24 -18
  206. package/src/idl_codegen_kamino_vault/types/BorrowRateCurve.ts +21 -16
  207. package/src/idl_codegen_kamino_vault/types/CurvePoint.ts +21 -18
  208. package/src/idl_codegen_kamino_vault/types/LastUpdate.ts +32 -27
  209. package/src/idl_codegen_kamino_vault/types/PriceHeuristic.ts +25 -22
  210. package/src/idl_codegen_kamino_vault/types/PythConfiguration.ts +14 -14
  211. package/src/idl_codegen_kamino_vault/types/ReserveCollateral.ts +35 -35
  212. package/src/idl_codegen_kamino_vault/types/ReserveConfig.ts +232 -191
  213. package/src/idl_codegen_kamino_vault/types/ReserveFees.ts +27 -23
  214. package/src/idl_codegen_kamino_vault/types/ReserveLiquidity.ts +116 -98
  215. package/src/idl_codegen_kamino_vault/types/ScopeConfiguration.ts +25 -25
  216. package/src/idl_codegen_kamino_vault/types/SwitchboardConfiguration.ts +21 -18
  217. package/src/idl_codegen_kamino_vault/types/TokenInfo.ts +92 -74
  218. package/src/idl_codegen_kamino_vault/types/VaultAllocation.ts +67 -49
  219. package/src/idl_codegen_kamino_vault/types/VaultConfigField.ts +270 -0
  220. package/src/idl_codegen_kamino_vault/types/index.ts +77 -30
  221. package/src/lending_operations/repay_with_collateral_operations.ts +2 -0
  222. package/src/leverage/calcs.ts +315 -8
  223. package/src/leverage/index.ts +1 -0
  224. package/src/leverage/operations.ts +1079 -1331
  225. package/src/leverage/types.ts +211 -0
  226. package/src/leverage/utils.ts +103 -64
  227. package/src/utils/constants.ts +2 -0
  228. package/src/utils/fuzz.ts +5 -0
  229. package/src/utils/index.ts +1 -0
  230. package/src/utils/rpc.ts +2 -1
@@ -1,7 +1,7 @@
1
- import { PublicKey } from '@solana/web3.js'; // eslint-disable-line @typescript-eslint/no-unused-vars
2
- import BN from 'bn.js'; // eslint-disable-line @typescript-eslint/no-unused-vars
3
- import * as types from '../types'; // eslint-disable-line @typescript-eslint/no-unused-vars
4
- import * as borsh from '@coral-xyz/borsh';
1
+ import { PublicKey } from "@solana/web3.js" // eslint-disable-line @typescript-eslint/no-unused-vars
2
+ import BN from "bn.js" // eslint-disable-line @typescript-eslint/no-unused-vars
3
+ import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
4
+ import * as borsh from "@coral-xyz/borsh"
5
5
 
6
6
  export interface ReserveFeesFields {
7
7
  /**
@@ -12,14 +12,14 @@ export interface ReserveFeesFields {
12
12
  * 0.01% (1 basis point) = 115292150460685
13
13
  * 0.00001% (Aave borrow fee) = 115292150461
14
14
  */
15
- borrowFeeSf: BN;
15
+ borrowFeeSf: BN
16
16
  /**
17
17
  * Fee for flash loan, expressed as scaled fraction.
18
18
  * 0.3% (Aave flash loan fee) = 0.003 * 2^60 = 3458764513820541
19
19
  */
20
- flashLoanFeeSf: BN;
20
+ flashLoanFeeSf: BN
21
21
  /** Used for allignment */
22
- padding: Array<number>;
22
+ padding: Array<number>
23
23
  }
24
24
 
25
25
  export interface ReserveFeesJSON {
@@ -31,14 +31,14 @@ export interface ReserveFeesJSON {
31
31
  * 0.01% (1 basis point) = 115292150460685
32
32
  * 0.00001% (Aave borrow fee) = 115292150461
33
33
  */
34
- borrowFeeSf: string;
34
+ borrowFeeSf: string
35
35
  /**
36
36
  * Fee for flash loan, expressed as scaled fraction.
37
37
  * 0.3% (Aave flash loan fee) = 0.003 * 2^60 = 3458764513820541
38
38
  */
39
- flashLoanFeeSf: string;
39
+ flashLoanFeeSf: string
40
40
  /** Used for allignment */
41
- padding: Array<number>;
41
+ padding: Array<number>
42
42
  }
43
43
 
44
44
  /**
@@ -57,26 +57,30 @@ export class ReserveFees {
57
57
  * 0.01% (1 basis point) = 115292150460685
58
58
  * 0.00001% (Aave borrow fee) = 115292150461
59
59
  */
60
- readonly borrowFeeSf: BN;
60
+ readonly borrowFeeSf: BN
61
61
  /**
62
62
  * Fee for flash loan, expressed as scaled fraction.
63
63
  * 0.3% (Aave flash loan fee) = 0.003 * 2^60 = 3458764513820541
64
64
  */
65
- readonly flashLoanFeeSf: BN;
65
+ readonly flashLoanFeeSf: BN
66
66
  /** Used for allignment */
67
- readonly padding: Array<number>;
67
+ readonly padding: Array<number>
68
68
 
69
69
  constructor(fields: ReserveFeesFields) {
70
- this.borrowFeeSf = fields.borrowFeeSf;
71
- this.flashLoanFeeSf = fields.flashLoanFeeSf;
72
- this.padding = fields.padding;
70
+ this.borrowFeeSf = fields.borrowFeeSf
71
+ this.flashLoanFeeSf = fields.flashLoanFeeSf
72
+ this.padding = fields.padding
73
73
  }
74
74
 
75
75
  static layout(property?: string) {
76
76
  return borsh.struct(
77
- [borsh.u64('borrowFeeSf'), borsh.u64('flashLoanFeeSf'), borsh.array(borsh.u8(), 8, 'padding')],
77
+ [
78
+ borsh.u64("borrowFeeSf"),
79
+ borsh.u64("flashLoanFeeSf"),
80
+ borsh.array(borsh.u8(), 8, "padding"),
81
+ ],
78
82
  property
79
- );
83
+ )
80
84
  }
81
85
 
82
86
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -85,7 +89,7 @@ export class ReserveFees {
85
89
  borrowFeeSf: obj.borrowFeeSf,
86
90
  flashLoanFeeSf: obj.flashLoanFeeSf,
87
91
  padding: obj.padding,
88
- });
92
+ })
89
93
  }
90
94
 
91
95
  static toEncodable(fields: ReserveFeesFields) {
@@ -93,7 +97,7 @@ export class ReserveFees {
93
97
  borrowFeeSf: fields.borrowFeeSf,
94
98
  flashLoanFeeSf: fields.flashLoanFeeSf,
95
99
  padding: fields.padding,
96
- };
100
+ }
97
101
  }
98
102
 
99
103
  toJSON(): ReserveFeesJSON {
@@ -101,7 +105,7 @@ export class ReserveFees {
101
105
  borrowFeeSf: this.borrowFeeSf.toString(),
102
106
  flashLoanFeeSf: this.flashLoanFeeSf.toString(),
103
107
  padding: this.padding,
104
- };
108
+ }
105
109
  }
106
110
 
107
111
  static fromJSON(obj: ReserveFeesJSON): ReserveFees {
@@ -109,10 +113,10 @@ export class ReserveFees {
109
113
  borrowFeeSf: new BN(obj.borrowFeeSf),
110
114
  flashLoanFeeSf: new BN(obj.flashLoanFeeSf),
111
115
  padding: obj.padding,
112
- });
116
+ })
113
117
  }
114
118
 
115
119
  toEncodable() {
116
- return ReserveFees.toEncodable(this);
120
+ return ReserveFees.toEncodable(this)
117
121
  }
118
122
  }
@@ -1,176 +1,184 @@
1
- import { PublicKey } from '@solana/web3.js'; // eslint-disable-line @typescript-eslint/no-unused-vars
2
- import BN from 'bn.js'; // eslint-disable-line @typescript-eslint/no-unused-vars
3
- import * as types from '../types'; // eslint-disable-line @typescript-eslint/no-unused-vars
4
- import * as borsh from '@coral-xyz/borsh';
1
+ import { PublicKey } from "@solana/web3.js" // eslint-disable-line @typescript-eslint/no-unused-vars
2
+ import BN from "bn.js" // eslint-disable-line @typescript-eslint/no-unused-vars
3
+ import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
4
+ import * as borsh from "@coral-xyz/borsh"
5
5
 
6
6
  export interface ReserveLiquidityFields {
7
7
  /** Reserve liquidity mint address */
8
- mintPubkey: PublicKey;
8
+ mintPubkey: PublicKey
9
9
  /** Reserve liquidity supply address */
10
- supplyVault: PublicKey;
10
+ supplyVault: PublicKey
11
11
  /** Reserve liquidity fee collection address */
12
- feeVault: PublicKey;
12
+ feeVault: PublicKey
13
13
  /** Reserve liquidity available */
14
- availableAmount: BN;
14
+ availableAmount: BN
15
15
  /** Reserve liquidity borrowed (scaled fraction) */
16
- borrowedAmountSf: BN;
16
+ borrowedAmountSf: BN
17
17
  /** Reserve liquidity market price in quote currency (scaled fraction) */
18
- marketPriceSf: BN;
18
+ marketPriceSf: BN
19
19
  /** Unix timestamp of the market price (from the oracle) */
20
- marketPriceLastUpdatedTs: BN;
20
+ marketPriceLastUpdatedTs: BN
21
21
  /** Reserve liquidity mint decimals */
22
- mintDecimals: BN;
22
+ mintDecimals: BN
23
23
  /**
24
24
  * Timestamp in slots when the last refresh reserve detected that the liquidity amount is above the deposit cap. When this threshold is crossed, then redemptions (auto-deleverage) are enabled.
25
25
  * If the threshold is not crossed, then the timestamp is set to 0
26
26
  */
27
- depositLimitCrossedSlot: BN;
27
+ depositLimitCrossedSlot: BN
28
28
  /**
29
29
  * Timestamp in slots when the last refresh reserve detected that the borrowed amount is above the borrow cap. When this threshold is crossed, then redemptions (auto-deleverage) are enabled.
30
30
  * If the threshold is not crossed, then the timestamp is set to 0
31
31
  */
32
- borrowLimitCrossedSlot: BN;
32
+ borrowLimitCrossedSlot: BN
33
33
  /** Reserve liquidity cumulative borrow rate (scaled fraction) */
34
- cumulativeBorrowRateBsf: types.BigFractionBytesFields;
34
+ cumulativeBorrowRateBsf: types.BigFractionBytesFields
35
35
  /** Reserve cumulative protocol fees (scaled fraction) */
36
- accumulatedProtocolFeesSf: BN;
36
+ accumulatedProtocolFeesSf: BN
37
37
  /** Reserve cumulative referrer fees (scaled fraction) */
38
- accumulatedReferrerFeesSf: BN;
38
+ accumulatedReferrerFeesSf: BN
39
39
  /** Reserve pending referrer fees, to be claimed in refresh_obligation by referrer or protocol (scaled fraction) */
40
- pendingReferrerFeesSf: BN;
40
+ pendingReferrerFeesSf: BN
41
41
  /** Reserve referrer fee absolute rate calculated at each refresh_reserve operation (scaled fraction) */
42
- absoluteReferralRateSf: BN;
43
- padding2: Array<BN>;
44
- padding3: Array<BN>;
42
+ absoluteReferralRateSf: BN
43
+ /** Token program of the liquidity mint */
44
+ tokenProgram: PublicKey
45
+ padding2: Array<BN>
46
+ padding3: Array<BN>
45
47
  }
46
48
 
47
49
  export interface ReserveLiquidityJSON {
48
50
  /** Reserve liquidity mint address */
49
- mintPubkey: string;
51
+ mintPubkey: string
50
52
  /** Reserve liquidity supply address */
51
- supplyVault: string;
53
+ supplyVault: string
52
54
  /** Reserve liquidity fee collection address */
53
- feeVault: string;
55
+ feeVault: string
54
56
  /** Reserve liquidity available */
55
- availableAmount: string;
57
+ availableAmount: string
56
58
  /** Reserve liquidity borrowed (scaled fraction) */
57
- borrowedAmountSf: string;
59
+ borrowedAmountSf: string
58
60
  /** Reserve liquidity market price in quote currency (scaled fraction) */
59
- marketPriceSf: string;
61
+ marketPriceSf: string
60
62
  /** Unix timestamp of the market price (from the oracle) */
61
- marketPriceLastUpdatedTs: string;
63
+ marketPriceLastUpdatedTs: string
62
64
  /** Reserve liquidity mint decimals */
63
- mintDecimals: string;
65
+ mintDecimals: string
64
66
  /**
65
67
  * Timestamp in slots when the last refresh reserve detected that the liquidity amount is above the deposit cap. When this threshold is crossed, then redemptions (auto-deleverage) are enabled.
66
68
  * If the threshold is not crossed, then the timestamp is set to 0
67
69
  */
68
- depositLimitCrossedSlot: string;
70
+ depositLimitCrossedSlot: string
69
71
  /**
70
72
  * Timestamp in slots when the last refresh reserve detected that the borrowed amount is above the borrow cap. When this threshold is crossed, then redemptions (auto-deleverage) are enabled.
71
73
  * If the threshold is not crossed, then the timestamp is set to 0
72
74
  */
73
- borrowLimitCrossedSlot: string;
75
+ borrowLimitCrossedSlot: string
74
76
  /** Reserve liquidity cumulative borrow rate (scaled fraction) */
75
- cumulativeBorrowRateBsf: types.BigFractionBytesJSON;
77
+ cumulativeBorrowRateBsf: types.BigFractionBytesJSON
76
78
  /** Reserve cumulative protocol fees (scaled fraction) */
77
- accumulatedProtocolFeesSf: string;
79
+ accumulatedProtocolFeesSf: string
78
80
  /** Reserve cumulative referrer fees (scaled fraction) */
79
- accumulatedReferrerFeesSf: string;
81
+ accumulatedReferrerFeesSf: string
80
82
  /** Reserve pending referrer fees, to be claimed in refresh_obligation by referrer or protocol (scaled fraction) */
81
- pendingReferrerFeesSf: string;
83
+ pendingReferrerFeesSf: string
82
84
  /** Reserve referrer fee absolute rate calculated at each refresh_reserve operation (scaled fraction) */
83
- absoluteReferralRateSf: string;
84
- padding2: Array<string>;
85
- padding3: Array<string>;
85
+ absoluteReferralRateSf: string
86
+ /** Token program of the liquidity mint */
87
+ tokenProgram: string
88
+ padding2: Array<string>
89
+ padding3: Array<string>
86
90
  }
87
91
 
88
92
  /** Reserve liquidity */
89
93
  export class ReserveLiquidity {
90
94
  /** Reserve liquidity mint address */
91
- readonly mintPubkey: PublicKey;
95
+ readonly mintPubkey: PublicKey
92
96
  /** Reserve liquidity supply address */
93
- readonly supplyVault: PublicKey;
97
+ readonly supplyVault: PublicKey
94
98
  /** Reserve liquidity fee collection address */
95
- readonly feeVault: PublicKey;
99
+ readonly feeVault: PublicKey
96
100
  /** Reserve liquidity available */
97
- readonly availableAmount: BN;
101
+ readonly availableAmount: BN
98
102
  /** Reserve liquidity borrowed (scaled fraction) */
99
- readonly borrowedAmountSf: BN;
103
+ readonly borrowedAmountSf: BN
100
104
  /** Reserve liquidity market price in quote currency (scaled fraction) */
101
- readonly marketPriceSf: BN;
105
+ readonly marketPriceSf: BN
102
106
  /** Unix timestamp of the market price (from the oracle) */
103
- readonly marketPriceLastUpdatedTs: BN;
107
+ readonly marketPriceLastUpdatedTs: BN
104
108
  /** Reserve liquidity mint decimals */
105
- readonly mintDecimals: BN;
109
+ readonly mintDecimals: BN
106
110
  /**
107
111
  * Timestamp in slots when the last refresh reserve detected that the liquidity amount is above the deposit cap. When this threshold is crossed, then redemptions (auto-deleverage) are enabled.
108
112
  * If the threshold is not crossed, then the timestamp is set to 0
109
113
  */
110
- readonly depositLimitCrossedSlot: BN;
114
+ readonly depositLimitCrossedSlot: BN
111
115
  /**
112
116
  * Timestamp in slots when the last refresh reserve detected that the borrowed amount is above the borrow cap. When this threshold is crossed, then redemptions (auto-deleverage) are enabled.
113
117
  * If the threshold is not crossed, then the timestamp is set to 0
114
118
  */
115
- readonly borrowLimitCrossedSlot: BN;
119
+ readonly borrowLimitCrossedSlot: BN
116
120
  /** Reserve liquidity cumulative borrow rate (scaled fraction) */
117
- readonly cumulativeBorrowRateBsf: types.BigFractionBytes;
121
+ readonly cumulativeBorrowRateBsf: types.BigFractionBytes
118
122
  /** Reserve cumulative protocol fees (scaled fraction) */
119
- readonly accumulatedProtocolFeesSf: BN;
123
+ readonly accumulatedProtocolFeesSf: BN
120
124
  /** Reserve cumulative referrer fees (scaled fraction) */
121
- readonly accumulatedReferrerFeesSf: BN;
125
+ readonly accumulatedReferrerFeesSf: BN
122
126
  /** Reserve pending referrer fees, to be claimed in refresh_obligation by referrer or protocol (scaled fraction) */
123
- readonly pendingReferrerFeesSf: BN;
127
+ readonly pendingReferrerFeesSf: BN
124
128
  /** Reserve referrer fee absolute rate calculated at each refresh_reserve operation (scaled fraction) */
125
- readonly absoluteReferralRateSf: BN;
126
- readonly padding2: Array<BN>;
127
- readonly padding3: Array<BN>;
129
+ readonly absoluteReferralRateSf: BN
130
+ /** Token program of the liquidity mint */
131
+ readonly tokenProgram: PublicKey
132
+ readonly padding2: Array<BN>
133
+ readonly padding3: Array<BN>
128
134
 
129
135
  constructor(fields: ReserveLiquidityFields) {
130
- this.mintPubkey = fields.mintPubkey;
131
- this.supplyVault = fields.supplyVault;
132
- this.feeVault = fields.feeVault;
133
- this.availableAmount = fields.availableAmount;
134
- this.borrowedAmountSf = fields.borrowedAmountSf;
135
- this.marketPriceSf = fields.marketPriceSf;
136
- this.marketPriceLastUpdatedTs = fields.marketPriceLastUpdatedTs;
137
- this.mintDecimals = fields.mintDecimals;
138
- this.depositLimitCrossedSlot = fields.depositLimitCrossedSlot;
139
- this.borrowLimitCrossedSlot = fields.borrowLimitCrossedSlot;
136
+ this.mintPubkey = fields.mintPubkey
137
+ this.supplyVault = fields.supplyVault
138
+ this.feeVault = fields.feeVault
139
+ this.availableAmount = fields.availableAmount
140
+ this.borrowedAmountSf = fields.borrowedAmountSf
141
+ this.marketPriceSf = fields.marketPriceSf
142
+ this.marketPriceLastUpdatedTs = fields.marketPriceLastUpdatedTs
143
+ this.mintDecimals = fields.mintDecimals
144
+ this.depositLimitCrossedSlot = fields.depositLimitCrossedSlot
145
+ this.borrowLimitCrossedSlot = fields.borrowLimitCrossedSlot
140
146
  this.cumulativeBorrowRateBsf = new types.BigFractionBytes({
141
147
  ...fields.cumulativeBorrowRateBsf,
142
- });
143
- this.accumulatedProtocolFeesSf = fields.accumulatedProtocolFeesSf;
144
- this.accumulatedReferrerFeesSf = fields.accumulatedReferrerFeesSf;
145
- this.pendingReferrerFeesSf = fields.pendingReferrerFeesSf;
146
- this.absoluteReferralRateSf = fields.absoluteReferralRateSf;
147
- this.padding2 = fields.padding2;
148
- this.padding3 = fields.padding3;
148
+ })
149
+ this.accumulatedProtocolFeesSf = fields.accumulatedProtocolFeesSf
150
+ this.accumulatedReferrerFeesSf = fields.accumulatedReferrerFeesSf
151
+ this.pendingReferrerFeesSf = fields.pendingReferrerFeesSf
152
+ this.absoluteReferralRateSf = fields.absoluteReferralRateSf
153
+ this.tokenProgram = fields.tokenProgram
154
+ this.padding2 = fields.padding2
155
+ this.padding3 = fields.padding3
149
156
  }
150
157
 
151
158
  static layout(property?: string) {
152
159
  return borsh.struct(
153
160
  [
154
- borsh.publicKey('mintPubkey'),
155
- borsh.publicKey('supplyVault'),
156
- borsh.publicKey('feeVault'),
157
- borsh.u64('availableAmount'),
158
- borsh.u128('borrowedAmountSf'),
159
- borsh.u128('marketPriceSf'),
160
- borsh.u64('marketPriceLastUpdatedTs'),
161
- borsh.u64('mintDecimals'),
162
- borsh.u64('depositLimitCrossedSlot'),
163
- borsh.u64('borrowLimitCrossedSlot'),
164
- types.BigFractionBytes.layout('cumulativeBorrowRateBsf'),
165
- borsh.u128('accumulatedProtocolFeesSf'),
166
- borsh.u128('accumulatedReferrerFeesSf'),
167
- borsh.u128('pendingReferrerFeesSf'),
168
- borsh.u128('absoluteReferralRateSf'),
169
- borsh.array(borsh.u64(), 55, 'padding2'),
170
- borsh.array(borsh.u128(), 32, 'padding3'),
161
+ borsh.publicKey("mintPubkey"),
162
+ borsh.publicKey("supplyVault"),
163
+ borsh.publicKey("feeVault"),
164
+ borsh.u64("availableAmount"),
165
+ borsh.u128("borrowedAmountSf"),
166
+ borsh.u128("marketPriceSf"),
167
+ borsh.u64("marketPriceLastUpdatedTs"),
168
+ borsh.u64("mintDecimals"),
169
+ borsh.u64("depositLimitCrossedSlot"),
170
+ borsh.u64("borrowLimitCrossedSlot"),
171
+ types.BigFractionBytes.layout("cumulativeBorrowRateBsf"),
172
+ borsh.u128("accumulatedProtocolFeesSf"),
173
+ borsh.u128("accumulatedReferrerFeesSf"),
174
+ borsh.u128("pendingReferrerFeesSf"),
175
+ borsh.u128("absoluteReferralRateSf"),
176
+ borsh.publicKey("tokenProgram"),
177
+ borsh.array(borsh.u64(), 51, "padding2"),
178
+ borsh.array(borsh.u128(), 32, "padding3"),
171
179
  ],
172
180
  property
173
- );
181
+ )
174
182
  }
175
183
 
176
184
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -186,14 +194,17 @@ export class ReserveLiquidity {
186
194
  mintDecimals: obj.mintDecimals,
187
195
  depositLimitCrossedSlot: obj.depositLimitCrossedSlot,
188
196
  borrowLimitCrossedSlot: obj.borrowLimitCrossedSlot,
189
- cumulativeBorrowRateBsf: types.BigFractionBytes.fromDecoded(obj.cumulativeBorrowRateBsf),
197
+ cumulativeBorrowRateBsf: types.BigFractionBytes.fromDecoded(
198
+ obj.cumulativeBorrowRateBsf
199
+ ),
190
200
  accumulatedProtocolFeesSf: obj.accumulatedProtocolFeesSf,
191
201
  accumulatedReferrerFeesSf: obj.accumulatedReferrerFeesSf,
192
202
  pendingReferrerFeesSf: obj.pendingReferrerFeesSf,
193
203
  absoluteReferralRateSf: obj.absoluteReferralRateSf,
204
+ tokenProgram: obj.tokenProgram,
194
205
  padding2: obj.padding2,
195
206
  padding3: obj.padding3,
196
- });
207
+ })
197
208
  }
198
209
 
199
210
  static toEncodable(fields: ReserveLiquidityFields) {
@@ -208,14 +219,17 @@ export class ReserveLiquidity {
208
219
  mintDecimals: fields.mintDecimals,
209
220
  depositLimitCrossedSlot: fields.depositLimitCrossedSlot,
210
221
  borrowLimitCrossedSlot: fields.borrowLimitCrossedSlot,
211
- cumulativeBorrowRateBsf: types.BigFractionBytes.toEncodable(fields.cumulativeBorrowRateBsf),
222
+ cumulativeBorrowRateBsf: types.BigFractionBytes.toEncodable(
223
+ fields.cumulativeBorrowRateBsf
224
+ ),
212
225
  accumulatedProtocolFeesSf: fields.accumulatedProtocolFeesSf,
213
226
  accumulatedReferrerFeesSf: fields.accumulatedReferrerFeesSf,
214
227
  pendingReferrerFeesSf: fields.pendingReferrerFeesSf,
215
228
  absoluteReferralRateSf: fields.absoluteReferralRateSf,
229
+ tokenProgram: fields.tokenProgram,
216
230
  padding2: fields.padding2,
217
231
  padding3: fields.padding3,
218
- };
232
+ }
219
233
  }
220
234
 
221
235
  toJSON(): ReserveLiquidityJSON {
@@ -235,9 +249,10 @@ export class ReserveLiquidity {
235
249
  accumulatedReferrerFeesSf: this.accumulatedReferrerFeesSf.toString(),
236
250
  pendingReferrerFeesSf: this.pendingReferrerFeesSf.toString(),
237
251
  absoluteReferralRateSf: this.absoluteReferralRateSf.toString(),
252
+ tokenProgram: this.tokenProgram.toString(),
238
253
  padding2: this.padding2.map((item) => item.toString()),
239
254
  padding3: this.padding3.map((item) => item.toString()),
240
- };
255
+ }
241
256
  }
242
257
 
243
258
  static fromJSON(obj: ReserveLiquidityJSON): ReserveLiquidity {
@@ -252,17 +267,20 @@ export class ReserveLiquidity {
252
267
  mintDecimals: new BN(obj.mintDecimals),
253
268
  depositLimitCrossedSlot: new BN(obj.depositLimitCrossedSlot),
254
269
  borrowLimitCrossedSlot: new BN(obj.borrowLimitCrossedSlot),
255
- cumulativeBorrowRateBsf: types.BigFractionBytes.fromJSON(obj.cumulativeBorrowRateBsf),
270
+ cumulativeBorrowRateBsf: types.BigFractionBytes.fromJSON(
271
+ obj.cumulativeBorrowRateBsf
272
+ ),
256
273
  accumulatedProtocolFeesSf: new BN(obj.accumulatedProtocolFeesSf),
257
274
  accumulatedReferrerFeesSf: new BN(obj.accumulatedReferrerFeesSf),
258
275
  pendingReferrerFeesSf: new BN(obj.pendingReferrerFeesSf),
259
276
  absoluteReferralRateSf: new BN(obj.absoluteReferralRateSf),
277
+ tokenProgram: new PublicKey(obj.tokenProgram),
260
278
  padding2: obj.padding2.map((item) => new BN(item)),
261
279
  padding3: obj.padding3.map((item) => new BN(item)),
262
- });
280
+ })
263
281
  }
264
282
 
265
283
  toEncodable() {
266
- return ReserveLiquidity.toEncodable(this);
284
+ return ReserveLiquidity.toEncodable(this)
267
285
  }
268
286
  }
@@ -1,49 +1,49 @@
1
- import { PublicKey } from '@solana/web3.js'; // eslint-disable-line @typescript-eslint/no-unused-vars
2
- import BN from 'bn.js'; // eslint-disable-line @typescript-eslint/no-unused-vars
3
- import * as types from '../types'; // eslint-disable-line @typescript-eslint/no-unused-vars
4
- import * as borsh from '@coral-xyz/borsh';
1
+ import { PublicKey } from "@solana/web3.js" // eslint-disable-line @typescript-eslint/no-unused-vars
2
+ import BN from "bn.js" // eslint-disable-line @typescript-eslint/no-unused-vars
3
+ import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
4
+ import * as borsh from "@coral-xyz/borsh"
5
5
 
6
6
  export interface ScopeConfigurationFields {
7
7
  /** Pubkey of the scope price feed (disabled if `null` or `default`) */
8
- priceFeed: PublicKey;
8
+ priceFeed: PublicKey
9
9
  /** This is the scope_id price chain that results in a price for the token */
10
- priceChain: Array<number>;
10
+ priceChain: Array<number>
11
11
  /** This is the scope_id price chain for the twap */
12
- twapChain: Array<number>;
12
+ twapChain: Array<number>
13
13
  }
14
14
 
15
15
  export interface ScopeConfigurationJSON {
16
16
  /** Pubkey of the scope price feed (disabled if `null` or `default`) */
17
- priceFeed: string;
17
+ priceFeed: string
18
18
  /** This is the scope_id price chain that results in a price for the token */
19
- priceChain: Array<number>;
19
+ priceChain: Array<number>
20
20
  /** This is the scope_id price chain for the twap */
21
- twapChain: Array<number>;
21
+ twapChain: Array<number>
22
22
  }
23
23
 
24
24
  export class ScopeConfiguration {
25
25
  /** Pubkey of the scope price feed (disabled if `null` or `default`) */
26
- readonly priceFeed: PublicKey;
26
+ readonly priceFeed: PublicKey
27
27
  /** This is the scope_id price chain that results in a price for the token */
28
- readonly priceChain: Array<number>;
28
+ readonly priceChain: Array<number>
29
29
  /** This is the scope_id price chain for the twap */
30
- readonly twapChain: Array<number>;
30
+ readonly twapChain: Array<number>
31
31
 
32
32
  constructor(fields: ScopeConfigurationFields) {
33
- this.priceFeed = fields.priceFeed;
34
- this.priceChain = fields.priceChain;
35
- this.twapChain = fields.twapChain;
33
+ this.priceFeed = fields.priceFeed
34
+ this.priceChain = fields.priceChain
35
+ this.twapChain = fields.twapChain
36
36
  }
37
37
 
38
38
  static layout(property?: string) {
39
39
  return borsh.struct(
40
40
  [
41
- borsh.publicKey('priceFeed'),
42
- borsh.array(borsh.u16(), 4, 'priceChain'),
43
- borsh.array(borsh.u16(), 4, 'twapChain'),
41
+ borsh.publicKey("priceFeed"),
42
+ borsh.array(borsh.u16(), 4, "priceChain"),
43
+ borsh.array(borsh.u16(), 4, "twapChain"),
44
44
  ],
45
45
  property
46
- );
46
+ )
47
47
  }
48
48
 
49
49
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -52,7 +52,7 @@ export class ScopeConfiguration {
52
52
  priceFeed: obj.priceFeed,
53
53
  priceChain: obj.priceChain,
54
54
  twapChain: obj.twapChain,
55
- });
55
+ })
56
56
  }
57
57
 
58
58
  static toEncodable(fields: ScopeConfigurationFields) {
@@ -60,7 +60,7 @@ export class ScopeConfiguration {
60
60
  priceFeed: fields.priceFeed,
61
61
  priceChain: fields.priceChain,
62
62
  twapChain: fields.twapChain,
63
- };
63
+ }
64
64
  }
65
65
 
66
66
  toJSON(): ScopeConfigurationJSON {
@@ -68,7 +68,7 @@ export class ScopeConfiguration {
68
68
  priceFeed: this.priceFeed.toString(),
69
69
  priceChain: this.priceChain,
70
70
  twapChain: this.twapChain,
71
- };
71
+ }
72
72
  }
73
73
 
74
74
  static fromJSON(obj: ScopeConfigurationJSON): ScopeConfiguration {
@@ -76,10 +76,10 @@ export class ScopeConfiguration {
76
76
  priceFeed: new PublicKey(obj.priceFeed),
77
77
  priceChain: obj.priceChain,
78
78
  twapChain: obj.twapChain,
79
- });
79
+ })
80
80
  }
81
81
 
82
82
  toEncodable() {
83
- return ScopeConfiguration.toEncodable(this);
83
+ return ScopeConfiguration.toEncodable(this)
84
84
  }
85
85
  }
@@ -1,32 +1,35 @@
1
- import { PublicKey } from '@solana/web3.js'; // eslint-disable-line @typescript-eslint/no-unused-vars
2
- import BN from 'bn.js'; // eslint-disable-line @typescript-eslint/no-unused-vars
3
- import * as types from '../types'; // eslint-disable-line @typescript-eslint/no-unused-vars
4
- import * as borsh from '@coral-xyz/borsh';
1
+ import { PublicKey } from "@solana/web3.js" // eslint-disable-line @typescript-eslint/no-unused-vars
2
+ import BN from "bn.js" // eslint-disable-line @typescript-eslint/no-unused-vars
3
+ import * as types from "../types" // eslint-disable-line @typescript-eslint/no-unused-vars
4
+ import * as borsh from "@coral-xyz/borsh"
5
5
 
6
6
  export interface SwitchboardConfigurationFields {
7
7
  /** Pubkey of the base price feed (disabled if `null` or `default`) */
8
- priceAggregator: PublicKey;
9
- twapAggregator: PublicKey;
8
+ priceAggregator: PublicKey
9
+ twapAggregator: PublicKey
10
10
  }
11
11
 
12
12
  export interface SwitchboardConfigurationJSON {
13
13
  /** Pubkey of the base price feed (disabled if `null` or `default`) */
14
- priceAggregator: string;
15
- twapAggregator: string;
14
+ priceAggregator: string
15
+ twapAggregator: string
16
16
  }
17
17
 
18
18
  export class SwitchboardConfiguration {
19
19
  /** Pubkey of the base price feed (disabled if `null` or `default`) */
20
- readonly priceAggregator: PublicKey;
21
- readonly twapAggregator: PublicKey;
20
+ readonly priceAggregator: PublicKey
21
+ readonly twapAggregator: PublicKey
22
22
 
23
23
  constructor(fields: SwitchboardConfigurationFields) {
24
- this.priceAggregator = fields.priceAggregator;
25
- this.twapAggregator = fields.twapAggregator;
24
+ this.priceAggregator = fields.priceAggregator
25
+ this.twapAggregator = fields.twapAggregator
26
26
  }
27
27
 
28
28
  static layout(property?: string) {
29
- return borsh.struct([borsh.publicKey('priceAggregator'), borsh.publicKey('twapAggregator')], property);
29
+ return borsh.struct(
30
+ [borsh.publicKey("priceAggregator"), borsh.publicKey("twapAggregator")],
31
+ property
32
+ )
30
33
  }
31
34
 
32
35
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -34,31 +37,31 @@ export class SwitchboardConfiguration {
34
37
  return new SwitchboardConfiguration({
35
38
  priceAggregator: obj.priceAggregator,
36
39
  twapAggregator: obj.twapAggregator,
37
- });
40
+ })
38
41
  }
39
42
 
40
43
  static toEncodable(fields: SwitchboardConfigurationFields) {
41
44
  return {
42
45
  priceAggregator: fields.priceAggregator,
43
46
  twapAggregator: fields.twapAggregator,
44
- };
47
+ }
45
48
  }
46
49
 
47
50
  toJSON(): SwitchboardConfigurationJSON {
48
51
  return {
49
52
  priceAggregator: this.priceAggregator.toString(),
50
53
  twapAggregator: this.twapAggregator.toString(),
51
- };
54
+ }
52
55
  }
53
56
 
54
57
  static fromJSON(obj: SwitchboardConfigurationJSON): SwitchboardConfiguration {
55
58
  return new SwitchboardConfiguration({
56
59
  priceAggregator: new PublicKey(obj.priceAggregator),
57
60
  twapAggregator: new PublicKey(obj.twapAggregator),
58
- });
61
+ })
59
62
  }
60
63
 
61
64
  toEncodable() {
62
- return SwitchboardConfiguration.toEncodable(this);
65
+ return SwitchboardConfiguration.toEncodable(this)
63
66
  }
64
67
  }