@gearbox-protocol/sdk 14.0.0-next.9 → 14.1.0-next.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.
- package/dist/cjs/abi/kyc/iDSRegistryService.js +149 -0
- package/dist/cjs/abi/kyc/iDSToken.js +71 -0
- package/dist/cjs/abi/kyc/iKYCCompressor.js +196 -0
- package/dist/cjs/abi/kyc/iKYCFactory.js +122 -0
- package/dist/cjs/abi/kyc/iKYCUnderlying.js +401 -0
- package/dist/cjs/abi/kyc/iSecuritizeDegenNFT.js +326 -0
- package/dist/cjs/abi/kyc/iSecuritizeKYCFactory.js +319 -0
- package/dist/cjs/dev/AccountOpener.js +45 -5
- package/dist/cjs/rewards/rewards/extra-apy.js +1 -1
- package/dist/cjs/sdk/MultichainSDK.js +5 -0
- package/dist/cjs/sdk/OnchainSDK.js +55 -6
- package/dist/cjs/sdk/accounts/AbstractCreditAccountsService.js +335 -21
- package/dist/cjs/sdk/accounts/CreditAccountsServiceV310.js +7 -1
- package/dist/cjs/sdk/base/TokensMeta.js +22 -42
- package/dist/cjs/sdk/base/token-types.js +9 -0
- package/dist/cjs/sdk/chain/chains.js +18 -1
- package/dist/cjs/sdk/constants/address-provider.js +3 -0
- package/dist/cjs/sdk/market/MarketRegister.js +70 -116
- package/dist/cjs/sdk/market/MarketSuite.js +3 -0
- package/dist/cjs/sdk/market/index.js +2 -0
- package/dist/cjs/sdk/market/kyc/KYCRegistry.js +269 -0
- package/dist/cjs/sdk/market/kyc/index.js +26 -0
- package/dist/cjs/sdk/market/kyc/securitize/SecuritizeKYCFactory.js +242 -0
- package/dist/cjs/sdk/market/kyc/securitize/constants.js +28 -0
- package/dist/cjs/sdk/market/kyc/securitize/index.js +26 -0
- package/dist/cjs/sdk/market/kyc/securitize/types.js +16 -0
- package/dist/cjs/sdk/{accounts/utils.js → market/kyc/types.js} +11 -15
- package/dist/cjs/sdk/market/pool/PoolSuite.js +3 -0
- package/dist/cjs/sdk/market/pool/PoolV310Contract.js +11 -2
- package/dist/cjs/sdk/market/pool/index.js +2 -0
- package/dist/cjs/sdk/market/pricefeeds/PriceFeedsRegister.js +3 -3
- package/dist/cjs/sdk/options.js +6 -0
- package/dist/cjs/sdk/pools/PoolService.js +104 -12
- package/dist/cjs/sdk/utils/viem/executeDelegatedMulticalls.js +38 -0
- package/dist/cjs/sdk/utils/viem/index.js +2 -4
- package/dist/esm/abi/kyc/iDSRegistryService.js +125 -0
- package/dist/esm/abi/kyc/iDSToken.js +47 -0
- package/dist/esm/abi/kyc/iKYCCompressor.js +172 -0
- package/dist/esm/abi/kyc/iKYCFactory.js +98 -0
- package/dist/esm/abi/kyc/iKYCUnderlying.js +377 -0
- package/dist/esm/abi/kyc/iSecuritizeDegenNFT.js +302 -0
- package/dist/esm/abi/kyc/iSecuritizeKYCFactory.js +295 -0
- package/dist/esm/dev/AccountOpener.js +47 -6
- package/dist/esm/rewards/rewards/extra-apy.js +1 -1
- package/dist/esm/sdk/MultichainSDK.js +5 -0
- package/dist/esm/sdk/OnchainSDK.js +58 -7
- package/dist/esm/sdk/accounts/AbstractCreditAccountsService.js +336 -22
- package/dist/esm/sdk/accounts/CreditAccountsServiceV310.js +7 -1
- package/dist/esm/sdk/base/TokensMeta.js +22 -44
- package/dist/esm/sdk/base/token-types.js +6 -0
- package/dist/esm/sdk/chain/chains.js +18 -1
- package/dist/esm/sdk/constants/address-provider.js +2 -0
- package/dist/esm/sdk/market/MarketRegister.js +74 -118
- package/dist/esm/sdk/market/MarketSuite.js +3 -0
- package/dist/esm/sdk/market/index.js +1 -0
- package/dist/esm/sdk/market/kyc/KYCRegistry.js +253 -0
- package/dist/esm/sdk/market/kyc/index.js +3 -0
- package/dist/esm/sdk/market/kyc/securitize/SecuritizeKYCFactory.js +218 -0
- package/dist/esm/sdk/market/kyc/securitize/constants.js +4 -0
- package/dist/esm/sdk/market/kyc/securitize/index.js +3 -0
- package/dist/esm/sdk/market/kyc/securitize/types.js +0 -0
- package/dist/esm/sdk/market/kyc/types.js +9 -0
- package/dist/esm/sdk/market/pool/PoolSuite.js +3 -0
- package/dist/esm/sdk/market/pool/PoolV310Contract.js +11 -2
- package/dist/esm/sdk/market/pool/index.js +1 -0
- package/dist/esm/sdk/market/pricefeeds/PriceFeedsRegister.js +3 -3
- package/dist/esm/sdk/options.js +6 -0
- package/dist/esm/sdk/pools/PoolService.js +109 -13
- package/dist/esm/sdk/utils/viem/executeDelegatedMulticalls.js +14 -0
- package/dist/esm/sdk/utils/viem/index.js +1 -2
- package/dist/types/abi/kyc/iDSRegistryService.d.ts +191 -0
- package/dist/types/abi/kyc/iDSToken.d.ts +67 -0
- package/dist/types/abi/kyc/iKYCCompressor.d.ts +228 -0
- package/dist/types/abi/kyc/iKYCFactory.d.ts +139 -0
- package/dist/types/abi/kyc/iKYCUnderlying.d.ts +548 -0
- package/dist/types/abi/kyc/iSecuritizeDegenNFT.d.ts +404 -0
- package/dist/types/abi/kyc/iSecuritizeKYCFactory.d.ts +376 -0
- package/dist/types/sdk/OnchainSDK.d.ts +19 -1
- package/dist/types/sdk/accounts/AbstractCreditAccountsService.d.ts +59 -6
- package/dist/types/sdk/accounts/CreditAccountsServiceV310.d.ts +1 -1
- package/dist/types/sdk/accounts/types.d.ts +114 -14
- package/dist/types/sdk/base/TokensMeta.d.ts +14 -3
- package/dist/types/sdk/base/token-types.d.ts +44 -4
- package/dist/types/sdk/base/types.d.ts +116 -2
- package/dist/types/sdk/chain/chains.d.ts +5 -1
- package/dist/types/sdk/constants/address-provider.d.ts +1 -0
- package/dist/types/sdk/market/MarketRegister.d.ts +6 -9
- package/dist/types/sdk/market/MarketSuite.d.ts +2 -0
- package/dist/types/sdk/market/index.d.ts +1 -0
- package/dist/types/sdk/market/kyc/KYCRegistry.d.ts +52 -0
- package/dist/types/sdk/market/kyc/index.d.ts +3 -0
- package/dist/types/sdk/market/kyc/securitize/SecuritizeKYCFactory.d.ts +429 -0
- package/dist/types/sdk/market/kyc/securitize/constants.d.ts +1 -0
- package/dist/types/sdk/market/kyc/securitize/index.d.ts +3 -0
- package/dist/types/sdk/market/kyc/securitize/types.d.ts +136 -0
- package/dist/types/sdk/market/kyc/types.d.ts +171 -0
- package/dist/types/sdk/market/oracle/PriceOracleBaseContract.d.ts +3 -2
- package/dist/types/sdk/market/oracle/types.d.ts +3 -10
- package/dist/types/sdk/market/pool/PoolSuite.d.ts +2 -0
- package/dist/types/sdk/market/pool/PoolV310Contract.d.ts +6 -2
- package/dist/types/sdk/market/pool/index.d.ts +1 -0
- package/dist/types/sdk/market/pricefeeds/PriceFeedsRegister.d.ts +1 -1
- package/dist/types/sdk/market/types.d.ts +1 -1
- package/dist/types/sdk/options.d.ts +1 -0
- package/dist/types/sdk/pools/PoolService.d.ts +8 -8
- package/dist/types/sdk/pools/types.d.ts +1 -1
- package/dist/types/sdk/types/state-human.d.ts +2 -0
- package/dist/types/sdk/types/state.d.ts +5 -0
- package/dist/types/sdk/utils/viem/executeDelegatedMulticalls.d.ts +28 -0
- package/dist/types/sdk/utils/viem/index.d.ts +1 -2
- package/package.json +4 -4
- package/dist/cjs/sdk/utils/viem/getLogsPaginated.js +0 -62
- package/dist/cjs/sdk/utils/viem/getLogsSafe.js +0 -87
- package/dist/esm/sdk/accounts/utils.js +0 -14
- package/dist/esm/sdk/utils/viem/getLogsPaginated.js +0 -38
- package/dist/esm/sdk/utils/viem/getLogsSafe.js +0 -65
- package/dist/types/sdk/accounts/utils.d.ts +0 -2
- package/dist/types/sdk/utils/viem/getLogsPaginated.d.ts +0 -12
- package/dist/types/sdk/utils/viem/getLogsSafe.d.ts +0 -3
|
@@ -79,8 +79,10 @@ const chains = {
|
|
|
79
79
|
"0x601067eba24bb5b558a184fc082525637e96a42d": "Gami Labs"
|
|
80
80
|
},
|
|
81
81
|
testMarketConfigurators: {
|
|
82
|
-
"0x99df7330bf42d596af2e9d9836d4fc2077c574aa": "M11 Credit"
|
|
82
|
+
"0x99df7330bf42d596af2e9d9836d4fc2077c574aa": "M11 Credit",
|
|
83
|
+
"0x610627d8d01a413bdd9b0a0b60070da7dd1e54ad": "Securitize"
|
|
83
84
|
},
|
|
85
|
+
kycFactories: [],
|
|
84
86
|
isPublic: true,
|
|
85
87
|
wellKnownToken: {
|
|
86
88
|
address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
|
@@ -98,6 +100,7 @@ const chains = {
|
|
|
98
100
|
defaultMarketConfigurators: {
|
|
99
101
|
"0x01023850b360b88de0d0f84015bbba1eba57fe7e": "Chaos Labs"
|
|
100
102
|
},
|
|
103
|
+
kycFactories: [],
|
|
101
104
|
isPublic: true,
|
|
102
105
|
wellKnownToken: {
|
|
103
106
|
address: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
|
|
@@ -116,6 +119,7 @@ const chains = {
|
|
|
116
119
|
"0x2a15969CE5320868eb609680751cF8896DD92De5": "Chaos Labs",
|
|
117
120
|
"0x9dddd1b9ce0ac8aa0c80e4ec141600b9bf0101c3": "UltraYield"
|
|
118
121
|
},
|
|
122
|
+
kycFactories: [],
|
|
119
123
|
isPublic: true,
|
|
120
124
|
wellKnownToken: {
|
|
121
125
|
address: "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
|
|
@@ -131,6 +135,7 @@ const chains = {
|
|
|
131
135
|
...import_chains.base,
|
|
132
136
|
network: "Base",
|
|
133
137
|
defaultMarketConfigurators: {},
|
|
138
|
+
kycFactories: [],
|
|
134
139
|
isPublic: false,
|
|
135
140
|
wellKnownToken: {
|
|
136
141
|
address: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
|
|
@@ -147,6 +152,7 @@ const chains = {
|
|
|
147
152
|
defaultMarketConfigurators: {
|
|
148
153
|
"0x8FFDd1F1433674516f83645a768E8900A2A5D076": "Chaos Labs"
|
|
149
154
|
},
|
|
155
|
+
kycFactories: [],
|
|
150
156
|
isPublic: true,
|
|
151
157
|
blockExplorers: {
|
|
152
158
|
default: {
|
|
@@ -168,6 +174,7 @@ const chains = {
|
|
|
168
174
|
...import_chains.megaeth,
|
|
169
175
|
network: "MegaETH",
|
|
170
176
|
defaultMarketConfigurators: {},
|
|
177
|
+
kycFactories: [],
|
|
171
178
|
isPublic: false,
|
|
172
179
|
wellKnownToken: {
|
|
173
180
|
address: "0xFAfDdbb3FC7688494971a79cc65DCa3EF82079E7",
|
|
@@ -189,6 +196,7 @@ const chains = {
|
|
|
189
196
|
"0x16956912813ab9a38d95730b52a8cf53e860a7c5": "Tulipa",
|
|
190
197
|
"0x7c6ee1bf9c1eb3ee55bdbdc1e8d0317aab718e0a": "UltraYield"
|
|
191
198
|
},
|
|
199
|
+
kycFactories: [],
|
|
192
200
|
isPublic: true,
|
|
193
201
|
wellKnownToken: {
|
|
194
202
|
address: "0xe7cd86e13AC4309349F30B3435a9d337750fC82D",
|
|
@@ -202,6 +210,7 @@ const chains = {
|
|
|
202
210
|
...import_chains.berachain,
|
|
203
211
|
network: "Berachain",
|
|
204
212
|
defaultMarketConfigurators: {},
|
|
213
|
+
kycFactories: [],
|
|
205
214
|
isPublic: false,
|
|
206
215
|
blockExplorers: {
|
|
207
216
|
default: {
|
|
@@ -223,6 +232,7 @@ const chains = {
|
|
|
223
232
|
...import_chains.avalanche,
|
|
224
233
|
network: "Avalanche",
|
|
225
234
|
defaultMarketConfigurators: {},
|
|
235
|
+
kycFactories: [],
|
|
226
236
|
isPublic: false,
|
|
227
237
|
wellKnownToken: {
|
|
228
238
|
address: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",
|
|
@@ -241,6 +251,7 @@ const chains = {
|
|
|
241
251
|
"0x92dc4ee43e9b207e16fbf3fd1a6933563c0a0d35": "Re7"
|
|
242
252
|
},
|
|
243
253
|
testMarketConfigurators: {},
|
|
254
|
+
kycFactories: [],
|
|
244
255
|
isPublic: true,
|
|
245
256
|
wellKnownToken: {
|
|
246
257
|
address: "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d",
|
|
@@ -255,6 +266,7 @@ const chains = {
|
|
|
255
266
|
...import_chains.worldchain,
|
|
256
267
|
network: "WorldChain",
|
|
257
268
|
defaultMarketConfigurators: {},
|
|
269
|
+
kycFactories: [],
|
|
258
270
|
isPublic: false,
|
|
259
271
|
wellKnownToken: {
|
|
260
272
|
address: "0x79a02482a880bce3f13e09da970dc34db4cd24d1",
|
|
@@ -269,6 +281,7 @@ const chains = {
|
|
|
269
281
|
defaultMarketConfigurators: {
|
|
270
282
|
"0x577424f0e6f50db668cc1bc76babb87e36732291": "Re7"
|
|
271
283
|
},
|
|
284
|
+
kycFactories: [],
|
|
272
285
|
isPublic: true,
|
|
273
286
|
wellKnownToken: {
|
|
274
287
|
address: "0x796Ea11Fa2dD751eD01b53C372fFDB4AAa8f00F9",
|
|
@@ -283,6 +296,7 @@ const chains = {
|
|
|
283
296
|
defaultMarketConfigurators: {
|
|
284
297
|
"0xc9961b8a0c763779690577f2c76962c086af2fe3": "Invariant Group"
|
|
285
298
|
},
|
|
299
|
+
kycFactories: [],
|
|
286
300
|
isPublic: true,
|
|
287
301
|
wellKnownToken: {
|
|
288
302
|
address: "0xad11a8BEb98bbf61dbb1aa0F6d6F2ECD87b35afA",
|
|
@@ -302,6 +316,7 @@ const chains = {
|
|
|
302
316
|
defaultMarketConfigurators: {
|
|
303
317
|
"0x25778dbf0e56b7feb8358c4aa2f6f9e19a1c145a": "Re7"
|
|
304
318
|
},
|
|
319
|
+
kycFactories: [],
|
|
305
320
|
isPublic: true,
|
|
306
321
|
wellKnownToken: {
|
|
307
322
|
address: "0xF242275d3a6527d877f2c927a82D9b057609cc71",
|
|
@@ -318,6 +333,7 @@ const chains = {
|
|
|
318
333
|
"0xce1cf71a28837daaa7b92d00ca4ef2fd649c2a67": "Hyperithm",
|
|
319
334
|
"0x9655f82b585b11cee8a05576ed8efcf755cec04b": "TelosC"
|
|
320
335
|
},
|
|
336
|
+
kycFactories: [],
|
|
321
337
|
isPublic: true,
|
|
322
338
|
wellKnownToken: {
|
|
323
339
|
address: "0x5d72a9d9a9510cd8cbdba12ac62593a58930a948",
|
|
@@ -344,6 +360,7 @@ const chains = {
|
|
|
344
360
|
defaultMarketConfigurators: {
|
|
345
361
|
"0x1ca8b92aa7233a9f8f7ba031ac45c878141adff0": "Invariant Group"
|
|
346
362
|
},
|
|
363
|
+
kycFactories: [],
|
|
347
364
|
isPublic: true,
|
|
348
365
|
wellKnownToken: {
|
|
349
366
|
address: "0x67B302E35Aef5EEE8c32D934F5856869EF428330",
|
|
@@ -36,6 +36,7 @@ __export(address_provider_exports, {
|
|
|
36
36
|
AP_GEAR_TOKEN: () => AP_GEAR_TOKEN,
|
|
37
37
|
AP_INFLATION_ATTACK_BLOCKER: () => AP_INFLATION_ATTACK_BLOCKER,
|
|
38
38
|
AP_INSOLVENCY_CHECKER: () => AP_INSOLVENCY_CHECKER,
|
|
39
|
+
AP_KYC_COMPRESSOR: () => AP_KYC_COMPRESSOR,
|
|
39
40
|
AP_MARKET_COMPRESSOR: () => AP_MARKET_COMPRESSOR,
|
|
40
41
|
AP_MARKET_CONFIGURATOR: () => AP_MARKET_CONFIGURATOR,
|
|
41
42
|
AP_PARTIAL_LIQUIDATION_BOT: () => AP_PARTIAL_LIQUIDATION_BOT,
|
|
@@ -87,6 +88,7 @@ const AP_WETH_GATEWAY = "WETH_GATEWAY";
|
|
|
87
88
|
const AP_WETH_TOKEN = "WETH_TOKEN";
|
|
88
89
|
const AP_ZAPPER_REGISTER = "ZAPPER_REGISTER";
|
|
89
90
|
const AP_ZERO_PRICE_FEED = "ZERO_PRICE_FEED";
|
|
91
|
+
const AP_KYC_COMPRESSOR = "GLOBAL::KYC_COMPRESSOR";
|
|
90
92
|
const ADDRESS_PROVIDER_V310 = "0xF7f0a609BfAb9a0A98786951ef10e5FE26cC1E38";
|
|
91
93
|
// Annotate the CommonJS export names for ESM import in node:
|
|
92
94
|
0 && (module.exports = {
|
|
@@ -108,6 +110,7 @@ const ADDRESS_PROVIDER_V310 = "0xF7f0a609BfAb9a0A98786951ef10e5FE26cC1E38";
|
|
|
108
110
|
AP_GEAR_TOKEN,
|
|
109
111
|
AP_INFLATION_ATTACK_BLOCKER,
|
|
110
112
|
AP_INSOLVENCY_CHECKER,
|
|
113
|
+
AP_KYC_COMPRESSOR,
|
|
111
114
|
AP_MARKET_COMPRESSOR,
|
|
112
115
|
AP_MARKET_CONFIGURATOR,
|
|
113
116
|
AP_PARTIAL_LIQUIDATION_BOT,
|
|
@@ -29,6 +29,9 @@ var import_MarketConfiguratorContract = require("./MarketConfiguratorContract.js
|
|
|
29
29
|
var import_MarketSuite = require("./MarketSuite.js");
|
|
30
30
|
var import_ZapperRegister = require("./ZapperRegister.js");
|
|
31
31
|
class MarketRegister extends import_ZapperRegister.ZapperRegister {
|
|
32
|
+
/**
|
|
33
|
+
* Mapping pool.address -> MarketSuite
|
|
34
|
+
*/
|
|
32
35
|
#markets = new import_utils.AddressMap(void 0, "markets");
|
|
33
36
|
#marketFilter;
|
|
34
37
|
#marketConfigurators = new import_utils.AddressMap(
|
|
@@ -42,9 +45,7 @@ class MarketRegister extends import_ZapperRegister.ZapperRegister {
|
|
|
42
45
|
**/
|
|
43
46
|
constructor(sdk, ignoreMarkets = []) {
|
|
44
47
|
super(sdk);
|
|
45
|
-
this.#ignoreMarkets = new
|
|
46
|
-
ignoreMarkets.map((m) => m.toLowerCase())
|
|
47
|
-
);
|
|
48
|
+
this.#ignoreMarkets = new import_utils.AddressSet(ignoreMarkets);
|
|
48
49
|
}
|
|
49
50
|
/**
|
|
50
51
|
* Restores market state from a previously serialized snapshot,
|
|
@@ -52,40 +53,41 @@ class MarketRegister extends import_ZapperRegister.ZapperRegister {
|
|
|
52
53
|
* @param state - Array of market data snapshots.
|
|
53
54
|
**/
|
|
54
55
|
hydrate(state) {
|
|
55
|
-
this.#markets.clear();
|
|
56
56
|
const configurators = new Set(state.map((m) => m.configurator));
|
|
57
57
|
this.#setMarketFilter([...configurators]);
|
|
58
|
-
|
|
59
|
-
const pool = data.pool.baseParams.addr;
|
|
60
|
-
if (this.#ignoreMarkets.has(pool.toLowerCase())) {
|
|
61
|
-
this.logger?.debug(
|
|
62
|
-
`ignoring market of pool ${pool} (${data.pool.name})`
|
|
63
|
-
);
|
|
64
|
-
continue;
|
|
65
|
-
}
|
|
66
|
-
this.#markets.upsert(
|
|
67
|
-
data.pool.baseParams.addr,
|
|
68
|
-
new import_MarketSuite.MarketSuite(this.sdk, data)
|
|
69
|
-
);
|
|
70
|
-
}
|
|
58
|
+
this.#setMarkets(state);
|
|
71
59
|
}
|
|
72
60
|
/**
|
|
73
|
-
*
|
|
61
|
+
* @internal
|
|
62
|
+
* Returns delegated multicalls for loading all markets from the on-chain
|
|
63
|
+
* market compressor. Used by the SDK to compose batched RPC calls.
|
|
74
64
|
*
|
|
75
|
-
* @param
|
|
76
|
-
* @param ignoreUpdateablePrices - When `true`, skips generating off-chain
|
|
77
|
-
* price updates before loading
|
|
65
|
+
* @param configurators - Addresses of market configurator contracts to query.
|
|
78
66
|
**/
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
67
|
+
getLoadMulticalls(configurators) {
|
|
68
|
+
this.#setMarketFilter(configurators);
|
|
69
|
+
const [marketCompressorAddress] = this.sdk.addressProvider.mustGetLatest(
|
|
70
|
+
import_constants.AP_MARKET_COMPRESSOR,
|
|
71
|
+
import_constants.VERSION_RANGE_310
|
|
72
|
+
);
|
|
73
|
+
return [
|
|
74
|
+
{
|
|
75
|
+
call: {
|
|
76
|
+
abi: import_marketCompressor.marketCompressorAbi,
|
|
77
|
+
address: marketCompressorAddress,
|
|
78
|
+
functionName: "getMarkets",
|
|
79
|
+
args: [this.marketFilter]
|
|
80
|
+
},
|
|
81
|
+
onResult: (resp) => {
|
|
82
|
+
this.#setMarkets(resp);
|
|
83
|
+
this.logger?.info(
|
|
84
|
+
`loaded ${this.#markets.size} markets in block ${this.sdk.currentBlock}`
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
];
|
|
87
89
|
}
|
|
88
|
-
#setMarketFilter(configurators
|
|
90
|
+
#setMarketFilter(configurators) {
|
|
89
91
|
for (const c of configurators) {
|
|
90
92
|
this.#marketConfigurators.upsert(
|
|
91
93
|
c,
|
|
@@ -94,7 +96,7 @@ class MarketRegister extends import_ZapperRegister.ZapperRegister {
|
|
|
94
96
|
}
|
|
95
97
|
this.#marketFilter = {
|
|
96
98
|
configurators,
|
|
97
|
-
pools,
|
|
99
|
+
pools: [],
|
|
98
100
|
underlying: import_constants.ADDRESS_0X0
|
|
99
101
|
};
|
|
100
102
|
}
|
|
@@ -121,106 +123,45 @@ class MarketRegister extends import_ZapperRegister.ZapperRegister {
|
|
|
121
123
|
**/
|
|
122
124
|
async syncState(ignoreUpdateablePrices) {
|
|
123
125
|
const dirty = this.markets.some((m) => m.dirty) || this.marketConfigurators.some((c) => c.dirty);
|
|
126
|
+
let multicalls;
|
|
127
|
+
let txs = [];
|
|
124
128
|
if (dirty) {
|
|
125
129
|
this.logger?.debug(
|
|
126
130
|
"some markets or market configurators are dirty, reloading everything"
|
|
127
131
|
);
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
132
|
+
multicalls = this.getLoadMulticalls([...this.marketFilter.configurators]);
|
|
133
|
+
if (!ignoreUpdateablePrices) {
|
|
134
|
+
const updatables = await this.sdk.priceFeeds.getPartialUpdatablePriceFeeds([
|
|
135
|
+
...this.marketFilter.configurators
|
|
136
|
+
]);
|
|
137
|
+
const updates = await this.sdk.priceFeeds.generatePriceFeedsUpdateTxs(updatables);
|
|
138
|
+
txs = updates.txs;
|
|
139
|
+
}
|
|
133
140
|
} else if (!ignoreUpdateablePrices) {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
import_constants.AP_MARKET_COMPRESSOR,
|
|
141
|
-
import_constants.VERSION_RANGE_310
|
|
142
|
-
);
|
|
143
|
-
let txs = [];
|
|
144
|
-
if (!ignoreUpdateablePrices) {
|
|
145
|
-
const updatables = await this.sdk.priceFeeds.getPartialUpdatablePriceFeeds(
|
|
146
|
-
configurators,
|
|
147
|
-
pools
|
|
148
|
-
);
|
|
149
|
-
const updates = await this.sdk.priceFeeds.generatePriceFeedsUpdateTxs(updatables);
|
|
141
|
+
multicalls = this.#getOracleSyncMulticalls();
|
|
142
|
+
if (!multicalls.length) {
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
this.logger?.debug(`syncing prices on ${multicalls.length} oracles`);
|
|
146
|
+
const updates = await this.sdk.priceFeeds.generatePriceFeedsUpdateTxs();
|
|
150
147
|
txs = updates.txs;
|
|
151
|
-
}
|
|
152
|
-
this.logger?.debug(
|
|
153
|
-
{ configurators, pools },
|
|
154
|
-
`calling getMarkets with ${txs.length} price updates in block ${this.sdk.currentBlock}`
|
|
155
|
-
);
|
|
156
|
-
let markets = [];
|
|
157
|
-
if (txs.length) {
|
|
158
|
-
const [resp] = await (0, import_viem.simulateWithPriceUpdates)(this.client, {
|
|
159
|
-
priceUpdates: txs,
|
|
160
|
-
contracts: [
|
|
161
|
-
{
|
|
162
|
-
abi: import_marketCompressor.marketCompressorAbi,
|
|
163
|
-
address: marketCompressorAddress,
|
|
164
|
-
functionName: "getMarkets",
|
|
165
|
-
args: [this.marketFilter]
|
|
166
|
-
}
|
|
167
|
-
],
|
|
168
|
-
blockNumber: this.sdk.currentBlock,
|
|
169
|
-
gas: this.sdk.gasLimit
|
|
170
|
-
});
|
|
171
|
-
markets = resp;
|
|
172
148
|
} else {
|
|
173
|
-
|
|
174
|
-
abi: import_marketCompressor.marketCompressorAbi,
|
|
175
|
-
address: marketCompressorAddress,
|
|
176
|
-
functionName: "getMarkets",
|
|
177
|
-
args: [this.marketFilter],
|
|
178
|
-
blockNumber: this.sdk.currentBlock,
|
|
179
|
-
// @ts-expect-error
|
|
180
|
-
gas: this.sdk.gasLimit
|
|
181
|
-
});
|
|
182
|
-
}
|
|
183
|
-
for (const data of markets) {
|
|
184
|
-
const pool = data.pool.baseParams.addr;
|
|
185
|
-
if (this.#ignoreMarkets.has(pool.toLowerCase())) {
|
|
186
|
-
this.logger?.debug(
|
|
187
|
-
`ignoring market of pool ${pool} (${data.pool.name})`
|
|
188
|
-
);
|
|
189
|
-
continue;
|
|
190
|
-
}
|
|
191
|
-
this.#markets.upsert(pool, new import_MarketSuite.MarketSuite(this.sdk, data));
|
|
149
|
+
return;
|
|
192
150
|
}
|
|
193
|
-
this.
|
|
194
|
-
|
|
195
|
-
|
|
151
|
+
await (0, import_viem.executeDelegatedMulticalls)(this.client, multicalls, {
|
|
152
|
+
priceUpdates: txs,
|
|
153
|
+
blockNumber: this.sdk.currentBlock,
|
|
154
|
+
gas: this.sdk.gasLimit
|
|
155
|
+
});
|
|
196
156
|
}
|
|
197
|
-
|
|
198
|
-
* Loads new prices and price feeds for given oracles from PriceFeedCompressor, defaults to all oracles
|
|
199
|
-
*/
|
|
200
|
-
async updatePrices(oracles) {
|
|
157
|
+
#getOracleSyncMulticalls(oracles) {
|
|
201
158
|
const uniqOracles = new import_utils.AddressMap();
|
|
202
159
|
for (const m of this.markets) {
|
|
203
160
|
if (!oracles || oracles.includes(m.priceOracle.address)) {
|
|
204
161
|
uniqOracles.upsert(m.priceOracle.address, m.priceOracle);
|
|
205
162
|
}
|
|
206
163
|
}
|
|
207
|
-
|
|
208
|
-
if (!multicalls.length) {
|
|
209
|
-
return;
|
|
210
|
-
}
|
|
211
|
-
this.logger?.debug(`syncing prices on ${multicalls.length} oracles`);
|
|
212
|
-
const { txs } = await this.sdk.priceFeeds.generatePriceFeedsUpdateTxs();
|
|
213
|
-
const oraclesStates = await (0, import_viem.simulateWithPriceUpdates)(this.client, {
|
|
214
|
-
priceUpdates: txs,
|
|
215
|
-
contracts: multicalls.map((mc) => mc.call),
|
|
216
|
-
gas: this.sdk.gasLimit,
|
|
217
|
-
blockNumber: this.sdk.currentBlock
|
|
218
|
-
});
|
|
219
|
-
for (let i = 0; i < multicalls.length; i++) {
|
|
220
|
-
const handler = multicalls[i].onResult;
|
|
221
|
-
const result = oraclesStates[i];
|
|
222
|
-
handler(result);
|
|
223
|
-
}
|
|
164
|
+
return uniqOracles.values().map((o) => o.syncStateMulticall());
|
|
224
165
|
}
|
|
225
166
|
get watchAddresses() {
|
|
226
167
|
return /* @__PURE__ */ new Set([
|
|
@@ -341,6 +282,19 @@ class MarketRegister extends import_ZapperRegister.ZapperRegister {
|
|
|
341
282
|
get markets() {
|
|
342
283
|
return this.#markets.values();
|
|
343
284
|
}
|
|
285
|
+
#setMarkets(markets) {
|
|
286
|
+
this.#markets.clear();
|
|
287
|
+
for (const data of markets) {
|
|
288
|
+
const pool = data.pool.baseParams.addr;
|
|
289
|
+
if (this.#ignoreMarkets.has(pool)) {
|
|
290
|
+
this.logger?.debug(
|
|
291
|
+
`ignoring market of pool ${pool} (${data.pool.name})`
|
|
292
|
+
);
|
|
293
|
+
continue;
|
|
294
|
+
}
|
|
295
|
+
this.#markets.upsert(pool, new import_MarketSuite.MarketSuite(this.sdk, data));
|
|
296
|
+
}
|
|
297
|
+
}
|
|
344
298
|
}
|
|
345
299
|
// Annotate the CommonJS export names for ESM import in node:
|
|
346
300
|
0 && (module.exports = {
|
|
@@ -65,6 +65,9 @@ class MarketSuite extends import_base.SDKConstruct {
|
|
|
65
65
|
get underlying() {
|
|
66
66
|
return this.pool.underlying;
|
|
67
67
|
}
|
|
68
|
+
get kycFactory() {
|
|
69
|
+
return this.pool.kycFactory;
|
|
70
|
+
}
|
|
68
71
|
get dirty() {
|
|
69
72
|
return this.configurator.dirty || this.pool.dirty || this.priceOracle.dirty || this.creditManagers.some((cm) => cm.dirty);
|
|
70
73
|
}
|
|
@@ -17,6 +17,7 @@ var market_exports = {};
|
|
|
17
17
|
module.exports = __toCommonJS(market_exports);
|
|
18
18
|
__reExport(market_exports, require("./adapters/index.js"), module.exports);
|
|
19
19
|
__reExport(market_exports, require("./credit/index.js"), module.exports);
|
|
20
|
+
__reExport(market_exports, require("./kyc/index.js"), module.exports);
|
|
20
21
|
__reExport(market_exports, require("./MarketRegister.js"), module.exports);
|
|
21
22
|
__reExport(market_exports, require("./MarketSuite.js"), module.exports);
|
|
22
23
|
__reExport(market_exports, require("./oracle/index.js"), module.exports);
|
|
@@ -27,6 +28,7 @@ __reExport(market_exports, require("./types.js"), module.exports);
|
|
|
27
28
|
0 && (module.exports = {
|
|
28
29
|
...require("./adapters/index.js"),
|
|
29
30
|
...require("./credit/index.js"),
|
|
31
|
+
...require("./kyc/index.js"),
|
|
30
32
|
...require("./MarketRegister.js"),
|
|
31
33
|
...require("./MarketSuite.js"),
|
|
32
34
|
...require("./oracle/index.js"),
|
|
@@ -0,0 +1,269 @@
|
|
|
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 KYCRegistry_exports = {};
|
|
20
|
+
__export(KYCRegistry_exports, {
|
|
21
|
+
KYCRegistry: () => KYCRegistry
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(KYCRegistry_exports);
|
|
24
|
+
var import_viem = require("viem");
|
|
25
|
+
var import_iKYCCompressor = require("../../../abi/kyc/iKYCCompressor.js");
|
|
26
|
+
var import_base = require("../../base/index.js");
|
|
27
|
+
var import_constants = require("../../constants/index.js");
|
|
28
|
+
var import_utils = require("../../utils/index.js");
|
|
29
|
+
var import_securitize = require("./securitize/index.js");
|
|
30
|
+
class KYCRegistry extends import_base.SDKConstruct {
|
|
31
|
+
#state;
|
|
32
|
+
#factories = new import_utils.AddressMap();
|
|
33
|
+
/**
|
|
34
|
+
* @internal
|
|
35
|
+
*
|
|
36
|
+
* Returns delegated multicalls for loading all KYC underlying tokens from the on-chain KYC compressor.
|
|
37
|
+
* Used by the SDK to compose batched RPC calls.
|
|
38
|
+
*
|
|
39
|
+
* @param configurators - Market configurators to query.
|
|
40
|
+
* @param kycFactories - KYC factory contracts to query.
|
|
41
|
+
*/
|
|
42
|
+
getLoadMulticalls(configurators, kycFactories = []) {
|
|
43
|
+
if (!kycFactories.length) return [];
|
|
44
|
+
const [kycCompressorAddress] = this.sdk.addressProvider.mustGetLatest(
|
|
45
|
+
import_constants.AP_KYC_COMPRESSOR,
|
|
46
|
+
import_constants.VERSION_RANGE_310
|
|
47
|
+
);
|
|
48
|
+
return [
|
|
49
|
+
{
|
|
50
|
+
call: {
|
|
51
|
+
abi: import_iKYCCompressor.iKYCCompressorAbi,
|
|
52
|
+
address: kycCompressorAddress,
|
|
53
|
+
functionName: "getKYCMarketsData",
|
|
54
|
+
args: [configurators, kycFactories]
|
|
55
|
+
},
|
|
56
|
+
onResult: (resp) => this.setState(resp)
|
|
57
|
+
}
|
|
58
|
+
];
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Fetches decoded investor data from the on-chain KYC compressor.
|
|
62
|
+
*
|
|
63
|
+
* Each factory produces its own investor data (e.g. registered tokens,
|
|
64
|
+
* cached signatures, EIP-712 messages to sign).
|
|
65
|
+
*
|
|
66
|
+
* @param investor - Investor EOA address.
|
|
67
|
+
* @param factories_ - Optional subset of factory addresses to query.
|
|
68
|
+
* When omitted, all loaded factories are used.
|
|
69
|
+
*/
|
|
70
|
+
async getInvestorData(investor, factories_) {
|
|
71
|
+
const [kycCompressorAddress] = this.sdk.addressProvider.mustGetLatest(
|
|
72
|
+
import_constants.AP_KYC_COMPRESSOR,
|
|
73
|
+
import_constants.VERSION_RANGE_310
|
|
74
|
+
);
|
|
75
|
+
let factories = this.#factories.values();
|
|
76
|
+
if (factories_?.length) {
|
|
77
|
+
factories = factories_.map((f) => this.#factories.mustGet(f));
|
|
78
|
+
}
|
|
79
|
+
const resp = await this.client.readContract({
|
|
80
|
+
abi: import_iKYCCompressor.iKYCCompressorAbi,
|
|
81
|
+
address: kycCompressorAddress,
|
|
82
|
+
functionName: "getKYCInvestorData",
|
|
83
|
+
args: [investor, factories.map((f) => f.address)]
|
|
84
|
+
});
|
|
85
|
+
const result = [];
|
|
86
|
+
for (let i = 0; i < factories.length; i++) {
|
|
87
|
+
const factory = factories[i];
|
|
88
|
+
const factoryData = resp[i];
|
|
89
|
+
const investorData = factory.decodeInvestorData(factoryData);
|
|
90
|
+
result.push(investorData);
|
|
91
|
+
}
|
|
92
|
+
return result;
|
|
93
|
+
}
|
|
94
|
+
/** All loaded KYC factory instances. */
|
|
95
|
+
get factories() {
|
|
96
|
+
return this.#factories.values();
|
|
97
|
+
}
|
|
98
|
+
/** Raw KYC compressor response, or `undefined` before attach/hydrate. */
|
|
99
|
+
get state() {
|
|
100
|
+
return this.#state;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Returns a human-readable snapshot of the KYC state.
|
|
104
|
+
*/
|
|
105
|
+
stateHuman(raw) {
|
|
106
|
+
return {
|
|
107
|
+
factories: this.factories.map((f) => f.stateHuman(raw))
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* @internal
|
|
112
|
+
*
|
|
113
|
+
* Replaces the internal state with a new KYC compressor response.
|
|
114
|
+
* Rebuilds token metadata for KYC underlyings and re-instantiates factory
|
|
115
|
+
* wrappers.
|
|
116
|
+
*/
|
|
117
|
+
setState(resp) {
|
|
118
|
+
this.#state = resp;
|
|
119
|
+
for (const u of resp?.[0] ?? []) {
|
|
120
|
+
this.#loadUnderlyingTokenData(u);
|
|
121
|
+
}
|
|
122
|
+
this.#factories.clear();
|
|
123
|
+
for (const f of resp?.[1] ?? []) {
|
|
124
|
+
this.#loadKYCFactoryData(f);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
#loadUnderlyingTokenData(u) {
|
|
128
|
+
const contractType = (0, import_utils.bytes32ToString)(u.baseParams.contractType);
|
|
129
|
+
const meta = this.tokensMeta.get(u.baseParams.addr);
|
|
130
|
+
if (!meta) {
|
|
131
|
+
throw new Error(
|
|
132
|
+
`KYC underlying token ${contractType} (${u.baseParams.addr}) not found in tokensMeta`
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
switch (contractType) {
|
|
136
|
+
case import_base.KYC_UNDERLYING_DEFAULT:
|
|
137
|
+
this.#loadKYCUnderlyingDefault(meta, u);
|
|
138
|
+
break;
|
|
139
|
+
case import_base.KYC_UNDERLYING_ON_DEMAND:
|
|
140
|
+
this.#loadKYCUnderlyingOnDemand(meta, u);
|
|
141
|
+
break;
|
|
142
|
+
default:
|
|
143
|
+
if (this.sdk.strictContractTypes) {
|
|
144
|
+
throw new Error(`Unknown KYC underlying type: ${contractType}`);
|
|
145
|
+
}
|
|
146
|
+
this.logger?.warn(`unknown KYC underlying type: ${contractType}`);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
#loadKYCUnderlyingDefault(meta, data) {
|
|
150
|
+
const decoded = (0, import_viem.decodeAbiParameters)(
|
|
151
|
+
[
|
|
152
|
+
{ name: "factory", type: "address" },
|
|
153
|
+
{ name: "asset", type: "address" }
|
|
154
|
+
],
|
|
155
|
+
data.baseParams.serializedParams
|
|
156
|
+
);
|
|
157
|
+
this.tokensMeta.upsert(data.baseParams.addr, {
|
|
158
|
+
...meta,
|
|
159
|
+
contractType: import_base.KYC_UNDERLYING_DEFAULT,
|
|
160
|
+
kycFactory: decoded[0],
|
|
161
|
+
asset: decoded[1]
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
#loadKYCUnderlyingOnDemand(meta, data) {
|
|
165
|
+
const decoded = (0, import_viem.decodeAbiParameters)(
|
|
166
|
+
[
|
|
167
|
+
{ name: "factory", type: "address" },
|
|
168
|
+
{ name: "asset", type: "address" },
|
|
169
|
+
{ name: "pool", type: "address" },
|
|
170
|
+
{ name: "liquidityProvider", type: "address" },
|
|
171
|
+
{ name: "marketConfigurator", type: "address" },
|
|
172
|
+
{ name: "allowedDepositors", type: "address[]" }
|
|
173
|
+
],
|
|
174
|
+
data.baseParams.serializedParams
|
|
175
|
+
);
|
|
176
|
+
const lpMeta = this.#getOnDemandLPMeta(data.extraDetails);
|
|
177
|
+
if (decoded[3] !== lpMeta.addr) {
|
|
178
|
+
throw new Error(
|
|
179
|
+
`Liquidity provider mismatch: ${decoded[3]} !== ${lpMeta.addr} for on-demand underlying ${data.baseParams.addr}`
|
|
180
|
+
);
|
|
181
|
+
}
|
|
182
|
+
this.tokensMeta.upsert(data.baseParams.addr, {
|
|
183
|
+
...meta,
|
|
184
|
+
contractType: import_base.KYC_UNDERLYING_ON_DEMAND,
|
|
185
|
+
kycFactory: decoded[0],
|
|
186
|
+
asset: decoded[1],
|
|
187
|
+
pool: decoded[2],
|
|
188
|
+
marketConfigurator: decoded[4],
|
|
189
|
+
allowedDepositors: decoded[5],
|
|
190
|
+
// liquidityProvider: decoded[3],
|
|
191
|
+
liquidityProvider: lpMeta
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
#getOnDemandLPMeta(extraDetails) {
|
|
195
|
+
const [decoded] = (0, import_viem.decodeAbiParameters)(
|
|
196
|
+
[
|
|
197
|
+
{
|
|
198
|
+
name: "baseParams",
|
|
199
|
+
type: "tuple",
|
|
200
|
+
components: [
|
|
201
|
+
{ name: "addr", type: "address" },
|
|
202
|
+
{ name: "version", type: "uint256" },
|
|
203
|
+
{ name: "contractType", type: "bytes32" },
|
|
204
|
+
{ name: "serializedParams", type: "bytes" }
|
|
205
|
+
]
|
|
206
|
+
}
|
|
207
|
+
],
|
|
208
|
+
extraDetails
|
|
209
|
+
);
|
|
210
|
+
const contractType = (0, import_utils.bytes32ToString)(decoded.contractType);
|
|
211
|
+
switch (contractType) {
|
|
212
|
+
case import_base.KYC_ON_DEMAND_LP_MONOPOLIZED:
|
|
213
|
+
return this.#getOnDemandLPMonopolizedMeta(
|
|
214
|
+
decoded.addr,
|
|
215
|
+
decoded.version,
|
|
216
|
+
decoded.serializedParams
|
|
217
|
+
);
|
|
218
|
+
default:
|
|
219
|
+
throw new Error(`Unknown on-demand LP contract type: ${contractType}`);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
#getOnDemandLPMonopolizedMeta(addr, version, serializedParams) {
|
|
223
|
+
const [marketConfigurator, depositor, pools] = (0, import_viem.decodeAbiParameters)(
|
|
224
|
+
[
|
|
225
|
+
{ name: "marketConfigurator", type: "address" },
|
|
226
|
+
{ name: "depositor", type: "address" },
|
|
227
|
+
{
|
|
228
|
+
name: "pools",
|
|
229
|
+
type: "tuple[]",
|
|
230
|
+
components: [
|
|
231
|
+
{ name: "pool", type: "address" },
|
|
232
|
+
{ name: "wrappedUnderlying", type: "address" },
|
|
233
|
+
{ name: "unwrappedUnderlying", type: "address" },
|
|
234
|
+
{ name: "depositAllowance", type: "uint256" },
|
|
235
|
+
{ name: "claimableAmount", type: "uint256" }
|
|
236
|
+
]
|
|
237
|
+
}
|
|
238
|
+
],
|
|
239
|
+
serializedParams
|
|
240
|
+
);
|
|
241
|
+
return {
|
|
242
|
+
addr,
|
|
243
|
+
version,
|
|
244
|
+
contractType: import_base.KYC_ON_DEMAND_LP_MONOPOLIZED,
|
|
245
|
+
marketConfigurator,
|
|
246
|
+
depositor,
|
|
247
|
+
pools: [...pools]
|
|
248
|
+
};
|
|
249
|
+
}
|
|
250
|
+
#loadKYCFactoryData(data) {
|
|
251
|
+
const contractType = (0, import_utils.bytes32ToString)(data.baseParams.contractType);
|
|
252
|
+
switch (contractType) {
|
|
253
|
+
case import_securitize.KYC_FACTORY_SECURITIZE:
|
|
254
|
+
this.#factories.upsert(
|
|
255
|
+
data.baseParams.addr,
|
|
256
|
+
new import_securitize.SecuritizeKYCFactory(this.sdk, data)
|
|
257
|
+
);
|
|
258
|
+
break;
|
|
259
|
+
default:
|
|
260
|
+
throw new Error(
|
|
261
|
+
`Unknown KYC factory type: ${contractType} for ${data.baseParams.addr}`
|
|
262
|
+
);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
267
|
+
0 && (module.exports = {
|
|
268
|
+
KYCRegistry
|
|
269
|
+
});
|