@gearbox-protocol/sdk 13.2.1 → 13.3.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.
- package/dist/cjs/abi/310/iSecuritizeDegenNFT.js +263 -0
- package/dist/cjs/abi/310/iSecuritizeKYCFactory.js +278 -0
- package/dist/cjs/{sdk/pools/PoolServiceV310.js → abi/iStateSerializer.js} +14 -8
- package/dist/cjs/dev/AccountOpener.js +45 -5
- package/dist/cjs/dev/index.js +2 -2
- package/dist/cjs/sdk/accounts/AbstractCreditAccountsService.js +462 -104
- package/dist/cjs/sdk/accounts/CreditAccountsServiceV310.js +16 -5
- package/dist/cjs/sdk/base/ChainContractsRegister.js +1 -1
- package/dist/cjs/sdk/base/TokensMeta.js +255 -32
- package/dist/cjs/sdk/base/index.js +2 -0
- package/dist/cjs/sdk/{constants/phantom-tokens.js → base/token-types.js} +9 -3
- package/dist/cjs/sdk/chain/chains.js +2 -1
- package/dist/cjs/sdk/constants/index.js +0 -2
- package/dist/cjs/sdk/market/MarketRegister.js +2 -2
- package/dist/cjs/sdk/market/MarketSuite.js +6 -0
- package/dist/cjs/{plugins/zappers/extraZappers.js → sdk/market/ZapperRegister.js} +110 -6
- package/dist/cjs/sdk/market/index.js +3 -1
- package/dist/cjs/sdk/market/pool/PoolSuite.js +3 -0
- package/dist/cjs/sdk/market/pool/PoolV310Contract.js +17 -2
- package/dist/cjs/sdk/market/pool/SecuritizeKYCFactory.js +97 -0
- package/dist/cjs/sdk/market/pool/index.js +4 -0
- package/dist/cjs/sdk/pools/PoolService.js +391 -0
- package/dist/cjs/sdk/pools/index.js +2 -4
- package/dist/cjs/sdk/utils/AddressMap.js +1 -1
- package/dist/cjs/sdk/utils/viem/sendRawTx.js +16 -0
- package/dist/esm/abi/310/iSecuritizeDegenNFT.js +239 -0
- package/dist/esm/abi/310/iSecuritizeKYCFactory.js +254 -0
- package/dist/esm/abi/iStateSerializer.js +12 -0
- package/dist/esm/dev/AccountOpener.js +47 -6
- package/dist/esm/dev/index.js +1 -1
- package/dist/esm/sdk/accounts/AbstractCreditAccountsService.js +462 -104
- package/dist/esm/sdk/accounts/CreditAccountsServiceV310.js +16 -5
- package/dist/esm/sdk/base/ChainContractsRegister.js +1 -1
- package/dist/esm/sdk/base/TokensMeta.js +261 -32
- package/dist/esm/sdk/base/index.js +1 -0
- package/dist/esm/sdk/{constants/phantom-tokens.js → base/token-types.js} +4 -0
- package/dist/esm/sdk/chain/chains.js +2 -1
- package/dist/esm/sdk/constants/index.js +0 -1
- package/dist/esm/sdk/market/MarketRegister.js +2 -2
- package/dist/esm/sdk/market/MarketSuite.js +6 -0
- package/dist/esm/{plugins/zappers/extraZappers.js → sdk/market/ZapperRegister.js} +109 -2
- package/dist/esm/sdk/market/index.js +1 -0
- package/dist/esm/sdk/market/pool/PoolSuite.js +3 -0
- package/dist/esm/sdk/market/pool/PoolV310Contract.js +17 -2
- package/dist/esm/sdk/market/pool/SecuritizeKYCFactory.js +73 -0
- package/dist/esm/sdk/market/pool/index.js +2 -0
- package/dist/esm/sdk/pools/PoolService.js +371 -0
- package/dist/esm/sdk/pools/index.js +1 -2
- package/dist/esm/sdk/utils/AddressMap.js +1 -1
- package/dist/esm/sdk/utils/viem/sendRawTx.js +19 -1
- package/dist/types/abi/310/iSecuritizeDegenNFT.d.ts +324 -0
- package/dist/types/abi/310/iSecuritizeKYCFactory.d.ts +322 -0
- package/dist/types/abi/iStateSerializer.d.ts +11 -0
- package/dist/types/dev/index.d.ts +1 -1
- package/dist/types/sdk/accounts/AbstractCreditAccountsService.d.ts +123 -27
- package/dist/types/sdk/accounts/CreditAccountsServiceV310.d.ts +1 -1
- package/dist/types/sdk/accounts/types.d.ts +108 -8
- package/dist/types/sdk/base/TokensMeta.d.ts +34 -18
- package/dist/types/sdk/base/index.d.ts +1 -0
- package/dist/types/sdk/base/token-types.d.ts +33 -0
- package/dist/types/sdk/base/types.d.ts +0 -1
- package/dist/types/sdk/chain/chains.d.ts +1 -1
- package/dist/types/sdk/constants/index.d.ts +0 -1
- package/dist/types/sdk/market/MarketRegister.d.ts +2 -2
- package/dist/types/sdk/market/MarketSuite.d.ts +3 -0
- package/dist/types/sdk/market/ZapperRegister.d.ts +17 -0
- package/dist/types/sdk/market/index.d.ts +1 -0
- package/dist/types/sdk/market/pool/PoolSuite.d.ts +2 -0
- package/dist/types/sdk/market/pool/PoolV310Contract.d.ts +6 -2
- package/dist/types/sdk/market/pool/SecuritizeKYCFactory.d.ts +345 -0
- package/dist/types/sdk/market/pool/index.d.ts +2 -0
- package/dist/types/sdk/market/types.d.ts +10 -0
- package/dist/types/sdk/pools/PoolService.d.ts +14 -0
- package/dist/types/sdk/pools/index.d.ts +1 -2
- package/dist/types/sdk/pools/types.d.ts +84 -63
- package/dist/types/sdk/utils/AddressMap.d.ts +1 -1
- package/dist/types/sdk/utils/viem/sendRawTx.d.ts +5 -1
- package/package.json +1 -1
- package/dist/cjs/plugins/zappers/ZappersPlugin.js +0 -144
- package/dist/cjs/plugins/zappers/index.js +0 -26
- package/dist/cjs/plugins/zappers/package.json +0 -1
- package/dist/cjs/sdk/pools/AbstractPoolService.js +0 -137
- package/dist/cjs/sdk/pools/createPoolService.js +0 -35
- package/dist/esm/plugins/zappers/ZappersPlugin.js +0 -126
- package/dist/esm/plugins/zappers/index.js +0 -3
- package/dist/esm/plugins/zappers/package.json +0 -1
- package/dist/esm/sdk/pools/AbstractPoolService.js +0 -113
- package/dist/esm/sdk/pools/PoolServiceV310.js +0 -6
- package/dist/esm/sdk/pools/createPoolService.js +0 -11
- package/dist/types/plugins/zappers/ZappersPlugin.d.ts +0 -18
- package/dist/types/plugins/zappers/extraZappers.d.ts +0 -6
- package/dist/types/plugins/zappers/index.d.ts +0 -3
- package/dist/types/plugins/zappers/types.d.ts +0 -12
- package/dist/types/sdk/constants/phantom-tokens.d.ts +0 -2
- package/dist/types/sdk/pools/AbstractPoolService.d.ts +0 -9
- package/dist/types/sdk/pools/PoolServiceV310.d.ts +0 -4
- package/dist/types/sdk/pools/createPoolService.d.ts +0 -3
- /package/dist/cjs/{plugins/zappers → sdk/market}/types.js +0 -0
- /package/dist/esm/{plugins/zappers → sdk/market}/types.js +0 -0
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { ContractEventName, DecodeFunctionDataReturnType, Log } from "viem";
|
|
2
|
-
import type {
|
|
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(
|
|
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 {};
|
|
@@ -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,14 +1,7 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
3
|
-
import type {
|
|
4
|
-
import type { iethZapperDepositsAbi } from "../../abi/iETHZapperDeposits.js";
|
|
5
|
-
import type { iZapperAbi } from "../../abi/iZapper.js";
|
|
1
|
+
import type { Abi } from "abitype";
|
|
2
|
+
import type { Address, ContractFunctionArgs, ContractFunctionName } from "viem";
|
|
3
|
+
import type { ZapperData } from "../market/index.js";
|
|
6
4
|
import type { Asset } from "../router/index.js";
|
|
7
|
-
interface IZapper {
|
|
8
|
-
zapper: Address;
|
|
9
|
-
tokenIn: Address;
|
|
10
|
-
tokenOut: Address;
|
|
11
|
-
}
|
|
12
5
|
interface PermitResult {
|
|
13
6
|
r: Address;
|
|
14
7
|
s: Address;
|
|
@@ -20,77 +13,105 @@ interface PermitResult {
|
|
|
20
13
|
deadline: bigint;
|
|
21
14
|
nonce: bigint;
|
|
22
15
|
}
|
|
16
|
+
export type PoolServiceCall<abi extends Abi | readonly unknown[] = Abi, functionName extends ContractFunctionName<abi, "nonpayable" | "payable"> = ContractFunctionName<abi, "nonpayable" | "payable">, args extends ContractFunctionArgs<abi, "nonpayable" | "payable", functionName> = ContractFunctionArgs<abi, "nonpayable" | "payable", functionName>> = {
|
|
17
|
+
abi: abi;
|
|
18
|
+
functionName: functionName;
|
|
19
|
+
args: args;
|
|
20
|
+
target: Address;
|
|
21
|
+
value?: bigint;
|
|
22
|
+
};
|
|
23
23
|
export interface AddLiquidityProps {
|
|
24
24
|
collateral: Asset;
|
|
25
25
|
pool: Address;
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
nativeTokenAddress: Address;
|
|
31
|
-
referralCode: bigint | undefined;
|
|
26
|
+
wallet: Address;
|
|
27
|
+
meta: DepositMetadata;
|
|
28
|
+
permit?: PermitResult;
|
|
29
|
+
referralCode?: bigint;
|
|
32
30
|
}
|
|
33
|
-
export type AddLiquidityCall = [
|
|
34
|
-
{
|
|
35
|
-
target: Address;
|
|
36
|
-
abi: typeof iethZapperDepositsAbi;
|
|
37
|
-
functionName: "depositWithReferral";
|
|
38
|
-
args: [Address, bigint];
|
|
39
|
-
value: bigint;
|
|
40
|
-
} | {
|
|
41
|
-
target: Address;
|
|
42
|
-
abi: typeof ierc20ZapperDepositsAbi;
|
|
43
|
-
functionName: "depositWithReferralAndPermit";
|
|
44
|
-
args: [bigint, Address, bigint, bigint, number, Address, Address];
|
|
45
|
-
} | {
|
|
46
|
-
target: Address;
|
|
47
|
-
abi: typeof ierc20ZapperDepositsAbi;
|
|
48
|
-
functionName: "depositWithReferral";
|
|
49
|
-
args: [bigint, Address, bigint];
|
|
50
|
-
} | {
|
|
51
|
-
target: Address;
|
|
52
|
-
abi: typeof iPoolV310Abi;
|
|
53
|
-
functionName: "depositWithReferral";
|
|
54
|
-
args: [bigint, Address, bigint];
|
|
55
|
-
}
|
|
56
|
-
];
|
|
57
31
|
export interface RemoveLiquidityProps {
|
|
58
32
|
pool: Address;
|
|
59
33
|
amount: bigint;
|
|
60
|
-
|
|
34
|
+
wallet: Address;
|
|
61
35
|
permit: PermitResult | undefined;
|
|
62
|
-
|
|
36
|
+
meta: WithdrawalMetadata;
|
|
37
|
+
}
|
|
38
|
+
export interface DepositMetadata {
|
|
39
|
+
/**
|
|
40
|
+
* Zapper that will perform the deposit, undefined in case of direct pool underlying deposit
|
|
41
|
+
*/
|
|
42
|
+
zapper?: ZapperData;
|
|
43
|
+
/**
|
|
44
|
+
* Before deposit user will nedd to call approve method on token that he wants to deposit,
|
|
45
|
+
* this is the spender address that will be used to call approve method.
|
|
46
|
+
*
|
|
47
|
+
*/
|
|
48
|
+
approveTarget: Address;
|
|
49
|
+
/**
|
|
50
|
+
* If true, user can avoid approval step and deposit with permit
|
|
51
|
+
*/
|
|
52
|
+
permissible: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Type of deposit
|
|
55
|
+
*/
|
|
56
|
+
type: "kyc-on-demand" | "kyc-default" | "classic";
|
|
57
|
+
}
|
|
58
|
+
export interface WithdrawalMetadata {
|
|
59
|
+
/**
|
|
60
|
+
* Zapper that will perform the deposit, undefined in case of direct pool underlying deposit
|
|
61
|
+
*/
|
|
62
|
+
zapper?: ZapperData;
|
|
63
|
+
/**
|
|
64
|
+
* Before deposit user will nedd to call approve method on token that he wants to deposit,
|
|
65
|
+
* this is the spender address that will be used to call approve method.
|
|
66
|
+
*
|
|
67
|
+
*/
|
|
68
|
+
approveTarget?: Address;
|
|
69
|
+
/**
|
|
70
|
+
* If true, user can avoid approval step and deposit with permit
|
|
71
|
+
*/
|
|
72
|
+
permissible: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Type of deposit
|
|
75
|
+
*/
|
|
76
|
+
type: "kyc-on-demand" | "kyc-default" | "classic";
|
|
63
77
|
}
|
|
64
|
-
export type RemoveLiquidityCall = [
|
|
65
|
-
{
|
|
66
|
-
target: Address;
|
|
67
|
-
abi: typeof iZapperAbi;
|
|
68
|
-
functionName: "redeemWithPermit";
|
|
69
|
-
args: [bigint, Address, bigint, number, Address, Address];
|
|
70
|
-
} | {
|
|
71
|
-
target: Address;
|
|
72
|
-
abi: typeof iZapperAbi;
|
|
73
|
-
functionName: "redeem";
|
|
74
|
-
args: [bigint, Address];
|
|
75
|
-
} | {
|
|
76
|
-
target: Address;
|
|
77
|
-
abi: typeof iPoolV310Abi;
|
|
78
|
-
functionName: "redeem";
|
|
79
|
-
args: [bigint, Address, Address];
|
|
80
|
-
}
|
|
81
|
-
];
|
|
82
78
|
export interface IPoolsService {
|
|
83
79
|
/**
|
|
84
|
-
*
|
|
80
|
+
* Returns list of tokens that can be deposited to a pool
|
|
81
|
+
* @param pool
|
|
82
|
+
*/
|
|
83
|
+
getDepositTokensIn(pool: Address): Address[];
|
|
84
|
+
/**
|
|
85
|
+
* Returns list of tokens that user can receive after depositing to a pool,
|
|
86
|
+
* depends on the pool type and the token being deposited (one of returned by {@link getDepositTokensIn}).
|
|
87
|
+
*
|
|
88
|
+
* Can return empty array if no tokens can be received (e.g. for KYC underlying on demand)
|
|
89
|
+
*
|
|
90
|
+
* @param pool
|
|
91
|
+
* @param tokenIn
|
|
92
|
+
*/
|
|
93
|
+
getDepositTokensOut(pool: Address, tokenIn: Address): Address[];
|
|
94
|
+
/**
|
|
95
|
+
* After user chooses tokenIn from {@link getDepositTokensIn} and tokenOut from {@link getDepositTokensOut},
|
|
96
|
+
* this method returns metadata that will be used to perform the deposit.
|
|
97
|
+
*
|
|
98
|
+
* @param pool
|
|
99
|
+
* @param tokenIn
|
|
100
|
+
* @param tokenOut can be undefined if deposit is not resulting in a token out (e.g. for KYC underlying on demand)
|
|
101
|
+
*/
|
|
102
|
+
getDepositMetadata(pool: Address, tokenIn: Address, tokenOut?: Address): DepositMetadata;
|
|
103
|
+
/**
|
|
104
|
+
* Returns contract call parameters for adding liquidity to a pool
|
|
105
|
+
* Or undefined if no deposit action is required (e.g. for KYC underlying on demand)
|
|
85
106
|
* @param props - {@link AddLiquidityProps}
|
|
86
107
|
* @returns - {@link AddLiquidityCall}
|
|
87
108
|
*/
|
|
88
|
-
addLiquidity(props: AddLiquidityProps):
|
|
109
|
+
addLiquidity(props: AddLiquidityProps): PoolServiceCall | undefined;
|
|
89
110
|
/**
|
|
90
111
|
* Remove liquidity from a pool
|
|
91
112
|
* @param props - {@link RemoveLiquidityProps}
|
|
92
113
|
* @returns - {@link RemoveLiquidityCall}
|
|
93
114
|
*/
|
|
94
|
-
removeLiquidity(props: RemoveLiquidityProps):
|
|
115
|
+
removeLiquidity(props: RemoveLiquidityProps): PoolServiceCall;
|
|
95
116
|
}
|
|
96
117
|
export {};
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import type { Account, Chain, Client, SendTransactionRequest, SendTransactionReturnType, Transport } from "viem";
|
|
2
|
-
import { type SendTransactionParameters } from "viem/actions";
|
|
2
|
+
import { type EstimateGasParameters, type SendTransactionParameters } from "viem/actions";
|
|
3
3
|
import type { RawTx } from "../../types/index.js";
|
|
4
4
|
export type SendRawTxParameters<chain extends Chain, account extends Account | undefined, request extends SendTransactionRequest<chain, chainOverride>, chainOverride extends Chain | undefined = undefined> = Omit<SendTransactionParameters<chain, account, chainOverride, request>, "data" | "to" | "value"> & {
|
|
5
5
|
tx: Pick<RawTx, "to" | "callData" | "value">;
|
|
6
6
|
};
|
|
7
7
|
export declare function sendRawTx<chain extends Chain, account extends Account | undefined, const request extends SendTransactionRequest<chain, chainOverride>, chainOverride extends Chain | undefined>(client: Client<Transport, chain, account>, params: SendRawTxParameters<chain, account, request, chainOverride>): Promise<SendTransactionReturnType>;
|
|
8
|
+
export type EstimateRawTxGasParameters<chain extends Chain> = Omit<EstimateGasParameters<chain>, "data" | "to" | "value"> & {
|
|
9
|
+
tx: Pick<RawTx, "to" | "callData" | "value">;
|
|
10
|
+
};
|
|
11
|
+
export declare function estimateRawTxGas<chain extends Chain, account extends Account | undefined>(client: Client<Transport, chain, account>, params: EstimateRawTxGasParameters<chain>): Promise<bigint>;
|