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

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 (53) 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 -123
  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 +84 -132
  15. package/dist/esm/dev/AccountOpener.js +6 -47
  16. package/dist/esm/sdk/accounts/AbstractCreditAccountsService.js +6 -339
  17. package/dist/esm/sdk/accounts/CreditAccountsServiceV310.js +1 -13
  18. package/dist/esm/sdk/base/TokensMeta.js +7 -155
  19. package/dist/esm/sdk/base/token-types.js +0 -4
  20. package/dist/esm/sdk/chain/chains.js +1 -2
  21. package/dist/esm/sdk/constants/addresses.js +2 -0
  22. package/dist/esm/sdk/market/MarketRegister.js +0 -3
  23. package/dist/esm/sdk/market/MarketSuite.js +0 -3
  24. package/dist/esm/sdk/market/ZapperRegister.js +0 -123
  25. package/dist/esm/sdk/market/pool/PoolSuite.js +0 -3
  26. package/dist/esm/sdk/market/pool/PoolV310Contract.js +2 -17
  27. package/dist/esm/sdk/market/pool/index.js +0 -2
  28. package/dist/esm/sdk/pools/PoolService.js +75 -127
  29. package/dist/types/sdk/accounts/AbstractCreditAccountsService.d.ts +5 -103
  30. package/dist/types/sdk/accounts/CreditAccountsServiceV310.d.ts +2 -4
  31. package/dist/types/sdk/accounts/types.d.ts +6 -130
  32. package/dist/types/sdk/base/TokensMeta.d.ts +3 -20
  33. package/dist/types/sdk/base/token-types.d.ts +1 -21
  34. package/dist/types/sdk/base/types.d.ts +3 -0
  35. package/dist/types/sdk/chain/chains.d.ts +1 -1
  36. package/dist/types/sdk/constants/addresses.d.ts +4 -0
  37. package/dist/types/sdk/market/MarketSuite.d.ts +0 -2
  38. package/dist/types/sdk/market/pool/PoolSuite.d.ts +0 -2
  39. package/dist/types/sdk/market/pool/PoolV310Contract.d.ts +2 -6
  40. package/dist/types/sdk/market/pool/index.d.ts +0 -2
  41. package/dist/types/sdk/market/types.d.ts +1 -1
  42. package/dist/types/sdk/pools/PoolService.d.ts +24 -0
  43. package/dist/types/sdk/pools/types.d.ts +9 -8
  44. package/package.json +1 -1
  45. package/dist/cjs/abi/310/iSecuritizeDegenNFT.js +0 -263
  46. package/dist/cjs/abi/310/iSecuritizeKYCFactory.js +0 -278
  47. package/dist/cjs/sdk/market/pool/SecuritizeKYCFactory.js +0 -97
  48. package/dist/esm/abi/310/iSecuritizeDegenNFT.js +0 -239
  49. package/dist/esm/abi/310/iSecuritizeKYCFactory.js +0 -254
  50. package/dist/esm/sdk/market/pool/SecuritizeKYCFactory.js +0 -73
  51. package/dist/types/abi/310/iSecuritizeDegenNFT.d.ts +0 -324
  52. package/dist/types/abi/310/iSecuritizeKYCFactory.d.ts +0 -322
  53. package/dist/types/sdk/market/pool/SecuritizeKYCFactory.d.ts +0 -345
@@ -1,239 +0,0 @@
1
- const iSecuritizeDegenNFTAbi = [
2
- {
3
- type: "function",
4
- name: "addRegistrar",
5
- inputs: [{ name: "registrar", type: "address", internalType: "address" }],
6
- outputs: [],
7
- stateMutability: "nonpayable"
8
- },
9
- {
10
- type: "function",
11
- name: "burn",
12
- inputs: [
13
- { name: "wallet", type: "address", internalType: "address" },
14
- { name: "", type: "uint256", internalType: "uint256" }
15
- ],
16
- outputs: [],
17
- stateMutability: "nonpayable"
18
- },
19
- {
20
- type: "function",
21
- name: "contractType",
22
- inputs: [],
23
- outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
24
- stateMutability: "view"
25
- },
26
- {
27
- type: "function",
28
- name: "getDSTokens",
29
- inputs: [],
30
- outputs: [{ name: "", type: "address[]", internalType: "address[]" }],
31
- stateMutability: "view"
32
- },
33
- {
34
- type: "function",
35
- name: "getFactory",
36
- inputs: [],
37
- outputs: [{ name: "", type: "address", internalType: "address" }],
38
- stateMutability: "view"
39
- },
40
- {
41
- type: "function",
42
- name: "getOperators",
43
- inputs: [{ name: "token", type: "address", internalType: "address" }],
44
- outputs: [{ name: "", type: "address[]", internalType: "address[]" }],
45
- stateMutability: "view"
46
- },
47
- {
48
- type: "function",
49
- name: "getRegisteredTokens",
50
- inputs: [
51
- { name: "creditAccount", type: "address", internalType: "address" }
52
- ],
53
- outputs: [{ name: "", type: "address[]", internalType: "address[]" }],
54
- stateMutability: "view"
55
- },
56
- {
57
- type: "function",
58
- name: "getRegistrar",
59
- inputs: [{ name: "token", type: "address", internalType: "address" }],
60
- outputs: [{ name: "", type: "address", internalType: "address" }],
61
- stateMutability: "view"
62
- },
63
- {
64
- type: "function",
65
- name: "isDSToken",
66
- inputs: [{ name: "token", type: "address", internalType: "address" }],
67
- outputs: [{ name: "", type: "bool", internalType: "bool" }],
68
- stateMutability: "view"
69
- },
70
- {
71
- type: "function",
72
- name: "isOperator",
73
- inputs: [
74
- { name: "token", type: "address", internalType: "address" },
75
- { name: "operator", type: "address", internalType: "address" }
76
- ],
77
- outputs: [{ name: "", type: "bool", internalType: "bool" }],
78
- stateMutability: "view"
79
- },
80
- {
81
- type: "function",
82
- name: "mint",
83
- inputs: [{ name: "wallet", type: "address", internalType: "address" }],
84
- outputs: [],
85
- stateMutability: "nonpayable"
86
- },
87
- {
88
- type: "function",
89
- name: "registerCreditAccount",
90
- inputs: [
91
- { name: "creditAccount", type: "address", internalType: "address" },
92
- { name: "tokens", type: "address[]", internalType: "address[]" }
93
- ],
94
- outputs: [],
95
- stateMutability: "nonpayable"
96
- },
97
- {
98
- type: "function",
99
- name: "registerHelperAccount",
100
- inputs: [
101
- { name: "creditAccount", type: "address", internalType: "address" },
102
- { name: "helperAccount", type: "address", internalType: "address" },
103
- { name: "token", type: "address", internalType: "address" }
104
- ],
105
- outputs: [],
106
- stateMutability: "nonpayable"
107
- },
108
- {
109
- type: "function",
110
- name: "serialize",
111
- inputs: [],
112
- outputs: [{ name: "serializedData", type: "bytes", internalType: "bytes" }],
113
- stateMutability: "view"
114
- },
115
- {
116
- type: "function",
117
- name: "setOperatorStatus",
118
- inputs: [
119
- { name: "token", type: "address", internalType: "address" },
120
- { name: "operator", type: "address", internalType: "address" },
121
- { name: "approved", type: "bool", internalType: "bool" }
122
- ],
123
- outputs: [],
124
- stateMutability: "nonpayable"
125
- },
126
- {
127
- type: "function",
128
- name: "version",
129
- inputs: [],
130
- outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
131
- stateMutability: "view"
132
- },
133
- {
134
- type: "event",
135
- name: "Burn",
136
- inputs: [
137
- {
138
- name: "wallet",
139
- type: "address",
140
- indexed: true,
141
- internalType: "address"
142
- }
143
- ],
144
- anonymous: false
145
- },
146
- {
147
- type: "event",
148
- name: "Mint",
149
- inputs: [
150
- {
151
- name: "wallet",
152
- type: "address",
153
- indexed: true,
154
- internalType: "address"
155
- }
156
- ],
157
- anonymous: false
158
- },
159
- {
160
- type: "event",
161
- name: "SetOperatorStatus",
162
- inputs: [
163
- {
164
- name: "token",
165
- type: "address",
166
- indexed: true,
167
- internalType: "address"
168
- },
169
- {
170
- name: "operator",
171
- type: "address",
172
- indexed: true,
173
- internalType: "address"
174
- },
175
- { name: "approved", type: "bool", indexed: false, internalType: "bool" }
176
- ],
177
- anonymous: false
178
- },
179
- {
180
- type: "event",
181
- name: "SetRegistrar",
182
- inputs: [
183
- {
184
- name: "token",
185
- type: "address",
186
- indexed: true,
187
- internalType: "address"
188
- },
189
- {
190
- name: "registrar",
191
- type: "address",
192
- indexed: true,
193
- internalType: "address"
194
- }
195
- ],
196
- anonymous: false
197
- },
198
- {
199
- type: "error",
200
- name: "CallerIsNotCreditFacadeException",
201
- inputs: [{ name: "caller", type: "address", internalType: "address" }]
202
- },
203
- {
204
- type: "error",
205
- name: "CallerIsNotFactoryException",
206
- inputs: [{ name: "caller", type: "address", internalType: "address" }]
207
- },
208
- {
209
- type: "error",
210
- name: "CallerIsNotInstanceOwnerException",
211
- inputs: [{ name: "caller", type: "address", internalType: "address" }]
212
- },
213
- {
214
- type: "error",
215
- name: "CallerIsNotOperatorException",
216
- inputs: [
217
- { name: "token", type: "address", internalType: "address" },
218
- { name: "caller", type: "address", internalType: "address" }
219
- ]
220
- },
221
- {
222
- type: "error",
223
- name: "RegistrarNotSetForTokenException",
224
- inputs: [{ name: "token", type: "address", internalType: "address" }]
225
- },
226
- {
227
- type: "error",
228
- name: "UnknownTokenException",
229
- inputs: [{ name: "token", type: "address", internalType: "address" }]
230
- },
231
- {
232
- type: "error",
233
- name: "UnknownWalletException",
234
- inputs: [{ name: "wallet", type: "address", internalType: "address" }]
235
- }
236
- ];
237
- export {
238
- iSecuritizeDegenNFTAbi
239
- };
@@ -1,254 +0,0 @@
1
- const iSecuritizeKYCFactoryAbi = [
2
- {
3
- type: "function",
4
- name: "contractType",
5
- inputs: [],
6
- outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
7
- stateMutability: "view"
8
- },
9
- {
10
- type: "function",
11
- name: "getCreditAccounts",
12
- inputs: [{ name: "investor", type: "address", internalType: "address" }],
13
- outputs: [{ name: "", type: "address[]", internalType: "address[]" }],
14
- stateMutability: "view"
15
- },
16
- {
17
- type: "function",
18
- name: "getDegenNFT",
19
- inputs: [],
20
- outputs: [{ name: "", type: "address", internalType: "address" }],
21
- stateMutability: "view"
22
- },
23
- {
24
- type: "function",
25
- name: "getInvestor",
26
- inputs: [
27
- { name: "creditAccount", type: "address", internalType: "address" }
28
- ],
29
- outputs: [{ name: "", type: "address", internalType: "address" }],
30
- stateMutability: "view"
31
- },
32
- {
33
- type: "function",
34
- name: "getWallet",
35
- inputs: [
36
- { name: "creditAccount", type: "address", internalType: "address" }
37
- ],
38
- outputs: [{ name: "", type: "address", internalType: "address" }],
39
- stateMutability: "view"
40
- },
41
- {
42
- type: "function",
43
- name: "isCreditAccount",
44
- inputs: [
45
- { name: "creditAccount", type: "address", internalType: "address" }
46
- ],
47
- outputs: [{ name: "", type: "bool", internalType: "bool" }],
48
- stateMutability: "view"
49
- },
50
- {
51
- type: "function",
52
- name: "isFrozen",
53
- inputs: [
54
- { name: "creditAccount", type: "address", internalType: "address" }
55
- ],
56
- outputs: [{ name: "", type: "bool", internalType: "bool" }],
57
- stateMutability: "view"
58
- },
59
- {
60
- type: "function",
61
- name: "multicall",
62
- inputs: [
63
- { name: "creditAccount", type: "address", internalType: "address" },
64
- {
65
- name: "calls",
66
- type: "tuple[]",
67
- internalType: "struct MultiCall[]",
68
- components: [
69
- { name: "target", type: "address", internalType: "address" },
70
- { name: "callData", type: "bytes", internalType: "bytes" }
71
- ]
72
- },
73
- {
74
- name: "tokensToRegister",
75
- type: "address[]",
76
- internalType: "address[]"
77
- }
78
- ],
79
- outputs: [],
80
- stateMutability: "nonpayable"
81
- },
82
- {
83
- type: "function",
84
- name: "openCreditAccount",
85
- inputs: [
86
- { name: "creditManager", 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
- { name: "creditAccount", type: "address", internalType: "address" },
104
- { name: "wallet", type: "address", internalType: "address" }
105
- ],
106
- stateMutability: "nonpayable"
107
- },
108
- {
109
- type: "function",
110
- name: "precomputeWalletAddress",
111
- inputs: [
112
- { name: "creditManager", type: "address", internalType: "address" },
113
- { name: "investor", type: "address", internalType: "address" }
114
- ],
115
- outputs: [{ name: "", type: "address", internalType: "address" }],
116
- stateMutability: "view"
117
- },
118
- {
119
- type: "function",
120
- name: "serialize",
121
- inputs: [],
122
- outputs: [{ name: "serializedData", type: "bytes", internalType: "bytes" }],
123
- stateMutability: "view"
124
- },
125
- {
126
- type: "function",
127
- name: "setFrozenStatus",
128
- inputs: [
129
- { name: "creditAccount", type: "address", internalType: "address" },
130
- { name: "frozen", type: "bool", internalType: "bool" }
131
- ],
132
- outputs: [],
133
- stateMutability: "nonpayable"
134
- },
135
- {
136
- type: "function",
137
- name: "setInvestor",
138
- inputs: [
139
- { name: "creditAccount", type: "address", internalType: "address" },
140
- { name: "investor", type: "address", internalType: "address" }
141
- ],
142
- outputs: [],
143
- stateMutability: "nonpayable"
144
- },
145
- {
146
- type: "function",
147
- name: "version",
148
- inputs: [],
149
- outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
150
- stateMutability: "view"
151
- },
152
- {
153
- type: "event",
154
- name: "CreateWallet",
155
- inputs: [
156
- {
157
- name: "creditAccount",
158
- type: "address",
159
- indexed: true,
160
- internalType: "address"
161
- },
162
- {
163
- name: "wallet",
164
- type: "address",
165
- indexed: true,
166
- internalType: "address"
167
- },
168
- {
169
- name: "investor",
170
- type: "address",
171
- indexed: true,
172
- internalType: "address"
173
- }
174
- ],
175
- anonymous: false
176
- },
177
- {
178
- type: "event",
179
- name: "SetFrozenStatus",
180
- inputs: [
181
- {
182
- name: "creditAccount",
183
- type: "address",
184
- indexed: true,
185
- internalType: "address"
186
- },
187
- { name: "frozen", type: "bool", indexed: false, internalType: "bool" }
188
- ],
189
- anonymous: false
190
- },
191
- {
192
- type: "event",
193
- name: "SetInvestor",
194
- inputs: [
195
- {
196
- name: "creditAccount",
197
- type: "address",
198
- indexed: true,
199
- internalType: "address"
200
- },
201
- {
202
- name: "oldInvestor",
203
- type: "address",
204
- indexed: true,
205
- internalType: "address"
206
- },
207
- {
208
- name: "newInvestor",
209
- type: "address",
210
- indexed: true,
211
- internalType: "address"
212
- }
213
- ],
214
- anonymous: false
215
- },
216
- {
217
- type: "error",
218
- name: "CallerIsNotInvestorException",
219
- inputs: [
220
- { name: "caller", type: "address", internalType: "address" },
221
- { name: "creditAccount", type: "address", internalType: "address" }
222
- ]
223
- },
224
- {
225
- type: "error",
226
- name: "FrozenCreditAccountException",
227
- inputs: [
228
- { name: "creditAccount", type: "address", internalType: "address" }
229
- ]
230
- },
231
- {
232
- type: "error",
233
- name: "InvalidCreditManagerException",
234
- inputs: [
235
- { name: "creditManager", type: "address", internalType: "address" }
236
- ]
237
- },
238
- {
239
- type: "error",
240
- name: "InvalidUnderlyingTokenException",
241
- inputs: [{ name: "underlying", type: "address", internalType: "address" }]
242
- },
243
- {
244
- type: "error",
245
- name: "UnknownCreditAccountException",
246
- inputs: [
247
- { name: "creditAccount", type: "address", internalType: "address" }
248
- ]
249
- },
250
- { type: "error", name: "ZeroAddressException", inputs: [] }
251
- ];
252
- export {
253
- iSecuritizeKYCFactoryAbi
254
- };
@@ -1,73 +0,0 @@
1
- import { iSecuritizeDegenNFTAbi } from "../../../abi/310/iSecuritizeDegenNFT.js";
2
- import { iSecuritizeKYCFactoryAbi } from "../../../abi/310/iSecuritizeKYCFactory.js";
3
- import { BaseContract } from "../../base/index.js";
4
- import { AddressMap } from "../../index.js";
5
- const abi = iSecuritizeKYCFactoryAbi;
6
- class SecuritizeKYCFactory extends BaseContract {
7
- investorCache;
8
- #degenNFT;
9
- constructor(options, address) {
10
- super(options, {
11
- addr: address,
12
- name: "SecuritizeKYCFactory",
13
- abi
14
- });
15
- }
16
- async precomputeWalletAddress(creditManager, investor) {
17
- return this.contract.read.precomputeWalletAddress([
18
- creditManager,
19
- investor
20
- ]);
21
- }
22
- async getWallet(creditAccount) {
23
- return this.contract.read.getWallet([creditAccount]);
24
- }
25
- /**
26
- * Returns the investor address for a credit account.
27
- * @param creditAccount - Credit account address
28
- * @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.
29
- */
30
- async getInvestor(creditAccount, fromCache) {
31
- if (fromCache && this.investorCache?.has(creditAccount)) {
32
- return this.investorCache.get(creditAccount);
33
- }
34
- const investor = await this.contract.read.getInvestor([creditAccount]);
35
- if (fromCache) {
36
- if (!this.investorCache) {
37
- this.investorCache = new AddressMap();
38
- }
39
- this.investorCache.upsert(creditAccount, investor);
40
- }
41
- return investor;
42
- }
43
- async getDSTokens() {
44
- const degenNFT = await this.getDegenNFT();
45
- const tokens = await this.client.readContract({
46
- address: degenNFT,
47
- abi: iSecuritizeDegenNFTAbi,
48
- functionName: "getDSTokens"
49
- });
50
- return [...tokens];
51
- }
52
- multicall(creditAccount, calls, tokensToRegister) {
53
- return this.createRawTx({
54
- functionName: "multicall",
55
- args: [creditAccount, calls, tokensToRegister]
56
- });
57
- }
58
- openCreditAccount(creditManager, calls, tokensToRegister) {
59
- return this.createRawTx({
60
- functionName: "openCreditAccount",
61
- args: [creditManager, calls, tokensToRegister]
62
- });
63
- }
64
- async getDegenNFT() {
65
- if (!this.#degenNFT) {
66
- this.#degenNFT = await this.contract.read.getDegenNFT();
67
- }
68
- return this.#degenNFT;
69
- }
70
- }
71
- export {
72
- SecuritizeKYCFactory
73
- };