@gearbox-protocol/sdk 13.5.0-kyc.1 → 13.5.0-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/dist/cjs/dev/AccountOpener.js +5 -45
  2. package/dist/cjs/sdk/accounts/AbstractCreditAccountsService.js +6 -339
  3. package/dist/cjs/sdk/accounts/CreditAccountsServiceV310.js +1 -13
  4. package/dist/cjs/sdk/base/TokensMeta.js +7 -151
  5. package/dist/cjs/sdk/base/token-types.js +0 -6
  6. package/dist/cjs/sdk/chain/chains.js +1 -2
  7. package/dist/cjs/sdk/constants/addresses.js +3 -0
  8. package/dist/cjs/sdk/market/MarketRegister.js +0 -3
  9. package/dist/cjs/sdk/market/MarketSuite.js +0 -3
  10. package/dist/cjs/sdk/market/ZapperRegister.js +0 -4
  11. package/dist/cjs/sdk/market/pool/PoolSuite.js +0 -3
  12. package/dist/cjs/sdk/market/pool/PoolV310Contract.js +2 -17
  13. package/dist/cjs/sdk/market/pool/index.js +0 -4
  14. package/dist/cjs/sdk/pools/PoolService.js +43 -122
  15. package/dist/cjs/sdk/pools/constants.js +37 -0
  16. package/dist/esm/dev/AccountOpener.js +6 -47
  17. package/dist/esm/sdk/accounts/AbstractCreditAccountsService.js +6 -339
  18. package/dist/esm/sdk/accounts/CreditAccountsServiceV310.js +1 -13
  19. package/dist/esm/sdk/base/TokensMeta.js +7 -155
  20. package/dist/esm/sdk/base/token-types.js +0 -4
  21. package/dist/esm/sdk/chain/chains.js +1 -2
  22. package/dist/esm/sdk/constants/addresses.js +2 -0
  23. package/dist/esm/sdk/market/MarketRegister.js +0 -3
  24. package/dist/esm/sdk/market/MarketSuite.js +0 -3
  25. package/dist/esm/sdk/market/ZapperRegister.js +0 -4
  26. package/dist/esm/sdk/market/pool/PoolSuite.js +0 -3
  27. package/dist/esm/sdk/market/pool/PoolV310Contract.js +2 -17
  28. package/dist/esm/sdk/market/pool/index.js +0 -2
  29. package/dist/esm/sdk/pools/PoolService.js +32 -115
  30. package/dist/esm/sdk/pools/constants.js +13 -0
  31. package/dist/types/sdk/accounts/AbstractCreditAccountsService.d.ts +5 -103
  32. package/dist/types/sdk/accounts/CreditAccountsServiceV310.d.ts +2 -4
  33. package/dist/types/sdk/accounts/types.d.ts +6 -130
  34. package/dist/types/sdk/base/TokensMeta.d.ts +3 -20
  35. package/dist/types/sdk/base/token-types.d.ts +1 -21
  36. package/dist/types/sdk/base/types.d.ts +3 -0
  37. package/dist/types/sdk/chain/chains.d.ts +1 -1
  38. package/dist/types/sdk/constants/addresses.d.ts +4 -0
  39. package/dist/types/sdk/market/MarketSuite.d.ts +0 -2
  40. package/dist/types/sdk/market/pool/PoolSuite.d.ts +0 -2
  41. package/dist/types/sdk/market/pool/PoolV310Contract.d.ts +2 -6
  42. package/dist/types/sdk/market/pool/index.d.ts +0 -2
  43. package/dist/types/sdk/market/types.d.ts +1 -1
  44. package/dist/types/sdk/pools/PoolService.d.ts +24 -0
  45. package/dist/types/sdk/pools/constants.d.ts +7 -0
  46. package/dist/types/sdk/pools/types.d.ts +9 -8
  47. package/package.json +1 -1
  48. package/dist/cjs/abi/310/iSecuritizeDegenNFT.js +0 -263
  49. package/dist/cjs/abi/310/iSecuritizeKYCFactory.js +0 -278
  50. package/dist/cjs/sdk/market/pool/SecuritizeKYCFactory.js +0 -97
  51. package/dist/esm/abi/310/iSecuritizeDegenNFT.js +0 -239
  52. package/dist/esm/abi/310/iSecuritizeKYCFactory.js +0 -254
  53. package/dist/esm/sdk/market/pool/SecuritizeKYCFactory.js +0 -73
  54. package/dist/types/abi/310/iSecuritizeDegenNFT.d.ts +0 -324
  55. package/dist/types/abi/310/iSecuritizeKYCFactory.d.ts +0 -322
  56. package/dist/types/sdk/market/pool/SecuritizeKYCFactory.d.ts +0 -345
@@ -53,6 +53,7 @@ export interface RemoveLiquidityProps {
53
53
  permit: PermitResult | undefined;
54
54
  meta: WithdrawalMetadata;
55
55
  }
56
+ export type MarketType = "classic";
56
57
  export interface DepositMetadata {
57
58
  /**
58
59
  * Zapper that will perform the deposit, undefined in case of direct pool underlying deposit
@@ -61,7 +62,6 @@ export interface DepositMetadata {
61
62
  /**
62
63
  * Before deposit user will nedd to call approve method on token that he wants to deposit,
63
64
  * this is the spender address that will be used to call approve method.
64
- *
65
65
  */
66
66
  approveTarget: Address;
67
67
  /**
@@ -70,28 +70,29 @@ export interface DepositMetadata {
70
70
  permissible: boolean;
71
71
  /**
72
72
  * Type of deposit
73
+ * @default "classic"
73
74
  */
74
- type: "kyc-on-demand" | "kyc-default" | "classic";
75
+ type?: MarketType;
75
76
  }
76
77
  export interface WithdrawalMetadata {
77
78
  /**
78
- * Zapper that will perform the deposit, undefined in case of direct pool underlying deposit
79
+ * Zapper that will perform the withdrawal, undefined in case of direct pool underlying withdrawal
79
80
  */
80
81
  zapper?: ZapperData;
81
82
  /**
82
- * Before deposit user will nedd to call approve method on token that he wants to deposit,
83
+ * Before withdrawal user will need to call approve method on token that he wants to withdraw (diesel token),
83
84
  * this is the spender address that will be used to call approve method.
84
- *
85
85
  */
86
86
  approveTarget?: Address;
87
87
  /**
88
- * If true, user can avoid approval step and deposit with permit
88
+ * If true, user can avoid approval step and withdrawal with permit
89
89
  */
90
90
  permissible: boolean;
91
91
  /**
92
- * Type of deposit
92
+ * Type of withdrawal
93
+ * @default "classic"
93
94
  */
94
- type: "kyc-on-demand" | "kyc-default" | "classic";
95
+ type?: MarketType;
95
96
  }
96
97
  /**
97
98
  * Service interface for pool liquidity operations.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gearbox-protocol/sdk",
3
- "version": "13.5.0-kyc.1",
3
+ "version": "13.5.0-next.2",
4
4
  "description": "Gearbox SDK",
5
5
  "license": "MIT",
6
6
  "main": "./dist/cjs/sdk/index.js",
@@ -1,263 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var iSecuritizeDegenNFT_exports = {};
20
- __export(iSecuritizeDegenNFT_exports, {
21
- iSecuritizeDegenNFTAbi: () => iSecuritizeDegenNFTAbi
22
- });
23
- module.exports = __toCommonJS(iSecuritizeDegenNFT_exports);
24
- const iSecuritizeDegenNFTAbi = [
25
- {
26
- type: "function",
27
- name: "addRegistrar",
28
- inputs: [{ name: "registrar", type: "address", internalType: "address" }],
29
- outputs: [],
30
- stateMutability: "nonpayable"
31
- },
32
- {
33
- type: "function",
34
- name: "burn",
35
- inputs: [
36
- { name: "wallet", type: "address", internalType: "address" },
37
- { name: "", type: "uint256", internalType: "uint256" }
38
- ],
39
- outputs: [],
40
- stateMutability: "nonpayable"
41
- },
42
- {
43
- type: "function",
44
- name: "contractType",
45
- inputs: [],
46
- outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
47
- stateMutability: "view"
48
- },
49
- {
50
- type: "function",
51
- name: "getDSTokens",
52
- inputs: [],
53
- outputs: [{ name: "", type: "address[]", internalType: "address[]" }],
54
- stateMutability: "view"
55
- },
56
- {
57
- type: "function",
58
- name: "getFactory",
59
- inputs: [],
60
- outputs: [{ name: "", type: "address", internalType: "address" }],
61
- stateMutability: "view"
62
- },
63
- {
64
- type: "function",
65
- name: "getOperators",
66
- inputs: [{ name: "token", type: "address", internalType: "address" }],
67
- outputs: [{ name: "", type: "address[]", internalType: "address[]" }],
68
- stateMutability: "view"
69
- },
70
- {
71
- type: "function",
72
- name: "getRegisteredTokens",
73
- inputs: [
74
- { name: "creditAccount", type: "address", internalType: "address" }
75
- ],
76
- outputs: [{ name: "", type: "address[]", internalType: "address[]" }],
77
- stateMutability: "view"
78
- },
79
- {
80
- type: "function",
81
- name: "getRegistrar",
82
- inputs: [{ name: "token", type: "address", internalType: "address" }],
83
- outputs: [{ name: "", type: "address", internalType: "address" }],
84
- stateMutability: "view"
85
- },
86
- {
87
- type: "function",
88
- name: "isDSToken",
89
- inputs: [{ name: "token", type: "address", internalType: "address" }],
90
- outputs: [{ name: "", type: "bool", internalType: "bool" }],
91
- stateMutability: "view"
92
- },
93
- {
94
- type: "function",
95
- name: "isOperator",
96
- inputs: [
97
- { name: "token", type: "address", internalType: "address" },
98
- { name: "operator", type: "address", internalType: "address" }
99
- ],
100
- outputs: [{ name: "", type: "bool", internalType: "bool" }],
101
- stateMutability: "view"
102
- },
103
- {
104
- type: "function",
105
- name: "mint",
106
- inputs: [{ name: "wallet", type: "address", internalType: "address" }],
107
- outputs: [],
108
- stateMutability: "nonpayable"
109
- },
110
- {
111
- type: "function",
112
- name: "registerCreditAccount",
113
- inputs: [
114
- { name: "creditAccount", type: "address", internalType: "address" },
115
- { name: "tokens", type: "address[]", internalType: "address[]" }
116
- ],
117
- outputs: [],
118
- stateMutability: "nonpayable"
119
- },
120
- {
121
- type: "function",
122
- name: "registerHelperAccount",
123
- inputs: [
124
- { name: "creditAccount", type: "address", internalType: "address" },
125
- { name: "helperAccount", type: "address", internalType: "address" },
126
- { name: "token", type: "address", internalType: "address" }
127
- ],
128
- outputs: [],
129
- stateMutability: "nonpayable"
130
- },
131
- {
132
- type: "function",
133
- name: "serialize",
134
- inputs: [],
135
- outputs: [{ name: "serializedData", type: "bytes", internalType: "bytes" }],
136
- stateMutability: "view"
137
- },
138
- {
139
- type: "function",
140
- name: "setOperatorStatus",
141
- inputs: [
142
- { name: "token", type: "address", internalType: "address" },
143
- { name: "operator", type: "address", internalType: "address" },
144
- { name: "approved", type: "bool", internalType: "bool" }
145
- ],
146
- outputs: [],
147
- stateMutability: "nonpayable"
148
- },
149
- {
150
- type: "function",
151
- name: "version",
152
- inputs: [],
153
- outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
154
- stateMutability: "view"
155
- },
156
- {
157
- type: "event",
158
- name: "Burn",
159
- inputs: [
160
- {
161
- name: "wallet",
162
- type: "address",
163
- indexed: true,
164
- internalType: "address"
165
- }
166
- ],
167
- anonymous: false
168
- },
169
- {
170
- type: "event",
171
- name: "Mint",
172
- inputs: [
173
- {
174
- name: "wallet",
175
- type: "address",
176
- indexed: true,
177
- internalType: "address"
178
- }
179
- ],
180
- anonymous: false
181
- },
182
- {
183
- type: "event",
184
- name: "SetOperatorStatus",
185
- inputs: [
186
- {
187
- name: "token",
188
- type: "address",
189
- indexed: true,
190
- internalType: "address"
191
- },
192
- {
193
- name: "operator",
194
- type: "address",
195
- indexed: true,
196
- internalType: "address"
197
- },
198
- { name: "approved", type: "bool", indexed: false, internalType: "bool" }
199
- ],
200
- anonymous: false
201
- },
202
- {
203
- type: "event",
204
- name: "SetRegistrar",
205
- inputs: [
206
- {
207
- name: "token",
208
- type: "address",
209
- indexed: true,
210
- internalType: "address"
211
- },
212
- {
213
- name: "registrar",
214
- type: "address",
215
- indexed: true,
216
- internalType: "address"
217
- }
218
- ],
219
- anonymous: false
220
- },
221
- {
222
- type: "error",
223
- name: "CallerIsNotCreditFacadeException",
224
- inputs: [{ name: "caller", type: "address", internalType: "address" }]
225
- },
226
- {
227
- type: "error",
228
- name: "CallerIsNotFactoryException",
229
- inputs: [{ name: "caller", type: "address", internalType: "address" }]
230
- },
231
- {
232
- type: "error",
233
- name: "CallerIsNotInstanceOwnerException",
234
- inputs: [{ name: "caller", type: "address", internalType: "address" }]
235
- },
236
- {
237
- type: "error",
238
- name: "CallerIsNotOperatorException",
239
- inputs: [
240
- { name: "token", type: "address", internalType: "address" },
241
- { name: "caller", type: "address", internalType: "address" }
242
- ]
243
- },
244
- {
245
- type: "error",
246
- name: "RegistrarNotSetForTokenException",
247
- inputs: [{ name: "token", type: "address", internalType: "address" }]
248
- },
249
- {
250
- type: "error",
251
- name: "UnknownTokenException",
252
- inputs: [{ name: "token", type: "address", internalType: "address" }]
253
- },
254
- {
255
- type: "error",
256
- name: "UnknownWalletException",
257
- inputs: [{ name: "wallet", type: "address", internalType: "address" }]
258
- }
259
- ];
260
- // Annotate the CommonJS export names for ESM import in node:
261
- 0 && (module.exports = {
262
- iSecuritizeDegenNFTAbi
263
- });
@@ -1,278 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var iSecuritizeKYCFactory_exports = {};
20
- __export(iSecuritizeKYCFactory_exports, {
21
- iSecuritizeKYCFactoryAbi: () => iSecuritizeKYCFactoryAbi
22
- });
23
- module.exports = __toCommonJS(iSecuritizeKYCFactory_exports);
24
- const iSecuritizeKYCFactoryAbi = [
25
- {
26
- type: "function",
27
- name: "contractType",
28
- inputs: [],
29
- outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
30
- stateMutability: "view"
31
- },
32
- {
33
- type: "function",
34
- name: "getCreditAccounts",
35
- inputs: [{ name: "investor", type: "address", internalType: "address" }],
36
- outputs: [{ name: "", type: "address[]", internalType: "address[]" }],
37
- stateMutability: "view"
38
- },
39
- {
40
- type: "function",
41
- name: "getDegenNFT",
42
- inputs: [],
43
- outputs: [{ name: "", type: "address", internalType: "address" }],
44
- stateMutability: "view"
45
- },
46
- {
47
- type: "function",
48
- name: "getInvestor",
49
- inputs: [
50
- { name: "creditAccount", type: "address", internalType: "address" }
51
- ],
52
- outputs: [{ name: "", type: "address", internalType: "address" }],
53
- stateMutability: "view"
54
- },
55
- {
56
- type: "function",
57
- name: "getWallet",
58
- inputs: [
59
- { name: "creditAccount", type: "address", internalType: "address" }
60
- ],
61
- outputs: [{ name: "", type: "address", internalType: "address" }],
62
- stateMutability: "view"
63
- },
64
- {
65
- type: "function",
66
- name: "isCreditAccount",
67
- inputs: [
68
- { name: "creditAccount", type: "address", internalType: "address" }
69
- ],
70
- outputs: [{ name: "", type: "bool", internalType: "bool" }],
71
- stateMutability: "view"
72
- },
73
- {
74
- type: "function",
75
- name: "isFrozen",
76
- inputs: [
77
- { name: "creditAccount", type: "address", internalType: "address" }
78
- ],
79
- outputs: [{ name: "", type: "bool", internalType: "bool" }],
80
- stateMutability: "view"
81
- },
82
- {
83
- type: "function",
84
- name: "multicall",
85
- inputs: [
86
- { name: "creditAccount", type: "address", internalType: "address" },
87
- {
88
- name: "calls",
89
- type: "tuple[]",
90
- internalType: "struct MultiCall[]",
91
- components: [
92
- { name: "target", type: "address", internalType: "address" },
93
- { name: "callData", type: "bytes", internalType: "bytes" }
94
- ]
95
- },
96
- {
97
- name: "tokensToRegister",
98
- type: "address[]",
99
- internalType: "address[]"
100
- }
101
- ],
102
- outputs: [],
103
- stateMutability: "nonpayable"
104
- },
105
- {
106
- type: "function",
107
- name: "openCreditAccount",
108
- inputs: [
109
- { name: "creditManager", type: "address", internalType: "address" },
110
- {
111
- name: "calls",
112
- type: "tuple[]",
113
- internalType: "struct MultiCall[]",
114
- components: [
115
- { name: "target", type: "address", internalType: "address" },
116
- { name: "callData", type: "bytes", internalType: "bytes" }
117
- ]
118
- },
119
- {
120
- name: "tokensToRegister",
121
- type: "address[]",
122
- internalType: "address[]"
123
- }
124
- ],
125
- outputs: [
126
- { name: "creditAccount", type: "address", internalType: "address" },
127
- { name: "wallet", type: "address", internalType: "address" }
128
- ],
129
- stateMutability: "nonpayable"
130
- },
131
- {
132
- type: "function",
133
- name: "precomputeWalletAddress",
134
- inputs: [
135
- { name: "creditManager", type: "address", internalType: "address" },
136
- { name: "investor", type: "address", internalType: "address" }
137
- ],
138
- outputs: [{ name: "", type: "address", internalType: "address" }],
139
- stateMutability: "view"
140
- },
141
- {
142
- type: "function",
143
- name: "serialize",
144
- inputs: [],
145
- outputs: [{ name: "serializedData", type: "bytes", internalType: "bytes" }],
146
- stateMutability: "view"
147
- },
148
- {
149
- type: "function",
150
- name: "setFrozenStatus",
151
- inputs: [
152
- { name: "creditAccount", type: "address", internalType: "address" },
153
- { name: "frozen", type: "bool", internalType: "bool" }
154
- ],
155
- outputs: [],
156
- stateMutability: "nonpayable"
157
- },
158
- {
159
- type: "function",
160
- name: "setInvestor",
161
- inputs: [
162
- { name: "creditAccount", type: "address", internalType: "address" },
163
- { name: "investor", type: "address", internalType: "address" }
164
- ],
165
- outputs: [],
166
- stateMutability: "nonpayable"
167
- },
168
- {
169
- type: "function",
170
- name: "version",
171
- inputs: [],
172
- outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
173
- stateMutability: "view"
174
- },
175
- {
176
- type: "event",
177
- name: "CreateWallet",
178
- inputs: [
179
- {
180
- name: "creditAccount",
181
- type: "address",
182
- indexed: true,
183
- internalType: "address"
184
- },
185
- {
186
- name: "wallet",
187
- type: "address",
188
- indexed: true,
189
- internalType: "address"
190
- },
191
- {
192
- name: "investor",
193
- type: "address",
194
- indexed: true,
195
- internalType: "address"
196
- }
197
- ],
198
- anonymous: false
199
- },
200
- {
201
- type: "event",
202
- name: "SetFrozenStatus",
203
- inputs: [
204
- {
205
- name: "creditAccount",
206
- type: "address",
207
- indexed: true,
208
- internalType: "address"
209
- },
210
- { name: "frozen", type: "bool", indexed: false, internalType: "bool" }
211
- ],
212
- anonymous: false
213
- },
214
- {
215
- type: "event",
216
- name: "SetInvestor",
217
- inputs: [
218
- {
219
- name: "creditAccount",
220
- type: "address",
221
- indexed: true,
222
- internalType: "address"
223
- },
224
- {
225
- name: "oldInvestor",
226
- type: "address",
227
- indexed: true,
228
- internalType: "address"
229
- },
230
- {
231
- name: "newInvestor",
232
- type: "address",
233
- indexed: true,
234
- internalType: "address"
235
- }
236
- ],
237
- anonymous: false
238
- },
239
- {
240
- type: "error",
241
- name: "CallerIsNotInvestorException",
242
- inputs: [
243
- { name: "caller", type: "address", internalType: "address" },
244
- { name: "creditAccount", type: "address", internalType: "address" }
245
- ]
246
- },
247
- {
248
- type: "error",
249
- name: "FrozenCreditAccountException",
250
- inputs: [
251
- { name: "creditAccount", type: "address", internalType: "address" }
252
- ]
253
- },
254
- {
255
- type: "error",
256
- name: "InvalidCreditManagerException",
257
- inputs: [
258
- { name: "creditManager", type: "address", internalType: "address" }
259
- ]
260
- },
261
- {
262
- type: "error",
263
- name: "InvalidUnderlyingTokenException",
264
- inputs: [{ name: "underlying", type: "address", internalType: "address" }]
265
- },
266
- {
267
- type: "error",
268
- name: "UnknownCreditAccountException",
269
- inputs: [
270
- { name: "creditAccount", type: "address", internalType: "address" }
271
- ]
272
- },
273
- { type: "error", name: "ZeroAddressException", inputs: [] }
274
- ];
275
- // Annotate the CommonJS export names for ESM import in node:
276
- 0 && (module.exports = {
277
- iSecuritizeKYCFactoryAbi
278
- });
@@ -1,97 +0,0 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var SecuritizeKYCFactory_exports = {};
20
- __export(SecuritizeKYCFactory_exports, {
21
- SecuritizeKYCFactory: () => SecuritizeKYCFactory
22
- });
23
- module.exports = __toCommonJS(SecuritizeKYCFactory_exports);
24
- var import_iSecuritizeDegenNFT = require("../../../abi/310/iSecuritizeDegenNFT.js");
25
- var import_iSecuritizeKYCFactory = require("../../../abi/310/iSecuritizeKYCFactory.js");
26
- var import_base = require("../../base/index.js");
27
- var import__ = require("../../index.js");
28
- const abi = import_iSecuritizeKYCFactory.iSecuritizeKYCFactoryAbi;
29
- class SecuritizeKYCFactory extends import_base.BaseContract {
30
- investorCache;
31
- #degenNFT;
32
- constructor(options, address) {
33
- super(options, {
34
- addr: address,
35
- name: "SecuritizeKYCFactory",
36
- abi
37
- });
38
- }
39
- async precomputeWalletAddress(creditManager, investor) {
40
- return this.contract.read.precomputeWalletAddress([
41
- creditManager,
42
- investor
43
- ]);
44
- }
45
- async getWallet(creditAccount) {
46
- return this.contract.read.getWallet([creditAccount]);
47
- }
48
- /**
49
- * Returns the investor address for a credit account.
50
- * @param creditAccount - Credit account address
51
- * @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.
52
- */
53
- async getInvestor(creditAccount, fromCache) {
54
- if (fromCache && this.investorCache?.has(creditAccount)) {
55
- return this.investorCache.get(creditAccount);
56
- }
57
- const investor = await this.contract.read.getInvestor([creditAccount]);
58
- if (fromCache) {
59
- if (!this.investorCache) {
60
- this.investorCache = new import__.AddressMap();
61
- }
62
- this.investorCache.upsert(creditAccount, investor);
63
- }
64
- return investor;
65
- }
66
- async getDSTokens() {
67
- const degenNFT = await this.getDegenNFT();
68
- const tokens = await this.client.readContract({
69
- address: degenNFT,
70
- abi: import_iSecuritizeDegenNFT.iSecuritizeDegenNFTAbi,
71
- functionName: "getDSTokens"
72
- });
73
- return [...tokens];
74
- }
75
- multicall(creditAccount, calls, tokensToRegister) {
76
- return this.createRawTx({
77
- functionName: "multicall",
78
- args: [creditAccount, calls, tokensToRegister]
79
- });
80
- }
81
- openCreditAccount(creditManager, calls, tokensToRegister) {
82
- return this.createRawTx({
83
- functionName: "openCreditAccount",
84
- args: [creditManager, calls, tokensToRegister]
85
- });
86
- }
87
- async getDegenNFT() {
88
- if (!this.#degenNFT) {
89
- this.#degenNFT = await this.contract.read.getDegenNFT();
90
- }
91
- return this.#degenNFT;
92
- }
93
- }
94
- // Annotate the CommonJS export names for ESM import in node:
95
- 0 && (module.exports = {
96
- SecuritizeKYCFactory
97
- });