@gearbox-protocol/sdk 13.3.0-next.2 → 13.3.0

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 (219) hide show
  1. package/dist/cjs/common-utils/charts/credit-manager-payload.js +16 -0
  2. package/dist/cjs/common-utils/charts/credit-manager.js +134 -0
  3. package/dist/cjs/common-utils/charts/credit-session.js +257 -0
  4. package/dist/cjs/common-utils/charts/credit-sessions-payload.js +16 -0
  5. package/dist/cjs/common-utils/charts/graph-payload.js +16 -0
  6. package/dist/cjs/common-utils/charts/index.js +36 -0
  7. package/dist/cjs/common-utils/charts/pool-payload.js +16 -0
  8. package/dist/cjs/common-utils/charts/pool.js +199 -0
  9. package/dist/cjs/common-utils/charts/token-data.js +91 -0
  10. package/dist/cjs/common-utils/index.js +4 -0
  11. package/dist/cjs/common-utils/static/index.js +28 -0
  12. package/dist/cjs/common-utils/static/migration-config.js +16 -0
  13. package/dist/cjs/common-utils/static/pool-config.js +16 -0
  14. package/dist/cjs/common-utils/static/strategy.js +16 -0
  15. package/dist/cjs/common-utils/static/trading-pair.js +16 -0
  16. package/dist/cjs/common-utils/utils/{assetsMath.js → assets-math.js} +13 -13
  17. package/dist/cjs/common-utils/utils/{bigintMath.js → bigint-math.js} +3 -3
  18. package/dist/cjs/common-utils/utils/creditAccount/{calcHealthFactor.js → calc-health-factor.js} +9 -9
  19. package/dist/cjs/common-utils/utils/creditAccount/{calcOverallAPY.js → calc-overall-apy.js} +8 -8
  20. package/dist/cjs/common-utils/utils/creditAccount/{calcQuotaBorrowRate.js → calc-quota-borrow-rate.js} +3 -3
  21. package/dist/cjs/common-utils/utils/creditAccount/{calcRelativeBaseBorrowRate.js → calc-relative-base-borrow-rate.js} +3 -3
  22. package/dist/cjs/common-utils/utils/creditAccount/debt.js +4 -4
  23. package/dist/cjs/common-utils/utils/creditAccount/{getTimeToLiquidation.js → get-time-to-liquidation.js} +3 -3
  24. package/dist/cjs/common-utils/utils/creditAccount/index.js +16 -16
  25. package/dist/cjs/common-utils/utils/creditAccount/{liquidationPrice.js → liquidation-price.js} +3 -3
  26. package/dist/cjs/common-utils/utils/creditAccount/{quotaUtils.js → quota-utils.js} +8 -8
  27. package/dist/cjs/common-utils/utils/creditAccount/sort.js +3 -3
  28. package/dist/cjs/common-utils/utils/index.js +6 -8
  29. package/dist/cjs/common-utils/utils/{priceMath.js → price-math.js} +3 -3
  30. package/dist/cjs/dev/AccountOpener.js +5 -45
  31. package/dist/cjs/dev/index.js +0 -2
  32. package/dist/cjs/plugins/zappers/ZappersPlugin.js +144 -0
  33. package/dist/cjs/{sdk/market/ZapperRegister.js → plugins/zappers/extraZappers.js} +6 -110
  34. package/dist/cjs/plugins/zappers/index.js +26 -0
  35. package/dist/cjs/plugins/zappers/package.json +1 -0
  36. package/dist/cjs/rewards/apy/index.js +24 -0
  37. package/dist/cjs/rewards/apy/output-details.js +16 -0
  38. package/dist/cjs/rewards/apy/output.js +16 -0
  39. package/dist/cjs/rewards/index.js +24 -0
  40. package/dist/cjs/rewards/package.json +1 -0
  41. package/dist/cjs/rewards/rewards/api.js +226 -0
  42. package/dist/cjs/rewards/rewards/apy.js +177 -0
  43. package/dist/cjs/rewards/rewards/common.js +16 -0
  44. package/dist/cjs/rewards/rewards/extra-apy.js +132 -0
  45. package/dist/cjs/rewards/rewards/index.js +28 -0
  46. package/dist/cjs/rewards/rewards/merkl-api.js +52 -0
  47. package/dist/cjs/sdk/accounts/AbstractCreditAccountsService.js +104 -462
  48. package/dist/cjs/sdk/accounts/CreditAccountsServiceV310.js +5 -16
  49. package/dist/cjs/sdk/base/ChainContractsRegister.js +1 -1
  50. package/dist/cjs/sdk/base/TokensMeta.js +32 -255
  51. package/dist/cjs/sdk/base/index.js +0 -2
  52. package/dist/cjs/sdk/chain/chains.js +1 -2
  53. package/dist/cjs/sdk/constants/index.js +2 -0
  54. package/dist/cjs/sdk/{base/token-types.js → constants/phantom-tokens.js} +3 -9
  55. package/dist/cjs/sdk/market/MarketRegister.js +2 -2
  56. package/dist/cjs/sdk/market/MarketSuite.js +0 -6
  57. package/dist/cjs/sdk/market/index.js +1 -3
  58. package/dist/cjs/sdk/market/pool/PoolSuite.js +0 -3
  59. package/dist/cjs/sdk/market/pool/PoolV310Contract.js +2 -17
  60. package/dist/cjs/sdk/market/pool/index.js +0 -4
  61. package/dist/cjs/sdk/pools/AbstractPoolService.js +137 -0
  62. package/dist/cjs/{abi/iStateSerializer.js → sdk/pools/PoolServiceV310.js} +8 -14
  63. package/dist/cjs/sdk/pools/createPoolService.js +35 -0
  64. package/dist/cjs/sdk/pools/index.js +4 -2
  65. package/dist/cjs/sdk/utils/AddressMap.js +1 -1
  66. package/dist/cjs/sdk/utils/viem/sendRawTx.js +0 -16
  67. package/dist/esm/common-utils/charts/credit-manager.js +115 -0
  68. package/dist/esm/common-utils/charts/credit-session.js +233 -0
  69. package/dist/esm/common-utils/charts/credit-sessions-payload.js +0 -0
  70. package/dist/esm/common-utils/charts/graph-payload.js +0 -0
  71. package/dist/esm/common-utils/charts/index.js +8 -0
  72. package/dist/esm/common-utils/charts/pool-payload.js +0 -0
  73. package/dist/esm/common-utils/charts/pool.js +179 -0
  74. package/dist/esm/common-utils/charts/token-data.js +67 -0
  75. package/dist/esm/common-utils/index.js +2 -0
  76. package/dist/esm/common-utils/static/index.js +4 -0
  77. package/dist/esm/common-utils/static/migration-config.js +0 -0
  78. package/dist/esm/common-utils/static/pool-config.js +0 -0
  79. package/dist/esm/common-utils/static/strategy.js +0 -0
  80. package/dist/esm/common-utils/static/trading-pair.js +0 -0
  81. package/dist/esm/common-utils/utils/{assetsMath.js → assets-math.js} +2 -2
  82. package/dist/esm/common-utils/utils/creditAccount/{calcHealthFactor.js → calc-health-factor.js} +2 -2
  83. package/dist/esm/common-utils/utils/creditAccount/{calcOverallAPY.js → calc-overall-apy.js} +1 -1
  84. package/dist/esm/common-utils/utils/creditAccount/debt.js +2 -2
  85. package/dist/esm/common-utils/utils/creditAccount/index.js +8 -8
  86. package/dist/esm/common-utils/utils/creditAccount/{quotaUtils.js → quota-utils.js} +1 -1
  87. package/dist/esm/common-utils/utils/creditAccount/sort.js +1 -1
  88. package/dist/esm/common-utils/utils/index.js +3 -4
  89. package/dist/esm/dev/AccountOpener.js +6 -47
  90. package/dist/esm/dev/index.js +0 -2
  91. package/dist/esm/plugins/zappers/ZappersPlugin.js +126 -0
  92. package/dist/esm/{sdk/market/ZapperRegister.js → plugins/zappers/extraZappers.js} +2 -109
  93. package/dist/esm/plugins/zappers/index.js +3 -0
  94. package/dist/esm/plugins/zappers/package.json +1 -0
  95. package/dist/esm/plugins/zappers/types.js +0 -0
  96. package/dist/esm/rewards/apy/index.js +2 -0
  97. package/dist/esm/rewards/apy/output-details.js +0 -0
  98. package/dist/esm/rewards/apy/output.js +0 -0
  99. package/dist/esm/rewards/index.js +2 -0
  100. package/dist/esm/rewards/package.json +1 -0
  101. package/dist/esm/rewards/rewards/api.js +204 -0
  102. package/dist/esm/rewards/rewards/apy.js +160 -0
  103. package/dist/esm/rewards/rewards/common.js +0 -0
  104. package/dist/esm/rewards/rewards/extra-apy.js +101 -0
  105. package/dist/esm/rewards/rewards/index.js +4 -0
  106. package/dist/esm/rewards/rewards/merkl-api.js +18 -0
  107. package/dist/esm/sdk/accounts/AbstractCreditAccountsService.js +104 -462
  108. package/dist/esm/sdk/accounts/CreditAccountsServiceV310.js +5 -16
  109. package/dist/esm/sdk/base/ChainContractsRegister.js +1 -1
  110. package/dist/esm/sdk/base/TokensMeta.js +32 -261
  111. package/dist/esm/sdk/base/index.js +0 -1
  112. package/dist/esm/sdk/chain/chains.js +1 -2
  113. package/dist/esm/sdk/constants/index.js +1 -0
  114. package/dist/esm/sdk/{base/token-types.js → constants/phantom-tokens.js} +0 -4
  115. package/dist/esm/sdk/market/MarketRegister.js +2 -2
  116. package/dist/esm/sdk/market/MarketSuite.js +0 -6
  117. package/dist/esm/sdk/market/index.js +0 -1
  118. package/dist/esm/sdk/market/pool/PoolSuite.js +0 -3
  119. package/dist/esm/sdk/market/pool/PoolV310Contract.js +2 -17
  120. package/dist/esm/sdk/market/pool/index.js +0 -2
  121. package/dist/esm/sdk/pools/AbstractPoolService.js +113 -0
  122. package/dist/esm/sdk/pools/PoolServiceV310.js +6 -0
  123. package/dist/esm/sdk/pools/createPoolService.js +11 -0
  124. package/dist/esm/sdk/pools/index.js +2 -1
  125. package/dist/esm/sdk/utils/AddressMap.js +1 -1
  126. package/dist/esm/sdk/utils/viem/sendRawTx.js +1 -19
  127. package/dist/types/common-utils/charts/credit-manager-payload.d.ts +50 -0
  128. package/dist/types/common-utils/charts/credit-manager.d.ts +48 -0
  129. package/dist/types/common-utils/charts/credit-session.d.ts +111 -0
  130. package/dist/types/common-utils/charts/credit-sessions-payload.d.ts +111 -0
  131. package/dist/types/common-utils/charts/graph-payload.d.ts +10 -0
  132. package/dist/types/common-utils/charts/index.d.ts +8 -0
  133. package/dist/types/common-utils/charts/pool-payload.d.ts +111 -0
  134. package/dist/types/common-utils/charts/pool.d.ts +91 -0
  135. package/dist/types/common-utils/charts/token-data.d.ts +20 -0
  136. package/dist/types/common-utils/index.d.ts +2 -0
  137. package/dist/types/common-utils/static/index.d.ts +4 -0
  138. package/dist/types/common-utils/static/migration-config.d.ts +10 -0
  139. package/dist/types/common-utils/static/pool-config.d.ts +11 -0
  140. package/dist/types/common-utils/static/strategy.d.ts +78 -0
  141. package/dist/types/common-utils/static/trading-pair.d.ts +15 -0
  142. package/dist/types/common-utils/utils/creditAccount/index.d.ts +8 -8
  143. package/dist/types/common-utils/utils/index.d.ts +3 -4
  144. package/dist/types/dev/index.d.ts +1 -1
  145. package/dist/types/plugins/zappers/ZappersPlugin.d.ts +18 -0
  146. package/dist/types/plugins/zappers/extraZappers.d.ts +6 -0
  147. package/dist/types/plugins/zappers/index.d.ts +3 -0
  148. package/dist/types/plugins/zappers/types.d.ts +12 -0
  149. package/dist/types/rewards/apy/index.d.ts +2 -0
  150. package/dist/types/rewards/apy/output-details.d.ts +97 -0
  151. package/dist/types/rewards/apy/output.d.ts +22 -0
  152. package/dist/types/rewards/index.d.ts +2 -0
  153. package/dist/types/rewards/rewards/api.d.ts +49 -0
  154. package/dist/types/rewards/rewards/apy.d.ts +41 -0
  155. package/dist/types/rewards/rewards/common.d.ts +16 -0
  156. package/dist/types/rewards/rewards/extra-apy.d.ts +30 -0
  157. package/dist/types/rewards/rewards/index.d.ts +4 -0
  158. package/dist/types/rewards/rewards/merkl-api.d.ts +45 -0
  159. package/dist/types/sdk/accounts/AbstractCreditAccountsService.d.ts +27 -123
  160. package/dist/types/sdk/accounts/CreditAccountsServiceV310.d.ts +1 -1
  161. package/dist/types/sdk/accounts/types.d.ts +8 -108
  162. package/dist/types/sdk/base/TokensMeta.d.ts +18 -34
  163. package/dist/types/sdk/base/index.d.ts +0 -1
  164. package/dist/types/sdk/base/types.d.ts +1 -0
  165. package/dist/types/sdk/chain/chains.d.ts +1 -1
  166. package/dist/types/sdk/constants/index.d.ts +1 -0
  167. package/dist/types/sdk/constants/phantom-tokens.d.ts +2 -0
  168. package/dist/types/sdk/market/MarketRegister.d.ts +2 -2
  169. package/dist/types/sdk/market/MarketSuite.d.ts +0 -3
  170. package/dist/types/sdk/market/index.d.ts +0 -1
  171. package/dist/types/sdk/market/pool/PoolSuite.d.ts +0 -2
  172. package/dist/types/sdk/market/pool/PoolV310Contract.d.ts +2 -6
  173. package/dist/types/sdk/market/pool/index.d.ts +0 -2
  174. package/dist/types/sdk/pools/AbstractPoolService.d.ts +9 -0
  175. package/dist/types/sdk/pools/PoolServiceV310.d.ts +4 -0
  176. package/dist/types/sdk/pools/createPoolService.d.ts +3 -0
  177. package/dist/types/sdk/pools/index.d.ts +2 -1
  178. package/dist/types/sdk/pools/types.d.ts +63 -84
  179. package/dist/types/sdk/utils/AddressMap.d.ts +1 -1
  180. package/dist/types/sdk/utils/viem/sendRawTx.d.ts +1 -5
  181. package/package.json +6 -1
  182. package/dist/cjs/abi/310/iSecuritizeDegenNFT.js +0 -263
  183. package/dist/cjs/abi/310/iSecuritizeKYCFactory.js +0 -278
  184. package/dist/cjs/common-utils/utils/endpoints.js +0 -65
  185. package/dist/cjs/sdk/market/pool/SecuritizeKYCFactory.js +0 -97
  186. package/dist/cjs/sdk/pools/PoolService.js +0 -391
  187. package/dist/esm/abi/310/iSecuritizeDegenNFT.js +0 -239
  188. package/dist/esm/abi/310/iSecuritizeKYCFactory.js +0 -254
  189. package/dist/esm/abi/iStateSerializer.js +0 -12
  190. package/dist/esm/common-utils/utils/endpoints.js +0 -41
  191. package/dist/esm/sdk/market/pool/SecuritizeKYCFactory.js +0 -73
  192. package/dist/esm/sdk/pools/PoolService.js +0 -371
  193. package/dist/types/abi/310/iSecuritizeDegenNFT.d.ts +0 -324
  194. package/dist/types/abi/310/iSecuritizeKYCFactory.d.ts +0 -322
  195. package/dist/types/abi/iStateSerializer.d.ts +0 -11
  196. package/dist/types/common-utils/utils/endpoints.d.ts +0 -27
  197. package/dist/types/sdk/base/token-types.d.ts +0 -33
  198. package/dist/types/sdk/market/ZapperRegister.d.ts +0 -17
  199. package/dist/types/sdk/market/pool/SecuritizeKYCFactory.d.ts +0 -345
  200. package/dist/types/sdk/market/types.d.ts +0 -10
  201. package/dist/types/sdk/pools/PoolService.d.ts +0 -14
  202. /package/dist/cjs/{sdk/market → plugins/zappers}/types.js +0 -0
  203. /package/dist/esm/{sdk/market/types.js → common-utils/charts/credit-manager-payload.js} +0 -0
  204. /package/dist/esm/common-utils/utils/{bigintMath.js → bigint-math.js} +0 -0
  205. /package/dist/esm/common-utils/utils/creditAccount/{calcQuotaBorrowRate.js → calc-quota-borrow-rate.js} +0 -0
  206. /package/dist/esm/common-utils/utils/creditAccount/{calcRelativeBaseBorrowRate.js → calc-relative-base-borrow-rate.js} +0 -0
  207. /package/dist/esm/common-utils/utils/creditAccount/{getTimeToLiquidation.js → get-time-to-liquidation.js} +0 -0
  208. /package/dist/esm/common-utils/utils/creditAccount/{liquidationPrice.js → liquidation-price.js} +0 -0
  209. /package/dist/esm/common-utils/utils/{priceMath.js → price-math.js} +0 -0
  210. /package/dist/types/common-utils/utils/{assetsMath.d.ts → assets-math.d.ts} +0 -0
  211. /package/dist/types/common-utils/utils/{bigintMath.d.ts → bigint-math.d.ts} +0 -0
  212. /package/dist/types/common-utils/utils/creditAccount/{calcHealthFactor.d.ts → calc-health-factor.d.ts} +0 -0
  213. /package/dist/types/common-utils/utils/creditAccount/{calcOverallAPY.d.ts → calc-overall-apy.d.ts} +0 -0
  214. /package/dist/types/common-utils/utils/creditAccount/{calcQuotaBorrowRate.d.ts → calc-quota-borrow-rate.d.ts} +0 -0
  215. /package/dist/types/common-utils/utils/creditAccount/{calcRelativeBaseBorrowRate.d.ts → calc-relative-base-borrow-rate.d.ts} +0 -0
  216. /package/dist/types/common-utils/utils/creditAccount/{getTimeToLiquidation.d.ts → get-time-to-liquidation.d.ts} +0 -0
  217. /package/dist/types/common-utils/utils/creditAccount/{liquidationPrice.d.ts → liquidation-price.d.ts} +0 -0
  218. /package/dist/types/common-utils/utils/creditAccount/{quotaUtils.d.ts → quota-utils.d.ts} +0 -0
  219. /package/dist/types/common-utils/utils/{priceMath.d.ts → price-math.d.ts} +0 -0
@@ -1,278 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var iSecuritizeKYCFactory_exports = {};
20
- __export(iSecuritizeKYCFactory_exports, {
21
- iSecuritizeKYCFactoryAbi: () => iSecuritizeKYCFactoryAbi
22
- });
23
- module.exports = __toCommonJS(iSecuritizeKYCFactory_exports);
24
- const iSecuritizeKYCFactoryAbi = [
25
- {
26
- type: "function",
27
- name: "contractType",
28
- inputs: [],
29
- outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
30
- stateMutability: "view"
31
- },
32
- {
33
- type: "function",
34
- name: "getCreditAccounts",
35
- inputs: [{ name: "investor", type: "address", internalType: "address" }],
36
- outputs: [{ name: "", type: "address[]", internalType: "address[]" }],
37
- stateMutability: "view"
38
- },
39
- {
40
- type: "function",
41
- name: "getDegenNFT",
42
- inputs: [],
43
- outputs: [{ name: "", type: "address", internalType: "address" }],
44
- stateMutability: "view"
45
- },
46
- {
47
- type: "function",
48
- name: "getInvestor",
49
- inputs: [
50
- { name: "creditAccount", type: "address", internalType: "address" }
51
- ],
52
- outputs: [{ name: "", type: "address", internalType: "address" }],
53
- stateMutability: "view"
54
- },
55
- {
56
- type: "function",
57
- name: "getWallet",
58
- inputs: [
59
- { name: "creditAccount", type: "address", internalType: "address" }
60
- ],
61
- outputs: [{ name: "", type: "address", internalType: "address" }],
62
- stateMutability: "view"
63
- },
64
- {
65
- type: "function",
66
- name: "isCreditAccount",
67
- inputs: [
68
- { name: "creditAccount", type: "address", internalType: "address" }
69
- ],
70
- outputs: [{ name: "", type: "bool", internalType: "bool" }],
71
- stateMutability: "view"
72
- },
73
- {
74
- type: "function",
75
- name: "isFrozen",
76
- inputs: [
77
- { name: "creditAccount", type: "address", internalType: "address" }
78
- ],
79
- outputs: [{ name: "", type: "bool", internalType: "bool" }],
80
- stateMutability: "view"
81
- },
82
- {
83
- type: "function",
84
- name: "multicall",
85
- inputs: [
86
- { name: "creditAccount", type: "address", internalType: "address" },
87
- {
88
- name: "calls",
89
- type: "tuple[]",
90
- internalType: "struct MultiCall[]",
91
- components: [
92
- { name: "target", type: "address", internalType: "address" },
93
- { name: "callData", type: "bytes", internalType: "bytes" }
94
- ]
95
- },
96
- {
97
- name: "tokensToRegister",
98
- type: "address[]",
99
- internalType: "address[]"
100
- }
101
- ],
102
- outputs: [],
103
- stateMutability: "nonpayable"
104
- },
105
- {
106
- type: "function",
107
- name: "openCreditAccount",
108
- inputs: [
109
- { name: "creditManager", type: "address", internalType: "address" },
110
- {
111
- name: "calls",
112
- type: "tuple[]",
113
- internalType: "struct MultiCall[]",
114
- components: [
115
- { name: "target", type: "address", internalType: "address" },
116
- { name: "callData", type: "bytes", internalType: "bytes" }
117
- ]
118
- },
119
- {
120
- name: "tokensToRegister",
121
- type: "address[]",
122
- internalType: "address[]"
123
- }
124
- ],
125
- outputs: [
126
- { name: "creditAccount", type: "address", internalType: "address" },
127
- { name: "wallet", type: "address", internalType: "address" }
128
- ],
129
- stateMutability: "nonpayable"
130
- },
131
- {
132
- type: "function",
133
- name: "precomputeWalletAddress",
134
- inputs: [
135
- { name: "creditManager", type: "address", internalType: "address" },
136
- { name: "investor", type: "address", internalType: "address" }
137
- ],
138
- outputs: [{ name: "", type: "address", internalType: "address" }],
139
- stateMutability: "view"
140
- },
141
- {
142
- type: "function",
143
- name: "serialize",
144
- inputs: [],
145
- outputs: [{ name: "serializedData", type: "bytes", internalType: "bytes" }],
146
- stateMutability: "view"
147
- },
148
- {
149
- type: "function",
150
- name: "setFrozenStatus",
151
- inputs: [
152
- { name: "creditAccount", type: "address", internalType: "address" },
153
- { name: "frozen", type: "bool", internalType: "bool" }
154
- ],
155
- outputs: [],
156
- stateMutability: "nonpayable"
157
- },
158
- {
159
- type: "function",
160
- name: "setInvestor",
161
- inputs: [
162
- { name: "creditAccount", type: "address", internalType: "address" },
163
- { name: "investor", type: "address", internalType: "address" }
164
- ],
165
- outputs: [],
166
- stateMutability: "nonpayable"
167
- },
168
- {
169
- type: "function",
170
- name: "version",
171
- inputs: [],
172
- outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
173
- stateMutability: "view"
174
- },
175
- {
176
- type: "event",
177
- name: "CreateWallet",
178
- inputs: [
179
- {
180
- name: "creditAccount",
181
- type: "address",
182
- indexed: true,
183
- internalType: "address"
184
- },
185
- {
186
- name: "wallet",
187
- type: "address",
188
- indexed: true,
189
- internalType: "address"
190
- },
191
- {
192
- name: "investor",
193
- type: "address",
194
- indexed: true,
195
- internalType: "address"
196
- }
197
- ],
198
- anonymous: false
199
- },
200
- {
201
- type: "event",
202
- name: "SetFrozenStatus",
203
- inputs: [
204
- {
205
- name: "creditAccount",
206
- type: "address",
207
- indexed: true,
208
- internalType: "address"
209
- },
210
- { name: "frozen", type: "bool", indexed: false, internalType: "bool" }
211
- ],
212
- anonymous: false
213
- },
214
- {
215
- type: "event",
216
- name: "SetInvestor",
217
- inputs: [
218
- {
219
- name: "creditAccount",
220
- type: "address",
221
- indexed: true,
222
- internalType: "address"
223
- },
224
- {
225
- name: "oldInvestor",
226
- type: "address",
227
- indexed: true,
228
- internalType: "address"
229
- },
230
- {
231
- name: "newInvestor",
232
- type: "address",
233
- indexed: true,
234
- internalType: "address"
235
- }
236
- ],
237
- anonymous: false
238
- },
239
- {
240
- type: "error",
241
- name: "CallerIsNotInvestorException",
242
- inputs: [
243
- { name: "caller", type: "address", internalType: "address" },
244
- { name: "creditAccount", type: "address", internalType: "address" }
245
- ]
246
- },
247
- {
248
- type: "error",
249
- name: "FrozenCreditAccountException",
250
- inputs: [
251
- { name: "creditAccount", type: "address", internalType: "address" }
252
- ]
253
- },
254
- {
255
- type: "error",
256
- name: "InvalidCreditManagerException",
257
- inputs: [
258
- { name: "creditManager", type: "address", internalType: "address" }
259
- ]
260
- },
261
- {
262
- type: "error",
263
- name: "InvalidUnderlyingTokenException",
264
- inputs: [{ name: "underlying", type: "address", internalType: "address" }]
265
- },
266
- {
267
- type: "error",
268
- name: "UnknownCreditAccountException",
269
- inputs: [
270
- { name: "creditAccount", type: "address", internalType: "address" }
271
- ]
272
- },
273
- { type: "error", name: "ZeroAddressException", inputs: [] }
274
- ];
275
- // Annotate the CommonJS export names for ESM import in node:
276
- 0 && (module.exports = {
277
- iSecuritizeKYCFactoryAbi
278
- });
@@ -1,65 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var endpoints_exports = {};
20
- __export(endpoints_exports, {
21
- GearboxBackendApi: () => GearboxBackendApi
22
- });
23
- module.exports = __toCommonJS(endpoints_exports);
24
- var import_sdk = require("../../sdk/index.js");
25
- const CHARTS_BACKEND_ADDRESS = "https://charts-server.fly.dev";
26
- const STATIC_TOKEN = "https://static.gearbox.finance/tokens/";
27
- class GearboxBackendApi {
28
- constructor() {
29
- }
30
- static getChartsUrl = (url, chainId, options = { params: {} }, priceSource) => {
31
- const domain = CHARTS_BACKEND_ADDRESS;
32
- const priceSourceArr = priceSource ? [priceSource] : [];
33
- const isMain = (0, import_sdk.isSupportedNetwork)(chainId);
34
- const relativePath = getRelativeUrl(
35
- url,
36
- isMain ? {
37
- ...options,
38
- params: { ...options.params, chainId }
39
- } : options
40
- );
41
- return [domain, "api", ...priceSourceArr, relativePath].join("/");
42
- };
43
- static getStaticTokenUrl = () => STATIC_TOKEN;
44
- static getRewardsMerkleUrl = (network, root, account) => {
45
- const path = `${network}_${root.slice(2)}/${account.slice(2, 4)}`;
46
- const url = `https://am.gearbox.finance/${path.toLowerCase()}.json`;
47
- return url;
48
- };
49
- static getNFTMerkleUrl = (network, root) => {
50
- const url = `https://dm.gearbox.finance/${network.toLowerCase()}_${root}.json`;
51
- return url;
52
- };
53
- static apyAllRewards = () => getRelativeUrl(
54
- "https://state-cache.gearbox.foundation/apy-server/latest.json"
55
- );
56
- }
57
- const getRelativeUrl = (url, options) => {
58
- const { params = {} } = options || {};
59
- const paramsString = Object.entries(params).map(([key, value]) => `${key}=${value}`).join("&");
60
- return [url, ...paramsString ? [paramsString] : []].join("?");
61
- };
62
- // Annotate the CommonJS export names for ESM import in node:
63
- 0 && (module.exports = {
64
- GearboxBackendApi
65
- });
@@ -1,97 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var SecuritizeKYCFactory_exports = {};
20
- __export(SecuritizeKYCFactory_exports, {
21
- SecuritizeKYCFactory: () => SecuritizeKYCFactory
22
- });
23
- module.exports = __toCommonJS(SecuritizeKYCFactory_exports);
24
- var import_iSecuritizeDegenNFT = require("../../../abi/310/iSecuritizeDegenNFT.js");
25
- var import_iSecuritizeKYCFactory = require("../../../abi/310/iSecuritizeKYCFactory.js");
26
- var import_base = require("../../base/index.js");
27
- var import__ = require("../../index.js");
28
- const abi = import_iSecuritizeKYCFactory.iSecuritizeKYCFactoryAbi;
29
- class SecuritizeKYCFactory extends import_base.BaseContract {
30
- investorCache;
31
- #degenNFT;
32
- constructor(options, address) {
33
- super(options, {
34
- addr: address,
35
- name: "SecuritizeKYCFactory",
36
- abi
37
- });
38
- }
39
- async precomputeWalletAddress(creditManager, investor) {
40
- return this.contract.read.precomputeWalletAddress([
41
- creditManager,
42
- investor
43
- ]);
44
- }
45
- async getWallet(creditAccount) {
46
- return this.contract.read.getWallet([creditAccount]);
47
- }
48
- /**
49
- * Returns the investor address for a credit account.
50
- * @param creditAccount - Credit account address
51
- * @param fromCache - If true, use and update an in-memory cache (creditAccount -> investor). On cache miss, loads from contract and stores the result for future calls.
52
- */
53
- async getInvestor(creditAccount, fromCache) {
54
- if (fromCache && this.investorCache?.has(creditAccount)) {
55
- return this.investorCache.get(creditAccount);
56
- }
57
- const investor = await this.contract.read.getInvestor([creditAccount]);
58
- if (fromCache) {
59
- if (!this.investorCache) {
60
- this.investorCache = new import__.AddressMap();
61
- }
62
- this.investorCache.upsert(creditAccount, investor);
63
- }
64
- return investor;
65
- }
66
- async getDSTokens() {
67
- const degenNFT = await this.getDegenNFT();
68
- const tokens = await this.client.readContract({
69
- address: degenNFT,
70
- abi: import_iSecuritizeDegenNFT.iSecuritizeDegenNFTAbi,
71
- functionName: "getDSTokens"
72
- });
73
- return [...tokens];
74
- }
75
- multicall(creditAccount, calls, tokensToRegister) {
76
- return this.createRawTx({
77
- functionName: "multicall",
78
- args: [creditAccount, calls, tokensToRegister]
79
- });
80
- }
81
- openCreditAccount(creditManager, calls, tokensToRegister) {
82
- return this.createRawTx({
83
- functionName: "openCreditAccount",
84
- args: [creditManager, calls, tokensToRegister]
85
- });
86
- }
87
- async getDegenNFT() {
88
- if (!this.#degenNFT) {
89
- this.#degenNFT = await this.contract.read.getDegenNFT();
90
- }
91
- return this.#degenNFT;
92
- }
93
- }
94
- // Annotate the CommonJS export names for ESM import in node:
95
- 0 && (module.exports = {
96
- SecuritizeKYCFactory
97
- });