@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.
Files changed (98) hide show
  1. package/dist/cjs/abi/kyc/iKYCCompressor.js +196 -0
  2. package/dist/cjs/abi/kyc/iKYCFactory.js +122 -0
  3. package/dist/cjs/abi/kyc/iKYCUnderlying.js +401 -0
  4. package/dist/cjs/abi/kyc/iSecuritizeDegenNFT.js +326 -0
  5. package/dist/cjs/abi/kyc/iSecuritizeKYCFactory.js +319 -0
  6. package/dist/cjs/dev/AccountOpener.js +45 -5
  7. package/dist/cjs/sdk/GearboxSDK.js +51 -4
  8. package/dist/cjs/sdk/accounts/AbstractCreditAccountsService.js +331 -16
  9. package/dist/cjs/sdk/accounts/CreditAccountsServiceV310.js +7 -1
  10. package/dist/cjs/sdk/base/TokensMeta.js +32 -43
  11. package/dist/cjs/sdk/base/token-types.js +9 -0
  12. package/dist/cjs/sdk/chain/chains.js +2 -1
  13. package/dist/cjs/sdk/constants/address-provider.js +3 -0
  14. package/dist/cjs/sdk/market/MarketRegister.js +70 -116
  15. package/dist/cjs/sdk/market/MarketSuite.js +3 -0
  16. package/dist/cjs/sdk/market/kyc/KYCRegister.js +255 -0
  17. package/dist/cjs/sdk/market/kyc/index.js +24 -0
  18. package/dist/cjs/sdk/market/kyc/securitize/SecuritizeKYCFactory.js +229 -0
  19. package/dist/cjs/sdk/market/kyc/securitize/constants.js +28 -0
  20. package/dist/cjs/sdk/market/kyc/securitize/index.js +26 -0
  21. package/dist/cjs/sdk/market/kyc/securitize/types.js +16 -0
  22. package/dist/cjs/sdk/market/kyc/types.js +29 -0
  23. package/dist/cjs/sdk/market/pool/PoolSuite.js +3 -0
  24. package/dist/cjs/sdk/market/pool/PoolV310Contract.js +11 -2
  25. package/dist/cjs/sdk/market/pool/index.js +2 -0
  26. package/dist/cjs/sdk/market/pricefeeds/PriceFeedsRegister.js +3 -3
  27. package/dist/cjs/sdk/options.js +6 -0
  28. package/dist/cjs/sdk/pools/PoolService.js +104 -12
  29. package/dist/cjs/sdk/utils/viem/executeDelegatedMulticalls.js +38 -0
  30. package/dist/cjs/sdk/utils/viem/index.js +2 -0
  31. package/dist/esm/abi/kyc/iKYCCompressor.js +172 -0
  32. package/dist/esm/abi/kyc/iKYCFactory.js +98 -0
  33. package/dist/esm/abi/kyc/iKYCUnderlying.js +377 -0
  34. package/dist/esm/abi/kyc/iSecuritizeDegenNFT.js +302 -0
  35. package/dist/esm/abi/kyc/iSecuritizeKYCFactory.js +295 -0
  36. package/dist/esm/dev/AccountOpener.js +47 -6
  37. package/dist/esm/sdk/GearboxSDK.js +55 -5
  38. package/dist/esm/sdk/accounts/AbstractCreditAccountsService.js +332 -17
  39. package/dist/esm/sdk/accounts/CreditAccountsServiceV310.js +7 -1
  40. package/dist/esm/sdk/base/TokensMeta.js +32 -45
  41. package/dist/esm/sdk/base/token-types.js +6 -0
  42. package/dist/esm/sdk/chain/chains.js +2 -1
  43. package/dist/esm/sdk/constants/address-provider.js +2 -0
  44. package/dist/esm/sdk/market/MarketRegister.js +74 -118
  45. package/dist/esm/sdk/market/MarketSuite.js +3 -0
  46. package/dist/esm/sdk/market/kyc/KYCRegister.js +239 -0
  47. package/dist/esm/sdk/market/kyc/index.js +2 -0
  48. package/dist/esm/sdk/market/kyc/securitize/SecuritizeKYCFactory.js +205 -0
  49. package/dist/esm/sdk/market/kyc/securitize/constants.js +4 -0
  50. package/dist/esm/sdk/market/kyc/securitize/index.js +3 -0
  51. package/dist/esm/sdk/market/kyc/securitize/types.js +0 -0
  52. package/dist/esm/sdk/market/kyc/types.js +5 -0
  53. package/dist/esm/sdk/market/pool/PoolSuite.js +3 -0
  54. package/dist/esm/sdk/market/pool/PoolV310Contract.js +11 -2
  55. package/dist/esm/sdk/market/pool/index.js +1 -0
  56. package/dist/esm/sdk/market/pricefeeds/PriceFeedsRegister.js +3 -3
  57. package/dist/esm/sdk/options.js +6 -0
  58. package/dist/esm/sdk/pools/PoolService.js +109 -13
  59. package/dist/esm/sdk/utils/viem/executeDelegatedMulticalls.js +14 -0
  60. package/dist/esm/sdk/utils/viem/index.js +1 -0
  61. package/dist/types/abi/kyc/iKYCCompressor.d.ts +228 -0
  62. package/dist/types/abi/kyc/iKYCFactory.d.ts +139 -0
  63. package/dist/types/abi/kyc/iKYCUnderlying.d.ts +548 -0
  64. package/dist/types/abi/kyc/iSecuritizeDegenNFT.d.ts +404 -0
  65. package/dist/types/abi/kyc/iSecuritizeKYCFactory.d.ts +376 -0
  66. package/dist/types/sdk/GearboxSDK.d.ts +7 -0
  67. package/dist/types/sdk/accounts/AbstractCreditAccountsService.d.ts +55 -2
  68. package/dist/types/sdk/accounts/CreditAccountsServiceV310.d.ts +1 -1
  69. package/dist/types/sdk/accounts/types.d.ts +93 -13
  70. package/dist/types/sdk/base/TokensMeta.d.ts +14 -3
  71. package/dist/types/sdk/base/token-types.d.ts +44 -4
  72. package/dist/types/sdk/base/types.d.ts +116 -2
  73. package/dist/types/sdk/chain/chains.d.ts +5 -1
  74. package/dist/types/sdk/constants/address-provider.d.ts +1 -0
  75. package/dist/types/sdk/market/MarketRegister.d.ts +6 -9
  76. package/dist/types/sdk/market/MarketSuite.d.ts +2 -0
  77. package/dist/types/sdk/market/kyc/KYCRegister.d.ts +31 -0
  78. package/dist/types/sdk/market/kyc/index.d.ts +2 -0
  79. package/dist/types/sdk/market/kyc/securitize/SecuritizeKYCFactory.d.ts +420 -0
  80. package/dist/types/sdk/market/kyc/securitize/constants.d.ts +1 -0
  81. package/dist/types/sdk/market/kyc/securitize/index.d.ts +3 -0
  82. package/dist/types/sdk/market/kyc/securitize/types.d.ts +62 -0
  83. package/dist/types/sdk/market/kyc/types.d.ts +93 -0
  84. package/dist/types/sdk/market/oracle/PriceOracleBaseContract.d.ts +3 -2
  85. package/dist/types/sdk/market/oracle/types.d.ts +3 -10
  86. package/dist/types/sdk/market/pool/PoolSuite.d.ts +2 -0
  87. package/dist/types/sdk/market/pool/PoolV310Contract.d.ts +6 -2
  88. package/dist/types/sdk/market/pool/index.d.ts +1 -0
  89. package/dist/types/sdk/market/pricefeeds/PriceFeedsRegister.d.ts +1 -1
  90. package/dist/types/sdk/market/types.d.ts +1 -1
  91. package/dist/types/sdk/options.d.ts +1 -0
  92. package/dist/types/sdk/pools/PoolService.d.ts +8 -8
  93. package/dist/types/sdk/pools/types.d.ts +1 -1
  94. package/dist/types/sdk/types/state-human.d.ts +2 -0
  95. package/dist/types/sdk/types/state.d.ts +5 -0
  96. package/dist/types/sdk/utils/viem/executeDelegatedMulticalls.d.ts +11 -0
  97. package/dist/types/sdk/utils/viem/index.d.ts +1 -0
  98. package/package.json +3 -2
@@ -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,11 @@
1
+ import type { Chain, Client, ContractFunctionParameters, Transport } from "viem";
2
+ import type { IPriceUpdateTx } from "../../types/index.js";
3
+ export interface DelegatedMulticall {
4
+ call: ContractFunctionParameters;
5
+ onResult: (resp: unknown) => void;
6
+ }
7
+ export declare function executeDelegatedMulticalls(client: Client<Transport, Chain>, multicalls: DelegatedMulticall[], opts: {
8
+ priceUpdates: IPriceUpdateTx[];
9
+ blockNumber: bigint;
10
+ gas?: bigint;
11
+ }): 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.5.0",
3
+ "version": "13.6.0-kyc.2",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/sdk/index.js",
@@ -105,7 +105,8 @@
105
105
  "typescript": "^5.9.3",
106
106
  "viem-deal": "^2.0.4",
107
107
  "vite": "^8.0.3",
108
- "vitest": "^4.1.2"
108
+ "vitest": "^4.1.2",
109
+ "yaml": "^2.8.3"
109
110
  },
110
111
  "peerDependencies": {
111
112
  "axios": "^1.0.0",