@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.
- package/dist/cjs/abi/compressors/{kycCompressor.js → rwaCompressor.js} +13 -13
- package/dist/cjs/abi/compressors/subcompressors/{kyc/onDemandKYCUnderlyingSubcompressor.js → rwa/onDemandRWAUnderlyingSubcompressor.js} +6 -6
- package/dist/cjs/abi/compressors/subcompressors/{kyc/securitizeKYCFactorySubcompressor.js → rwa/securitizeRWAFactorySubcompressor.js} +6 -6
- package/dist/cjs/abi/{kyc/iKYCCompressor.js → rwa/iRWACompressor.js} +13 -13
- package/dist/cjs/abi/{kyc/iKYCFactory.js → rwa/iRWAFactory.js} +6 -6
- package/dist/cjs/abi/{kyc/iKYCUnderlying.js → rwa/iRWAUnderlying.js} +7 -7
- package/dist/cjs/abi/{kyc/iSecuritizeKYCFactory.js → rwa/iSecuritizeRWAFactory.js} +7 -7
- package/dist/cjs/dev/claimDSToken.js +4 -4
- package/dist/cjs/plugins/adapters/abi/index.js +2 -0
- package/dist/cjs/plugins/adapters/abi/securitize/index.js +30 -0
- package/dist/cjs/sdk/OnchainSDK.js +12 -12
- package/dist/cjs/sdk/accounts/CreditAccountsServiceV310.js +59 -59
- package/dist/cjs/sdk/base/TokensMeta.js +6 -6
- package/dist/cjs/sdk/base/token-types.js +11 -11
- package/dist/cjs/sdk/chain/chains.js +16 -16
- package/dist/cjs/sdk/constants/address-provider.js +3 -3
- package/dist/cjs/sdk/market/MarketSuite.js +2 -2
- package/dist/cjs/sdk/market/index.js +2 -2
- package/dist/cjs/sdk/market/pool/PoolSuite.js +2 -2
- package/dist/cjs/sdk/market/pool/PoolV310Contract.js +3 -3
- package/dist/cjs/sdk/market/{kyc/KYCRegistry.js → rwa/RWARegistry.js} +48 -48
- package/dist/cjs/sdk/market/{kyc → rwa}/index.js +6 -6
- package/dist/cjs/sdk/market/{kyc → rwa}/securitize/SecuritizeDegenNFT.js +1 -1
- package/dist/cjs/sdk/market/{kyc/securitize/SecuritizeKYCFactory.js → rwa/securitize/SecuritizeRWAFactory.js} +20 -20
- package/dist/cjs/sdk/market/{kyc → rwa}/securitize/constants.js +3 -3
- package/dist/cjs/sdk/market/{kyc → rwa}/securitize/index.js +2 -2
- package/dist/cjs/sdk/market/{kyc → rwa}/types.js +6 -6
- package/dist/cjs/sdk/options.js +4 -4
- package/dist/cjs/sdk/pools/PoolService.js +26 -26
- package/dist/esm/abi/compressors/{kycCompressor.js → rwaCompressor.js} +9 -9
- package/dist/esm/abi/compressors/subcompressors/{kyc/onDemandKYCUnderlyingSubcompressor.js → rwa/onDemandRWAUnderlyingSubcompressor.js} +2 -2
- package/dist/esm/abi/compressors/subcompressors/{kyc/securitizeKYCFactorySubcompressor.js → rwa/securitizeRWAFactorySubcompressor.js} +2 -2
- package/dist/esm/abi/{kyc/iKYCCompressor.js → rwa/iRWACompressor.js} +9 -9
- package/dist/esm/abi/{kyc/iKYCFactory.js → rwa/iRWAFactory.js} +2 -2
- package/dist/esm/abi/{kyc/iKYCUnderlying.js → rwa/iRWAUnderlying.js} +3 -3
- package/dist/esm/abi/{kyc/iSecuritizeKYCFactory.js → rwa/iSecuritizeRWAFactory.js} +3 -3
- package/dist/esm/dev/claimDSToken.js +4 -4
- package/dist/esm/plugins/adapters/abi/index.js +1 -0
- package/dist/esm/plugins/adapters/abi/securitize/index.js +5 -0
- package/dist/esm/sdk/OnchainSDK.js +13 -13
- package/dist/esm/sdk/accounts/CreditAccountsServiceV310.js +59 -59
- package/dist/esm/sdk/base/TokensMeta.js +6 -6
- package/dist/esm/sdk/base/token-types.js +7 -7
- package/dist/esm/sdk/chain/chains.js +16 -16
- package/dist/esm/sdk/constants/address-provider.js +2 -2
- package/dist/esm/sdk/market/MarketSuite.js +2 -2
- package/dist/esm/sdk/market/index.js +1 -1
- package/dist/esm/sdk/market/pool/PoolSuite.js +2 -2
- package/dist/esm/sdk/market/pool/PoolV310Contract.js +3 -3
- package/dist/esm/sdk/market/{kyc/KYCRegistry.js → rwa/RWARegistry.js} +50 -50
- package/dist/esm/sdk/market/{kyc → rwa}/index.js +1 -1
- package/dist/esm/sdk/market/{kyc → rwa}/securitize/SecuritizeDegenNFT.js +1 -1
- package/dist/esm/sdk/market/{kyc/securitize/SecuritizeKYCFactory.js → rwa/securitize/SecuritizeRWAFactory.js} +17 -17
- package/dist/esm/sdk/market/rwa/securitize/constants.js +4 -0
- package/dist/esm/sdk/market/{kyc → rwa}/securitize/index.js +1 -1
- package/dist/esm/sdk/market/rwa/types.js +9 -0
- package/dist/esm/sdk/options.js +4 -4
- package/dist/esm/sdk/pools/PoolService.js +28 -28
- package/dist/types/abi/compressors/{kycCompressor.d.ts → rwaCompressor.d.ts} +8 -8
- package/dist/types/abi/compressors/subcompressors/{kyc/onDemandKYCUnderlyingSubcompressor.d.ts → rwa/onDemandRWAUnderlyingSubcompressor.d.ts} +1 -1
- package/dist/types/abi/compressors/subcompressors/{kyc/securitizeKYCFactorySubcompressor.d.ts → rwa/securitizeRWAFactorySubcompressor.d.ts} +1 -1
- package/dist/types/abi/{kyc/iKYCCompressor.d.ts → rwa/iRWACompressor.d.ts} +8 -8
- package/dist/types/abi/{kyc/iKYCFactory.d.ts → rwa/iRWAFactory.d.ts} +1 -1
- package/dist/types/abi/{kyc/iKYCUnderlying.d.ts → rwa/iRWAUnderlying.d.ts} +2 -2
- package/dist/types/abi/{kyc/iSecuritizeKYCFactory.d.ts → rwa/iSecuritizeRWAFactory.d.ts} +2 -2
- package/dist/types/dev/claimDSToken.d.ts +1 -1
- package/dist/types/plugins/adapters/abi/index.d.ts +1 -0
- package/dist/types/plugins/adapters/abi/securitize/index.d.ts +5 -0
- package/dist/types/sdk/OnchainSDK.d.ts +5 -5
- package/dist/types/sdk/accounts/CreditAccountsServiceV310.d.ts +19 -19
- package/dist/types/sdk/accounts/types.d.ts +26 -26
- package/dist/types/sdk/base/TokensMeta.d.ts +5 -5
- package/dist/types/sdk/base/token-types.d.ts +17 -17
- package/dist/types/sdk/base/types.d.ts +2 -2
- package/dist/types/sdk/chain/chains.d.ts +2 -2
- package/dist/types/sdk/constants/address-provider.d.ts +1 -1
- package/dist/types/sdk/market/MarketSuite.d.ts +2 -2
- package/dist/types/sdk/market/index.d.ts +1 -1
- package/dist/types/sdk/market/pool/PoolSuite.d.ts +2 -2
- package/dist/types/sdk/market/pool/PoolV310Contract.d.ts +2 -2
- package/dist/types/sdk/market/rwa/RWARegistry.d.ts +52 -0
- package/dist/types/sdk/market/{kyc → rwa}/index.d.ts +1 -1
- package/dist/types/sdk/market/{kyc/securitize/SecuritizeKYCFactory.d.ts → rwa/securitize/SecuritizeRWAFactory.d.ts} +16 -16
- package/dist/types/sdk/market/rwa/securitize/constants.d.ts +1 -0
- package/dist/types/sdk/market/{kyc → rwa}/securitize/index.d.ts +1 -1
- package/dist/types/sdk/market/{kyc → rwa}/securitize/types.d.ts +12 -12
- package/dist/types/sdk/market/{kyc → rwa}/types.d.ts +48 -48
- package/dist/types/sdk/market/types.d.ts +1 -1
- package/dist/types/sdk/options.d.ts +1 -1
- package/dist/types/sdk/pools/types.d.ts +4 -4
- package/dist/types/sdk/types/state-human.d.ts +2 -2
- package/dist/types/sdk/types/state.d.ts +3 -3
- package/package.json +1 -1
- package/dist/esm/sdk/market/kyc/securitize/constants.js +0 -4
- package/dist/esm/sdk/market/kyc/types.js +0 -9
- package/dist/types/sdk/market/kyc/KYCRegistry.d.ts +0 -52
- package/dist/types/sdk/market/kyc/securitize/constants.d.ts +0 -1
- /package/dist/cjs/abi/{kyc → rwa}/iDSRegistryService.js +0 -0
- /package/dist/cjs/abi/{kyc → rwa}/iDSToken.js +0 -0
- /package/dist/cjs/abi/{kyc → rwa}/iSecuritizeDegenNFT.js +0 -0
- /package/dist/cjs/sdk/market/{kyc → rwa}/securitize/types.js +0 -0
- /package/dist/esm/abi/{kyc → rwa}/iDSRegistryService.js +0 -0
- /package/dist/esm/abi/{kyc → rwa}/iDSToken.js +0 -0
- /package/dist/esm/abi/{kyc → rwa}/iSecuritizeDegenNFT.js +0 -0
- /package/dist/esm/sdk/market/{kyc → rwa}/securitize/types.js +0 -0
- /package/dist/types/abi/{kyc → rwa}/iDSRegistryService.d.ts +0 -0
- /package/dist/types/abi/{kyc → rwa}/iDSToken.d.ts +0 -0
- /package/dist/types/abi/{kyc → rwa}/iSecuritizeDegenNFT.d.ts +0 -0
- /package/dist/types/sdk/market/{kyc → rwa}/securitize/SecuritizeDegenNFT.d.ts +0 -0
|
@@ -30,7 +30,7 @@ var import_peripheryCompressor = require("../../abi/compressors/peripheryCompres
|
|
|
30
30
|
var import_rewardsCompressor = require("../../abi/compressors/rewardsCompressor.js");
|
|
31
31
|
var import_IWithdrawalCompressorV310 = require("../../abi/IWithdrawalCompressorV310.js");
|
|
32
32
|
var import_iBaseRewardPool = require("../../abi/iBaseRewardPool.js");
|
|
33
|
-
var
|
|
33
|
+
var import_iRWAFactory = require("../../abi/rwa/iRWAFactory.js");
|
|
34
34
|
var import_base = require("../base/index.js");
|
|
35
35
|
var import_chains = require("../chain/chains.js");
|
|
36
36
|
var import_constants = require("../constants/index.js");
|
|
@@ -77,7 +77,7 @@ class CreditAccountsServiceV310 extends import_base.SDKConstruct {
|
|
|
77
77
|
const marketSuite = this.sdk.marketRegister.findByCreditManager(
|
|
78
78
|
raw.creditManager
|
|
79
79
|
);
|
|
80
|
-
const factory = marketSuite.
|
|
80
|
+
const factory = marketSuite.rwaFactory;
|
|
81
81
|
let ca;
|
|
82
82
|
let investor;
|
|
83
83
|
if (raw.success) {
|
|
@@ -96,7 +96,7 @@ class CreditAccountsServiceV310 extends import_base.SDKConstruct {
|
|
|
96
96
|
},
|
|
97
97
|
...factory ? [
|
|
98
98
|
{
|
|
99
|
-
abi:
|
|
99
|
+
abi: import_iRWAFactory.iRWAFactoryAbi,
|
|
100
100
|
address: factory.address,
|
|
101
101
|
functionName: "getInvestor",
|
|
102
102
|
args: [raw.creditAccount]
|
|
@@ -177,8 +177,8 @@ class CreditAccountsServiceV310 extends import_base.SDKConstruct {
|
|
|
177
177
|
const { txs: priceUpdateTxs } = await this.sdk.priceFeeds.generatePriceFeedsUpdateTxs(
|
|
178
178
|
ignoreReservePrices ? { main: true } : void 0
|
|
179
179
|
);
|
|
180
|
-
const investorDataList = await this.sdk.
|
|
181
|
-
const
|
|
180
|
+
const investorDataList = await this.sdk.rwa.getInvestorData(borrower);
|
|
181
|
+
const rwaAccountAddresses = investorDataList.flatMap(
|
|
182
182
|
(d) => d.creditAccounts.map((ca) => ca.creditAccount)
|
|
183
183
|
);
|
|
184
184
|
const cmFilter = creditManager ? {
|
|
@@ -199,7 +199,7 @@ class CreditAccountsServiceV310 extends import_base.SDKConstruct {
|
|
|
199
199
|
maxHealthFactor: import_constants.MAX_UINT256,
|
|
200
200
|
reverting: false
|
|
201
201
|
};
|
|
202
|
-
const
|
|
202
|
+
const rwaContracts = rwaAccountAddresses.map(
|
|
203
203
|
(account) => ({
|
|
204
204
|
abi: import_creditAccountCompressor.creditAccountCompressorAbi,
|
|
205
205
|
address: this.compressor,
|
|
@@ -215,21 +215,21 @@ class CreditAccountsServiceV310 extends import_base.SDKConstruct {
|
|
|
215
215
|
args: [cmFilter, { ...permissiveFilter, reverting }, 0n]
|
|
216
216
|
})
|
|
217
217
|
);
|
|
218
|
-
const allContracts = [...
|
|
218
|
+
const allContracts = [...rwaContracts, ...getCreditAccountsContracts];
|
|
219
219
|
const results = await (0, import_viem2.simulateWithPriceUpdates)(this.client, {
|
|
220
220
|
priceUpdates: priceUpdateTxs,
|
|
221
221
|
contracts: allContracts,
|
|
222
222
|
blockNumber,
|
|
223
223
|
gas: this.sdk.gasLimit
|
|
224
224
|
});
|
|
225
|
-
const
|
|
225
|
+
const rwaResults = results.slice(
|
|
226
226
|
0,
|
|
227
|
-
|
|
227
|
+
rwaAccountAddresses.length
|
|
228
228
|
);
|
|
229
|
-
const normalResults = results.slice(
|
|
229
|
+
const normalResults = results.slice(rwaAccountAddresses.length);
|
|
230
230
|
const seen = new import_utils.AddressSet();
|
|
231
231
|
const allCAs = [];
|
|
232
|
-
for (const ca of
|
|
232
|
+
for (const ca of rwaResults) {
|
|
233
233
|
if (!seen.has(ca.creditAccount)) {
|
|
234
234
|
seen.add(ca.creditAccount);
|
|
235
235
|
allCAs.push({ ...ca, investor: borrower });
|
|
@@ -252,7 +252,7 @@ class CreditAccountsServiceV310 extends import_base.SDKConstruct {
|
|
|
252
252
|
return true;
|
|
253
253
|
});
|
|
254
254
|
this.logger?.debug(
|
|
255
|
-
`loaded ${allCAs.length} borrower credit accounts (${
|
|
255
|
+
`loaded ${allCAs.length} borrower credit accounts (${rwaResults.length} RWA, ${filtered.length} after filter)`
|
|
256
256
|
);
|
|
257
257
|
return filtered.sort((a, b) => Number(a.healthFactor - b.healthFactor));
|
|
258
258
|
}
|
|
@@ -604,9 +604,9 @@ class CreditAccountsServiceV310 extends import_base.SDKConstruct {
|
|
|
604
604
|
const cm = this.sdk.marketRegister.findCreditManager(ca.creditManager);
|
|
605
605
|
await this.sdk.tokensMeta.loadTokenData(cm.underlying);
|
|
606
606
|
const underlying = this.sdk.tokensMeta.mustGet(cm.underlying);
|
|
607
|
-
if (this.sdk.tokensMeta.
|
|
607
|
+
if (this.sdk.tokensMeta.isRWAUnderlying(underlying)) {
|
|
608
608
|
throw new Error(
|
|
609
|
-
"closeCreditAccount is not supported for
|
|
609
|
+
"closeCreditAccount is not supported for RWA underlying credit accounts"
|
|
610
610
|
);
|
|
611
611
|
}
|
|
612
612
|
const routerCloseResult = closePath || await this.sdk.routerFor(ca).findBestClosePath({
|
|
@@ -714,13 +714,13 @@ class CreditAccountsServiceV310 extends import_base.SDKConstruct {
|
|
|
714
714
|
],
|
|
715
715
|
{}
|
|
716
716
|
) : [];
|
|
717
|
-
const unwrapCalls = collateral && isDecrease ? await this.
|
|
717
|
+
const unwrapCalls = collateral && isDecrease ? await this.getRWAUnwrapCalls(
|
|
718
718
|
collateral[0].balance,
|
|
719
719
|
creditAccount.creditManager
|
|
720
720
|
) || [] : [];
|
|
721
721
|
if (addCollateralCalls.length > 0 && unwrapCalls.length === 0 && collateral && collateral?.[0].token !== creditAccount.underlying) {
|
|
722
722
|
throw new Error(
|
|
723
|
-
"Can't use collateral other than underlying for non
|
|
723
|
+
"Can't use collateral other than underlying for non RWA market"
|
|
724
724
|
);
|
|
725
725
|
}
|
|
726
726
|
const operationCalls = [
|
|
@@ -940,7 +940,7 @@ class CreditAccountsServiceV310 extends import_base.SDKConstruct {
|
|
|
940
940
|
const { creditManager } = options;
|
|
941
941
|
const suite = this.sdk.marketRegister.findCreditManager(creditManager);
|
|
942
942
|
const marketSuite = this.sdk.marketRegister.findByPool(suite.pool);
|
|
943
|
-
const factory = marketSuite.
|
|
943
|
+
const factory = marketSuite.rwaFactory;
|
|
944
944
|
if (factory) {
|
|
945
945
|
return factory.getApprovalAddress(options);
|
|
946
946
|
}
|
|
@@ -950,11 +950,11 @@ class CreditAccountsServiceV310 extends import_base.SDKConstruct {
|
|
|
950
950
|
* {@inheritDoc ICreditAccountsService.getOpenAccountRequirements}
|
|
951
951
|
*/
|
|
952
952
|
async getOpenAccountRequirements(borrower, creditManager, props) {
|
|
953
|
-
const {
|
|
954
|
-
if (!
|
|
953
|
+
const { rwaFactory } = this.sdk.marketRegister.findByCreditManager(creditManager);
|
|
954
|
+
if (!rwaFactory) {
|
|
955
955
|
return void 0;
|
|
956
956
|
}
|
|
957
|
-
return
|
|
957
|
+
return rwaFactory.getOpenAccountRequirements(borrower, props);
|
|
958
958
|
}
|
|
959
959
|
/**
|
|
960
960
|
* {@inheritDoc ICreditAccountsService.openCA}
|
|
@@ -974,7 +974,7 @@ class CreditAccountsServiceV310 extends import_base.SDKConstruct {
|
|
|
974
974
|
callsAfter,
|
|
975
975
|
minQuota,
|
|
976
976
|
averageQuota,
|
|
977
|
-
|
|
977
|
+
rwaOptions
|
|
978
978
|
} = props;
|
|
979
979
|
const cmSuite = this.sdk.marketRegister.findCreditManager(creditManager);
|
|
980
980
|
const cm = cmSuite.creditManager;
|
|
@@ -1013,7 +1013,7 @@ class CreditAccountsServiceV310 extends import_base.SDKConstruct {
|
|
|
1013
1013
|
to,
|
|
1014
1014
|
calls,
|
|
1015
1015
|
referralCode,
|
|
1016
|
-
|
|
1016
|
+
rwaOptions
|
|
1017
1017
|
);
|
|
1018
1018
|
}
|
|
1019
1019
|
tx.value = ethAmount.toString(10);
|
|
@@ -1097,17 +1097,17 @@ class CreditAccountsServiceV310 extends import_base.SDKConstruct {
|
|
|
1097
1097
|
return resp;
|
|
1098
1098
|
}
|
|
1099
1099
|
/**
|
|
1100
|
-
* Returns multicall entries to redeem (unwrap)
|
|
1101
|
-
* Used when withdrawing debt from a
|
|
1102
|
-
* Only applies when the credit manager's underlying is
|
|
1100
|
+
* Returns multicall entries to redeem (unwrap) RWA ERC-4626 vault shares into underlying for the given credit manager.
|
|
1101
|
+
* Used when withdrawing debt from a RWA market: redeems adapter vault shares so the underlying can be withdrawn.
|
|
1102
|
+
* Only applies when the credit manager's underlying is RWA-gated and has an ERC-4626 adapter configured.
|
|
1103
1103
|
* @param amount - Number of vault shares (adapter tokens) to redeem
|
|
1104
1104
|
* @param creditManager - Credit manager address
|
|
1105
|
-
* @returns Array of MultiCall to pass to credit facade multicall, or undefined if underlying is not
|
|
1105
|
+
* @returns Array of MultiCall to pass to credit facade multicall, or undefined if underlying is not RWA or no adapter is configured
|
|
1106
1106
|
*/
|
|
1107
|
-
async
|
|
1107
|
+
async getRWAUnwrapCalls(amount, creditManager) {
|
|
1108
1108
|
const suite = this.sdk.marketRegister.findCreditManager(creditManager);
|
|
1109
1109
|
const meta = this.sdk.tokensMeta.mustGet(suite.underlying);
|
|
1110
|
-
if (!this.sdk.tokensMeta.
|
|
1110
|
+
if (!this.sdk.tokensMeta.isRWAUnderlying(meta)) {
|
|
1111
1111
|
return void 0;
|
|
1112
1112
|
}
|
|
1113
1113
|
const adapter = suite.creditManager.adapters.get(meta.addr);
|
|
@@ -1128,17 +1128,17 @@ class CreditAccountsServiceV310 extends import_base.SDKConstruct {
|
|
|
1128
1128
|
return mc;
|
|
1129
1129
|
}
|
|
1130
1130
|
/**
|
|
1131
|
-
* Returns multicall entries to deposit (wrap) underlying into
|
|
1132
|
-
* Used when adding debt on a
|
|
1133
|
-
* Only applies when the credit manager's underlying is
|
|
1131
|
+
* Returns multicall entries to deposit (wrap) underlying into RWA ERC-4626 vault shares for the given credit manager.
|
|
1132
|
+
* Used when adding debt on a RWA market: deposits underlying into the adapter vault so shares are minted on the account.
|
|
1133
|
+
* Only applies when the credit manager's underlying is RWA-gated and has an ERC-4626 adapter configured.
|
|
1134
1134
|
* @param amount - Amount of underlying assets to deposit into the vault (in underlying decimals)
|
|
1135
1135
|
* @param creditManager - Credit manager address
|
|
1136
|
-
* @returns Array of MultiCall to pass to credit facade multicall, or undefined if underlying is not
|
|
1136
|
+
* @returns Array of MultiCall to pass to credit facade multicall, or undefined if underlying is not RWA or no adapter is configured
|
|
1137
1137
|
*/
|
|
1138
|
-
async
|
|
1138
|
+
async getRWAWrapCalls(amount, creditManager) {
|
|
1139
1139
|
const suite = this.sdk.marketRegister.findCreditManager(creditManager);
|
|
1140
1140
|
const meta = this.sdk.tokensMeta.mustGet(suite.underlying);
|
|
1141
|
-
if (!this.sdk.tokensMeta.
|
|
1141
|
+
if (!this.sdk.tokensMeta.isRWAUnderlying(meta)) {
|
|
1142
1142
|
return void 0;
|
|
1143
1143
|
}
|
|
1144
1144
|
const adapter = suite.creditManager.adapters.get(meta.addr);
|
|
@@ -1159,17 +1159,17 @@ class CreditAccountsServiceV310 extends import_base.SDKConstruct {
|
|
|
1159
1159
|
return mc;
|
|
1160
1160
|
}
|
|
1161
1161
|
/**
|
|
1162
|
-
* Returns multicall entries to call redeemDiff on the
|
|
1163
|
-
* Redeems the leftover vault shares (e.g. after repaying debt) so the account does not hold excess
|
|
1164
|
-
* Only applies when the credit manager's underlying is
|
|
1162
|
+
* Returns multicall entries to call redeemDiff on the RWA ERC-4626 adapter for the given credit manager.
|
|
1163
|
+
* Redeems the leftover vault shares (e.g. after repaying debt) so the account does not hold excess RWA vault tokens.
|
|
1164
|
+
* Only applies when the credit manager's underlying is RWA-gated and has an ERC-4626 adapter configured.
|
|
1165
1165
|
* @param amount - Leftover vault share amount to redeem (in adapter/vault decimals)
|
|
1166
1166
|
* @param creditManager - Credit manager address
|
|
1167
|
-
* @returns Array of MultiCall to pass to credit facade multicall, or undefined if underlying is not
|
|
1167
|
+
* @returns Array of MultiCall to pass to credit facade multicall, or undefined if underlying is not RWA or no adapter is configured
|
|
1168
1168
|
*/
|
|
1169
1169
|
async getRedeemDiffCalls(amount, creditManager) {
|
|
1170
1170
|
const suite = this.sdk.marketRegister.findCreditManager(creditManager);
|
|
1171
1171
|
const meta = this.sdk.tokensMeta.mustGet(suite.underlying);
|
|
1172
|
-
if (!this.sdk.tokensMeta.
|
|
1172
|
+
if (!this.sdk.tokensMeta.isRWAUnderlying(meta)) {
|
|
1173
1173
|
return void 0;
|
|
1174
1174
|
}
|
|
1175
1175
|
const adapter = suite.creditManager.adapters.get(meta.addr);
|
|
@@ -1190,17 +1190,17 @@ class CreditAccountsServiceV310 extends import_base.SDKConstruct {
|
|
|
1190
1190
|
return mc;
|
|
1191
1191
|
}
|
|
1192
1192
|
/**
|
|
1193
|
-
* Returns multicall entries to call depositDiff on the
|
|
1193
|
+
* Returns multicall entries to call depositDiff on the RWA ERC-4626 adapter for the given credit manager.
|
|
1194
1194
|
* Deposits the leftover underlying (e.g. after decreasing debt) into the vault so the account does not hold excess underlying.
|
|
1195
|
-
* Only applies when the credit manager's underlying is
|
|
1195
|
+
* Only applies when the credit manager's underlying is RWA-gated and has an ERC-4626 adapter configured.
|
|
1196
1196
|
* @param amount - Leftover underlying amount to deposit into the vault (in underlying decimals)
|
|
1197
1197
|
* @param creditManager - Credit manager address
|
|
1198
|
-
* @returns Array of MultiCall to pass to credit facade multicall, or undefined if underlying is not
|
|
1198
|
+
* @returns Array of MultiCall to pass to credit facade multicall, or undefined if underlying is not RWA or no adapter is configured
|
|
1199
1199
|
*/
|
|
1200
1200
|
async getDepositDiffCalls(amount, creditManager) {
|
|
1201
1201
|
const suite = this.sdk.marketRegister.findCreditManager(creditManager);
|
|
1202
1202
|
const meta = this.sdk.tokensMeta.mustGet(suite.underlying);
|
|
1203
|
-
if (!this.sdk.tokensMeta.
|
|
1203
|
+
if (!this.sdk.tokensMeta.isRWAUnderlying(meta)) {
|
|
1204
1204
|
return void 0;
|
|
1205
1205
|
}
|
|
1206
1206
|
const adapter = suite.creditManager.adapters.get(meta.addr);
|
|
@@ -1677,68 +1677,68 @@ class CreditAccountsServiceV310 extends import_base.SDKConstruct {
|
|
|
1677
1677
|
return this.#compressor;
|
|
1678
1678
|
}
|
|
1679
1679
|
/**
|
|
1680
|
-
* Wrapper that selects between credit facade and
|
|
1680
|
+
* Wrapper that selects between credit facade and RWA factory
|
|
1681
1681
|
* @param suite
|
|
1682
1682
|
* @param to
|
|
1683
1683
|
* @param calls
|
|
1684
1684
|
* @param referralCode
|
|
1685
|
-
* @param
|
|
1685
|
+
* @param rwaOptions
|
|
1686
1686
|
* @returns
|
|
1687
1687
|
*/
|
|
1688
|
-
async #openCreditAccountTx(suite, to, calls, referralCode,
|
|
1688
|
+
async #openCreditAccountTx(suite, to, calls, referralCode, rwaOptions) {
|
|
1689
1689
|
const marketSuite = this.sdk.marketRegister.findByPool(suite.pool);
|
|
1690
|
-
const factory = marketSuite.
|
|
1690
|
+
const factory = marketSuite.rwaFactory;
|
|
1691
1691
|
if (factory) {
|
|
1692
1692
|
return factory.openCreditAccount(
|
|
1693
1693
|
suite.creditManager.address,
|
|
1694
1694
|
calls,
|
|
1695
|
-
|
|
1695
|
+
rwaOptions
|
|
1696
1696
|
);
|
|
1697
1697
|
}
|
|
1698
1698
|
return suite.creditFacade.openCreditAccount(to, calls, referralCode ?? 0n);
|
|
1699
1699
|
}
|
|
1700
1700
|
/**
|
|
1701
|
-
* Wrapper that selects between credit facade and
|
|
1701
|
+
* Wrapper that selects between credit facade and RWA factory
|
|
1702
1702
|
* @param suite
|
|
1703
1703
|
* @param creditAccount
|
|
1704
1704
|
* @param calls
|
|
1705
|
-
* @param
|
|
1705
|
+
* @param rwaOptions
|
|
1706
1706
|
* @returns
|
|
1707
1707
|
*/
|
|
1708
|
-
async #multicallTx(suite, creditAccount, calls,
|
|
1708
|
+
async #multicallTx(suite, creditAccount, calls, rwaOptions) {
|
|
1709
1709
|
const marketSuite = this.sdk.marketRegister.findByCreditManager(
|
|
1710
1710
|
suite.creditManager.address
|
|
1711
1711
|
);
|
|
1712
|
-
const factory = marketSuite.
|
|
1712
|
+
const factory = marketSuite.rwaFactory;
|
|
1713
1713
|
if (factory) {
|
|
1714
|
-
return factory.multicall(creditAccount, calls,
|
|
1714
|
+
return factory.multicall(creditAccount, calls, rwaOptions);
|
|
1715
1715
|
}
|
|
1716
1716
|
return suite.creditFacade.multicall(creditAccount, calls);
|
|
1717
1717
|
}
|
|
1718
1718
|
/**
|
|
1719
|
-
* Wrapper that selects between credit facade and
|
|
1719
|
+
* Wrapper that selects between credit facade and RWA factory
|
|
1720
1720
|
* @param suite
|
|
1721
1721
|
* @param creditAccount
|
|
1722
1722
|
* @param calls
|
|
1723
1723
|
* @param operation
|
|
1724
|
-
* @param
|
|
1724
|
+
* @param rwaOptions
|
|
1725
1725
|
* @returns
|
|
1726
1726
|
*/
|
|
1727
|
-
async #closeCreditAccountTx(suite, creditAccount, calls, operation,
|
|
1727
|
+
async #closeCreditAccountTx(suite, creditAccount, calls, operation, rwaOptions) {
|
|
1728
1728
|
const marketSuite = this.sdk.marketRegister.findByCreditManager(
|
|
1729
1729
|
suite.creditManager.address
|
|
1730
1730
|
);
|
|
1731
|
-
const factory = marketSuite.
|
|
1731
|
+
const factory = marketSuite.rwaFactory;
|
|
1732
1732
|
if (operation === "close") {
|
|
1733
1733
|
if (factory) {
|
|
1734
1734
|
throw new Error(
|
|
1735
|
-
"CloseOptions=close is not supported for
|
|
1735
|
+
"CloseOptions=close is not supported for RWA underlying credit accounts"
|
|
1736
1736
|
);
|
|
1737
1737
|
}
|
|
1738
1738
|
return suite.creditFacade.closeCreditAccount(creditAccount, calls);
|
|
1739
1739
|
}
|
|
1740
1740
|
if (factory) {
|
|
1741
|
-
return factory.multicall(creditAccount, calls,
|
|
1741
|
+
return factory.multicall(creditAccount, calls, rwaOptions);
|
|
1742
1742
|
}
|
|
1743
1743
|
return suite.creditFacade.multicall(creditAccount, calls);
|
|
1744
1744
|
}
|
|
@@ -81,12 +81,12 @@ class TokensMeta extends import_utils.AddressMap {
|
|
|
81
81
|
return !!t.contractType?.startsWith("PHANTOM_TOKEN::");
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
84
|
-
* Returns true if the token is a
|
|
84
|
+
* Returns true if the token is a RWA underlying token, throws if the token data is not loaded
|
|
85
85
|
* @param t
|
|
86
86
|
* @returns
|
|
87
87
|
*/
|
|
88
|
-
|
|
89
|
-
return !!t.contractType?.startsWith("
|
|
88
|
+
isRWAUnderlying(t) {
|
|
89
|
+
return !!t.contractType?.startsWith("RWA_UNDERLYING::");
|
|
90
90
|
}
|
|
91
91
|
/**
|
|
92
92
|
* Returns a map of all phantom tokens
|
|
@@ -102,13 +102,13 @@ class TokensMeta extends import_utils.AddressMap {
|
|
|
102
102
|
return result;
|
|
103
103
|
}
|
|
104
104
|
/**
|
|
105
|
-
* Returns a map of all
|
|
105
|
+
* Returns a map of all RWA underlying tokens
|
|
106
106
|
* Throws if token data is not loaded
|
|
107
107
|
*/
|
|
108
|
-
get
|
|
108
|
+
get rwaUnderlyings() {
|
|
109
109
|
const result = new import_utils.AddressMap();
|
|
110
110
|
for (const [token, meta] of this.entries()) {
|
|
111
|
-
if (this.
|
|
111
|
+
if (this.isRWAUnderlying(meta)) {
|
|
112
112
|
result.upsert(token, meta);
|
|
113
113
|
}
|
|
114
114
|
}
|
|
@@ -18,10 +18,10 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var token_types_exports = {};
|
|
20
20
|
__export(token_types_exports, {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
PHANTOM_TOKEN_CONTRACT_TYPES: () => PHANTOM_TOKEN_CONTRACT_TYPES,
|
|
22
|
+
RWA_ON_DEMAND_LP_MONOPOLIZED: () => RWA_ON_DEMAND_LP_MONOPOLIZED,
|
|
23
|
+
RWA_UNDERLYING_DEFAULT: () => RWA_UNDERLYING_DEFAULT,
|
|
24
|
+
RWA_UNDERLYING_ON_DEMAND: () => RWA_UNDERLYING_ON_DEMAND
|
|
25
25
|
});
|
|
26
26
|
module.exports = __toCommonJS(token_types_exports);
|
|
27
27
|
const PHANTOM_TOKEN_CONTRACT_TYPES = [
|
|
@@ -33,13 +33,13 @@ const PHANTOM_TOKEN_CONTRACT_TYPES = [
|
|
|
33
33
|
"PHANTOM_TOKEN::STAKING_REWARDS",
|
|
34
34
|
"PHANTOM_TOKEN::UPSHIFT_WITHDRAW"
|
|
35
35
|
];
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
const
|
|
36
|
+
const RWA_UNDERLYING_DEFAULT = "RWA_UNDERLYING::DEFAULT";
|
|
37
|
+
const RWA_UNDERLYING_ON_DEMAND = "RWA_UNDERLYING::ON_DEMAND";
|
|
38
|
+
const RWA_ON_DEMAND_LP_MONOPOLIZED = "ON_DEMAND_LP::MONOPOLIZED";
|
|
39
39
|
// Annotate the CommonJS export names for ESM import in node:
|
|
40
40
|
0 && (module.exports = {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
PHANTOM_TOKEN_CONTRACT_TYPES,
|
|
42
|
+
RWA_ON_DEMAND_LP_MONOPOLIZED,
|
|
43
|
+
RWA_UNDERLYING_DEFAULT,
|
|
44
|
+
RWA_UNDERLYING_ON_DEMAND
|
|
45
45
|
});
|
|
@@ -82,7 +82,7 @@ const chains = {
|
|
|
82
82
|
"0x99df7330bf42d596af2e9d9836d4fc2077c574aa": "M11 Credit",
|
|
83
83
|
"0x610627d8d01a413bdd9b0a0b60070da7dd1e54ad": "Securitize"
|
|
84
84
|
},
|
|
85
|
-
|
|
85
|
+
rwaFactories: [],
|
|
86
86
|
isPublic: true,
|
|
87
87
|
wellKnownToken: {
|
|
88
88
|
address: "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
|
|
@@ -100,7 +100,7 @@ const chains = {
|
|
|
100
100
|
defaultMarketConfigurators: {
|
|
101
101
|
"0x01023850b360b88de0d0f84015bbba1eba57fe7e": "Chaos Labs"
|
|
102
102
|
},
|
|
103
|
-
|
|
103
|
+
rwaFactories: [],
|
|
104
104
|
isPublic: true,
|
|
105
105
|
wellKnownToken: {
|
|
106
106
|
address: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831",
|
|
@@ -119,7 +119,7 @@ const chains = {
|
|
|
119
119
|
"0x2a15969CE5320868eb609680751cF8896DD92De5": "Chaos Labs",
|
|
120
120
|
"0x9dddd1b9ce0ac8aa0c80e4ec141600b9bf0101c3": "UltraYield"
|
|
121
121
|
},
|
|
122
|
-
|
|
122
|
+
rwaFactories: [],
|
|
123
123
|
isPublic: true,
|
|
124
124
|
wellKnownToken: {
|
|
125
125
|
address: "0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",
|
|
@@ -135,7 +135,7 @@ const chains = {
|
|
|
135
135
|
...import_chains.base,
|
|
136
136
|
network: "Base",
|
|
137
137
|
defaultMarketConfigurators: {},
|
|
138
|
-
|
|
138
|
+
rwaFactories: [],
|
|
139
139
|
isPublic: false,
|
|
140
140
|
wellKnownToken: {
|
|
141
141
|
address: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
|
|
@@ -152,7 +152,7 @@ const chains = {
|
|
|
152
152
|
defaultMarketConfigurators: {
|
|
153
153
|
"0x8FFDd1F1433674516f83645a768E8900A2A5D076": "Chaos Labs"
|
|
154
154
|
},
|
|
155
|
-
|
|
155
|
+
rwaFactories: [],
|
|
156
156
|
isPublic: true,
|
|
157
157
|
blockExplorers: {
|
|
158
158
|
default: {
|
|
@@ -174,7 +174,7 @@ const chains = {
|
|
|
174
174
|
...import_chains.megaeth,
|
|
175
175
|
network: "MegaETH",
|
|
176
176
|
defaultMarketConfigurators: {},
|
|
177
|
-
|
|
177
|
+
rwaFactories: [],
|
|
178
178
|
isPublic: false,
|
|
179
179
|
wellKnownToken: {
|
|
180
180
|
address: "0xFAfDdbb3FC7688494971a79cc65DCa3EF82079E7",
|
|
@@ -196,7 +196,7 @@ const chains = {
|
|
|
196
196
|
"0x16956912813ab9a38d95730b52a8cf53e860a7c5": "Tulipa",
|
|
197
197
|
"0x7c6ee1bf9c1eb3ee55bdbdc1e8d0317aab718e0a": "UltraYield"
|
|
198
198
|
},
|
|
199
|
-
|
|
199
|
+
rwaFactories: [],
|
|
200
200
|
isPublic: true,
|
|
201
201
|
wellKnownToken: {
|
|
202
202
|
address: "0xe7cd86e13AC4309349F30B3435a9d337750fC82D",
|
|
@@ -210,7 +210,7 @@ const chains = {
|
|
|
210
210
|
...import_chains.berachain,
|
|
211
211
|
network: "Berachain",
|
|
212
212
|
defaultMarketConfigurators: {},
|
|
213
|
-
|
|
213
|
+
rwaFactories: [],
|
|
214
214
|
isPublic: false,
|
|
215
215
|
blockExplorers: {
|
|
216
216
|
default: {
|
|
@@ -232,7 +232,7 @@ const chains = {
|
|
|
232
232
|
...import_chains.avalanche,
|
|
233
233
|
network: "Avalanche",
|
|
234
234
|
defaultMarketConfigurators: {},
|
|
235
|
-
|
|
235
|
+
rwaFactories: [],
|
|
236
236
|
isPublic: false,
|
|
237
237
|
wellKnownToken: {
|
|
238
238
|
address: "0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",
|
|
@@ -251,7 +251,7 @@ const chains = {
|
|
|
251
251
|
"0x92dc4ee43e9b207e16fbf3fd1a6933563c0a0d35": "Re7"
|
|
252
252
|
},
|
|
253
253
|
testMarketConfigurators: {},
|
|
254
|
-
|
|
254
|
+
rwaFactories: [],
|
|
255
255
|
isPublic: true,
|
|
256
256
|
wellKnownToken: {
|
|
257
257
|
address: "0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d",
|
|
@@ -266,7 +266,7 @@ const chains = {
|
|
|
266
266
|
...import_chains.worldchain,
|
|
267
267
|
network: "WorldChain",
|
|
268
268
|
defaultMarketConfigurators: {},
|
|
269
|
-
|
|
269
|
+
rwaFactories: [],
|
|
270
270
|
isPublic: false,
|
|
271
271
|
wellKnownToken: {
|
|
272
272
|
address: "0x79a02482a880bce3f13e09da970dc34db4cd24d1",
|
|
@@ -281,7 +281,7 @@ const chains = {
|
|
|
281
281
|
defaultMarketConfigurators: {
|
|
282
282
|
"0x577424f0e6f50db668cc1bc76babb87e36732291": "Re7"
|
|
283
283
|
},
|
|
284
|
-
|
|
284
|
+
rwaFactories: [],
|
|
285
285
|
isPublic: true,
|
|
286
286
|
wellKnownToken: {
|
|
287
287
|
address: "0x796Ea11Fa2dD751eD01b53C372fFDB4AAa8f00F9",
|
|
@@ -296,7 +296,7 @@ const chains = {
|
|
|
296
296
|
defaultMarketConfigurators: {
|
|
297
297
|
"0xc9961b8a0c763779690577f2c76962c086af2fe3": "Invariant Group"
|
|
298
298
|
},
|
|
299
|
-
|
|
299
|
+
rwaFactories: [],
|
|
300
300
|
isPublic: true,
|
|
301
301
|
wellKnownToken: {
|
|
302
302
|
address: "0xad11a8BEb98bbf61dbb1aa0F6d6F2ECD87b35afA",
|
|
@@ -316,7 +316,7 @@ const chains = {
|
|
|
316
316
|
defaultMarketConfigurators: {
|
|
317
317
|
"0x25778dbf0e56b7feb8358c4aa2f6f9e19a1c145a": "Re7"
|
|
318
318
|
},
|
|
319
|
-
|
|
319
|
+
rwaFactories: [],
|
|
320
320
|
isPublic: true,
|
|
321
321
|
wellKnownToken: {
|
|
322
322
|
address: "0xF242275d3a6527d877f2c927a82D9b057609cc71",
|
|
@@ -333,7 +333,7 @@ const chains = {
|
|
|
333
333
|
"0xce1cf71a28837daaa7b92d00ca4ef2fd649c2a67": "Hyperithm",
|
|
334
334
|
"0x9655f82b585b11cee8a05576ed8efcf755cec04b": "TelosC"
|
|
335
335
|
},
|
|
336
|
-
|
|
336
|
+
rwaFactories: [],
|
|
337
337
|
isPublic: true,
|
|
338
338
|
wellKnownToken: {
|
|
339
339
|
address: "0x5d72a9d9a9510cd8cbdba12ac62593a58930a948",
|
|
@@ -360,7 +360,7 @@ const chains = {
|
|
|
360
360
|
defaultMarketConfigurators: {
|
|
361
361
|
"0x1ca8b92aa7233a9f8f7ba031ac45c878141adff0": "Invariant Group"
|
|
362
362
|
},
|
|
363
|
-
|
|
363
|
+
rwaFactories: [],
|
|
364
364
|
isPublic: true,
|
|
365
365
|
wellKnownToken: {
|
|
366
366
|
address: "0x67B302E35Aef5EEE8c32D934F5856869EF428330",
|
|
@@ -36,7 +36,6 @@ __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,
|
|
40
39
|
AP_MARKET_COMPRESSOR: () => AP_MARKET_COMPRESSOR,
|
|
41
40
|
AP_MARKET_CONFIGURATOR: () => AP_MARKET_CONFIGURATOR,
|
|
42
41
|
AP_PARTIAL_LIQUIDATION_BOT: () => AP_PARTIAL_LIQUIDATION_BOT,
|
|
@@ -46,6 +45,7 @@ __export(address_provider_exports, {
|
|
|
46
45
|
AP_PRICE_ORACLE: () => AP_PRICE_ORACLE,
|
|
47
46
|
AP_REWARDS_COMPRESSOR: () => AP_REWARDS_COMPRESSOR,
|
|
48
47
|
AP_ROUTER: () => AP_ROUTER,
|
|
48
|
+
AP_RWA_COMPRESSOR: () => AP_RWA_COMPRESSOR,
|
|
49
49
|
AP_TOKEN_COMPRESSOR: () => AP_TOKEN_COMPRESSOR,
|
|
50
50
|
AP_TREASURY: () => AP_TREASURY,
|
|
51
51
|
AP_WETH_GATEWAY: () => AP_WETH_GATEWAY,
|
|
@@ -88,7 +88,7 @@ const AP_WETH_GATEWAY = "WETH_GATEWAY";
|
|
|
88
88
|
const AP_WETH_TOKEN = "WETH_TOKEN";
|
|
89
89
|
const AP_ZAPPER_REGISTER = "ZAPPER_REGISTER";
|
|
90
90
|
const AP_ZERO_PRICE_FEED = "ZERO_PRICE_FEED";
|
|
91
|
-
const
|
|
91
|
+
const AP_RWA_COMPRESSOR = "GLOBAL::RWA_COMPRESSOR";
|
|
92
92
|
const ADDRESS_PROVIDER_V310 = "0xF7f0a609BfAb9a0A98786951ef10e5FE26cC1E38";
|
|
93
93
|
// Annotate the CommonJS export names for ESM import in node:
|
|
94
94
|
0 && (module.exports = {
|
|
@@ -110,7 +110,6 @@ const ADDRESS_PROVIDER_V310 = "0xF7f0a609BfAb9a0A98786951ef10e5FE26cC1E38";
|
|
|
110
110
|
AP_GEAR_TOKEN,
|
|
111
111
|
AP_INFLATION_ATTACK_BLOCKER,
|
|
112
112
|
AP_INSOLVENCY_CHECKER,
|
|
113
|
-
AP_KYC_COMPRESSOR,
|
|
114
113
|
AP_MARKET_COMPRESSOR,
|
|
115
114
|
AP_MARKET_CONFIGURATOR,
|
|
116
115
|
AP_PARTIAL_LIQUIDATION_BOT,
|
|
@@ -120,6 +119,7 @@ const ADDRESS_PROVIDER_V310 = "0xF7f0a609BfAb9a0A98786951ef10e5FE26cC1E38";
|
|
|
120
119
|
AP_PRICE_ORACLE,
|
|
121
120
|
AP_REWARDS_COMPRESSOR,
|
|
122
121
|
AP_ROUTER,
|
|
122
|
+
AP_RWA_COMPRESSOR,
|
|
123
123
|
AP_TOKEN_COMPRESSOR,
|
|
124
124
|
AP_TREASURY,
|
|
125
125
|
AP_WETH_GATEWAY,
|
|
@@ -65,8 +65,8 @@ class MarketSuite extends import_base.SDKConstruct {
|
|
|
65
65
|
get underlying() {
|
|
66
66
|
return this.pool.underlying;
|
|
67
67
|
}
|
|
68
|
-
get
|
|
69
|
-
return this.pool.
|
|
68
|
+
get rwaFactory() {
|
|
69
|
+
return this.pool.rwaFactory;
|
|
70
70
|
}
|
|
71
71
|
get dirty() {
|
|
72
72
|
return this.configurator.dirty || this.pool.dirty || this.priceOracle.dirty || this.creditManagers.some((cm) => cm.dirty);
|
|
@@ -17,22 +17,22 @@ 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);
|
|
21
20
|
__reExport(market_exports, require("./MarketRegister.js"), module.exports);
|
|
22
21
|
__reExport(market_exports, require("./MarketSuite.js"), module.exports);
|
|
23
22
|
__reExport(market_exports, require("./oracle/index.js"), module.exports);
|
|
24
23
|
__reExport(market_exports, require("./pool/index.js"), module.exports);
|
|
25
24
|
__reExport(market_exports, require("./pricefeeds/index.js"), module.exports);
|
|
25
|
+
__reExport(market_exports, require("./rwa/index.js"), module.exports);
|
|
26
26
|
__reExport(market_exports, require("./types.js"), module.exports);
|
|
27
27
|
// Annotate the CommonJS export names for ESM import in node:
|
|
28
28
|
0 && (module.exports = {
|
|
29
29
|
...require("./adapters/index.js"),
|
|
30
30
|
...require("./credit/index.js"),
|
|
31
|
-
...require("./kyc/index.js"),
|
|
32
31
|
...require("./MarketRegister.js"),
|
|
33
32
|
...require("./MarketSuite.js"),
|
|
34
33
|
...require("./oracle/index.js"),
|
|
35
34
|
...require("./pool/index.js"),
|
|
36
35
|
...require("./pricefeeds/index.js"),
|
|
36
|
+
...require("./rwa/index.js"),
|
|
37
37
|
...require("./types.js")
|
|
38
38
|
});
|
|
@@ -88,8 +88,8 @@ class PoolSuite extends import_base.SDKConstruct {
|
|
|
88
88
|
get underlying() {
|
|
89
89
|
return this.pool.underlying;
|
|
90
90
|
}
|
|
91
|
-
get
|
|
92
|
-
return this.pool.
|
|
91
|
+
get rwaFactory() {
|
|
92
|
+
return this.pool.rwaFactory;
|
|
93
93
|
}
|
|
94
94
|
get dirty() {
|
|
95
95
|
return this.pool.dirty || this.rateKeeper.dirty || this.pqk.dirty || this.interestRateModel.dirty;
|
|
@@ -48,10 +48,10 @@ class PoolV310Contract extends import_base.BaseContract {
|
|
|
48
48
|
symbol: data.symbol
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
|
-
get
|
|
51
|
+
get rwaFactory() {
|
|
52
52
|
const meta = this.#sdk.tokensMeta.mustGet(this.underlying);
|
|
53
|
-
if (this.#sdk.tokensMeta.
|
|
54
|
-
return this.#sdk.mustGetContract(meta.
|
|
53
|
+
if (this.#sdk.tokensMeta.isRWAUnderlying(meta)) {
|
|
54
|
+
return this.#sdk.mustGetContract(meta.rwaFactory);
|
|
55
55
|
}
|
|
56
56
|
return void 0;
|
|
57
57
|
}
|