@gearbox-protocol/sdk 14.7.0 → 14.8.0-next.2

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 (109) hide show
  1. package/dist/cjs/abi/compressors/{kycCompressor.js → rwaCompressor.js} +13 -13
  2. package/dist/cjs/abi/compressors/subcompressors/{kyc/onDemandKYCUnderlyingSubcompressor.js → rwa/onDemandRWAUnderlyingSubcompressor.js} +6 -6
  3. package/dist/cjs/abi/compressors/subcompressors/{kyc/securitizeKYCFactorySubcompressor.js → rwa/securitizeRWAFactorySubcompressor.js} +6 -6
  4. package/dist/cjs/abi/{kyc/iKYCCompressor.js → rwa/iRWACompressor.js} +13 -13
  5. package/dist/cjs/abi/{kyc/iKYCFactory.js → rwa/iRWAFactory.js} +6 -6
  6. package/dist/cjs/abi/{kyc/iKYCUnderlying.js → rwa/iRWAUnderlying.js} +7 -7
  7. package/dist/cjs/abi/{kyc/iSecuritizeKYCFactory.js → rwa/iSecuritizeRWAFactory.js} +7 -7
  8. package/dist/cjs/dev/claimDSToken.js +4 -4
  9. package/dist/cjs/plugins/adapters/abi/index.js +2 -0
  10. package/dist/cjs/plugins/adapters/abi/securitize/index.js +30 -0
  11. package/dist/cjs/sdk/OnchainSDK.js +12 -12
  12. package/dist/cjs/sdk/accounts/CreditAccountsServiceV310.js +59 -59
  13. package/dist/cjs/sdk/base/TokensMeta.js +6 -6
  14. package/dist/cjs/sdk/base/token-types.js +11 -11
  15. package/dist/cjs/sdk/chain/chains.js +16 -16
  16. package/dist/cjs/sdk/constants/address-provider.js +3 -3
  17. package/dist/cjs/sdk/market/MarketSuite.js +2 -2
  18. package/dist/cjs/sdk/market/index.js +2 -2
  19. package/dist/cjs/sdk/market/pool/PoolSuite.js +2 -2
  20. package/dist/cjs/sdk/market/pool/PoolV310Contract.js +3 -3
  21. package/dist/cjs/sdk/market/{kyc/KYCRegistry.js → rwa/RWARegistry.js} +48 -48
  22. package/dist/cjs/sdk/market/{kyc → rwa}/index.js +6 -6
  23. package/dist/cjs/sdk/market/{kyc → rwa}/securitize/SecuritizeDegenNFT.js +1 -1
  24. package/dist/cjs/sdk/market/{kyc/securitize/SecuritizeKYCFactory.js → rwa/securitize/SecuritizeRWAFactory.js} +20 -20
  25. package/dist/cjs/sdk/market/{kyc → rwa}/securitize/constants.js +3 -3
  26. package/dist/cjs/sdk/market/{kyc → rwa}/securitize/index.js +2 -2
  27. package/dist/cjs/sdk/market/{kyc → rwa}/types.js +6 -6
  28. package/dist/cjs/sdk/options.js +4 -4
  29. package/dist/cjs/sdk/pools/PoolService.js +26 -26
  30. package/dist/esm/abi/compressors/{kycCompressor.js → rwaCompressor.js} +9 -9
  31. package/dist/esm/abi/compressors/subcompressors/{kyc/onDemandKYCUnderlyingSubcompressor.js → rwa/onDemandRWAUnderlyingSubcompressor.js} +2 -2
  32. package/dist/esm/abi/compressors/subcompressors/{kyc/securitizeKYCFactorySubcompressor.js → rwa/securitizeRWAFactorySubcompressor.js} +2 -2
  33. package/dist/esm/abi/{kyc/iKYCCompressor.js → rwa/iRWACompressor.js} +9 -9
  34. package/dist/esm/abi/{kyc/iKYCFactory.js → rwa/iRWAFactory.js} +2 -2
  35. package/dist/esm/abi/{kyc/iKYCUnderlying.js → rwa/iRWAUnderlying.js} +3 -3
  36. package/dist/esm/abi/{kyc/iSecuritizeKYCFactory.js → rwa/iSecuritizeRWAFactory.js} +3 -3
  37. package/dist/esm/dev/claimDSToken.js +4 -4
  38. package/dist/esm/plugins/adapters/abi/index.js +1 -0
  39. package/dist/esm/plugins/adapters/abi/securitize/index.js +5 -0
  40. package/dist/esm/sdk/OnchainSDK.js +13 -13
  41. package/dist/esm/sdk/accounts/CreditAccountsServiceV310.js +59 -59
  42. package/dist/esm/sdk/base/TokensMeta.js +6 -6
  43. package/dist/esm/sdk/base/token-types.js +7 -7
  44. package/dist/esm/sdk/chain/chains.js +16 -16
  45. package/dist/esm/sdk/constants/address-provider.js +2 -2
  46. package/dist/esm/sdk/market/MarketSuite.js +2 -2
  47. package/dist/esm/sdk/market/index.js +1 -1
  48. package/dist/esm/sdk/market/pool/PoolSuite.js +2 -2
  49. package/dist/esm/sdk/market/pool/PoolV310Contract.js +3 -3
  50. package/dist/esm/sdk/market/{kyc/KYCRegistry.js → rwa/RWARegistry.js} +50 -50
  51. package/dist/esm/sdk/market/{kyc → rwa}/index.js +1 -1
  52. package/dist/esm/sdk/market/{kyc → rwa}/securitize/SecuritizeDegenNFT.js +1 -1
  53. package/dist/esm/sdk/market/{kyc/securitize/SecuritizeKYCFactory.js → rwa/securitize/SecuritizeRWAFactory.js} +17 -17
  54. package/dist/esm/sdk/market/rwa/securitize/constants.js +4 -0
  55. package/dist/esm/sdk/market/{kyc → rwa}/securitize/index.js +1 -1
  56. package/dist/esm/sdk/market/rwa/types.js +9 -0
  57. package/dist/esm/sdk/options.js +4 -4
  58. package/dist/esm/sdk/pools/PoolService.js +28 -28
  59. package/dist/types/abi/compressors/{kycCompressor.d.ts → rwaCompressor.d.ts} +8 -8
  60. package/dist/types/abi/compressors/subcompressors/{kyc/onDemandKYCUnderlyingSubcompressor.d.ts → rwa/onDemandRWAUnderlyingSubcompressor.d.ts} +1 -1
  61. package/dist/types/abi/compressors/subcompressors/{kyc/securitizeKYCFactorySubcompressor.d.ts → rwa/securitizeRWAFactorySubcompressor.d.ts} +1 -1
  62. package/dist/types/abi/{kyc/iKYCCompressor.d.ts → rwa/iRWACompressor.d.ts} +8 -8
  63. package/dist/types/abi/{kyc/iKYCFactory.d.ts → rwa/iRWAFactory.d.ts} +1 -1
  64. package/dist/types/abi/{kyc/iKYCUnderlying.d.ts → rwa/iRWAUnderlying.d.ts} +2 -2
  65. package/dist/types/abi/{kyc/iSecuritizeKYCFactory.d.ts → rwa/iSecuritizeRWAFactory.d.ts} +2 -2
  66. package/dist/types/dev/claimDSToken.d.ts +1 -1
  67. package/dist/types/plugins/adapters/abi/index.d.ts +1 -0
  68. package/dist/types/plugins/adapters/abi/securitize/index.d.ts +5 -0
  69. package/dist/types/sdk/OnchainSDK.d.ts +5 -5
  70. package/dist/types/sdk/accounts/CreditAccountsServiceV310.d.ts +19 -19
  71. package/dist/types/sdk/accounts/types.d.ts +26 -26
  72. package/dist/types/sdk/base/TokensMeta.d.ts +5 -5
  73. package/dist/types/sdk/base/token-types.d.ts +17 -17
  74. package/dist/types/sdk/base/types.d.ts +2 -2
  75. package/dist/types/sdk/chain/chains.d.ts +2 -2
  76. package/dist/types/sdk/constants/address-provider.d.ts +1 -1
  77. package/dist/types/sdk/market/MarketSuite.d.ts +2 -2
  78. package/dist/types/sdk/market/index.d.ts +1 -1
  79. package/dist/types/sdk/market/pool/PoolSuite.d.ts +2 -2
  80. package/dist/types/sdk/market/pool/PoolV310Contract.d.ts +2 -2
  81. package/dist/types/sdk/market/rwa/RWARegistry.d.ts +52 -0
  82. package/dist/types/sdk/market/{kyc → rwa}/index.d.ts +1 -1
  83. package/dist/types/sdk/market/{kyc/securitize/SecuritizeKYCFactory.d.ts → rwa/securitize/SecuritizeRWAFactory.d.ts} +16 -16
  84. package/dist/types/sdk/market/rwa/securitize/constants.d.ts +1 -0
  85. package/dist/types/sdk/market/{kyc → rwa}/securitize/index.d.ts +1 -1
  86. package/dist/types/sdk/market/{kyc → rwa}/securitize/types.d.ts +12 -12
  87. package/dist/types/sdk/market/{kyc → rwa}/types.d.ts +48 -48
  88. package/dist/types/sdk/market/types.d.ts +1 -1
  89. package/dist/types/sdk/options.d.ts +1 -1
  90. package/dist/types/sdk/pools/types.d.ts +4 -4
  91. package/dist/types/sdk/types/state-human.d.ts +2 -2
  92. package/dist/types/sdk/types/state.d.ts +3 -3
  93. package/package.json +1 -1
  94. package/dist/esm/sdk/market/kyc/securitize/constants.js +0 -4
  95. package/dist/esm/sdk/market/kyc/types.js +0 -9
  96. package/dist/types/sdk/market/kyc/KYCRegistry.d.ts +0 -52
  97. package/dist/types/sdk/market/kyc/securitize/constants.d.ts +0 -1
  98. /package/dist/cjs/abi/{kyc → rwa}/iDSRegistryService.js +0 -0
  99. /package/dist/cjs/abi/{kyc → rwa}/iDSToken.js +0 -0
  100. /package/dist/cjs/abi/{kyc → rwa}/iSecuritizeDegenNFT.js +0 -0
  101. /package/dist/cjs/sdk/market/{kyc → rwa}/securitize/types.js +0 -0
  102. /package/dist/esm/abi/{kyc → rwa}/iDSRegistryService.js +0 -0
  103. /package/dist/esm/abi/{kyc → rwa}/iDSToken.js +0 -0
  104. /package/dist/esm/abi/{kyc → rwa}/iSecuritizeDegenNFT.js +0 -0
  105. /package/dist/esm/sdk/market/{kyc → rwa}/securitize/types.js +0 -0
  106. /package/dist/types/abi/{kyc → rwa}/iDSRegistryService.d.ts +0 -0
  107. /package/dist/types/abi/{kyc → rwa}/iDSToken.d.ts +0 -0
  108. /package/dist/types/abi/{kyc → rwa}/iSecuritizeDegenNFT.d.ts +0 -0
  109. /package/dist/types/sdk/market/{kyc → rwa}/securitize/SecuritizeDegenNFT.d.ts +0 -0
@@ -1,51 +1,51 @@
1
1
  import { decodeAbiParameters } from "viem";
2
- import { iKYCCompressorAbi } from "../../../abi/kyc/iKYCCompressor.js";
2
+ import { iRWACompressorAbi } from "../../../abi/rwa/iRWACompressor.js";
3
3
  import {
4
- KYC_ON_DEMAND_LP_MONOPOLIZED,
5
- KYC_UNDERLYING_DEFAULT,
6
- KYC_UNDERLYING_ON_DEMAND,
4
+ RWA_ON_DEMAND_LP_MONOPOLIZED,
5
+ RWA_UNDERLYING_DEFAULT,
6
+ RWA_UNDERLYING_ON_DEMAND,
7
7
  SDKConstruct
8
8
  } from "../../base/index.js";
9
- import { AP_KYC_COMPRESSOR, VERSION_RANGE_310 } from "../../constants/index.js";
9
+ import { AP_RWA_COMPRESSOR, VERSION_RANGE_310 } from "../../constants/index.js";
10
10
  import { AddressMap, bytes32ToString } from "../../utils/index.js";
11
11
  import {
12
- KYC_FACTORY_SECURITIZE,
13
- SecuritizeKYCFactory
12
+ RWA_FACTORY_SECURITIZE,
13
+ SecuritizeRWAFactory
14
14
  } from "./securitize/index.js";
15
- class KYCRegistry extends SDKConstruct {
15
+ class RWARegistry extends SDKConstruct {
16
16
  #state;
17
17
  #factories = new AddressMap();
18
18
  /**
19
19
  * @internal
20
20
  *
21
- * Returns delegated multicalls for loading all KYC underlying tokens from the on-chain KYC compressor.
21
+ * Returns delegated multicalls for loading all RWA underlying tokens from the on-chain RWA compressor.
22
22
  * Used by the SDK to compose batched RPC calls.
23
23
  *
24
24
  * @param configurators - Market configurators to query.
25
- * @param kycFactories - KYC factory contracts to query.
25
+ * @param rwaFactories - RWA factory contracts to query.
26
26
  */
27
- getLoadMulticalls(configurators, kycFactories = []) {
28
- if (!kycFactories.length) {
27
+ getLoadMulticalls(configurators, rwaFactories = []) {
28
+ if (!rwaFactories.length) {
29
29
  return [];
30
30
  }
31
- const [kycCompressorAddress] = this.sdk.addressProvider.mustGetLatest(
32
- AP_KYC_COMPRESSOR,
31
+ const [rwaCompressorAddress] = this.sdk.addressProvider.mustGetLatest(
32
+ AP_RWA_COMPRESSOR,
33
33
  VERSION_RANGE_310
34
34
  );
35
35
  return [
36
36
  {
37
37
  call: {
38
- abi: iKYCCompressorAbi,
39
- address: kycCompressorAddress,
40
- functionName: "getKYCMarketsData",
41
- args: [configurators, kycFactories]
38
+ abi: iRWACompressorAbi,
39
+ address: rwaCompressorAddress,
40
+ functionName: "getRWAMarketsData",
41
+ args: [configurators, rwaFactories]
42
42
  },
43
43
  onResult: (resp) => this.setState(resp)
44
44
  }
45
45
  ];
46
46
  }
47
47
  /**
48
- * Fetches decoded investor data from the on-chain KYC compressor.
48
+ * Fetches decoded investor data from the on-chain RWA compressor.
49
49
  *
50
50
  * Each factory produces its own investor data (e.g. registered tokens,
51
51
  * cached signatures, EIP-712 messages to sign).
@@ -62,14 +62,14 @@ class KYCRegistry extends SDKConstruct {
62
62
  if (!factories.length) {
63
63
  return [];
64
64
  }
65
- const [kycCompressorAddress] = this.sdk.addressProvider.mustGetLatest(
66
- AP_KYC_COMPRESSOR,
65
+ const [rwaCompressorAddress] = this.sdk.addressProvider.mustGetLatest(
66
+ AP_RWA_COMPRESSOR,
67
67
  VERSION_RANGE_310
68
68
  );
69
69
  const resp = await this.client.readContract({
70
- abi: iKYCCompressorAbi,
71
- address: kycCompressorAddress,
72
- functionName: "getKYCInvestorData",
70
+ abi: iRWACompressorAbi,
71
+ address: rwaCompressorAddress,
72
+ functionName: "getRWAInvestorData",
73
73
  args: [investor, factories.map((f) => f.address)]
74
74
  });
75
75
  const result = [];
@@ -81,16 +81,16 @@ class KYCRegistry extends SDKConstruct {
81
81
  }
82
82
  return result;
83
83
  }
84
- /** All loaded KYC factory instances. */
84
+ /** All loaded RWA factory instances. */
85
85
  get factories() {
86
86
  return this.#factories.values();
87
87
  }
88
- /** Raw KYC compressor response, or `undefined` before attach/hydrate. */
88
+ /** Raw RWA compressor response, or `undefined` before attach/hydrate. */
89
89
  get state() {
90
90
  return this.#state;
91
91
  }
92
92
  /**
93
- * Returns a human-readable snapshot of the KYC state.
93
+ * Returns a human-readable snapshot of the RWA state.
94
94
  */
95
95
  stateHuman(raw) {
96
96
  return {
@@ -100,8 +100,8 @@ class KYCRegistry extends SDKConstruct {
100
100
  /**
101
101
  * @internal
102
102
  *
103
- * Replaces the internal state with a new KYC compressor response.
104
- * Rebuilds token metadata for KYC underlyings and re-instantiates factory
103
+ * Replaces the internal state with a new RWA compressor response.
104
+ * Rebuilds token metadata for RWA underlyings and re-instantiates factory
105
105
  * wrappers.
106
106
  */
107
107
  setState(resp) {
@@ -111,7 +111,7 @@ class KYCRegistry extends SDKConstruct {
111
111
  }
112
112
  this.#factories.clear();
113
113
  for (const f of resp?.[1] ?? []) {
114
- this.#loadKYCFactoryData(f);
114
+ this.#loadRWAFactoryData(f);
115
115
  }
116
116
  }
117
117
  #loadUnderlyingTokenData(u) {
@@ -119,24 +119,24 @@ class KYCRegistry extends SDKConstruct {
119
119
  const meta = this.tokensMeta.get(u.baseParams.addr);
120
120
  if (!meta) {
121
121
  throw new Error(
122
- `KYC underlying token ${contractType} (${u.baseParams.addr}) not found in tokensMeta`
122
+ `RWA underlying token ${contractType} (${u.baseParams.addr}) not found in tokensMeta`
123
123
  );
124
124
  }
125
125
  switch (contractType) {
126
- case KYC_UNDERLYING_DEFAULT:
127
- this.#loadKYCUnderlyingDefault(meta, u);
126
+ case RWA_UNDERLYING_DEFAULT:
127
+ this.#loadRWAUnderlyingDefault(meta, u);
128
128
  break;
129
- case KYC_UNDERLYING_ON_DEMAND:
130
- this.#loadKYCUnderlyingOnDemand(meta, u);
129
+ case RWA_UNDERLYING_ON_DEMAND:
130
+ this.#loadRWAUnderlyingOnDemand(meta, u);
131
131
  break;
132
132
  default:
133
133
  if (this.sdk.strictContractTypes) {
134
- throw new Error(`Unknown KYC underlying type: ${contractType}`);
134
+ throw new Error(`Unknown RWA underlying type: ${contractType}`);
135
135
  }
136
- this.logger?.warn(`unknown KYC underlying type: ${contractType}`);
136
+ this.logger?.warn(`unknown RWA underlying type: ${contractType}`);
137
137
  }
138
138
  }
139
- #loadKYCUnderlyingDefault(meta, data) {
139
+ #loadRWAUnderlyingDefault(meta, data) {
140
140
  const decoded = decodeAbiParameters(
141
141
  [
142
142
  { name: "factory", type: "address" },
@@ -146,12 +146,12 @@ class KYCRegistry extends SDKConstruct {
146
146
  );
147
147
  this.tokensMeta.upsert(data.baseParams.addr, {
148
148
  ...meta,
149
- contractType: KYC_UNDERLYING_DEFAULT,
150
- kycFactory: decoded[0],
149
+ contractType: RWA_UNDERLYING_DEFAULT,
150
+ rwaFactory: decoded[0],
151
151
  asset: decoded[1]
152
152
  });
153
153
  }
154
- #loadKYCUnderlyingOnDemand(meta, data) {
154
+ #loadRWAUnderlyingOnDemand(meta, data) {
155
155
  const decoded = decodeAbiParameters(
156
156
  [
157
157
  { name: "factory", type: "address" },
@@ -171,8 +171,8 @@ class KYCRegistry extends SDKConstruct {
171
171
  }
172
172
  this.tokensMeta.upsert(data.baseParams.addr, {
173
173
  ...meta,
174
- contractType: KYC_UNDERLYING_ON_DEMAND,
175
- kycFactory: decoded[0],
174
+ contractType: RWA_UNDERLYING_ON_DEMAND,
175
+ rwaFactory: decoded[0],
176
176
  asset: decoded[1],
177
177
  pool: decoded[2],
178
178
  marketConfigurator: decoded[4],
@@ -199,7 +199,7 @@ class KYCRegistry extends SDKConstruct {
199
199
  );
200
200
  const contractType = bytes32ToString(decoded.contractType);
201
201
  switch (contractType) {
202
- case KYC_ON_DEMAND_LP_MONOPOLIZED:
202
+ case RWA_ON_DEMAND_LP_MONOPOLIZED:
203
203
  return this.#getOnDemandLPMonopolizedMeta(
204
204
  decoded.addr,
205
205
  decoded.version,
@@ -231,28 +231,28 @@ class KYCRegistry extends SDKConstruct {
231
231
  return {
232
232
  addr,
233
233
  version,
234
- contractType: KYC_ON_DEMAND_LP_MONOPOLIZED,
234
+ contractType: RWA_ON_DEMAND_LP_MONOPOLIZED,
235
235
  marketConfigurator,
236
236
  depositor,
237
237
  pools: [...pools]
238
238
  };
239
239
  }
240
- #loadKYCFactoryData(data) {
240
+ #loadRWAFactoryData(data) {
241
241
  const contractType = bytes32ToString(data.baseParams.contractType);
242
242
  switch (contractType) {
243
- case KYC_FACTORY_SECURITIZE:
243
+ case RWA_FACTORY_SECURITIZE:
244
244
  this.#factories.upsert(
245
245
  data.baseParams.addr,
246
- new SecuritizeKYCFactory(this.sdk, data)
246
+ new SecuritizeRWAFactory(this.sdk, data)
247
247
  );
248
248
  break;
249
249
  default:
250
250
  throw new Error(
251
- `Unknown KYC factory type: ${contractType} for ${data.baseParams.addr}`
251
+ `Unknown RWA factory type: ${contractType} for ${data.baseParams.addr}`
252
252
  );
253
253
  }
254
254
  }
255
255
  }
256
256
  export {
257
- KYCRegistry
257
+ RWARegistry
258
258
  };
@@ -1,3 +1,3 @@
1
- export * from "./KYCRegistry.js";
1
+ export * from "./RWARegistry.js";
2
2
  export * from "./securitize/index.js";
3
3
  export * from "./types.js";
@@ -1,4 +1,4 @@
1
- import { iSecuritizeDegenNFTAbi } from "../../../../abi/kyc/iSecuritizeDegenNFT.js";
1
+ import { iSecuritizeDegenNFTAbi } from "../../../../abi/rwa/iSecuritizeDegenNFT.js";
2
2
  import { BaseContract } from "../../../base/index.js";
3
3
  const abi = iSecuritizeDegenNFTAbi;
4
4
  class SecuritizeDegenNFT extends BaseContract {
@@ -1,24 +1,24 @@
1
1
  import { decodeAbiParameters } from "viem";
2
- import { iSecuritizeKYCFactoryAbi } from "../../../../abi/kyc/iSecuritizeKYCFactory.js";
2
+ import { iSecuritizeRWAFactoryAbi } from "../../../../abi/rwa/iSecuritizeRWAFactory.js";
3
3
  import { BaseContract } from "../../../base/index.js";
4
4
  import { AddressMap, AddressSet } from "../../../utils/index.js";
5
- import { KYC_FACTORY_SECURITIZE } from "./constants.js";
5
+ import { RWA_FACTORY_SECURITIZE } from "./constants.js";
6
6
  import { SecuritizeDegenNFT } from "./SecuritizeDegenNFT.js";
7
7
  import {
8
8
  SECURITIZE_REGISTER_VAULT_TYPES
9
9
  } from "./types.js";
10
- const abi = iSecuritizeKYCFactoryAbi;
11
- class SecuritizeKYCFactory extends BaseContract {
10
+ const abi = iSecuritizeRWAFactoryAbi;
11
+ class SecuritizeRWAFactory extends BaseContract {
12
12
  #sdk;
13
13
  #investorCache = new AddressMap();
14
14
  degenNFT;
15
15
  owner;
16
16
  dsTokens;
17
- contractType = KYC_FACTORY_SECURITIZE;
17
+ contractType = RWA_FACTORY_SECURITIZE;
18
18
  constructor(sdk, data) {
19
19
  super(sdk, {
20
20
  ...data.baseParams,
21
- name: "SecuritizeKYCFactory",
21
+ name: "SecuritizeRWAFactory",
22
22
  abi
23
23
  });
24
24
  this.#sdk = sdk;
@@ -50,7 +50,7 @@ class SecuritizeKYCFactory extends BaseContract {
50
50
  }));
51
51
  }
52
52
  /**
53
- * {@inheritDoc IKYCFactory.decodeInvestorData}
53
+ * {@inheritDoc IRWAFactory.decodeInvestorData}
54
54
  */
55
55
  decodeInvestorData(data) {
56
56
  const { creditAccounts, extraDetails } = data;
@@ -71,7 +71,7 @@ class SecuritizeKYCFactory extends BaseContract {
71
71
  extraDetails
72
72
  );
73
73
  return {
74
- type: KYC_FACTORY_SECURITIZE,
74
+ type: RWA_FACTORY_SECURITIZE,
75
75
  factory: this.address,
76
76
  cachedSignatures: [...cachedSignatures],
77
77
  registerVaultMessages: registerVaultMessages.map((m) => ({
@@ -105,7 +105,7 @@ class SecuritizeKYCFactory extends BaseContract {
105
105
  };
106
106
  }
107
107
  /**
108
- * {@inheritDoc IKYCFactory.getInvestor}
108
+ * {@inheritDoc IRWAFactory.getInvestor}
109
109
  */
110
110
  async getInvestor(creditAccount, fromCache) {
111
111
  if (fromCache && this.#investorCache.has(creditAccount)) {
@@ -118,7 +118,7 @@ class SecuritizeKYCFactory extends BaseContract {
118
118
  return investor;
119
119
  }
120
120
  /**
121
- * {@inheritDoc IKYCFactory.getApprovalAddress}
121
+ * {@inheritDoc IRWAFactory.getApprovalAddress}
122
122
  */
123
123
  async getApprovalAddress(options) {
124
124
  if ("creditAccount" in options) {
@@ -130,13 +130,13 @@ class SecuritizeKYCFactory extends BaseContract {
130
130
  );
131
131
  }
132
132
  /**
133
- * {@inheritDoc IKYCFactory.getWallet}
133
+ * {@inheritDoc IRWAFactory.getWallet}
134
134
  */
135
135
  async getWallet(creditAccount) {
136
136
  return this.contract.read.getWallet([creditAccount]);
137
137
  }
138
138
  /**
139
- * {@inheritDoc IKYCFactory.multicall}
139
+ * {@inheritDoc IRWAFactory.multicall}
140
140
  */
141
141
  multicall(creditAccount, calls, options) {
142
142
  const { tokensToRegister = [], signaturesToCache = [] } = options ?? {};
@@ -146,10 +146,10 @@ class SecuritizeKYCFactory extends BaseContract {
146
146
  });
147
147
  }
148
148
  /**
149
- * {@inheritDoc IKYCFactory.getOpenAccountRequirements}
149
+ * {@inheritDoc IRWAFactory.getOpenAccountRequirements}
150
150
  */
151
151
  async getOpenAccountRequirements(investor, props) {
152
- const [investorData] = await this.#sdk.kyc.getInvestorData(investor, [
152
+ const [investorData] = await this.#sdk.rwa.getInvestorData(investor, [
153
153
  this.address
154
154
  ]);
155
155
  const tokensToRegister = new AddressSet([props.tokenOutAddress]);
@@ -163,14 +163,14 @@ class SecuritizeKYCFactory extends BaseContract {
163
163
  (m) => unsignedTokens.has(m.message.token)
164
164
  );
165
165
  return {
166
- type: KYC_FACTORY_SECURITIZE,
166
+ type: RWA_FACTORY_SECURITIZE,
167
167
  securitizeTokensToRegister: Array.from(securitizeTokensToRegister),
168
168
  tokensToRegister: Array.from(tokensToRegister),
169
169
  requiredSignatures
170
170
  };
171
171
  }
172
172
  /**
173
- * {@inheritDoc IKYCFactory.openCreditAccount}
173
+ * {@inheritDoc IRWAFactory.openCreditAccount}
174
174
  */
175
175
  openCreditAccount(creditManager, calls, options) {
176
176
  const { tokensToRegister = [], signaturesToCache = [] } = options ?? {};
@@ -234,5 +234,5 @@ const registerVaultMessageTuple = [
234
234
  { name: "deadline", type: "uint256" }
235
235
  ];
236
236
  export {
237
- SecuritizeKYCFactory
237
+ SecuritizeRWAFactory
238
238
  };
@@ -0,0 +1,4 @@
1
+ const RWA_FACTORY_SECURITIZE = "RWA_FACTORY::SECURITIZE";
2
+ export {
3
+ RWA_FACTORY_SECURITIZE
4
+ };
@@ -1,3 +1,3 @@
1
1
  export * from "./constants.js";
2
- export * from "./SecuritizeKYCFactory.js";
2
+ export * from "./SecuritizeRWAFactory.js";
3
3
  export * from "./types.js";
@@ -0,0 +1,9 @@
1
+ import { RWA_FACTORY_SECURITIZE } from "./securitize/index.js";
2
+ const RWA_FACTORY_TYPES = [RWA_FACTORY_SECURITIZE];
3
+ function isRWAFactory(factory, type) {
4
+ return factory.contractType === type;
5
+ }
6
+ export {
7
+ RWA_FACTORY_TYPES,
8
+ isRWAFactory
9
+ };
@@ -24,11 +24,11 @@ const AttachOptionsSchema = z.object({
24
24
  /** Addresses of market configurator contracts to load. */
25
25
  marketConfigurators: z.array(ZodAddress()).optional(),
26
26
  /**
27
- * Addresses of KYC factory contracts to load.
28
- * If not set, all default KYC factories for the chain are loaded
29
- * (from {@link GearboxChain.kycFactories})
27
+ * Addresses of RWA factory contracts to load.
28
+ * If not set, all default RWA factories for the chain are loaded
29
+ * (from {@link GearboxChain.rwaFactories})
30
30
  **/
31
- kycFactories: z.array(ZodAddress()).optional(),
31
+ rwaFactories: z.array(ZodAddress()).optional(),
32
32
  /** Pin SDK to a specific block number during attach. */
33
33
  blockNumber: z.union([z.bigint().nonnegative(), z.number().int().nonnegative()]).optional(),
34
34
  /** Skip fetching updatable price feeds on attach and sync. */
@@ -4,8 +4,8 @@ import { ierc20ZapperDepositsAbi } from "../../abi/iERC20ZapperDeposits.js";
4
4
  import { iethZapperDepositsAbi } from "../../abi/iETHZapperDeposits.js";
5
5
  import { iZapperAbi } from "../../abi/iZapper.js";
6
6
  import {
7
- KYC_UNDERLYING_DEFAULT,
8
- KYC_UNDERLYING_ON_DEMAND,
7
+ RWA_UNDERLYING_DEFAULT,
8
+ RWA_UNDERLYING_ON_DEMAND,
9
9
  SDKConstruct
10
10
  } from "../base/index.js";
11
11
  import { NATIVE_ADDRESS } from "../constants/index.js";
@@ -16,11 +16,11 @@ class PoolService extends SDKConstruct {
16
16
  */
17
17
  getDepositTokensIn(pool) {
18
18
  const underlying = this.#describeUnderlying(pool);
19
- if (this.sdk.tokensMeta.isKYCUnderlying(underlying)) {
19
+ if (this.sdk.tokensMeta.isRWAUnderlying(underlying)) {
20
20
  switch (underlying.contractType) {
21
- case KYC_UNDERLYING_DEFAULT:
21
+ case RWA_UNDERLYING_DEFAULT:
22
22
  return this.#depositTokensIn(pool, false);
23
- case KYC_UNDERLYING_ON_DEMAND:
23
+ case RWA_UNDERLYING_ON_DEMAND:
24
24
  return [underlying.asset];
25
25
  }
26
26
  }
@@ -31,11 +31,11 @@ class PoolService extends SDKConstruct {
31
31
  */
32
32
  getDepositTokensOut(pool, tokenIn) {
33
33
  const underlying = this.#describeUnderlying(pool);
34
- if (this.sdk.tokensMeta.isKYCUnderlying(underlying)) {
34
+ if (this.sdk.tokensMeta.isRWAUnderlying(underlying)) {
35
35
  switch (underlying.contractType) {
36
- case KYC_UNDERLYING_DEFAULT:
36
+ case RWA_UNDERLYING_DEFAULT:
37
37
  return this.#depositTokensOut(pool, tokenIn, false);
38
- case KYC_UNDERLYING_ON_DEMAND:
38
+ case RWA_UNDERLYING_ON_DEMAND:
39
39
  return [];
40
40
  }
41
41
  }
@@ -46,23 +46,23 @@ class PoolService extends SDKConstruct {
46
46
  */
47
47
  getDepositMetadata(pool, tokenIn, tokenOut) {
48
48
  const underlying = this.#describeUnderlying(pool);
49
- if (this.sdk.tokensMeta.isKYCUnderlying(underlying)) {
49
+ if (this.sdk.tokensMeta.isRWAUnderlying(underlying)) {
50
50
  switch (underlying.contractType) {
51
- case KYC_UNDERLYING_DEFAULT: {
51
+ case RWA_UNDERLYING_DEFAULT: {
52
52
  return this.#depositMetadata(
53
- "kyc-default",
53
+ "rwa-default",
54
54
  pool,
55
55
  tokenIn,
56
56
  tokenOut,
57
57
  false
58
58
  );
59
59
  }
60
- case KYC_UNDERLYING_ON_DEMAND:
60
+ case RWA_UNDERLYING_ON_DEMAND:
61
61
  return {
62
62
  zapper: void 0,
63
63
  approveTarget: underlying.liquidityProvider.addr,
64
64
  permissible: false,
65
- type: "kyc-on-demand"
65
+ type: "rwa-on-demand"
66
66
  };
67
67
  }
68
68
  }
@@ -74,8 +74,8 @@ class PoolService extends SDKConstruct {
74
74
  addLiquidity(props) {
75
75
  const { collateral, meta, permit, referralCode, pool, wallet } = props;
76
76
  const underlying = this.#describeUnderlying(pool);
77
- if (this.sdk.tokensMeta.isKYCUnderlying(underlying)) {
78
- if (underlying.contractType === KYC_UNDERLYING_ON_DEMAND) {
77
+ if (this.sdk.tokensMeta.isRWAUnderlying(underlying)) {
78
+ if (underlying.contractType === RWA_UNDERLYING_ON_DEMAND) {
79
79
  return void 0;
80
80
  }
81
81
  }
@@ -122,11 +122,11 @@ class PoolService extends SDKConstruct {
122
122
  */
123
123
  getWithdrawalTokensIn(pool) {
124
124
  const underlying = this.#describeUnderlying(pool);
125
- if (this.sdk.tokensMeta.isKYCUnderlying(underlying)) {
125
+ if (this.sdk.tokensMeta.isRWAUnderlying(underlying)) {
126
126
  switch (underlying.contractType) {
127
- case KYC_UNDERLYING_DEFAULT:
127
+ case RWA_UNDERLYING_DEFAULT:
128
128
  return this.#withdrawalTokensIn(pool, false);
129
- case KYC_UNDERLYING_ON_DEMAND:
129
+ case RWA_UNDERLYING_ON_DEMAND:
130
130
  return [];
131
131
  }
132
132
  }
@@ -137,11 +137,11 @@ class PoolService extends SDKConstruct {
137
137
  */
138
138
  getWithdrawalTokensOut(pool, tokenIn) {
139
139
  const underlying = this.#describeUnderlying(pool);
140
- if (this.sdk.tokensMeta.isKYCUnderlying(underlying)) {
140
+ if (this.sdk.tokensMeta.isRWAUnderlying(underlying)) {
141
141
  switch (underlying.contractType) {
142
- case KYC_UNDERLYING_DEFAULT:
142
+ case RWA_UNDERLYING_DEFAULT:
143
143
  return this.#withdrawalTokensOut(pool, tokenIn, false);
144
- case KYC_UNDERLYING_ON_DEMAND:
144
+ case RWA_UNDERLYING_ON_DEMAND:
145
145
  return [underlying.asset];
146
146
  }
147
147
  }
@@ -153,8 +153,8 @@ class PoolService extends SDKConstruct {
153
153
  removeLiquidity(props) {
154
154
  const { pool, amount, meta, wallet, permit } = props;
155
155
  const underlying = this.#describeUnderlying(pool);
156
- if (this.sdk.tokensMeta.isKYCUnderlying(underlying)) {
157
- if (underlying.contractType === KYC_UNDERLYING_ON_DEMAND) {
156
+ if (this.sdk.tokensMeta.isRWAUnderlying(underlying)) {
157
+ if (underlying.contractType === RWA_UNDERLYING_ON_DEMAND) {
158
158
  return {
159
159
  abi: ierc20Abi,
160
160
  functionName: "approve",
@@ -195,23 +195,23 @@ class PoolService extends SDKConstruct {
195
195
  */
196
196
  getWithdrawalMetadata(pool, tokenIn, tokenOut) {
197
197
  const underlying = this.#describeUnderlying(pool);
198
- if (this.sdk.tokensMeta.isKYCUnderlying(underlying)) {
198
+ if (this.sdk.tokensMeta.isRWAUnderlying(underlying)) {
199
199
  switch (underlying.contractType) {
200
- case KYC_UNDERLYING_DEFAULT: {
200
+ case RWA_UNDERLYING_DEFAULT: {
201
201
  return this.#withdrawalMetadata(
202
- "kyc-default",
202
+ "rwa-default",
203
203
  pool,
204
204
  tokenIn,
205
205
  tokenOut,
206
206
  false
207
207
  );
208
208
  }
209
- case KYC_UNDERLYING_ON_DEMAND:
209
+ case RWA_UNDERLYING_ON_DEMAND:
210
210
  return {
211
211
  zapper: void 0,
212
212
  approveTarget: void 0,
213
213
  permissible: false,
214
- type: "kyc-on-demand"
214
+ type: "rwa-on-demand"
215
215
  };
216
216
  }
217
217
  }
@@ -1,4 +1,4 @@
1
- export declare const kycCompressorAbi: readonly [{
1
+ export declare const rwaCompressorAbi: readonly [{
2
2
  readonly type: "constructor";
3
3
  readonly inputs: readonly [{
4
4
  readonly name: "addressProvider";
@@ -18,7 +18,7 @@ export declare const kycCompressorAbi: readonly [{
18
18
  readonly stateMutability: "view";
19
19
  }, {
20
20
  readonly type: "function";
21
- readonly name: "getKYCInvestorData";
21
+ readonly name: "getRWAInvestorData";
22
22
  readonly inputs: readonly [{
23
23
  readonly name: "investor";
24
24
  readonly type: "address";
@@ -31,11 +31,11 @@ export declare const kycCompressorAbi: readonly [{
31
31
  readonly outputs: readonly [{
32
32
  readonly name: "investorData";
33
33
  readonly type: "tuple[]";
34
- readonly internalType: "struct IKYCCompressor.KYCInvestorData[]";
34
+ readonly internalType: "struct IRWACompressor.RWAInvestorData[]";
35
35
  readonly components: readonly [{
36
36
  readonly name: "creditAccounts";
37
37
  readonly type: "tuple[]";
38
- readonly internalType: "struct IKYCCompressor.KYCCreditAccountData[]";
38
+ readonly internalType: "struct IRWACompressor.RWACreditAccountData[]";
39
39
  readonly components: readonly [{
40
40
  readonly name: "creditAccount";
41
41
  readonly type: "address";
@@ -62,7 +62,7 @@ export declare const kycCompressorAbi: readonly [{
62
62
  readonly stateMutability: "view";
63
63
  }, {
64
64
  readonly type: "function";
65
- readonly name: "getKYCMarketsData";
65
+ readonly name: "getRWAMarketsData";
66
66
  readonly inputs: readonly [{
67
67
  readonly name: "configurators";
68
68
  readonly type: "address[]";
@@ -75,7 +75,7 @@ export declare const kycCompressorAbi: readonly [{
75
75
  readonly outputs: readonly [{
76
76
  readonly name: "underlyingsData";
77
77
  readonly type: "tuple[]";
78
- readonly internalType: "struct IKYCCompressor.KYCUnderlyingData[]";
78
+ readonly internalType: "struct IRWACompressor.RWAUnderlyingData[]";
79
79
  readonly components: readonly [{
80
80
  readonly name: "baseParams";
81
81
  readonly type: "tuple";
@@ -113,7 +113,7 @@ export declare const kycCompressorAbi: readonly [{
113
113
  }, {
114
114
  readonly name: "factoriesData";
115
115
  readonly type: "tuple[]";
116
- readonly internalType: "struct IKYCCompressor.KYCFactoryData[]";
116
+ readonly internalType: "struct IRWACompressor.RWAFactoryData[]";
117
117
  readonly components: readonly [{
118
118
  readonly name: "baseParams";
119
119
  readonly type: "tuple";
@@ -219,7 +219,7 @@ export declare const kycCompressorAbi: readonly [{
219
219
  }];
220
220
  }, {
221
221
  readonly type: "error";
222
- readonly name: "InvalidKYCFactoryException";
222
+ readonly name: "InvalidRWAFactoryException";
223
223
  readonly inputs: readonly [{
224
224
  readonly name: "factory";
225
225
  readonly type: "address";
@@ -1,4 +1,4 @@
1
- export declare const onDemandKYCUnderlyingSubcompressorAbi: readonly [{
1
+ export declare const onDemandRWAUnderlyingSubcompressorAbi: readonly [{
2
2
  readonly type: "function";
3
3
  readonly name: "contractType";
4
4
  readonly inputs: readonly [];
@@ -1,4 +1,4 @@
1
- export declare const securitizeKYCFactorySubcompressorAbi: readonly [{
1
+ export declare const securitizeRWAFactorySubcompressorAbi: readonly [{
2
2
  readonly type: "function";
3
3
  readonly name: "contractType";
4
4
  readonly inputs: readonly [];