@gearbox-protocol/sdk 14.5.2 → 14.5.4

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 (38) hide show
  1. package/dist/cjs/abi/compressors/kycCompressor.js +207 -0
  2. package/dist/cjs/abi/compressors/subcompressors/kyc/onDemandKYCUnderlyingSubcompressor.js +60 -0
  3. package/dist/cjs/abi/compressors/subcompressors/kyc/securitizeKYCFactorySubcompressor.js +80 -0
  4. package/dist/cjs/abi/compressors/subcompressors/withdrawal/securitizeRedemptionSubcompressor.js +187 -0
  5. package/dist/cjs/permissionless/bindings/market-configurator.js +27 -0
  6. package/dist/esm/abi/compressors/kycCompressor.js +183 -0
  7. package/dist/esm/abi/compressors/subcompressors/kyc/onDemandKYCUnderlyingSubcompressor.js +36 -0
  8. package/dist/esm/abi/compressors/subcompressors/kyc/securitizeKYCFactorySubcompressor.js +56 -0
  9. package/dist/esm/abi/compressors/subcompressors/withdrawal/securitizeRedemptionSubcompressor.js +163 -0
  10. package/dist/esm/permissionless/bindings/market-configurator.js +27 -0
  11. package/dist/types/abi/compressors/kycCompressor.d.ts +236 -0
  12. package/dist/types/abi/compressors/subcompressors/kyc/onDemandKYCUnderlyingSubcompressor.d.ts +49 -0
  13. package/dist/types/abi/compressors/subcompressors/kyc/securitizeKYCFactorySubcompressor.d.ts +85 -0
  14. package/dist/types/abi/compressors/subcompressors/withdrawal/securitizeRedemptionSubcompressor.d.ts +220 -0
  15. package/dist/types/permissionless/bindings/market-configurator.d.ts +7 -1
  16. package/dist/types/permissionless/bindings/types.d.ts +1 -0
  17. package/package.json +1 -1
  18. /package/dist/cjs/abi/compressors/subcompressors/{infinifiWithdrawalSubcompressor.js → withdrawal/infinifiWithdrawalSubcompressor.js} +0 -0
  19. /package/dist/cjs/abi/compressors/subcompressors/{kelpLRTWithdrawalSubcompressor.js → withdrawal/kelpLRTWithdrawalSubcompressor.js} +0 -0
  20. /package/dist/cjs/abi/compressors/subcompressors/{mellowFlexibleDepositSubcompressor.js → withdrawal/mellowFlexibleDepositSubcompressor.js} +0 -0
  21. /package/dist/cjs/abi/compressors/subcompressors/{mellowFlexibleRedeemSubcompressor.js → withdrawal/mellowFlexibleRedeemSubcompressor.js} +0 -0
  22. /package/dist/cjs/abi/compressors/subcompressors/{mellowWithdrawalSubcompressor.js → withdrawal/mellowWithdrawalSubcompressor.js} +0 -0
  23. /package/dist/cjs/abi/compressors/subcompressors/{midasWithdrawalSubcompressor.js → withdrawal/midasWithdrawalSubcompressor.js} +0 -0
  24. /package/dist/cjs/abi/compressors/subcompressors/{upshiftWithdrawalSubcompressor.js → withdrawal/upshiftWithdrawalSubcompressor.js} +0 -0
  25. /package/dist/esm/abi/compressors/subcompressors/{infinifiWithdrawalSubcompressor.js → withdrawal/infinifiWithdrawalSubcompressor.js} +0 -0
  26. /package/dist/esm/abi/compressors/subcompressors/{kelpLRTWithdrawalSubcompressor.js → withdrawal/kelpLRTWithdrawalSubcompressor.js} +0 -0
  27. /package/dist/esm/abi/compressors/subcompressors/{mellowFlexibleDepositSubcompressor.js → withdrawal/mellowFlexibleDepositSubcompressor.js} +0 -0
  28. /package/dist/esm/abi/compressors/subcompressors/{mellowFlexibleRedeemSubcompressor.js → withdrawal/mellowFlexibleRedeemSubcompressor.js} +0 -0
  29. /package/dist/esm/abi/compressors/subcompressors/{mellowWithdrawalSubcompressor.js → withdrawal/mellowWithdrawalSubcompressor.js} +0 -0
  30. /package/dist/esm/abi/compressors/subcompressors/{midasWithdrawalSubcompressor.js → withdrawal/midasWithdrawalSubcompressor.js} +0 -0
  31. /package/dist/esm/abi/compressors/subcompressors/{upshiftWithdrawalSubcompressor.js → withdrawal/upshiftWithdrawalSubcompressor.js} +0 -0
  32. /package/dist/types/abi/compressors/subcompressors/{infinifiWithdrawalSubcompressor.d.ts → withdrawal/infinifiWithdrawalSubcompressor.d.ts} +0 -0
  33. /package/dist/types/abi/compressors/subcompressors/{kelpLRTWithdrawalSubcompressor.d.ts → withdrawal/kelpLRTWithdrawalSubcompressor.d.ts} +0 -0
  34. /package/dist/types/abi/compressors/subcompressors/{mellowFlexibleDepositSubcompressor.d.ts → withdrawal/mellowFlexibleDepositSubcompressor.d.ts} +0 -0
  35. /package/dist/types/abi/compressors/subcompressors/{mellowFlexibleRedeemSubcompressor.d.ts → withdrawal/mellowFlexibleRedeemSubcompressor.d.ts} +0 -0
  36. /package/dist/types/abi/compressors/subcompressors/{mellowWithdrawalSubcompressor.d.ts → withdrawal/mellowWithdrawalSubcompressor.d.ts} +0 -0
  37. /package/dist/types/abi/compressors/subcompressors/{midasWithdrawalSubcompressor.d.ts → withdrawal/midasWithdrawalSubcompressor.d.ts} +0 -0
  38. /package/dist/types/abi/compressors/subcompressors/{upshiftWithdrawalSubcompressor.d.ts → withdrawal/upshiftWithdrawalSubcompressor.d.ts} +0 -0
@@ -0,0 +1,183 @@
1
+ const kycCompressorAbi = [
2
+ {
3
+ type: "constructor",
4
+ inputs: [
5
+ {
6
+ name: "addressProvider",
7
+ type: "address",
8
+ internalType: "contract IAddressProvider"
9
+ }
10
+ ],
11
+ stateMutability: "nonpayable"
12
+ },
13
+ {
14
+ type: "function",
15
+ name: "contractType",
16
+ inputs: [],
17
+ outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
18
+ stateMutability: "view"
19
+ },
20
+ {
21
+ type: "function",
22
+ name: "getKYCInvestorData",
23
+ inputs: [
24
+ { name: "investor", type: "address", internalType: "address" },
25
+ { name: "factories", type: "address[]", internalType: "address[]" }
26
+ ],
27
+ outputs: [
28
+ {
29
+ name: "investorData",
30
+ type: "tuple[]",
31
+ internalType: "struct IKYCCompressor.KYCInvestorData[]",
32
+ components: [
33
+ {
34
+ name: "creditAccounts",
35
+ type: "tuple[]",
36
+ internalType: "struct IKYCCompressor.KYCCreditAccountData[]",
37
+ components: [
38
+ {
39
+ name: "creditAccount",
40
+ type: "address",
41
+ internalType: "address"
42
+ },
43
+ { name: "wallet", type: "address", internalType: "address" },
44
+ { name: "frozen", type: "bool", internalType: "bool" },
45
+ { name: "extraDetails", type: "bytes", internalType: "bytes" }
46
+ ]
47
+ },
48
+ { name: "extraDetails", type: "bytes", internalType: "bytes" }
49
+ ]
50
+ }
51
+ ],
52
+ stateMutability: "view"
53
+ },
54
+ {
55
+ type: "function",
56
+ name: "getKYCMarketsData",
57
+ inputs: [
58
+ { name: "configurators", type: "address[]", internalType: "address[]" },
59
+ { name: "factories", type: "address[]", internalType: "address[]" }
60
+ ],
61
+ outputs: [
62
+ {
63
+ name: "underlyingsData",
64
+ type: "tuple[]",
65
+ internalType: "struct IKYCCompressor.KYCUnderlyingData[]",
66
+ components: [
67
+ {
68
+ name: "baseParams",
69
+ type: "tuple",
70
+ internalType: "struct BaseParams",
71
+ components: [
72
+ { name: "addr", type: "address", internalType: "address" },
73
+ { name: "version", type: "uint256", internalType: "uint256" },
74
+ {
75
+ name: "contractType",
76
+ type: "bytes32",
77
+ internalType: "bytes32"
78
+ },
79
+ {
80
+ name: "serializedParams",
81
+ type: "bytes",
82
+ internalType: "bytes"
83
+ }
84
+ ]
85
+ },
86
+ { name: "asset", type: "address", internalType: "address" },
87
+ { name: "factory", type: "address", internalType: "address" },
88
+ { name: "extraDetails", type: "bytes", internalType: "bytes" }
89
+ ]
90
+ },
91
+ {
92
+ name: "factoriesData",
93
+ type: "tuple[]",
94
+ internalType: "struct IKYCCompressor.KYCFactoryData[]",
95
+ components: [
96
+ {
97
+ name: "baseParams",
98
+ type: "tuple",
99
+ internalType: "struct BaseParams",
100
+ components: [
101
+ { name: "addr", type: "address", internalType: "address" },
102
+ { name: "version", type: "uint256", internalType: "uint256" },
103
+ {
104
+ name: "contractType",
105
+ type: "bytes32",
106
+ internalType: "bytes32"
107
+ },
108
+ {
109
+ name: "serializedParams",
110
+ type: "bytes",
111
+ internalType: "bytes"
112
+ }
113
+ ]
114
+ },
115
+ {
116
+ name: "tokens",
117
+ type: "tuple[]",
118
+ internalType: "struct TokenData[]",
119
+ components: [
120
+ { name: "addr", type: "address", internalType: "address" },
121
+ { name: "symbol", type: "string", internalType: "string" },
122
+ { name: "name", type: "string", internalType: "string" },
123
+ { name: "decimals", type: "uint8", internalType: "uint8" }
124
+ ]
125
+ },
126
+ { name: "extraDetails", type: "bytes", internalType: "bytes" }
127
+ ]
128
+ }
129
+ ],
130
+ stateMutability: "view"
131
+ },
132
+ {
133
+ type: "function",
134
+ name: "setSubcompressor",
135
+ inputs: [
136
+ { name: "subcompressor", type: "address", internalType: "address" }
137
+ ],
138
+ outputs: [],
139
+ stateMutability: "nonpayable"
140
+ },
141
+ {
142
+ type: "function",
143
+ name: "subcompressors",
144
+ inputs: [
145
+ { name: "domain", type: "bytes32", internalType: "bytes32" },
146
+ { name: "postfix", type: "bytes32", internalType: "bytes32" }
147
+ ],
148
+ outputs: [{ name: "", type: "address", internalType: "address" }],
149
+ stateMutability: "view"
150
+ },
151
+ {
152
+ type: "function",
153
+ name: "version",
154
+ inputs: [],
155
+ outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
156
+ stateMutability: "view"
157
+ },
158
+ {
159
+ type: "error",
160
+ name: "CallerIsNotInstanceOwnerException",
161
+ inputs: [{ name: "caller", type: "address", internalType: "address" }]
162
+ },
163
+ {
164
+ type: "error",
165
+ name: "InvalidDomainException",
166
+ inputs: [{ name: "domain", type: "bytes32", internalType: "bytes32" }]
167
+ },
168
+ {
169
+ type: "error",
170
+ name: "InvalidKYCFactoryException",
171
+ inputs: [{ name: "factory", type: "address", internalType: "address" }]
172
+ },
173
+ {
174
+ type: "error",
175
+ name: "InvalidMarketConfiguratorException",
176
+ inputs: [
177
+ { name: "marketConfigurator", type: "address", internalType: "address" }
178
+ ]
179
+ }
180
+ ];
181
+ export {
182
+ kycCompressorAbi
183
+ };
@@ -0,0 +1,36 @@
1
+ const onDemandKYCUnderlyingSubcompressorAbi = [
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: "getCompressedType",
12
+ inputs: [],
13
+ outputs: [
14
+ { name: "", type: "bytes32", internalType: "bytes32" },
15
+ { name: "", type: "bytes32", internalType: "bytes32" }
16
+ ],
17
+ stateMutability: "pure"
18
+ },
19
+ {
20
+ type: "function",
21
+ name: "getUnderlyingData",
22
+ inputs: [{ name: "underlying", type: "address", internalType: "address" }],
23
+ outputs: [{ name: "", type: "bytes", internalType: "bytes" }],
24
+ stateMutability: "view"
25
+ },
26
+ {
27
+ type: "function",
28
+ name: "version",
29
+ inputs: [],
30
+ outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
31
+ stateMutability: "view"
32
+ }
33
+ ];
34
+ export {
35
+ onDemandKYCUnderlyingSubcompressorAbi
36
+ };
@@ -0,0 +1,56 @@
1
+ const securitizeKYCFactorySubcompressorAbi = [
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: "getCompressedType",
12
+ inputs: [],
13
+ outputs: [
14
+ { name: "", type: "bytes32", internalType: "bytes32" },
15
+ { name: "", type: "bytes32", internalType: "bytes32" }
16
+ ],
17
+ stateMutability: "pure"
18
+ },
19
+ {
20
+ type: "function",
21
+ name: "getCreditAccountData",
22
+ inputs: [
23
+ { name: "creditAccount", type: "address", internalType: "address" },
24
+ { name: "factory", type: "address", internalType: "address" }
25
+ ],
26
+ outputs: [{ name: "", type: "bytes", internalType: "bytes" }],
27
+ stateMutability: "view"
28
+ },
29
+ {
30
+ type: "function",
31
+ name: "getFactoryData",
32
+ inputs: [{ name: "", type: "address", internalType: "address" }],
33
+ outputs: [{ name: "", type: "bytes", internalType: "bytes" }],
34
+ stateMutability: "pure"
35
+ },
36
+ {
37
+ type: "function",
38
+ name: "getInvestorData",
39
+ inputs: [
40
+ { name: "investor", type: "address", internalType: "address" },
41
+ { name: "factory", type: "address", internalType: "address" }
42
+ ],
43
+ outputs: [{ name: "", type: "bytes", internalType: "bytes" }],
44
+ stateMutability: "view"
45
+ },
46
+ {
47
+ type: "function",
48
+ name: "version",
49
+ inputs: [],
50
+ outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
51
+ stateMutability: "view"
52
+ }
53
+ ];
54
+ export {
55
+ securitizeKYCFactorySubcompressorAbi
56
+ };
@@ -0,0 +1,163 @@
1
+ const securitizeRedemptionSubcompressorAbi = [
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: "getCurrentWithdrawals",
12
+ inputs: [
13
+ { name: "creditAccount", type: "address", internalType: "address" },
14
+ { name: "token", type: "address", internalType: "address" }
15
+ ],
16
+ outputs: [
17
+ {
18
+ name: "",
19
+ type: "tuple[]",
20
+ internalType: "struct ClaimableWithdrawal[]",
21
+ components: [
22
+ { name: "token", type: "address", internalType: "address" },
23
+ {
24
+ name: "withdrawalPhantomToken",
25
+ type: "address",
26
+ internalType: "address"
27
+ },
28
+ {
29
+ name: "withdrawalTokenSpent",
30
+ type: "uint256",
31
+ internalType: "uint256"
32
+ },
33
+ {
34
+ name: "outputs",
35
+ type: "tuple[]",
36
+ internalType: "struct WithdrawalOutput[]",
37
+ components: [
38
+ { name: "token", type: "address", internalType: "address" },
39
+ { name: "isDelayed", type: "bool", internalType: "bool" },
40
+ { name: "amount", type: "uint256", internalType: "uint256" }
41
+ ]
42
+ },
43
+ {
44
+ name: "claimCalls",
45
+ type: "tuple[]",
46
+ internalType: "struct MultiCall[]",
47
+ components: [
48
+ { name: "target", type: "address", internalType: "address" },
49
+ { name: "callData", type: "bytes", internalType: "bytes" }
50
+ ]
51
+ }
52
+ ]
53
+ },
54
+ {
55
+ name: "",
56
+ type: "tuple[]",
57
+ internalType: "struct PendingWithdrawal[]",
58
+ components: [
59
+ { name: "token", type: "address", internalType: "address" },
60
+ {
61
+ name: "withdrawalPhantomToken",
62
+ type: "address",
63
+ internalType: "address"
64
+ },
65
+ {
66
+ name: "expectedOutputs",
67
+ type: "tuple[]",
68
+ internalType: "struct WithdrawalOutput[]",
69
+ components: [
70
+ { name: "token", type: "address", internalType: "address" },
71
+ { name: "isDelayed", type: "bool", internalType: "bool" },
72
+ { name: "amount", type: "uint256", internalType: "uint256" }
73
+ ]
74
+ },
75
+ { name: "claimableAt", type: "uint256", internalType: "uint256" }
76
+ ]
77
+ }
78
+ ],
79
+ stateMutability: "view"
80
+ },
81
+ {
82
+ type: "function",
83
+ name: "getWithdrawableAssets",
84
+ inputs: [
85
+ { name: "", type: "address", internalType: "address" },
86
+ { name: "token", type: "address", internalType: "address" }
87
+ ],
88
+ outputs: [
89
+ {
90
+ name: "",
91
+ type: "tuple[]",
92
+ internalType: "struct WithdrawableAsset[]",
93
+ components: [
94
+ { name: "token", type: "address", internalType: "address" },
95
+ {
96
+ name: "withdrawalPhantomToken",
97
+ type: "address",
98
+ internalType: "address"
99
+ },
100
+ { name: "underlying", type: "address", internalType: "address" },
101
+ {
102
+ name: "withdrawalLength",
103
+ type: "uint256",
104
+ internalType: "uint256"
105
+ }
106
+ ]
107
+ }
108
+ ],
109
+ stateMutability: "view"
110
+ },
111
+ {
112
+ type: "function",
113
+ name: "getWithdrawalRequestResult",
114
+ inputs: [
115
+ { name: "creditAccount", type: "address", internalType: "address" },
116
+ { name: "token", type: "address", internalType: "address" },
117
+ { name: "withdrawalToken", type: "address", internalType: "address" },
118
+ { name: "amount", type: "uint256", internalType: "uint256" }
119
+ ],
120
+ outputs: [
121
+ {
122
+ name: "requestableWithdrawal",
123
+ type: "tuple",
124
+ internalType: "struct RequestableWithdrawal",
125
+ components: [
126
+ { name: "token", type: "address", internalType: "address" },
127
+ { name: "amountIn", type: "uint256", internalType: "uint256" },
128
+ {
129
+ name: "outputs",
130
+ type: "tuple[]",
131
+ internalType: "struct WithdrawalOutput[]",
132
+ components: [
133
+ { name: "token", type: "address", internalType: "address" },
134
+ { name: "isDelayed", type: "bool", internalType: "bool" },
135
+ { name: "amount", type: "uint256", internalType: "uint256" }
136
+ ]
137
+ },
138
+ {
139
+ name: "requestCalls",
140
+ type: "tuple[]",
141
+ internalType: "struct MultiCall[]",
142
+ components: [
143
+ { name: "target", type: "address", internalType: "address" },
144
+ { name: "callData", type: "bytes", internalType: "bytes" }
145
+ ]
146
+ },
147
+ { name: "claimableAt", type: "uint256", internalType: "uint256" }
148
+ ]
149
+ }
150
+ ],
151
+ stateMutability: "view"
152
+ },
153
+ {
154
+ type: "function",
155
+ name: "version",
156
+ inputs: [],
157
+ outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
158
+ stateMutability: "view"
159
+ }
160
+ ];
161
+ export {
162
+ securitizeRedemptionSubcompressorAbi
163
+ };
@@ -28,6 +28,7 @@ import { LossPolicyFactory } from "./factory/loss-policy-factory.js";
28
28
  import { PoolFactory } from "./factory/pool-factory.js";
29
29
  import { PriceOracleFactory } from "./factory/price-oracle-factory.js";
30
30
  import { AddressProviderContract } from "./index.js";
31
+ const PERIPHERY_DOMAINS = ["ZAPPER", "DEGEN_NFT"];
31
32
  const abi = iMarketConfiguratorV310Abi;
32
33
  class MarketConfiguratorContract extends BaseContract {
33
34
  creditFactory;
@@ -479,6 +480,32 @@ class MarketConfiguratorContract extends BaseContract {
479
480
  args: [newEmergencyAdmin]
480
481
  });
481
482
  }
483
+ addPeripheryContract(peripheryContract) {
484
+ return this.createRawTx({
485
+ functionName: "addPeripheryContract",
486
+ args: [peripheryContract]
487
+ });
488
+ }
489
+ removePeripheryContract(peripheryContract) {
490
+ return this.createRawTx({
491
+ functionName: "removePeripheryContract",
492
+ args: [peripheryContract]
493
+ });
494
+ }
495
+ getPeripheryDomains() {
496
+ return PERIPHERY_DOMAINS;
497
+ }
498
+ async getPeripheryContracts() {
499
+ const entries = await Promise.all(
500
+ PERIPHERY_DOMAINS.map(async (domain) => {
501
+ const contracts = await this.contract.read.getPeripheryContracts([
502
+ stringToHex(domain, { size: 32 })
503
+ ]);
504
+ return [domain, contracts];
505
+ })
506
+ );
507
+ return Object.fromEntries(entries);
508
+ }
482
509
  //
483
510
  // SYNC
484
511
  //