@gearbox-protocol/sdk 13.5.0 → 13.6.0-kyc.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/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/sdk/GearboxSDK.js +51 -4
- package/dist/cjs/sdk/accounts/AbstractCreditAccountsService.js +331 -16
- package/dist/cjs/sdk/accounts/CreditAccountsServiceV310.js +7 -1
- package/dist/cjs/sdk/base/TokensMeta.js +32 -43
- package/dist/cjs/sdk/base/token-types.js +9 -0
- package/dist/cjs/sdk/chain/chains.js +2 -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/kyc/KYCRegister.js +255 -0
- package/dist/cjs/sdk/market/kyc/index.js +24 -0
- package/dist/cjs/sdk/market/kyc/securitize/SecuritizeKYCFactory.js +229 -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/market/kyc/types.js +29 -0
- 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 -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/sdk/GearboxSDK.js +55 -5
- package/dist/esm/sdk/accounts/AbstractCreditAccountsService.js +332 -17
- package/dist/esm/sdk/accounts/CreditAccountsServiceV310.js +7 -1
- package/dist/esm/sdk/base/TokensMeta.js +32 -45
- package/dist/esm/sdk/base/token-types.js +6 -0
- package/dist/esm/sdk/chain/chains.js +2 -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/kyc/KYCRegister.js +239 -0
- package/dist/esm/sdk/market/kyc/index.js +2 -0
- package/dist/esm/sdk/market/kyc/securitize/SecuritizeKYCFactory.js +205 -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 +5 -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 -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/GearboxSDK.d.ts +7 -0
- package/dist/types/sdk/accounts/AbstractCreditAccountsService.d.ts +55 -2
- package/dist/types/sdk/accounts/CreditAccountsServiceV310.d.ts +1 -1
- package/dist/types/sdk/accounts/types.d.ts +93 -13
- 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/kyc/KYCRegister.d.ts +31 -0
- package/dist/types/sdk/market/kyc/index.d.ts +2 -0
- package/dist/types/sdk/market/kyc/securitize/SecuritizeKYCFactory.d.ts +420 -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 +62 -0
- package/dist/types/sdk/market/kyc/types.d.ts +93 -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 +11 -0
- package/dist/types/sdk/utils/viem/index.d.ts +1 -0
- package/package.json +3 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { Address, Chain, PublicClient, Transport } from "viem";
|
|
2
2
|
import type { Asset } from "../router/index.js";
|
|
3
3
|
import type { ILogger } from "../types/logger.js";
|
|
4
4
|
import { AddressMap } from "../utils/index.js";
|
|
5
|
-
import type { PhantomTokenMeta, TokenMetaData } from "./token-types.js";
|
|
5
|
+
import type { KYCTokenMeta, PhantomTokenMeta, TokenMetaData } from "./token-types.js";
|
|
6
6
|
/**
|
|
7
7
|
* Options for {@link TokensMeta.formatBN}.
|
|
8
8
|
**/
|
|
@@ -50,11 +50,22 @@ export declare class TokensMeta extends AddressMap<TokenMetaData> {
|
|
|
50
50
|
* @returns
|
|
51
51
|
*/
|
|
52
52
|
isPhantomToken(t: TokenMetaData): t is PhantomTokenMeta;
|
|
53
|
+
/**
|
|
54
|
+
* Returns true if the token is a KYC underlying token, throws if the token data is not loaded
|
|
55
|
+
* @param t
|
|
56
|
+
* @returns
|
|
57
|
+
*/
|
|
58
|
+
isKYCUnderlying(t: TokenMetaData): t is KYCTokenMeta;
|
|
53
59
|
/**
|
|
54
60
|
* Returns a map of all phantom tokens
|
|
55
61
|
* Throws if token data is not loaded
|
|
56
62
|
*/
|
|
57
63
|
get phantomTokens(): AddressMap<PhantomTokenMeta>;
|
|
64
|
+
/**
|
|
65
|
+
* Returns a map of all KYC underlying tokens
|
|
66
|
+
* Throws if token data is not loaded
|
|
67
|
+
*/
|
|
68
|
+
get kycUnderlyings(): AddressMap<KYCTokenMeta>;
|
|
58
69
|
/**
|
|
59
70
|
* Formats a raw token amount into a human-readable decimal string,
|
|
60
71
|
* dividing by `10^decimals` for the token.
|
|
@@ -85,7 +96,7 @@ export declare class TokensMeta extends AddressMap<TokenMetaData> {
|
|
|
85
96
|
mustFindBySymbol(symbol: string): TokenMetaData;
|
|
86
97
|
/**
|
|
87
98
|
* Loads token information about phantom tokens
|
|
88
|
-
*
|
|
99
|
+
* In future other custom tokens types that do not have compressors might be handled here
|
|
89
100
|
*
|
|
90
101
|
* @param tokens - tokens to load data for, defaults to all tokens
|
|
91
102
|
*/
|
|
@@ -1,13 +1,53 @@
|
|
|
1
|
+
import type { Address } from "viem";
|
|
1
2
|
import type { MarketData, Unarray } from "./types.js";
|
|
2
3
|
type TokenData = Unarray<MarketData["tokens"]>;
|
|
3
4
|
export declare const PHANTOM_TOKEN_CONTRACT_TYPES: readonly ["PHANTOM_TOKEN::CONVEX", "PHANTOM_TOKEN::INFINIFI_UNWIND", "PHANTOM_TOKEN::INFRARED", "PHANTOM_TOKEN::MELLOW_WITHDRAWAL", "PHANTOM_TOKEN::MIDAS_REDEMPTION", "PHANTOM_TOKEN::STAKING_REWARDS", "PHANTOM_TOKEN::UPSHIFT_WITHDRAW"];
|
|
5
|
+
export declare const KYC_UNDERLYING_DEFAULT = "KYC_UNDERLYING::DEFAULT";
|
|
6
|
+
export declare const KYC_UNDERLYING_ON_DEMAND = "KYC_UNDERLYING::ON_DEMAND";
|
|
7
|
+
export type KYCUnderlyingContractType = typeof KYC_UNDERLYING_DEFAULT | typeof KYC_UNDERLYING_ON_DEMAND;
|
|
8
|
+
export declare const KYC_ON_DEMAND_LP_MONOPOLIZED = "ON_DEMAND_LP::MONOPOLIZED";
|
|
9
|
+
export type KYCOnDemandLpContractType = typeof KYC_ON_DEMAND_LP_MONOPOLIZED;
|
|
4
10
|
export type PhantomTokenContractType = (typeof PHANTOM_TOKEN_CONTRACT_TYPES)[number];
|
|
5
|
-
export
|
|
6
|
-
isDSToken?: boolean;
|
|
11
|
+
export interface SimpleTokenMeta extends TokenData {
|
|
7
12
|
contractType?: string;
|
|
8
|
-
}
|
|
13
|
+
}
|
|
9
14
|
export type PhantomTokenMeta = SimpleTokenMeta & {
|
|
10
15
|
contractType: PhantomTokenContractType;
|
|
11
16
|
};
|
|
12
|
-
export
|
|
17
|
+
export interface KYCDefaultTokenMeta extends SimpleTokenMeta {
|
|
18
|
+
contractType: typeof KYC_UNDERLYING_DEFAULT;
|
|
19
|
+
kycFactory: Address;
|
|
20
|
+
asset: Address;
|
|
21
|
+
}
|
|
22
|
+
export interface LPMonopolizedPoolMeta {
|
|
23
|
+
pool: Address;
|
|
24
|
+
wrappedUnderlying: Address;
|
|
25
|
+
unwrappedUnderlying: Address;
|
|
26
|
+
depositAllowance: bigint;
|
|
27
|
+
claimableAmount: bigint;
|
|
28
|
+
}
|
|
29
|
+
export interface KYCOnDemandLPMonopolizedMeta {
|
|
30
|
+
addr: Address;
|
|
31
|
+
version: bigint;
|
|
32
|
+
contractType: typeof KYC_ON_DEMAND_LP_MONOPOLIZED;
|
|
33
|
+
marketConfigurator: Address;
|
|
34
|
+
/**
|
|
35
|
+
* Only this user can deposit into the pool and withdraw
|
|
36
|
+
* Other users should not see it at all
|
|
37
|
+
*/
|
|
38
|
+
depositor: Address;
|
|
39
|
+
pools: LPMonopolizedPoolMeta[];
|
|
40
|
+
}
|
|
41
|
+
export type KYCOnDemandLPMeta = KYCOnDemandLPMonopolizedMeta;
|
|
42
|
+
export interface KYCOnDemandTokenMeta extends SimpleTokenMeta {
|
|
43
|
+
contractType: typeof KYC_UNDERLYING_ON_DEMAND;
|
|
44
|
+
kycFactory: Address;
|
|
45
|
+
asset: Address;
|
|
46
|
+
pool: Address;
|
|
47
|
+
marketConfigurator: Address;
|
|
48
|
+
allowedDepositors: Address[];
|
|
49
|
+
liquidityProvider: KYCOnDemandLPMeta;
|
|
50
|
+
}
|
|
51
|
+
export type KYCTokenMeta = KYCDefaultTokenMeta | KYCOnDemandTokenMeta;
|
|
52
|
+
export type TokenMetaData = SimpleTokenMeta | PhantomTokenMeta | KYCTokenMeta;
|
|
13
53
|
export {};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { AbiParametersToPrimitiveTypes, ExtractAbiFunction } from "abitype";
|
|
2
2
|
import type { Address, Hex } from "viem";
|
|
3
|
-
import type { creditAccountCompressorAbi } from "../../abi/compressors/creditAccountCompressor.js";
|
|
4
3
|
import type { gaugeCompressorAbi } from "../../abi/compressors/gaugeCompressor.js";
|
|
5
4
|
import type { marketCompressorAbi } from "../../abi/compressors/marketCompressor.js";
|
|
6
5
|
import type { peripheryCompressorAbi } from "../../abi/compressors/peripheryCompressor.js";
|
|
@@ -62,10 +61,125 @@ export interface BaseState {
|
|
|
62
61
|
* Filter criteria for querying markets.
|
|
63
62
|
**/
|
|
64
63
|
export type MarketFilter = AbiParametersToPrimitiveTypes<ExtractAbiFunction<typeof marketCompressorAbi, "getMarkets">["inputs"]>[0];
|
|
64
|
+
/**
|
|
65
|
+
* Info on credit account's assets
|
|
66
|
+
**/
|
|
67
|
+
export interface TokenInfo {
|
|
68
|
+
/**
|
|
69
|
+
* Token address.
|
|
70
|
+
**/
|
|
71
|
+
token: Address;
|
|
72
|
+
/**
|
|
73
|
+
* Token mask in the credit manager.
|
|
74
|
+
**/
|
|
75
|
+
mask: bigint;
|
|
76
|
+
/**
|
|
77
|
+
* Account's balance of token.
|
|
78
|
+
**/
|
|
79
|
+
balance: bigint;
|
|
80
|
+
/**
|
|
81
|
+
* Account's quota of token.
|
|
82
|
+
**/
|
|
83
|
+
quota: bigint;
|
|
84
|
+
/**
|
|
85
|
+
* Whether balance call was successful.
|
|
86
|
+
**/
|
|
87
|
+
success: boolean;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* On-chain state of a credit account.
|
|
91
|
+
*
|
|
92
|
+
* @remarks
|
|
93
|
+
* Fields from `totalDebtUSD` through `healthFactor` are not filled when
|
|
94
|
+
* `success` is `false`.
|
|
95
|
+
*
|
|
96
|
+
**/
|
|
97
|
+
export interface CreditAccountDataPayload {
|
|
98
|
+
/**
|
|
99
|
+
* Credit account address.
|
|
100
|
+
**/
|
|
101
|
+
creditAccount: Address;
|
|
102
|
+
/**
|
|
103
|
+
* Credit manager account is opened in.
|
|
104
|
+
**/
|
|
105
|
+
creditManager: Address;
|
|
106
|
+
/**
|
|
107
|
+
* Facade connected to account's credit manager.
|
|
108
|
+
**/
|
|
109
|
+
creditFacade: Address;
|
|
110
|
+
/**
|
|
111
|
+
* Credit manager's underlying token.
|
|
112
|
+
**/
|
|
113
|
+
underlying: Address;
|
|
114
|
+
/**
|
|
115
|
+
* Credit account's owner (contract address for KYC accounts, EOA for
|
|
116
|
+
* normal accounts).
|
|
117
|
+
**/
|
|
118
|
+
owner: Address;
|
|
119
|
+
/**
|
|
120
|
+
* Expiration timestamp, in case facade is expirable.
|
|
121
|
+
**/
|
|
122
|
+
expirationDate: number;
|
|
123
|
+
/**
|
|
124
|
+
* Bitmask of tokens enabled on credit account as collateral.
|
|
125
|
+
**/
|
|
126
|
+
enabledTokensMask: bigint;
|
|
127
|
+
/**
|
|
128
|
+
* Credit account's debt principal in underlying.
|
|
129
|
+
**/
|
|
130
|
+
debt: bigint;
|
|
131
|
+
/**
|
|
132
|
+
* Base and quota interest accrued on the credit account.
|
|
133
|
+
**/
|
|
134
|
+
accruedInterest: bigint;
|
|
135
|
+
/**
|
|
136
|
+
* Fees accrued on the credit account.
|
|
137
|
+
**/
|
|
138
|
+
accruedFees: bigint;
|
|
139
|
+
/**
|
|
140
|
+
* Account's total debt in USD.
|
|
141
|
+
**/
|
|
142
|
+
totalDebtUSD: bigint;
|
|
143
|
+
/**
|
|
144
|
+
* Account's total value in USD.
|
|
145
|
+
**/
|
|
146
|
+
totalValueUSD: bigint;
|
|
147
|
+
/**
|
|
148
|
+
* Account's threshold-weighted value in USD.
|
|
149
|
+
**/
|
|
150
|
+
twvUSD: bigint;
|
|
151
|
+
/**
|
|
152
|
+
* Account's total value in underlying.
|
|
153
|
+
**/
|
|
154
|
+
totalValue: bigint;
|
|
155
|
+
/**
|
|
156
|
+
* Account's health factor, i.e. ratio of `twvUSD` to `totalDebtUSD`,
|
|
157
|
+
* with 18 decimals precision.
|
|
158
|
+
**/
|
|
159
|
+
healthFactor: bigint;
|
|
160
|
+
/**
|
|
161
|
+
* Whether collateral calculation was successful.
|
|
162
|
+
**/
|
|
163
|
+
success: boolean;
|
|
164
|
+
/**
|
|
165
|
+
* Info on credit account's enabled tokens and tokens with non-zero balance.
|
|
166
|
+
**/
|
|
167
|
+
tokens: readonly TokenInfo[];
|
|
168
|
+
}
|
|
65
169
|
/**
|
|
66
170
|
* Full on-chain snapshot of a single credit account.
|
|
171
|
+
*
|
|
172
|
+
* @typeParam WithInvestor - When `true`, the result includes an `investor`
|
|
173
|
+
* field (`Address | undefined`). Defaults to `false` (no investor field).
|
|
67
174
|
**/
|
|
68
|
-
export type CreditAccountData =
|
|
175
|
+
export type CreditAccountData<WithInvestor extends boolean = false> = WithInvestor extends true ? CreditAccountDataPayload & {
|
|
176
|
+
/**
|
|
177
|
+
* Investor EOA address (the real person behind the account).
|
|
178
|
+
* - KYC accounts: resolved from KYC factory, always defined.
|
|
179
|
+
* - Normal accounts: `undefined` (owner IS the investor).
|
|
180
|
+
**/
|
|
181
|
+
investor: Address | undefined;
|
|
182
|
+
} : CreditAccountDataPayload;
|
|
69
183
|
/**
|
|
70
184
|
* Reward distribution details for a single reward token.
|
|
71
185
|
**/
|
|
@@ -4,7 +4,7 @@ import { z } from "zod/v4";
|
|
|
4
4
|
* Known curator names that manage Gearbox markets.
|
|
5
5
|
*
|
|
6
6
|
**/
|
|
7
|
-
export type Curator = "Chaos Labs" | "K3" | "cp0x" | "Re7" | "Invariant Group" | "Tulipa" | "M11 Credit" | "kpk" | "Hyperithm" | "UltraYield" | "TelosC" | "Gami Labs";
|
|
7
|
+
export type Curator = "Chaos Labs" | "K3" | "cp0x" | "Re7" | "Invariant Group" | "Tulipa" | "M11 Credit" | "kpk" | "Hyperithm" | "UltraYield" | "TelosC" | "Gami Labs" | "Securitize";
|
|
8
8
|
/**
|
|
9
9
|
* Extended viem {@link Chain} with Gearbox-specific metadata.
|
|
10
10
|
*
|
|
@@ -20,6 +20,10 @@ export interface GearboxChain extends Chain {
|
|
|
20
20
|
* Market configurator addresses operated by known curators on this chain.
|
|
21
21
|
**/
|
|
22
22
|
defaultMarketConfigurators: Record<Address, Curator>;
|
|
23
|
+
/**
|
|
24
|
+
* Known KYC factory addresses on this chain
|
|
25
|
+
*/
|
|
26
|
+
kycFactories?: Address[];
|
|
23
27
|
/**
|
|
24
28
|
* Market configurators used in test/staging environments.
|
|
25
29
|
**/
|
|
@@ -31,6 +31,7 @@ export declare const AP_WETH_GATEWAY = "WETH_GATEWAY";
|
|
|
31
31
|
export declare const AP_WETH_TOKEN = "WETH_TOKEN";
|
|
32
32
|
export declare const AP_ZAPPER_REGISTER = "ZAPPER_REGISTER";
|
|
33
33
|
export declare const AP_ZERO_PRICE_FEED = "ZERO_PRICE_FEED";
|
|
34
|
+
export declare const AP_KYC_COMPRESSOR = "GLOBAL::KYC_COMPRESSOR";
|
|
34
35
|
/**
|
|
35
36
|
* Default address provider address for v3.1.0
|
|
36
37
|
* Is determenistic and does not depend on the network type
|
|
@@ -3,6 +3,7 @@ import type { MarketData, MarketFilter } from "../base/index.js";
|
|
|
3
3
|
import type { GearboxSDK } from "../GearboxSDK.js";
|
|
4
4
|
import type { MarketStateHuman } from "../types/index.js";
|
|
5
5
|
import { AddressMap } from "../utils/index.js";
|
|
6
|
+
import { type DelegatedMulticall } from "../utils/viem/index.js";
|
|
6
7
|
import type { CreditSuite } from "./credit/index.js";
|
|
7
8
|
import { MarketConfiguratorContract } from "./MarketConfiguratorContract.js";
|
|
8
9
|
import { MarketSuite } from "./MarketSuite.js";
|
|
@@ -30,13 +31,13 @@ export declare class MarketRegister extends ZapperRegister {
|
|
|
30
31
|
**/
|
|
31
32
|
hydrate(state: MarketData[]): void;
|
|
32
33
|
/**
|
|
33
|
-
*
|
|
34
|
+
* @internal
|
|
35
|
+
* Returns delegated multicalls for loading all markets from the on-chain
|
|
36
|
+
* market compressor. Used by the SDK to compose batched RPC calls.
|
|
34
37
|
*
|
|
35
|
-
* @param
|
|
36
|
-
* @param ignoreUpdateablePrices - When `true`, skips generating off-chain
|
|
37
|
-
* price updates before loading
|
|
38
|
+
* @param configurators - Addresses of market configurator contracts to query.
|
|
38
39
|
**/
|
|
39
|
-
|
|
40
|
+
getLoadMulticalls(configurators: Address[]): DelegatedMulticall[];
|
|
40
41
|
/**
|
|
41
42
|
* The active filter used to scope market compressor queries.
|
|
42
43
|
* @throws If the register has not been hydrated or attached yet.
|
|
@@ -52,10 +53,6 @@ export declare class MarketRegister extends ZapperRegister {
|
|
|
52
53
|
* @param ignoreUpdateablePrices - When `true`, skips off-chain price updates.
|
|
53
54
|
**/
|
|
54
55
|
syncState(ignoreUpdateablePrices?: boolean): Promise<void>;
|
|
55
|
-
/**
|
|
56
|
-
* Loads new prices and price feeds for given oracles from PriceFeedCompressor, defaults to all oracles
|
|
57
|
-
*/
|
|
58
|
-
updatePrices(oracles?: Address[]): Promise<void>;
|
|
59
56
|
get watchAddresses(): Set<Address>;
|
|
60
57
|
/**
|
|
61
58
|
* Serializable snapshot of all loaded markets, suitable for hydration.
|
|
@@ -4,6 +4,7 @@ import { SDKConstruct } from "../base/index.js";
|
|
|
4
4
|
import type { GearboxSDK } from "../GearboxSDK.js";
|
|
5
5
|
import type { MarketStateHuman } from "../types/index.js";
|
|
6
6
|
import { CreditSuite } from "./credit/index.js";
|
|
7
|
+
import type { IKYCFactory, OpenAccountRequirements } from "./kyc/types.js";
|
|
7
8
|
import { type ILossPolicyContract } from "./loss-policy/index.js";
|
|
8
9
|
import { MarketConfiguratorContract } from "./MarketConfiguratorContract.js";
|
|
9
10
|
import type { IPriceOracleContract } from "./oracle/index.js";
|
|
@@ -22,6 +23,7 @@ export declare class MarketSuite extends SDKConstruct {
|
|
|
22
23
|
readonly state: MarketData;
|
|
23
24
|
constructor(sdk: GearboxSDK, marketData: MarketData);
|
|
24
25
|
get underlying(): Address;
|
|
26
|
+
get kycFactory(): IKYCFactory<unknown, OpenAccountRequirements> | undefined;
|
|
25
27
|
get dirty(): boolean;
|
|
26
28
|
get watchAddresses(): Set<Address>;
|
|
27
29
|
stateHuman(raw?: boolean): MarketStateHuman;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { Address } from "abitype";
|
|
2
|
+
import { SDKConstruct } from "../../base/index.js";
|
|
3
|
+
import type { DelegatedMulticall } from "../../utils/viem/index.js";
|
|
4
|
+
import { SecuritizeKYCFactory } from "./securitize/index.js";
|
|
5
|
+
import type { InvestorData, KYCCompressorResponse, KYCState, KYCStateHuman } from "./types.js";
|
|
6
|
+
export declare class KYCRegister extends SDKConstruct {
|
|
7
|
+
#private;
|
|
8
|
+
/**
|
|
9
|
+
* @internal
|
|
10
|
+
*
|
|
11
|
+
* Returns delegated multicalls for loading all KYC underlying tokens from the on-chain KYC compressor.
|
|
12
|
+
* Used by the SDK to compose batched RPC calls.
|
|
13
|
+
*
|
|
14
|
+
* @param configurators - Market configurators to query.
|
|
15
|
+
* @param kycFactories - KYC factory contracts to query.
|
|
16
|
+
* @returns
|
|
17
|
+
*/
|
|
18
|
+
getLoadMulticalls(configurators: Address[], kycFactories?: Address[]): DelegatedMulticall[];
|
|
19
|
+
/**
|
|
20
|
+
* Returns the investor data for a given investor and optional list of factories.
|
|
21
|
+
* If no factories are provided, all factories will be used.
|
|
22
|
+
* @param investor
|
|
23
|
+
* @param factories_
|
|
24
|
+
* @returns
|
|
25
|
+
*/
|
|
26
|
+
getInvestorData(investor: Address, factories_?: Address[]): Promise<InvestorData[]>;
|
|
27
|
+
get factories(): SecuritizeKYCFactory[];
|
|
28
|
+
get state(): KYCState | undefined;
|
|
29
|
+
stateHuman(raw?: boolean): KYCStateHuman;
|
|
30
|
+
setState(resp?: KYCCompressorResponse): void;
|
|
31
|
+
}
|