@gearbox-protocol/sdk 13.4.0 → 13.5.0-next.1

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 (90) hide show
  1. package/dist/cjs/abi/310/iSecuritizeDegenNFT.js +263 -0
  2. package/dist/cjs/abi/310/iSecuritizeKYCFactory.js +278 -0
  3. package/dist/cjs/{sdk/pools/PoolServiceV310.js → abi/iStateSerializer.js} +14 -8
  4. package/dist/cjs/dev/AccountOpener.js +45 -5
  5. package/dist/cjs/sdk/accounts/AbstractCreditAccountsService.js +375 -13
  6. package/dist/cjs/sdk/accounts/CreditAccountsServiceV310.js +16 -5
  7. package/dist/cjs/sdk/base/ChainContractsRegister.js +1 -1
  8. package/dist/cjs/sdk/base/TokensMeta.js +255 -32
  9. package/dist/cjs/sdk/base/index.js +2 -0
  10. package/dist/cjs/sdk/{constants/phantom-tokens.js → base/token-types.js} +9 -3
  11. package/dist/cjs/sdk/chain/chains.js +2 -1
  12. package/dist/cjs/sdk/constants/index.js +0 -2
  13. package/dist/cjs/sdk/market/MarketRegister.js +5 -2
  14. package/dist/cjs/sdk/market/MarketSuite.js +6 -0
  15. package/dist/cjs/{plugins/zappers/extraZappers.js → sdk/market/ZapperRegister.js} +110 -6
  16. package/dist/cjs/sdk/market/index.js +3 -1
  17. package/dist/cjs/sdk/market/pool/PoolSuite.js +3 -0
  18. package/dist/cjs/sdk/market/pool/PoolV310Contract.js +17 -2
  19. package/dist/cjs/sdk/market/pool/SecuritizeKYCFactory.js +97 -0
  20. package/dist/cjs/sdk/market/pool/index.js +4 -0
  21. package/dist/cjs/sdk/pools/PoolService.js +391 -0
  22. package/dist/cjs/sdk/pools/index.js +2 -4
  23. package/dist/esm/abi/310/iSecuritizeDegenNFT.js +239 -0
  24. package/dist/esm/abi/310/iSecuritizeKYCFactory.js +254 -0
  25. package/dist/esm/abi/iStateSerializer.js +12 -0
  26. package/dist/esm/dev/AccountOpener.js +47 -6
  27. package/dist/esm/sdk/accounts/AbstractCreditAccountsService.js +375 -13
  28. package/dist/esm/sdk/accounts/CreditAccountsServiceV310.js +16 -5
  29. package/dist/esm/sdk/base/ChainContractsRegister.js +1 -1
  30. package/dist/esm/sdk/base/TokensMeta.js +261 -32
  31. package/dist/esm/sdk/base/index.js +1 -0
  32. package/dist/esm/sdk/{constants/phantom-tokens.js → base/token-types.js} +4 -0
  33. package/dist/esm/sdk/chain/chains.js +2 -1
  34. package/dist/esm/sdk/constants/index.js +0 -1
  35. package/dist/esm/sdk/market/MarketRegister.js +5 -2
  36. package/dist/esm/sdk/market/MarketSuite.js +6 -0
  37. package/dist/esm/{plugins/zappers/extraZappers.js → sdk/market/ZapperRegister.js} +109 -2
  38. package/dist/esm/sdk/market/index.js +1 -0
  39. package/dist/esm/sdk/market/pool/PoolSuite.js +3 -0
  40. package/dist/esm/sdk/market/pool/PoolV310Contract.js +17 -2
  41. package/dist/esm/sdk/market/pool/SecuritizeKYCFactory.js +73 -0
  42. package/dist/esm/sdk/market/pool/index.js +2 -0
  43. package/dist/esm/sdk/pools/PoolService.js +371 -0
  44. package/dist/esm/sdk/pools/index.js +1 -2
  45. package/dist/types/abi/310/iSecuritizeDegenNFT.d.ts +324 -0
  46. package/dist/types/abi/310/iSecuritizeKYCFactory.d.ts +322 -0
  47. package/dist/types/abi/iStateSerializer.d.ts +11 -0
  48. package/dist/types/sdk/accounts/AbstractCreditAccountsService.d.ts +114 -3
  49. package/dist/types/sdk/accounts/CreditAccountsServiceV310.d.ts +1 -1
  50. package/dist/types/sdk/accounts/types.d.ts +96 -6
  51. package/dist/types/sdk/base/TokensMeta.d.ts +34 -21
  52. package/dist/types/sdk/base/index.d.ts +1 -0
  53. package/dist/types/sdk/base/token-types.d.ts +33 -0
  54. package/dist/types/sdk/base/types.d.ts +0 -7
  55. package/dist/types/sdk/chain/chains.d.ts +1 -1
  56. package/dist/types/sdk/constants/index.d.ts +0 -1
  57. package/dist/types/sdk/market/MarketRegister.d.ts +2 -2
  58. package/dist/types/sdk/market/MarketSuite.d.ts +3 -0
  59. package/dist/types/sdk/market/ZapperRegister.d.ts +17 -0
  60. package/dist/types/sdk/market/index.d.ts +1 -0
  61. package/dist/types/sdk/market/pool/PoolSuite.d.ts +2 -0
  62. package/dist/types/sdk/market/pool/PoolV310Contract.d.ts +6 -2
  63. package/dist/types/sdk/market/pool/SecuritizeKYCFactory.d.ts +345 -0
  64. package/dist/types/sdk/market/pool/index.d.ts +2 -0
  65. package/dist/types/sdk/market/types.d.ts +10 -0
  66. package/dist/types/sdk/pools/PoolService.d.ts +14 -0
  67. package/dist/types/sdk/pools/index.d.ts +1 -2
  68. package/dist/types/sdk/pools/types.d.ts +85 -111
  69. package/package.json +1 -1
  70. package/dist/cjs/plugins/zappers/ZappersPlugin.js +0 -144
  71. package/dist/cjs/plugins/zappers/index.js +0 -26
  72. package/dist/cjs/plugins/zappers/package.json +0 -1
  73. package/dist/cjs/sdk/pools/AbstractPoolService.js +0 -143
  74. package/dist/cjs/sdk/pools/createPoolService.js +0 -35
  75. package/dist/esm/plugins/zappers/ZappersPlugin.js +0 -126
  76. package/dist/esm/plugins/zappers/index.js +0 -3
  77. package/dist/esm/plugins/zappers/package.json +0 -1
  78. package/dist/esm/sdk/pools/AbstractPoolService.js +0 -119
  79. package/dist/esm/sdk/pools/PoolServiceV310.js +0 -6
  80. package/dist/esm/sdk/pools/createPoolService.js +0 -11
  81. package/dist/types/plugins/zappers/ZappersPlugin.d.ts +0 -18
  82. package/dist/types/plugins/zappers/extraZappers.d.ts +0 -6
  83. package/dist/types/plugins/zappers/index.d.ts +0 -3
  84. package/dist/types/plugins/zappers/types.d.ts +0 -12
  85. package/dist/types/sdk/constants/phantom-tokens.d.ts +0 -2
  86. package/dist/types/sdk/pools/AbstractPoolService.d.ts +0 -21
  87. package/dist/types/sdk/pools/PoolServiceV310.d.ts +0 -4
  88. package/dist/types/sdk/pools/createPoolService.d.ts +0 -3
  89. /package/dist/cjs/{plugins/zappers → sdk/market}/types.js +0 -0
  90. /package/dist/esm/{plugins/zappers → sdk/market}/types.js +0 -0
@@ -1,8 +1,8 @@
1
- import type { Address, Chain, PublicClient, Transport } from "viem";
2
- import type { PhantomTokenContractType } from "../constants/index.js";
1
+ import { type Address, type Chain, type PublicClient, type Transport } from "viem";
3
2
  import type { Asset } from "../router/index.js";
3
+ import type { ILogger } from "../types/logger.js";
4
4
  import { AddressMap } from "../utils/index.js";
5
- import type { TokenMetaData } from "./types.js";
5
+ import { type DSTokenMeta, type KYCTokenMeta, type PhantomTokenMeta, type TokenMetaData } from "./token-types.js";
6
6
  /**
7
7
  * Options for {@link TokensMeta.formatBN}.
8
8
  **/
@@ -16,15 +16,6 @@ export interface FormatBNOptions {
16
16
  **/
17
17
  symbol?: boolean;
18
18
  }
19
- /**
20
- * Token metadata enriched with some attributes specific to certain classes of tokens
21
- **/
22
- export interface TokenMetaDataExtended extends TokenMetaData {
23
- /**
24
- * Classification of the phantom token, or `undefined` for normal tokens.
25
- **/
26
- phantomTokenType?: PhantomTokenContractType;
27
- }
28
19
  /**
29
20
  * Registry of token metadata (symbol, decimals, phantom type) keyed by address.
30
21
  *
@@ -33,13 +24,14 @@ export interface TokenMetaDataExtended extends TokenMetaData {
33
24
  *
34
25
  * Provides methods to lazy-load information about certain classes of tokens (e.g. phantom tokens)
35
26
  */
36
- export declare class TokensMeta extends AddressMap<TokenMetaDataExtended> {
27
+ export declare class TokensMeta extends AddressMap<TokenMetaData> {
37
28
  #private;
38
- constructor(client: PublicClient<Transport, Chain>);
29
+ constructor(client: PublicClient<Transport, Chain>, logger?: ILogger);
39
30
  /**
40
31
  * Clears all token metadata
41
32
  **/
42
33
  reset(): void;
34
+ upsert(address: string, value: TokenMetaData | undefined): void;
43
35
  /**
44
36
  * Returns the symbol string for a token.
45
37
  * @param token - Token address.
@@ -53,15 +45,34 @@ export declare class TokensMeta extends AddressMap<TokenMetaDataExtended> {
53
45
  */
54
46
  decimals(token: Address): number;
55
47
  /**
56
- * Returns the phantom token type for a given token, or undefined for normal tokens
57
- * Throws if the phantom token data is not loaded
48
+ * Returns true if the token is a phantom token, throws if the token data is not loaded
49
+ * @param t
50
+ * @returns
51
+ */
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;
59
+ /**
60
+ * Returns true if the token is a DSToken, throws if the token data is not loaded
61
+ * @param t
62
+ * @returns
58
63
  */
59
- phantomTokenType(token: Address): PhantomTokenContractType | undefined;
64
+ isDSToken(t: TokenMetaData): t is DSTokenMeta;
60
65
  /**
61
66
  * Returns a map of all phantom tokens
62
- * Throws if the phantom token data is not loaded
67
+ * Throws if token data is not loaded
63
68
  */
64
- get phantomTokens(): AddressMap<TokenMetaDataExtended>;
69
+ get phantomTokens(): AddressMap<PhantomTokenMeta>;
70
+ /**
71
+ * Returns a map of all KYC underlying tokens
72
+ * Throws if token data is not loaded
73
+ */
74
+ get kycUnderlyings(): AddressMap<KYCTokenMeta>;
75
+ get dsTokens(): AddressMap<DSTokenMeta>;
65
76
  /**
66
77
  * Formats a raw token amount into a human-readable decimal string,
67
78
  * dividing by `10^decimals` for the token.
@@ -91,7 +102,9 @@ export declare class TokensMeta extends AddressMap<TokenMetaDataExtended> {
91
102
  */
92
103
  mustFindBySymbol(symbol: string): TokenMetaData;
93
104
  /**
94
- * Loads phantom token data for all known tokens from chain
105
+ * Loads token information about phantom tokens, KYC underlying tokens and DSTokens
106
+ *
107
+ * @param tokens - tokens to load data for, defaults to all tokens
95
108
  */
96
- loadPhantomTokens(): Promise<void>;
109
+ loadTokenData(...tokens: Address[]): Promise<void>;
97
110
  }
@@ -5,4 +5,5 @@ export * from "./errors.js";
5
5
  export * from "./PlaceholderContract.js";
6
6
  export * from "./SDKConstruct.js";
7
7
  export * from "./TokensMeta.js";
8
+ export * from "./token-types.js";
8
9
  export * from "./types.js";
@@ -0,0 +1,33 @@
1
+ import type { Address } from "viem";
2
+ import type { MarketData, Unarray } from "./types.js";
3
+ type TokenData = Unarray<MarketData["tokens"]>;
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 type PhantomTokenContractType = (typeof PHANTOM_TOKEN_CONTRACT_TYPES)[number];
9
+ export type SimpleTokenMeta = TokenData & {
10
+ isDSToken?: boolean;
11
+ contractType?: string;
12
+ };
13
+ export type PhantomTokenMeta = SimpleTokenMeta & {
14
+ contractType: PhantomTokenContractType;
15
+ };
16
+ export type KYCDefaultTokenMeta = SimpleTokenMeta & {
17
+ contractType: typeof KYC_UNDERLYING_DEFAULT;
18
+ kycFactory: Address;
19
+ asset: Address;
20
+ };
21
+ export type KYCOnDemandTokenMeta = SimpleTokenMeta & {
22
+ contractType: typeof KYC_UNDERLYING_ON_DEMAND;
23
+ kycFactory: Address;
24
+ asset: Address;
25
+ pool: Address;
26
+ liquidityProvider: Address;
27
+ };
28
+ export type DSTokenMeta = Omit<SimpleTokenMeta, "isDSToken"> & {
29
+ isDSToken: true;
30
+ };
31
+ export type KYCTokenMeta = KYCDefaultTokenMeta | KYCOnDemandTokenMeta;
32
+ export type TokenMetaData = SimpleTokenMeta | PhantomTokenMeta | KYCTokenMeta | DSTokenMeta;
33
+ export {};
@@ -102,13 +102,6 @@ export type CreditConfiguratorState = CreditSuiteState["creditConfigurator"];
102
102
  * Adapter contract data for a credit suite.
103
103
  **/
104
104
  export type AdapterData = Unarray<CreditSuiteState["adapters"]>;
105
- /**
106
- * On-chain metadata for a single token (symbol, decimals, address).
107
- **/
108
- export type TokenMetaData = Unarray<MarketData["tokens"]>;
109
- /**
110
- * On-chain state of a lending pool.
111
- **/
112
105
  export type PoolState = MarketData["pool"];
113
106
  /**
114
107
  * On-chain state of a quota keeper.
@@ -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
  *
@@ -4,5 +4,4 @@ export * from "./bot-permissions.js";
4
4
  export * from "./math.js";
5
5
  export * from "./networks.js";
6
6
  export * from "./periphery.js";
7
- export * from "./phantom-tokens.js";
8
7
  export * from "./versions.js";
@@ -1,6 +1,5 @@
1
1
  import type { Address } from "viem";
2
2
  import type { MarketData, MarketFilter } from "../base/index.js";
3
- import { SDKConstruct } from "../base/index.js";
4
3
  import type { GearboxSDK } from "../GearboxSDK.js";
5
4
  import type { MarketStateHuman } from "../types/index.js";
6
5
  import { AddressMap } from "../utils/index.js";
@@ -9,6 +8,7 @@ import { MarketConfiguratorContract } from "./MarketConfiguratorContract.js";
9
8
  import { MarketSuite } from "./MarketSuite.js";
10
9
  import type { IPriceOracleContract } from "./oracle/index.js";
11
10
  import type { PoolSuite } from "./pool/index.js";
11
+ import { ZapperRegister } from "./ZapperRegister.js";
12
12
  /**
13
13
  * Central registry of all Gearbox markets on the current chain.
14
14
  *
@@ -16,7 +16,7 @@ import type { PoolSuite } from "./pool/index.js";
16
16
  * managers into a single unit. The `MarketRegister` loads this data from the
17
17
  * on-chain market compressor and exposes convenience lookup methods
18
18
  **/
19
- export declare class MarketRegister extends SDKConstruct {
19
+ export declare class MarketRegister extends ZapperRegister {
20
20
  #private;
21
21
  /**
22
22
  * @param sdk - Top-level SDK instance.
@@ -8,6 +8,7 @@ import { type ILossPolicyContract } from "./loss-policy/index.js";
8
8
  import { MarketConfiguratorContract } from "./MarketConfiguratorContract.js";
9
9
  import type { IPriceOracleContract } from "./oracle/index.js";
10
10
  import { PoolSuite } from "./pool/index.js";
11
+ import type { SecuritizeKYCFactory } from "./pool/SecuritizeKYCFactory.js";
11
12
  export declare class MarketSuite extends SDKConstruct {
12
13
  readonly acl: Address;
13
14
  readonly treasury: Address;
@@ -21,6 +22,8 @@ export declare class MarketSuite extends SDKConstruct {
21
22
  */
22
23
  readonly state: MarketData;
23
24
  constructor(sdk: GearboxSDK, marketData: MarketData);
25
+ get underlying(): Address;
26
+ getKYCFactory(): Promise<SecuritizeKYCFactory | undefined>;
24
27
  get dirty(): boolean;
25
28
  get watchAddresses(): Set<Address>;
26
29
  stateHuman(raw?: boolean): MarketStateHuman;
@@ -0,0 +1,17 @@
1
+ import type { Address } from "viem";
2
+ import { SDKConstruct } from "../base/index.js";
3
+ import { AddressMap } from "../utils/index.js";
4
+ import type { ZapperData } from "./types.js";
5
+ export declare class ZapperRegister extends SDKConstruct {
6
+ #private;
7
+ /**
8
+ * Load zappers for all pools using periphery compressor, adds hardcoded zappers
9
+ */
10
+ loadZappers(force?: boolean): Promise<void>;
11
+ get zappers(): AddressMap<ZapperData[]>;
12
+ poolZappers(pool: Address): ZapperData[];
13
+ /**
14
+ * Can return multiple zappers if there are multiple zappers for the same tokenIn and tokenOut
15
+ */
16
+ getZapper(pool: Address, tokenIn: Address, tokenOut: Address): Array<ZapperData> | undefined;
17
+ }
@@ -5,3 +5,4 @@ export * from "./MarketSuite.js";
5
5
  export * from "./oracle/index.js";
6
6
  export * from "./pool/index.js";
7
7
  export * from "./pricefeeds/index.js";
8
+ export * from "./types.js";
@@ -6,6 +6,7 @@ import type { PoolSuiteStateHuman } from "../../types/index.js";
6
6
  import type { MarketConfiguratorContract } from "../MarketConfiguratorContract.js";
7
7
  import { GaugeContract } from "./GaugeContract.js";
8
8
  import { LinearInterestRateModelContract } from "./LinearInterestRateModelContract.js";
9
+ import type { SecuritizeKYCFactory } from "./SecuritizeKYCFactory.js";
9
10
  import { TumblerContract } from "./TumblerContract.js";
10
11
  import type { IInterestRateModelContract, IRateKeeperContract, PoolContract, PoolQuotaKeeperContract } from "./types.js";
11
12
  export declare class PoolSuite extends SDKConstruct {
@@ -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
+ getKYCFactory(): Promise<SecuritizeKYCFactory | 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 { SecuritizeKYCFactory } from "./SecuritizeKYCFactory.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
+ getKYCFactory(): Promise<SecuritizeKYCFactory | 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[];
@@ -0,0 +1,345 @@
1
+ import type { Address } from "viem";
2
+ import type { ConstructOptions } from "../../base/index.js";
3
+ import { BaseContract } from "../../base/index.js";
4
+ import type { MultiCall, RawTx } from "../../types/index.js";
5
+ declare const abi: readonly [{
6
+ readonly type: "function";
7
+ readonly name: "contractType";
8
+ readonly inputs: readonly [];
9
+ readonly outputs: readonly [{
10
+ readonly name: "";
11
+ readonly type: "bytes32";
12
+ readonly internalType: "bytes32";
13
+ }];
14
+ readonly stateMutability: "view";
15
+ }, {
16
+ readonly type: "function";
17
+ readonly name: "getCreditAccounts";
18
+ readonly inputs: readonly [{
19
+ readonly name: "investor";
20
+ readonly type: "address";
21
+ readonly internalType: "address";
22
+ }];
23
+ readonly outputs: readonly [{
24
+ readonly name: "";
25
+ readonly type: "address[]";
26
+ readonly internalType: "address[]";
27
+ }];
28
+ readonly stateMutability: "view";
29
+ }, {
30
+ readonly type: "function";
31
+ readonly name: "getDegenNFT";
32
+ readonly inputs: readonly [];
33
+ readonly outputs: readonly [{
34
+ readonly name: "";
35
+ readonly type: "address";
36
+ readonly internalType: "address";
37
+ }];
38
+ readonly stateMutability: "view";
39
+ }, {
40
+ readonly type: "function";
41
+ readonly name: "getInvestor";
42
+ readonly inputs: readonly [{
43
+ readonly name: "creditAccount";
44
+ readonly type: "address";
45
+ readonly internalType: "address";
46
+ }];
47
+ readonly outputs: readonly [{
48
+ readonly name: "";
49
+ readonly type: "address";
50
+ readonly internalType: "address";
51
+ }];
52
+ readonly stateMutability: "view";
53
+ }, {
54
+ readonly type: "function";
55
+ readonly name: "getWallet";
56
+ readonly inputs: readonly [{
57
+ readonly name: "creditAccount";
58
+ readonly type: "address";
59
+ readonly internalType: "address";
60
+ }];
61
+ readonly outputs: readonly [{
62
+ readonly name: "";
63
+ readonly type: "address";
64
+ readonly internalType: "address";
65
+ }];
66
+ readonly stateMutability: "view";
67
+ }, {
68
+ readonly type: "function";
69
+ readonly name: "isCreditAccount";
70
+ readonly inputs: readonly [{
71
+ readonly name: "creditAccount";
72
+ readonly type: "address";
73
+ readonly internalType: "address";
74
+ }];
75
+ readonly outputs: readonly [{
76
+ readonly name: "";
77
+ readonly type: "bool";
78
+ readonly internalType: "bool";
79
+ }];
80
+ readonly stateMutability: "view";
81
+ }, {
82
+ readonly type: "function";
83
+ readonly name: "isFrozen";
84
+ readonly inputs: readonly [{
85
+ readonly name: "creditAccount";
86
+ readonly type: "address";
87
+ readonly internalType: "address";
88
+ }];
89
+ readonly outputs: readonly [{
90
+ readonly name: "";
91
+ readonly type: "bool";
92
+ readonly internalType: "bool";
93
+ }];
94
+ readonly stateMutability: "view";
95
+ }, {
96
+ readonly type: "function";
97
+ readonly name: "multicall";
98
+ readonly inputs: readonly [{
99
+ readonly name: "creditAccount";
100
+ readonly type: "address";
101
+ readonly internalType: "address";
102
+ }, {
103
+ readonly name: "calls";
104
+ readonly type: "tuple[]";
105
+ readonly internalType: "struct MultiCall[]";
106
+ readonly components: readonly [{
107
+ readonly name: "target";
108
+ readonly type: "address";
109
+ readonly internalType: "address";
110
+ }, {
111
+ readonly name: "callData";
112
+ readonly type: "bytes";
113
+ readonly internalType: "bytes";
114
+ }];
115
+ }, {
116
+ readonly name: "tokensToRegister";
117
+ readonly type: "address[]";
118
+ readonly internalType: "address[]";
119
+ }];
120
+ readonly outputs: readonly [];
121
+ readonly stateMutability: "nonpayable";
122
+ }, {
123
+ readonly type: "function";
124
+ readonly name: "openCreditAccount";
125
+ readonly inputs: readonly [{
126
+ readonly name: "creditManager";
127
+ readonly type: "address";
128
+ readonly internalType: "address";
129
+ }, {
130
+ readonly name: "calls";
131
+ readonly type: "tuple[]";
132
+ readonly internalType: "struct MultiCall[]";
133
+ readonly components: readonly [{
134
+ readonly name: "target";
135
+ readonly type: "address";
136
+ readonly internalType: "address";
137
+ }, {
138
+ readonly name: "callData";
139
+ readonly type: "bytes";
140
+ readonly internalType: "bytes";
141
+ }];
142
+ }, {
143
+ readonly name: "tokensToRegister";
144
+ readonly type: "address[]";
145
+ readonly internalType: "address[]";
146
+ }];
147
+ readonly outputs: readonly [{
148
+ readonly name: "creditAccount";
149
+ readonly type: "address";
150
+ readonly internalType: "address";
151
+ }, {
152
+ readonly name: "wallet";
153
+ readonly type: "address";
154
+ readonly internalType: "address";
155
+ }];
156
+ readonly stateMutability: "nonpayable";
157
+ }, {
158
+ readonly type: "function";
159
+ readonly name: "precomputeWalletAddress";
160
+ readonly inputs: readonly [{
161
+ readonly name: "creditManager";
162
+ readonly type: "address";
163
+ readonly internalType: "address";
164
+ }, {
165
+ readonly name: "investor";
166
+ readonly type: "address";
167
+ readonly internalType: "address";
168
+ }];
169
+ readonly outputs: readonly [{
170
+ readonly name: "";
171
+ readonly type: "address";
172
+ readonly internalType: "address";
173
+ }];
174
+ readonly stateMutability: "view";
175
+ }, {
176
+ readonly type: "function";
177
+ readonly name: "serialize";
178
+ readonly inputs: readonly [];
179
+ readonly outputs: readonly [{
180
+ readonly name: "serializedData";
181
+ readonly type: "bytes";
182
+ readonly internalType: "bytes";
183
+ }];
184
+ readonly stateMutability: "view";
185
+ }, {
186
+ readonly type: "function";
187
+ readonly name: "setFrozenStatus";
188
+ readonly inputs: readonly [{
189
+ readonly name: "creditAccount";
190
+ readonly type: "address";
191
+ readonly internalType: "address";
192
+ }, {
193
+ readonly name: "frozen";
194
+ readonly type: "bool";
195
+ readonly internalType: "bool";
196
+ }];
197
+ readonly outputs: readonly [];
198
+ readonly stateMutability: "nonpayable";
199
+ }, {
200
+ readonly type: "function";
201
+ readonly name: "setInvestor";
202
+ readonly inputs: readonly [{
203
+ readonly name: "creditAccount";
204
+ readonly type: "address";
205
+ readonly internalType: "address";
206
+ }, {
207
+ readonly name: "investor";
208
+ readonly type: "address";
209
+ readonly internalType: "address";
210
+ }];
211
+ readonly outputs: readonly [];
212
+ readonly stateMutability: "nonpayable";
213
+ }, {
214
+ readonly type: "function";
215
+ readonly name: "version";
216
+ readonly inputs: readonly [];
217
+ readonly outputs: readonly [{
218
+ readonly name: "";
219
+ readonly type: "uint256";
220
+ readonly internalType: "uint256";
221
+ }];
222
+ readonly stateMutability: "view";
223
+ }, {
224
+ readonly type: "event";
225
+ readonly name: "CreateWallet";
226
+ readonly inputs: readonly [{
227
+ readonly name: "creditAccount";
228
+ readonly type: "address";
229
+ readonly indexed: true;
230
+ readonly internalType: "address";
231
+ }, {
232
+ readonly name: "wallet";
233
+ readonly type: "address";
234
+ readonly indexed: true;
235
+ readonly internalType: "address";
236
+ }, {
237
+ readonly name: "investor";
238
+ readonly type: "address";
239
+ readonly indexed: true;
240
+ readonly internalType: "address";
241
+ }];
242
+ readonly anonymous: false;
243
+ }, {
244
+ readonly type: "event";
245
+ readonly name: "SetFrozenStatus";
246
+ readonly inputs: readonly [{
247
+ readonly name: "creditAccount";
248
+ readonly type: "address";
249
+ readonly indexed: true;
250
+ readonly internalType: "address";
251
+ }, {
252
+ readonly name: "frozen";
253
+ readonly type: "bool";
254
+ readonly indexed: false;
255
+ readonly internalType: "bool";
256
+ }];
257
+ readonly anonymous: false;
258
+ }, {
259
+ readonly type: "event";
260
+ readonly name: "SetInvestor";
261
+ readonly inputs: readonly [{
262
+ readonly name: "creditAccount";
263
+ readonly type: "address";
264
+ readonly indexed: true;
265
+ readonly internalType: "address";
266
+ }, {
267
+ readonly name: "oldInvestor";
268
+ readonly type: "address";
269
+ readonly indexed: true;
270
+ readonly internalType: "address";
271
+ }, {
272
+ readonly name: "newInvestor";
273
+ readonly type: "address";
274
+ readonly indexed: true;
275
+ readonly internalType: "address";
276
+ }];
277
+ readonly anonymous: false;
278
+ }, {
279
+ readonly type: "error";
280
+ readonly name: "CallerIsNotInvestorException";
281
+ readonly inputs: readonly [{
282
+ readonly name: "caller";
283
+ readonly type: "address";
284
+ readonly internalType: "address";
285
+ }, {
286
+ readonly name: "creditAccount";
287
+ readonly type: "address";
288
+ readonly internalType: "address";
289
+ }];
290
+ }, {
291
+ readonly type: "error";
292
+ readonly name: "FrozenCreditAccountException";
293
+ readonly inputs: readonly [{
294
+ readonly name: "creditAccount";
295
+ readonly type: "address";
296
+ readonly internalType: "address";
297
+ }];
298
+ }, {
299
+ readonly type: "error";
300
+ readonly name: "InvalidCreditManagerException";
301
+ readonly inputs: readonly [{
302
+ readonly name: "creditManager";
303
+ readonly type: "address";
304
+ readonly internalType: "address";
305
+ }];
306
+ }, {
307
+ readonly type: "error";
308
+ readonly name: "InvalidUnderlyingTokenException";
309
+ readonly inputs: readonly [{
310
+ readonly name: "underlying";
311
+ readonly type: "address";
312
+ readonly internalType: "address";
313
+ }];
314
+ }, {
315
+ readonly type: "error";
316
+ readonly name: "UnknownCreditAccountException";
317
+ readonly inputs: readonly [{
318
+ readonly name: "creditAccount";
319
+ readonly type: "address";
320
+ readonly internalType: "address";
321
+ }];
322
+ }, {
323
+ readonly type: "error";
324
+ readonly name: "ZeroAddressException";
325
+ readonly inputs: readonly [];
326
+ }];
327
+ type abi = typeof abi;
328
+ export declare class SecuritizeKYCFactory extends BaseContract<abi> {
329
+ #private;
330
+ private investorCache;
331
+ constructor(options: ConstructOptions, address: Address);
332
+ precomputeWalletAddress(creditManager: Address, investor: Address): Promise<Address>;
333
+ getWallet(creditAccount: Address): Promise<Address>;
334
+ /**
335
+ * Returns the investor address for a credit account.
336
+ * @param creditAccount - Credit account address
337
+ * @param fromCache - If true, use and update an in-memory cache (creditAccount -> investor). On cache miss, loads from contract and stores the result for future calls.
338
+ */
339
+ getInvestor(creditAccount: Address, fromCache?: boolean): Promise<Address>;
340
+ getDSTokens(): Promise<Address[]>;
341
+ multicall(creditAccount: Address, calls: MultiCall[], tokensToRegister: Address[]): RawTx;
342
+ openCreditAccount(creditManager: Address, calls: MultiCall[], tokensToRegister: Address[]): RawTx;
343
+ getDegenNFT(): Promise<Address>;
344
+ }
345
+ export {};
@@ -1,4 +1,6 @@
1
1
  export * from "./GaugeContract.js";
2
2
  export * from "./LinearInterestRateModelContract.js";
3
3
  export * from "./PoolSuite.js";
4
+ export * from "./PoolV310Contract.js";
5
+ export * from "./SecuritizeKYCFactory.js";
4
6
  export * from "./types.js";
@@ -0,0 +1,10 @@
1
+ import type { AbiParametersToPrimitiveTypes, ExtractAbiFunction } from "abitype";
2
+ import type { Address } from "viem";
3
+ import type { peripheryCompressorAbi } from "../../abi/compressors/peripheryCompressor.js";
4
+ import type { Unarray } from "../base/index.js";
5
+ type CompressorZapperData = Unarray<AbiParametersToPrimitiveTypes<ExtractAbiFunction<typeof peripheryCompressorAbi, "getZappers">["outputs"]>>;
6
+ export interface ZapperData extends CompressorZapperData {
7
+ pool: Address;
8
+ type: "migration" | "kyc" | "base";
9
+ }
10
+ export {};
@@ -0,0 +1,14 @@
1
+ import type { Address } from "viem";
2
+ import { SDKConstruct } from "../base/index.js";
3
+ import type { AddLiquidityProps, DepositMetadata, IPoolsService, PoolServiceCall, RemoveLiquidityProps, WithdrawalMetadata } from "./types.js";
4
+ export declare class PoolService extends SDKConstruct implements IPoolsService {
5
+ #private;
6
+ getDepositTokensIn(pool: Address): Address[];
7
+ getDepositTokensOut(pool: Address, tokenIn: Address): Address[];
8
+ getDepositMetadata(pool: Address, tokenIn: Address, tokenOut?: Address): DepositMetadata;
9
+ addLiquidity(props: AddLiquidityProps): PoolServiceCall | undefined;
10
+ getWithdrawalTokensIn(pool: Address): Address[];
11
+ getWithdrawalTokensOut(pool: Address, tokenIn: Address): Address[];
12
+ removeLiquidity(props: RemoveLiquidityProps): PoolServiceCall;
13
+ getWithdrawalMetadata(pool: Address, tokenIn: Address, tokenOut?: Address): WithdrawalMetadata;
14
+ }
@@ -1,3 +1,2 @@
1
- export * from "./AbstractPoolService.js";
2
- export * from "./createPoolService.js";
1
+ export * from "./PoolService.js";
3
2
  export * from "./types.js";