@gearbox-protocol/sdk 13.6.0 → 13.7.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.
Files changed (109) hide show
  1. package/dist/cjs/abi/kyc/iDSRegistryService.js +70 -0
  2. package/dist/cjs/abi/kyc/iDSToken.js +71 -0
  3. package/dist/cjs/abi/kyc/iKYCCompressor.js +196 -0
  4. package/dist/cjs/abi/kyc/iKYCFactory.js +122 -0
  5. package/dist/cjs/abi/kyc/iKYCUnderlying.js +401 -0
  6. package/dist/cjs/abi/kyc/iSecuritizeDegenNFT.js +326 -0
  7. package/dist/cjs/abi/kyc/iSecuritizeKYCFactory.js +319 -0
  8. package/dist/cjs/dev/AccountOpener.js +45 -5
  9. package/dist/cjs/history/errors.js +2 -0
  10. package/dist/cjs/sdk/GearboxSDK.js +51 -4
  11. package/dist/cjs/sdk/accounts/AbstractCreditAccountsService.js +324 -16
  12. package/dist/cjs/sdk/accounts/CreditAccountsServiceV310.js +7 -1
  13. package/dist/cjs/sdk/base/TokensMeta.js +32 -43
  14. package/dist/cjs/sdk/base/token-types.js +9 -0
  15. package/dist/cjs/sdk/chain/chains.js +2 -1
  16. package/dist/cjs/sdk/constants/address-provider.js +3 -0
  17. package/dist/cjs/sdk/market/MarketRegister.js +70 -116
  18. package/dist/cjs/sdk/market/MarketSuite.js +3 -0
  19. package/dist/cjs/sdk/market/index.js +2 -0
  20. package/dist/cjs/sdk/market/kyc/KYCRegistry.js +269 -0
  21. package/dist/cjs/sdk/market/kyc/index.js +26 -0
  22. package/dist/cjs/sdk/market/kyc/securitize/SecuritizeKYCFactory.js +244 -0
  23. package/dist/cjs/sdk/market/kyc/securitize/constants.js +28 -0
  24. package/dist/cjs/sdk/market/kyc/securitize/index.js +26 -0
  25. package/dist/cjs/sdk/market/kyc/securitize/types.js +16 -0
  26. package/dist/cjs/sdk/market/kyc/types.js +34 -0
  27. package/dist/cjs/sdk/market/pool/PoolSuite.js +3 -0
  28. package/dist/cjs/sdk/market/pool/PoolV310Contract.js +11 -2
  29. package/dist/cjs/sdk/market/pool/index.js +2 -0
  30. package/dist/cjs/sdk/market/pricefeeds/PriceFeedsRegister.js +3 -3
  31. package/dist/cjs/sdk/options.js +6 -0
  32. package/dist/cjs/sdk/pools/PoolService.js +104 -12
  33. package/dist/cjs/sdk/utils/viem/executeDelegatedMulticalls.js +38 -0
  34. package/dist/cjs/sdk/utils/viem/index.js +2 -0
  35. package/dist/esm/abi/kyc/iDSRegistryService.js +46 -0
  36. package/dist/esm/abi/kyc/iDSToken.js +47 -0
  37. package/dist/esm/abi/kyc/iKYCCompressor.js +172 -0
  38. package/dist/esm/abi/kyc/iKYCFactory.js +98 -0
  39. package/dist/esm/abi/kyc/iKYCUnderlying.js +377 -0
  40. package/dist/esm/abi/kyc/iSecuritizeDegenNFT.js +302 -0
  41. package/dist/esm/abi/kyc/iSecuritizeKYCFactory.js +295 -0
  42. package/dist/esm/dev/AccountOpener.js +47 -6
  43. package/dist/esm/history/errors.js +2 -0
  44. package/dist/esm/sdk/GearboxSDK.js +55 -5
  45. package/dist/esm/sdk/accounts/AbstractCreditAccountsService.js +328 -17
  46. package/dist/esm/sdk/accounts/CreditAccountsServiceV310.js +7 -1
  47. package/dist/esm/sdk/base/TokensMeta.js +32 -45
  48. package/dist/esm/sdk/base/token-types.js +6 -0
  49. package/dist/esm/sdk/chain/chains.js +2 -1
  50. package/dist/esm/sdk/constants/address-provider.js +2 -0
  51. package/dist/esm/sdk/market/MarketRegister.js +74 -118
  52. package/dist/esm/sdk/market/MarketSuite.js +3 -0
  53. package/dist/esm/sdk/market/index.js +1 -0
  54. package/dist/esm/sdk/market/kyc/KYCRegistry.js +253 -0
  55. package/dist/esm/sdk/market/kyc/index.js +3 -0
  56. package/dist/esm/sdk/market/kyc/securitize/SecuritizeKYCFactory.js +220 -0
  57. package/dist/esm/sdk/market/kyc/securitize/constants.js +4 -0
  58. package/dist/esm/sdk/market/kyc/securitize/index.js +3 -0
  59. package/dist/esm/sdk/market/kyc/securitize/types.js +0 -0
  60. package/dist/esm/sdk/market/kyc/types.js +9 -0
  61. package/dist/esm/sdk/market/pool/PoolSuite.js +3 -0
  62. package/dist/esm/sdk/market/pool/PoolV310Contract.js +11 -2
  63. package/dist/esm/sdk/market/pool/index.js +1 -0
  64. package/dist/esm/sdk/market/pricefeeds/PriceFeedsRegister.js +3 -3
  65. package/dist/esm/sdk/options.js +6 -0
  66. package/dist/esm/sdk/pools/PoolService.js +109 -13
  67. package/dist/esm/sdk/utils/viem/executeDelegatedMulticalls.js +14 -0
  68. package/dist/esm/sdk/utils/viem/index.js +1 -0
  69. package/dist/types/abi/kyc/iDSRegistryService.d.ts +71 -0
  70. package/dist/types/abi/kyc/iDSToken.d.ts +67 -0
  71. package/dist/types/abi/kyc/iKYCCompressor.d.ts +228 -0
  72. package/dist/types/abi/kyc/iKYCFactory.d.ts +139 -0
  73. package/dist/types/abi/kyc/iKYCUnderlying.d.ts +548 -0
  74. package/dist/types/abi/kyc/iSecuritizeDegenNFT.d.ts +404 -0
  75. package/dist/types/abi/kyc/iSecuritizeKYCFactory.d.ts +376 -0
  76. package/dist/types/sdk/GearboxSDK.d.ts +7 -0
  77. package/dist/types/sdk/accounts/AbstractCreditAccountsService.d.ts +52 -2
  78. package/dist/types/sdk/accounts/CreditAccountsServiceV310.d.ts +1 -1
  79. package/dist/types/sdk/accounts/types.d.ts +93 -13
  80. package/dist/types/sdk/base/TokensMeta.d.ts +14 -3
  81. package/dist/types/sdk/base/token-types.d.ts +44 -4
  82. package/dist/types/sdk/base/types.d.ts +116 -2
  83. package/dist/types/sdk/chain/chains.d.ts +5 -1
  84. package/dist/types/sdk/constants/address-provider.d.ts +1 -0
  85. package/dist/types/sdk/market/MarketRegister.d.ts +6 -9
  86. package/dist/types/sdk/market/MarketSuite.d.ts +2 -0
  87. package/dist/types/sdk/market/index.d.ts +1 -0
  88. package/dist/types/sdk/market/kyc/KYCRegistry.d.ts +52 -0
  89. package/dist/types/sdk/market/kyc/index.d.ts +3 -0
  90. package/dist/types/sdk/market/kyc/securitize/SecuritizeKYCFactory.d.ts +428 -0
  91. package/dist/types/sdk/market/kyc/securitize/constants.d.ts +1 -0
  92. package/dist/types/sdk/market/kyc/securitize/index.d.ts +3 -0
  93. package/dist/types/sdk/market/kyc/securitize/types.d.ts +127 -0
  94. package/dist/types/sdk/market/kyc/types.d.ts +170 -0
  95. package/dist/types/sdk/market/oracle/PriceOracleBaseContract.d.ts +3 -2
  96. package/dist/types/sdk/market/oracle/types.d.ts +3 -10
  97. package/dist/types/sdk/market/pool/PoolSuite.d.ts +2 -0
  98. package/dist/types/sdk/market/pool/PoolV310Contract.d.ts +6 -2
  99. package/dist/types/sdk/market/pool/index.d.ts +1 -0
  100. package/dist/types/sdk/market/pricefeeds/PriceFeedsRegister.d.ts +1 -1
  101. package/dist/types/sdk/market/types.d.ts +1 -1
  102. package/dist/types/sdk/options.d.ts +1 -0
  103. package/dist/types/sdk/pools/PoolService.d.ts +8 -8
  104. package/dist/types/sdk/pools/types.d.ts +1 -1
  105. package/dist/types/sdk/types/state-human.d.ts +2 -0
  106. package/dist/types/sdk/types/state.d.ts +5 -0
  107. package/dist/types/sdk/utils/viem/executeDelegatedMulticalls.d.ts +28 -0
  108. package/dist/types/sdk/utils/viem/index.d.ts +1 -0
  109. package/package.json +8 -7
@@ -0,0 +1,170 @@
1
+ import type { AbiParametersToPrimitiveTypes, ExtractAbiFunction } from "abitype";
2
+ import type { Address, ContractFunctionParameters } from "viem";
3
+ import type { iKYCCompressorAbi } from "../../../abi/kyc/iKYCCompressor.js";
4
+ import type { IBaseContract, Unarray } from "../../base/index.js";
5
+ import type { MultiCall, RawTx } from "../../types/index.js";
6
+ import type { SecuritizeInvestorData, SecuritizeKYCFactoryStateHuman, SecuritizeMulticallParams, SecuritizeOpenAccountRequirements } from "./securitize/index.js";
7
+ import { KYC_FACTORY_SECURITIZE } from "./securitize/index.js";
8
+ /**
9
+ * Discriminated union of all known KYC factory contract type strings.
10
+ **/
11
+ export declare const KYC_FACTORY_TYPES: readonly ["KYC_FACTORY::SECURITIZE"];
12
+ /**
13
+ * String literal union of known KYC factory types.
14
+ **/
15
+ export type KYCFactoryType = (typeof KYC_FACTORY_TYPES)[number];
16
+ /**
17
+ * @internal
18
+ *
19
+ * Type-level registry mapping each {@link KYCFactoryType} to its associated
20
+ * data types. Adding a new KYC factory requires a single new entry here;
21
+ * all derived types ({@link InvestorData}, {@link AnyOpenAccountRequirements},
22
+ * etc.) update automatically.
23
+ **/
24
+ interface KYCFactoryTypeMap {
25
+ [KYC_FACTORY_SECURITIZE]: {
26
+ investorData: SecuritizeInvestorData;
27
+ openAccountRequirements: SecuritizeOpenAccountRequirements;
28
+ stateHuman: SecuritizeKYCFactoryStateHuman;
29
+ multicallParams: SecuritizeMulticallParams;
30
+ };
31
+ }
32
+ /** Extracts the investor data type for a specific factory type `T`. */
33
+ type KYCInvestorDataFor<T extends KYCFactoryType> = KYCFactoryTypeMap[T]["investorData"];
34
+ /** Extracts the open-account requirements type for a specific factory type `T`. */
35
+ type KYCOpenAccountReqFor<T extends KYCFactoryType> = KYCFactoryTypeMap[T]["openAccountRequirements"];
36
+ /** Extracts the multicall/openCreditAccount extra params type for a specific factory type `T`. */
37
+ type KYCMulticallParamsFor<T extends KYCFactoryType> = KYCFactoryTypeMap[T]["multicallParams"];
38
+ /**
39
+ * Raw return type of `KYCCompressor.getKYCMarketsData`.
40
+ **/
41
+ export type KYCCompressorResponse = AbiParametersToPrimitiveTypes<ExtractAbiFunction<typeof iKYCCompressorAbi, "getKYCMarketsData">["outputs"]>;
42
+ /**
43
+ * On-chain state of a KYC underlying token.
44
+ **/
45
+ export type KYCUnderlyingData = Unarray<KYCCompressorResponse[0]>;
46
+ /**
47
+ * On-chain state of a KYC factory.
48
+ **/
49
+ export type KYCFactoryData = Unarray<KYCCompressorResponse[1]>;
50
+ /**
51
+ * Typed contract call parameters for `KYCCompressor.getKYCMarketsData`.
52
+ **/
53
+ export type KYCCompressorCall = ContractFunctionParameters<typeof iKYCCompressorAbi, "view", "getKYCMarketsData">;
54
+ /**
55
+ * Single element of the `KYCCompressor.getKYCInvestorData` return array.
56
+ * Contains per-factory credit accounts and factory-specific extra details.
57
+ **/
58
+ export type KYCCompressorInvestorData = Unarray<AbiParametersToPrimitiveTypes<ExtractAbiFunction<typeof iKYCCompressorAbi, "getKYCInvestorData">["outputs"]>[0]>;
59
+ /**
60
+ * Full KYC compressor response, used as the persisted/hydrated state.
61
+ **/
62
+ export type KYCState = KYCCompressorResponse;
63
+ /**
64
+ * Investor data decoded from the KYC compressor, union of all factory types.
65
+ **/
66
+ export type InvestorData = KYCFactoryTypeMap[KYCFactoryType]["investorData"];
67
+ /**
68
+ * Human-readable KYC factory state, union of all factory types.
69
+ **/
70
+ export type KYCFactoryStateHuman = KYCFactoryTypeMap[KYCFactoryType]["stateHuman"];
71
+ /**
72
+ * Human-readable snapshot of the full KYC registry state.
73
+ **/
74
+ export interface KYCStateHuman {
75
+ /** State of each loaded KYC factory. */
76
+ factories: KYCFactoryStateHuman[];
77
+ }
78
+ /**
79
+ * Open-account requirements for any KYC factory (union of all factory types).
80
+ **/
81
+ export type OpenAccountRequirements = KYCFactoryTypeMap[KYCFactoryType]["openAccountRequirements"];
82
+ /**
83
+ * Shared interface for all KYC factory contracts.
84
+ *
85
+ * Parameterised by a single factory type literal `T` which indexes into
86
+ * {@link KYCFactoryTypeMap} to derive all associated data types.
87
+ *
88
+ * @typeParam T - factory type
89
+ **/
90
+ export interface IKYCFactory<T extends KYCFactoryType = KYCFactoryType> extends IBaseContract {
91
+ /**
92
+ * Narrowed factory type discriminant
93
+ **/
94
+ readonly contractType: T;
95
+ /**
96
+ * @internal
97
+ *
98
+ * Decodes factory-specific extra details from the compressor's investor data.
99
+ * Each factory knows how to decode its own extra details.
100
+ *
101
+ * @param data - raw KYCCompressor InvestorData
102
+ **/
103
+ decodeInvestorData(data: KYCCompressorInvestorData): KYCInvestorDataFor<T>;
104
+ /**
105
+ * Returns the investor address for a credit account.
106
+ * @param creditAccount - credit account address
107
+ * @param fromCache - if true, use and update an in-memory cache
108
+ * (creditAccount → investor). On cache miss, loads from contract and
109
+ * stores the result for future calls.
110
+ **/
111
+ getInvestor(creditAccount: Address, fromCache?: boolean): Promise<Address>;
112
+ /**
113
+ * Returns address to which approval should be given on collateral token
114
+ *
115
+ * @param options - either `{ creditManager, creditAccount }` for an
116
+ * existing account or `{ creditManager, borrower }` for a new one
117
+ **/
118
+ getApprovalAddress(options: {
119
+ creditManager: Address;
120
+ borrower: Address;
121
+ } | {
122
+ creditManager: Address;
123
+ creditAccount: Address;
124
+ }): Promise<Address>;
125
+ /**
126
+ * Returns the wallet address for a credit account.
127
+ * Wallet is a smart contract that owns the credit account, and
128
+ * it is different from the investor address (actual user).
129
+ * @param creditAccount - credit account address
130
+ **/
131
+ getWallet(creditAccount: Address): Promise<Address>;
132
+ /**
133
+ * Creates a raw transaction to perform operations on a credit account.
134
+ * Similar to {@link CreditFacadeV310Contract.multicall}.
135
+ *
136
+ * @param creditAccount - credit account address
137
+ * @param calls - calls to perform
138
+ * @param options - optional factory-specific parameters (e.g. tokens to
139
+ * register, signatures to cache). When omitted the implementation
140
+ * uses sensible defaults (typically empty arrays).
141
+ **/
142
+ multicall(creditAccount: Address, calls: MultiCall[], options?: KYCMulticallParamsFor<T>): RawTx;
143
+ /**
144
+ * Checks if the user can open a credit account with this factory.
145
+ * @param investor - investor address
146
+ * @returns open account requirements for the investor, or `undefined` if the
147
+ * user can open a credit account without any further actions
148
+ **/
149
+ getOpenAccountRequirements(investor: Address): Promise<KYCOpenAccountReqFor<T> | undefined>;
150
+ /**
151
+ * Creates a raw transaction to open a credit account.
152
+ * Similar to {@link CreditFacadeV310Contract.openCreditAccount}.
153
+ *
154
+ * @param creditManager - credit manager address
155
+ * @param calls - initial calls to perform
156
+ * @param options - optional factory-specific parameters (e.g. tokens to
157
+ * register, signatures to cache). When omitted the implementation
158
+ * uses sensible defaults (typically empty arrays).
159
+ **/
160
+ openCreditAccount(creditManager: Address, calls: MultiCall[], options?: KYCMulticallParamsFor<T>): RawTx;
161
+ }
162
+ /**
163
+ * Narrows an {@link IKYCFactory} to a specific factory type.
164
+ *
165
+ * @param factory - factory instance to check
166
+ * @param type - expected factory type literal
167
+ * @returns `true` if `factory.factoryType === type`
168
+ **/
169
+ export declare function isKYCFactory<T extends KYCFactoryType>(factory: IKYCFactory, type: T): factory is IKYCFactory<T>;
170
+ export {};
@@ -5,10 +5,11 @@ import { BaseContract } from "../../base/index.js";
5
5
  import type { GearboxSDK } from "../../GearboxSDK.js";
6
6
  import type { PriceOracleStateHuman } from "../../types/index.js";
7
7
  import { AddressMap } from "../../utils/index.js";
8
+ import type { DelegatedMulticall } from "../../utils/viem/index.js";
8
9
  import type { IPriceFeedContract, UpdatePriceFeedsResult } from "../pricefeeds/index.js";
9
10
  import { PriceFeedRef } from "../pricefeeds/index.js";
10
11
  import PriceFeedAnswerMap from "./PriceFeedAnswerMap.js";
11
- import type { DelegatedOracleMulticall, IPriceOracleContract, OnDemandPriceUpdates, PriceFeedsForTokensOptions } from "./types.js";
12
+ import type { IPriceOracleContract, OnDemandPriceUpdates, PriceFeedsForTokensOptions } from "./types.js";
12
13
  /**
13
14
  * Base implementation of the Gearbox price oracle.
14
15
  *
@@ -74,7 +75,7 @@ export declare abstract class PriceOracleBaseContract<abi extends Abi | readonly
74
75
  /**
75
76
  * {@inheritDoc IPriceOracleContract.syncStateMulticall}
76
77
  **/
77
- syncStateMulticall(): DelegatedOracleMulticall;
78
+ syncStateMulticall(): DelegatedMulticall;
78
79
  /**
79
80
  * {@inheritDoc IPriceOracleContract.watchAddresses}
80
81
  **/
@@ -1,8 +1,8 @@
1
- import type { Address, ContractFunctionParameters, ContractFunctionReturnType } from "viem";
2
- import type { priceFeedCompressorAbi } from "../../../abi/compressors/priceFeedCompressor.js";
1
+ import type { Address } from "viem";
3
2
  import type { IBaseContract } from "../../base/index.js";
4
3
  import type { MultiCall, PriceOracleStateHuman } from "../../types/index.js";
5
4
  import type { AddressMap } from "../../utils/index.js";
5
+ import type { DelegatedMulticall } from "../../utils/viem/index.js";
6
6
  import type { IPriceFeedContract, PriceFeedRef, PriceUpdate, UpdatePriceFeedsResult } from "../pricefeeds/index.js";
7
7
  import type PriceFeedAnswerMap from "./PriceFeedAnswerMap.js";
8
8
  /**
@@ -71,7 +71,7 @@ export interface IPriceOracleContract extends IBaseContract {
71
71
  /**
72
72
  * @internal
73
73
  **/
74
- syncStateMulticall: () => DelegatedOracleMulticall;
74
+ syncStateMulticall: () => DelegatedMulticall;
75
75
  /**
76
76
  * Checks whether the given price feed address appears anywhere in this
77
77
  * oracle's feed tree (including as a dependency of a composite feed,
@@ -124,10 +124,3 @@ export interface IPriceOracleContract extends IBaseContract {
124
124
  **/
125
125
  stateHuman: (raw?: boolean) => PriceOracleStateHuman;
126
126
  }
127
- /**
128
- * @internal
129
- **/
130
- export interface DelegatedOracleMulticall {
131
- call: ContractFunctionParameters<typeof priceFeedCompressorAbi, "view", "getPriceOracleState">;
132
- onResult: (resp: ContractFunctionReturnType<typeof priceFeedCompressorAbi, "view", "getPriceOracleState">) => void;
133
- }
@@ -3,6 +3,7 @@ import type { MarketData } from "../../base/index.js";
3
3
  import { SDKConstruct } from "../../base/index.js";
4
4
  import type { GearboxSDK } from "../../GearboxSDK.js";
5
5
  import type { PoolSuiteStateHuman } from "../../types/index.js";
6
+ import type { IKYCFactory } from "../kyc/types.js";
6
7
  import type { MarketConfiguratorContract } from "../MarketConfiguratorContract.js";
7
8
  import { GaugeContract } from "./GaugeContract.js";
8
9
  import { LinearInterestRateModelContract } from "./LinearInterestRateModelContract.js";
@@ -20,6 +21,7 @@ export declare class PoolSuite extends SDKConstruct {
20
21
  get linearModel(): LinearInterestRateModelContract;
21
22
  get marketConfigurator(): MarketConfiguratorContract;
22
23
  get underlying(): Address;
24
+ get kycFactory(): IKYCFactory | undefined;
23
25
  get dirty(): boolean;
24
26
  get watchAddresses(): Set<Address>;
25
27
  stateHuman(raw?: boolean): PoolSuiteStateHuman;
@@ -1,8 +1,10 @@
1
1
  import type { ContractEventName, DecodeFunctionDataReturnType, Log } from "viem";
2
- import type { ConstructOptions, CreditManagerDebtParams, PoolState } from "../../base/index.js";
2
+ import type { CreditManagerDebtParams, PoolState } from "../../base/index.js";
3
3
  import { BaseContract } from "../../base/index.js";
4
+ import type { GearboxSDK } from "../../GearboxSDK.js";
4
5
  import type { PoolStateHuman } from "../../types/index.js";
5
6
  import { AddressMap } from "../../utils/index.js";
7
+ import type { IKYCFactory } from "../kyc/types.js";
6
8
  declare const abi: readonly [{
7
9
  readonly type: "function";
8
10
  readonly inputs: readonly [];
@@ -1130,8 +1132,10 @@ type abi = typeof abi;
1130
1132
  export interface PoolV310Contract extends Omit<PoolState, "baseParams" | "creditManagerDebtParams" | "name">, BaseContract<abi> {
1131
1133
  }
1132
1134
  export declare class PoolV310Contract extends BaseContract<abi> {
1135
+ #private;
1133
1136
  readonly creditManagerDebtParams: AddressMap<CreditManagerDebtParams>;
1134
- constructor(options: ConstructOptions, data: PoolState);
1137
+ constructor(sdk: GearboxSDK, data: PoolState);
1138
+ get kycFactory(): IKYCFactory | undefined;
1135
1139
  stateHuman(raw?: boolean): PoolStateHuman;
1136
1140
  processLog(log: Log<bigint, number, false, undefined, undefined, abi, ContractEventName<abi>>): void;
1137
1141
  protected stringifyFunctionParams(params: DecodeFunctionDataReturnType<abi>): string[];
@@ -1,4 +1,5 @@
1
1
  export * from "./GaugeContract.js";
2
2
  export * from "./LinearInterestRateModelContract.js";
3
3
  export * from "./PoolSuite.js";
4
+ export * from "./PoolV310Contract.js";
4
5
  export * from "./types.js";
@@ -152,7 +152,7 @@ export declare class PriceFeedRegister extends SDKConstruct implements IHooks<Pr
152
152
  * Loads PARTIAL information about all updatable price feeds from MarketCompressor
153
153
  * Discovered price feeds are not saved anywhere in PriceFeedRegister, and can later be used to load price feed updates
154
154
  */
155
- getPartialUpdatablePriceFeeds(configurators: Address[], pools?: Address[]): Promise<IPriceFeedContract[]>;
155
+ getPartialUpdatablePriceFeeds(configurators: Address[]): Promise<IPriceFeedContract[]>;
156
156
  /**
157
157
  * Instantiates the appropriate price feed contract wrapper based on
158
158
  * the `contractType` discriminator in the node's base params.
@@ -5,6 +5,6 @@ import type { Unarray } from "../base/index.js";
5
5
  type CompressorZapperData = Unarray<AbiParametersToPrimitiveTypes<ExtractAbiFunction<typeof peripheryCompressorAbi, "getZappers">["outputs"]>>;
6
6
  export interface ZapperData extends CompressorZapperData {
7
7
  pool: Address;
8
- type: "migration" | "base";
8
+ type: "migration" | "kyc" | "base";
9
9
  }
10
10
  export {};
@@ -7,6 +7,7 @@ import type { ILogger } from "./types/index.js";
7
7
  export declare const SDKOptions: z.ZodObject<{
8
8
  addressProvider: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>;
9
9
  marketConfigurators: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>>;
10
+ kycFactories: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>>;
10
11
  blockNumber: z.ZodOptional<z.ZodUnion<readonly [z.ZodBigInt, z.ZodNumber]>>;
11
12
  ignoreUpdateablePrices: z.ZodOptional<z.ZodBoolean>;
12
13
  ignoreMarkets: z.ZodOptional<z.ZodArray<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>>;
@@ -4,35 +4,35 @@ import type { AddLiquidityProps, DepositMetadata, IPoolsService, PoolServiceCall
4
4
  export declare class PoolService extends SDKConstruct implements IPoolsService {
5
5
  #private;
6
6
  /**
7
- * @inheritdoc IPoolsService.getDepositTokensIn
7
+ * {@inheritDoc IPoolsService.getDepositTokensIn}
8
8
  */
9
9
  getDepositTokensIn(pool: Address): Address[];
10
10
  /**
11
- * @inheritdoc IPoolsService.getDepositTokensOut
11
+ * {@inheritDoc IPoolsService.getDepositTokensOut}
12
12
  */
13
13
  getDepositTokensOut(pool: Address, tokenIn: Address): Address[];
14
14
  /**
15
- * @inheritdoc IPoolsService.getDepositMetadata
15
+ * {@inheritDoc IPoolsService.getDepositMetadata}
16
16
  */
17
17
  getDepositMetadata(pool: Address, tokenIn: Address, tokenOut?: Address): DepositMetadata;
18
18
  /**
19
- * @inheritdoc IPoolsService.addLiquidity
19
+ * {@inheritDoc IPoolsService.addLiquidity}
20
20
  */
21
21
  addLiquidity(props: AddLiquidityProps): PoolServiceCall | undefined;
22
22
  /**
23
- * @inheritdoc IPoolsService.getWithdrawalTokensIn
23
+ * {@inheritDoc IPoolsService.getWithdrawalTokensIn}
24
24
  */
25
25
  getWithdrawalTokensIn(pool: Address): Address[];
26
26
  /**
27
- * @inheritdoc IPoolsService.getWithdrawalTokensOut
27
+ * {@inheritDoc IPoolsService.getWithdrawalTokensOut}
28
28
  */
29
29
  getWithdrawalTokensOut(pool: Address, tokenIn: Address): Address[];
30
30
  /**
31
- * @inheritdoc IPoolsService.removeLiquidity
31
+ * {@inheritDoc IPoolsService.removeLiquidity}
32
32
  */
33
33
  removeLiquidity(props: RemoveLiquidityProps): PoolServiceCall;
34
34
  /**
35
- * @inheritdoc IPoolsService.getWithdrawalMetadata
35
+ * {@inheritDoc IPoolsService.getWithdrawalMetadata}
36
36
  */
37
37
  getWithdrawalMetadata(pool: Address, tokenIn: Address, tokenOut?: Address): WithdrawalMetadata;
38
38
  }
@@ -53,7 +53,7 @@ export interface RemoveLiquidityProps {
53
53
  permit: PermitResult | undefined;
54
54
  meta: WithdrawalMetadata;
55
55
  }
56
- export type MarketType = "classic";
56
+ export type MarketType = "kyc-on-demand" | "kyc-default" | "classic";
57
57
  export interface DepositMetadata {
58
58
  /**
59
59
  * Zapper that will perform the deposit, undefined in case of direct pool underlying deposit
@@ -1,6 +1,7 @@
1
1
  import type { Address } from "viem";
2
2
  import type { TokenMetaData } from "../base/index.js";
3
3
  import type { PriceFeedContractType } from "../market/index.js";
4
+ import type { KYCStateHuman } from "../market/kyc/index.js";
4
5
  export interface BaseContractStateHuman {
5
6
  address: string;
6
7
  version: number;
@@ -199,4 +200,5 @@ export interface GearboxStateHuman {
199
200
  markets: MarketStateHuman[];
200
201
  plugins: Record<string, unknown>;
201
202
  tokens: TokenMetaData[];
203
+ kyc: KYCStateHuman;
202
204
  }
@@ -1,6 +1,7 @@
1
1
  import type { MarketData } from "../base/index.js";
2
2
  import type { NetworkType } from "../chain/chains.js";
3
3
  import type { AddressProviderState } from "../core/index.js";
4
+ import type { KYCState } from "../market/kyc/index.js";
4
5
  import type { PluginStatesMap, PluginsMap } from "../plugins/index.js";
5
6
  /**
6
7
  * Complete serialisable snapshot of the Gearbox SDK state.
@@ -40,6 +41,10 @@ export interface GearboxState<Plugins extends PluginsMap = {}> {
40
41
  * All loaded market data.
41
42
  **/
42
43
  markets: MarketData[];
44
+ /**
45
+ * KYC compressor state snapshot, if KYC factories were loaded.
46
+ **/
47
+ kyc?: KYCState;
43
48
  /**
44
49
  * Per-plugin serialised state.
45
50
  **/
@@ -0,0 +1,28 @@
1
+ import type { Chain, Client, ContractFunctionParameters, Transport } from "viem";
2
+ import type { IPriceUpdateTx } from "../../types/index.js";
3
+ /**
4
+ * A contract call paired with a callback that receives its decoded result.
5
+ * Used to compose batched on-chain reads that are executed together inside a
6
+ * single {@link simulateWithPriceUpdates} call.
7
+ **/
8
+ export interface DelegatedMulticall {
9
+ /** Contract call parameters (ABI, address, function name, args). */
10
+ call: ContractFunctionParameters;
11
+ /** Callback invoked with the decoded return value after simulation. */
12
+ onResult: (resp: unknown) => void;
13
+ }
14
+ /**
15
+ * Executes multiple contract read calls in a single
16
+ * {@link simulateWithPriceUpdates} batch and dispatches each result to its
17
+ * corresponding {@link DelegatedMulticall.onResult} callback.
18
+ *
19
+ * @param client - Viem public client.
20
+ * @param multicalls - Calls to execute with their result handlers.
21
+ * @param opts - Price-update transactions, target block number, and optional
22
+ * gas limit forwarded to the simulation.
23
+ **/
24
+ export declare function executeDelegatedMulticalls(client: Client<Transport, Chain>, multicalls: DelegatedMulticall[], opts: {
25
+ priceUpdates: IPriceUpdateTx[];
26
+ blockNumber: bigint;
27
+ gas?: bigint;
28
+ }): Promise<void>;
@@ -1,4 +1,5 @@
1
1
  export * from "./cast.js";
2
+ export * from "./executeDelegatedMulticalls.js";
2
3
  export * from "./getLogsPaginated.js";
3
4
  export * from "./getLogsSafe.js";
4
5
  export * from "./sendRawTx.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "13.6.0",
3
+ "version": "13.7.0-kyc.2",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/sdk/index.js",
@@ -89,12 +89,12 @@
89
89
  "zod": "^4.3.6"
90
90
  },
91
91
  "devDependencies": {
92
- "@biomejs/biome": "^2.4.10",
92
+ "@biomejs/biome": "^2.4.11",
93
93
  "@commitlint/cli": "^20.5.0",
94
94
  "@commitlint/config-conventional": "^20.5.0",
95
- "@gearbox-protocol/biome-config": "^1.0.25",
95
+ "@gearbox-protocol/biome-config": "^1.0.26",
96
96
  "@types/cross-spawn": "^6.0.6",
97
- "axios": "^1.14.0",
97
+ "axios": "^1.15.0",
98
98
  "cross-spawn": "^7.0.6",
99
99
  "husky": "^9.1.7",
100
100
  "lint-staged": "^16.4.0",
@@ -102,10 +102,11 @@
102
102
  "pino-pretty": "^13.1.3",
103
103
  "tsup": "^8.5.1",
104
104
  "tsx": "^4.21.0",
105
- "typescript": "^5.9.3",
105
+ "typescript": "^6.0.2",
106
106
  "viem-deal": "^2.0.4",
107
- "vite": "^8.0.3",
108
- "vitest": "^4.1.2"
107
+ "vite": "^8.0.8",
108
+ "vitest": "^4.1.4",
109
+ "yaml": "^2.8.3"
109
110
  },
110
111
  "peerDependencies": {
111
112
  "axios": "^1.0.0",