@gearbox-protocol/sdk 14.12.0-next.77 → 14.12.0-next.79

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 (107) hide show
  1. package/dist/cjs/model/filters.js +20 -0
  2. package/dist/cjs/model/filters.schema.js +21 -0
  3. package/dist/cjs/model/index.js +6 -0
  4. package/dist/cjs/model/liquidations.js +10 -8
  5. package/dist/cjs/model/liquidations.schema.js +6 -5
  6. package/dist/cjs/model/opportunities.js +11 -9
  7. package/dist/cjs/model/opportunities.schema.js +7 -6
  8. package/dist/cjs/model/positions.js +10 -8
  9. package/dist/cjs/model/positions.schema.js +5 -4
  10. package/dist/cjs/model/primitives.schema.js +5 -4
  11. package/dist/cjs/preview/index.js +0 -1
  12. package/dist/cjs/preview/preview/buildDelayedPreview.js +4 -3
  13. package/dist/cjs/preview/preview/index.js +0 -1
  14. package/dist/cjs/preview/preview/previewAdjustCreditAccount.js +3 -2
  15. package/dist/cjs/preview/preview/types.js +0 -16
  16. package/dist/cjs/sdk/accounts/CreditAccountsServiceV310.js +12 -38
  17. package/dist/cjs/sdk/accounts/credit-account-compressor/CreditAccountCompressor.js +1 -1
  18. package/dist/cjs/sdk/index.js +3 -0
  19. package/dist/cjs/sdk/market/MarketSuite.js +5 -3
  20. package/dist/cjs/sdk/market/credit/CreditFacadeV310Contract.js +10 -0
  21. package/dist/cjs/sdk/market/credit/expectedBalanceDeltas.js +25 -0
  22. package/dist/cjs/sdk/market/credit/index.js +2 -0
  23. package/dist/cjs/sdk/market/index.js +2 -0
  24. package/dist/cjs/sdk/opportunities/MultichainOpportunitiesService.js +5 -2
  25. package/dist/cjs/sdk/opportunities/OpportunitiesService.js +4 -1
  26. package/dist/cjs/sdk/positions/MultichainPositionsService.js +5 -2
  27. package/dist/cjs/sdk/positions/PositionsService.js +8 -4
  28. package/dist/cjs/sdk/utils/index.js +1 -0
  29. package/dist/cjs/sdk/utils/zod.js +36 -14
  30. package/dist/esm/model/filters.js +18 -0
  31. package/dist/esm/model/filters.schema.js +19 -0
  32. package/dist/esm/model/index.js +3 -1
  33. package/dist/esm/model/liquidations.js +10 -8
  34. package/dist/esm/model/liquidations.schema.js +6 -5
  35. package/dist/esm/model/opportunities.js +11 -9
  36. package/dist/esm/model/opportunities.schema.js +7 -6
  37. package/dist/esm/model/positions.js +10 -8
  38. package/dist/esm/model/positions.schema.js +5 -4
  39. package/dist/esm/model/primitives.schema.js +6 -5
  40. package/dist/esm/preview/index.js +2 -2
  41. package/dist/esm/preview/preview/buildDelayedPreview.js +5 -4
  42. package/dist/esm/preview/preview/index.js +2 -2
  43. package/dist/esm/preview/preview/previewAdjustCreditAccount.js +4 -3
  44. package/dist/esm/preview/preview/types.js +1 -16
  45. package/dist/esm/sdk/accounts/CreditAccountsServiceV310.js +12 -38
  46. package/dist/esm/sdk/accounts/credit-account-compressor/CreditAccountCompressor.js +1 -1
  47. package/dist/esm/sdk/index.js +3 -2
  48. package/dist/esm/sdk/market/MarketSuite.js +5 -3
  49. package/dist/esm/sdk/market/credit/CreditFacadeV310Contract.js +10 -0
  50. package/dist/esm/sdk/market/credit/expectedBalanceDeltas.js +24 -0
  51. package/dist/esm/sdk/market/credit/index.js +2 -1
  52. package/dist/esm/sdk/market/index.js +2 -1
  53. package/dist/esm/sdk/opportunities/MultichainOpportunitiesService.js +5 -2
  54. package/dist/esm/sdk/opportunities/OpportunitiesService.js +4 -1
  55. package/dist/esm/sdk/positions/MultichainPositionsService.js +5 -2
  56. package/dist/esm/sdk/positions/PositionsService.js +8 -4
  57. package/dist/esm/sdk/utils/index.js +2 -2
  58. package/dist/esm/sdk/utils/zod.js +36 -15
  59. package/dist/types/dev/AccountOpener.d.ts +1 -1
  60. package/dist/types/model/curators.schema.d.ts +1 -1
  61. package/dist/types/model/filters.d.ts +30 -0
  62. package/dist/types/model/filters.schema.d.ts +16 -0
  63. package/dist/types/model/history.schema.d.ts +6 -6
  64. package/dist/types/model/index.d.ts +3 -1
  65. package/dist/types/model/liquidations.d.ts +14 -10
  66. package/dist/types/model/liquidations.schema.d.ts +52 -52
  67. package/dist/types/model/opportunities.d.ts +15 -11
  68. package/dist/types/model/opportunities.schema.d.ts +107 -107
  69. package/dist/types/model/positions.d.ts +14 -10
  70. package/dist/types/model/positions.schema.d.ts +96 -96
  71. package/dist/types/model/primitives.d.ts +1 -0
  72. package/dist/types/model/primitives.schema.d.ts +9 -8
  73. package/dist/types/preview/index.d.ts +2 -2
  74. package/dist/types/preview/preview/index.d.ts +2 -2
  75. package/dist/types/preview/preview/types.d.ts +1 -16
  76. package/dist/types/sdk/OnchainSDK.d.ts +3 -3
  77. package/dist/types/sdk/accounts/CreditAccountsServiceV310.d.ts +8 -7
  78. package/dist/types/sdk/accounts/bots/types.d.ts +1 -1
  79. package/dist/types/sdk/accounts/credit-account-compressor/CreditAccountCompressor.d.ts +1 -1
  80. package/dist/types/sdk/accounts/credit-account-compressor/CreditAccountCompressorV310Contract.d.ts +1 -1
  81. package/dist/types/sdk/accounts/credit-account-compressor/types.d.ts +3 -3
  82. package/dist/types/sdk/accounts/index.d.ts +2 -2
  83. package/dist/types/sdk/accounts/intents/operations/repay-credit-account/index.d.ts +1 -2
  84. package/dist/types/sdk/accounts/liquidations/types.d.ts +1 -1
  85. package/dist/types/sdk/accounts/types.d.ts +8 -78
  86. package/dist/types/sdk/accounts/withdrawal-compressor/WithdrawalCompressorV310Contract.d.ts +1 -1
  87. package/dist/types/sdk/accounts/withdrawal-compressor/WithdrawalCompressorV311Contract.d.ts +1 -1
  88. package/dist/types/sdk/accounts/withdrawal-compressor/WithdrawalCompressorV313Contract.d.ts +1 -1
  89. package/dist/types/sdk/base/index.d.ts +2 -2
  90. package/dist/types/sdk/base/types.d.ts +43 -2
  91. package/dist/types/sdk/index.d.ts +25 -24
  92. package/dist/types/sdk/market/MarketSuite.d.ts +1 -1
  93. package/dist/types/sdk/market/credit/CreditFacadeV310Contract.d.ts +6 -3
  94. package/dist/types/sdk/market/credit/CreditSuite.d.ts +2 -2
  95. package/dist/types/sdk/market/credit/expectedBalanceDeltas.d.ts +39 -0
  96. package/dist/types/sdk/market/credit/index.d.ts +3 -2
  97. package/dist/types/sdk/market/credit/types.d.ts +26 -3
  98. package/dist/types/sdk/market/index.d.ts +4 -3
  99. package/dist/types/sdk/market/rwa/index.d.ts +2 -2
  100. package/dist/types/sdk/market/rwa/securitize/SecuritizeRWAFactory.d.ts +1 -2
  101. package/dist/types/sdk/market/rwa/types.d.ts +11 -2
  102. package/dist/types/sdk/options.d.ts +4 -4
  103. package/dist/types/sdk/pools/types.d.ts +1 -12
  104. package/dist/types/sdk/positions/PositionsService.d.ts +1 -1
  105. package/dist/types/sdk/utils/index.d.ts +2 -2
  106. package/dist/types/sdk/utils/zod.d.ts +7 -3
  107. package/package.json +1 -1
@@ -8,33 +8,33 @@ import { z } from "zod/v4";
8
8
  * {@link LiquidatableAccountFilter}
9
9
  **/
10
10
  declare const liquidatableAccountFilterSchema: z.ZodObject<{
11
- chainIds: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
12
- underlyingType: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"Stable">, z.ZodLiteral<"ETH">, z.ZodLiteral<"BTC">]>>;
13
- paused: z.ZodOptional<z.ZodBoolean>;
14
- rwa: z.ZodOptional<z.ZodBoolean>;
15
- delayed: z.ZodOptional<z.ZodBoolean>;
11
+ chainIds: z.ZodOptional<z.ZodUnion<[z.ZodArray<z.ZodNumber>, z.ZodLiteral<"all">]>>;
12
+ underlyingType: z.ZodOptional<z.ZodUnion<[z.ZodUnion<readonly [z.ZodLiteral<"Stable">, z.ZodLiteral<"ETH">, z.ZodLiteral<"BTC">]>, z.ZodLiteral<"all">]>>;
13
+ paused: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodLiteral<"all">]>>;
14
+ rwa: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodLiteral<"all">]>>;
15
+ delayed: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodLiteral<"all">]>>;
16
16
  }, z.core.$strip>;
17
17
  /**
18
18
  * {@link LiquidatableAccount}
19
19
  **/
20
20
  declare const liquidatableAccountSchema: z.ZodObject<{
21
21
  chainId: z.ZodNumber;
22
- creditAccount: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
23
- creditManager: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
22
+ creditAccount: z.ZodCodec<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>;
23
+ creditManager: z.ZodCodec<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>;
24
24
  asset: z.ZodObject<{
25
25
  chainId: z.ZodNumber;
26
- address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
26
+ address: z.ZodCodec<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>;
27
27
  symbol: z.ZodString;
28
28
  name: z.ZodString;
29
29
  decimals: z.ZodNumber;
30
30
  assetType: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"Stable">, z.ZodLiteral<"ETH">, z.ZodLiteral<"BTC">]>>;
31
31
  }, z.core.$strip>;
32
32
  totalValue: z.ZodObject<{
33
- value: z.ZodBigInt;
33
+ value: z.ZodCodec<z.ZodUnion<[z.ZodString, z.ZodBigInt]>, z.ZodBigInt>;
34
34
  valueUsd: z.ZodNullable<z.ZodNumber>;
35
35
  token: z.ZodObject<{
36
36
  chainId: z.ZodNumber;
37
- address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
37
+ address: z.ZodCodec<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>;
38
38
  symbol: z.ZodString;
39
39
  name: z.ZodString;
40
40
  decimals: z.ZodNumber;
@@ -42,11 +42,11 @@ declare const liquidatableAccountSchema: z.ZodObject<{
42
42
  }, z.core.$strip>;
43
43
  }, z.core.$strip>;
44
44
  repaymentAmount: z.ZodObject<{
45
- value: z.ZodBigInt;
45
+ value: z.ZodCodec<z.ZodUnion<[z.ZodString, z.ZodBigInt]>, z.ZodBigInt>;
46
46
  valueUsd: z.ZodNullable<z.ZodNumber>;
47
47
  token: z.ZodObject<{
48
48
  chainId: z.ZodNumber;
49
- address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
49
+ address: z.ZodCodec<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>;
50
50
  symbol: z.ZodString;
51
51
  name: z.ZodString;
52
52
  decimals: z.ZodNumber;
@@ -54,11 +54,11 @@ declare const liquidatableAccountSchema: z.ZodObject<{
54
54
  }, z.core.$strip>;
55
55
  }, z.core.$strip>;
56
56
  estimatedProfit: z.ZodObject<{
57
- value: z.ZodBigInt;
57
+ value: z.ZodCodec<z.ZodUnion<[z.ZodString, z.ZodBigInt]>, z.ZodBigInt>;
58
58
  valueUsd: z.ZodNullable<z.ZodNumber>;
59
59
  token: z.ZodObject<{
60
60
  chainId: z.ZodNumber;
61
- address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
61
+ address: z.ZodCodec<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>;
62
62
  symbol: z.ZodString;
63
63
  name: z.ZodString;
64
64
  decimals: z.ZodNumber;
@@ -73,11 +73,11 @@ declare const liquidatableAccountSchema: z.ZodObject<{
73
73
  * {@link InstantReceivedAsset}
74
74
  **/
75
75
  declare const instantReceivedAssetSchema: z.ZodObject<{
76
- value: z.ZodBigInt;
76
+ value: z.ZodCodec<z.ZodUnion<[z.ZodString, z.ZodBigInt]>, z.ZodBigInt>;
77
77
  valueUsd: z.ZodNullable<z.ZodNumber>;
78
78
  token: z.ZodObject<{
79
79
  chainId: z.ZodNumber;
80
- address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
80
+ address: z.ZodCodec<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>;
81
81
  symbol: z.ZodString;
82
82
  name: z.ZodString;
83
83
  decimals: z.ZodNumber;
@@ -89,29 +89,29 @@ declare const instantReceivedAssetSchema: z.ZodObject<{
89
89
  * {@link DelayedReceivedAsset}
90
90
  **/
91
91
  declare const delayedReceivedAssetSchema: z.ZodObject<{
92
- value: z.ZodBigInt;
92
+ value: z.ZodCodec<z.ZodUnion<[z.ZodString, z.ZodBigInt]>, z.ZodBigInt>;
93
93
  valueUsd: z.ZodNullable<z.ZodNumber>;
94
94
  token: z.ZodObject<{
95
95
  chainId: z.ZodNumber;
96
- address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
96
+ address: z.ZodCodec<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>;
97
97
  symbol: z.ZodString;
98
98
  name: z.ZodString;
99
99
  decimals: z.ZodNumber;
100
100
  assetType: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"Stable">, z.ZodLiteral<"ETH">, z.ZodLiteral<"BTC">]>>;
101
101
  }, z.core.$strip>;
102
102
  isDelayed: z.ZodLiteral<true>;
103
- redeemer: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>;
103
+ redeemer: z.ZodOptional<z.ZodCodec<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>>;
104
104
  claimableAt: z.ZodOptional<z.ZodNumber>;
105
105
  }, z.core.$strip>;
106
106
  /**
107
107
  * {@link ReceivedAsset}
108
108
  **/
109
109
  declare const receivedAssetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
110
- value: z.ZodBigInt;
110
+ value: z.ZodCodec<z.ZodUnion<[z.ZodString, z.ZodBigInt]>, z.ZodBigInt>;
111
111
  valueUsd: z.ZodNullable<z.ZodNumber>;
112
112
  token: z.ZodObject<{
113
113
  chainId: z.ZodNumber;
114
- address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
114
+ address: z.ZodCodec<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>;
115
115
  symbol: z.ZodString;
116
116
  name: z.ZodString;
117
117
  decimals: z.ZodNumber;
@@ -119,35 +119,35 @@ declare const receivedAssetSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
119
119
  }, z.core.$strip>;
120
120
  isDelayed: z.ZodLiteral<false>;
121
121
  }, z.core.$strip>, z.ZodObject<{
122
- value: z.ZodBigInt;
122
+ value: z.ZodCodec<z.ZodUnion<[z.ZodString, z.ZodBigInt]>, z.ZodBigInt>;
123
123
  valueUsd: z.ZodNullable<z.ZodNumber>;
124
124
  token: z.ZodObject<{
125
125
  chainId: z.ZodNumber;
126
- address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
126
+ address: z.ZodCodec<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>;
127
127
  symbol: z.ZodString;
128
128
  name: z.ZodString;
129
129
  decimals: z.ZodNumber;
130
130
  assetType: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"Stable">, z.ZodLiteral<"ETH">, z.ZodLiteral<"BTC">]>>;
131
131
  }, z.core.$strip>;
132
132
  isDelayed: z.ZodLiteral<true>;
133
- redeemer: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>;
133
+ redeemer: z.ZodOptional<z.ZodCodec<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>>;
134
134
  claimableAt: z.ZodOptional<z.ZodNumber>;
135
135
  }, z.core.$strip>], "isDelayed">;
136
136
  /**
137
137
  * {@link LiquidationApproval}
138
138
  **/
139
139
  declare const liquidationApprovalSchema: z.ZodObject<{
140
- value: z.ZodBigInt;
140
+ value: z.ZodCodec<z.ZodUnion<[z.ZodString, z.ZodBigInt]>, z.ZodBigInt>;
141
141
  valueUsd: z.ZodNullable<z.ZodNumber>;
142
142
  token: z.ZodObject<{
143
143
  chainId: z.ZodNumber;
144
- address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
144
+ address: z.ZodCodec<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>;
145
145
  symbol: z.ZodString;
146
146
  name: z.ZodString;
147
147
  decimals: z.ZodNumber;
148
148
  assetType: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"Stable">, z.ZodLiteral<"ETH">, z.ZodLiteral<"BTC">]>>;
149
149
  }, z.core.$strip>;
150
- spender: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
150
+ spender: z.ZodCodec<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>;
151
151
  }, z.core.$strip>;
152
152
  /**
153
153
  * {@link LiquidationPosition}
@@ -158,18 +158,18 @@ declare const liquidationPositionSchema: z.ZodObject<{
158
158
  chainId: z.ZodNumber;
159
159
  sourceToken: z.ZodObject<{
160
160
  chainId: z.ZodNumber;
161
- address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
161
+ address: z.ZodCodec<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>;
162
162
  symbol: z.ZodString;
163
163
  name: z.ZodString;
164
164
  decimals: z.ZodNumber;
165
165
  assetType: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"Stable">, z.ZodLiteral<"ETH">, z.ZodLiteral<"BTC">]>>;
166
166
  }, z.core.$strip>;
167
167
  output: z.ZodObject<{
168
- value: z.ZodBigInt;
168
+ value: z.ZodCodec<z.ZodUnion<[z.ZodString, z.ZodBigInt]>, z.ZodBigInt>;
169
169
  valueUsd: z.ZodNullable<z.ZodNumber>;
170
170
  token: z.ZodObject<{
171
171
  chainId: z.ZodNumber;
172
- address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
172
+ address: z.ZodCodec<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>;
173
173
  symbol: z.ZodString;
174
174
  name: z.ZodString;
175
175
  decimals: z.ZodNumber;
@@ -178,33 +178,33 @@ declare const liquidationPositionSchema: z.ZodObject<{
178
178
  }, z.core.$strip>;
179
179
  claimableAt: z.ZodOptional<z.ZodNumber>;
180
180
  claimTx: z.ZodOptional<z.ZodObject<{
181
- to: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
182
- callData: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
183
- value: z.ZodOptional<z.ZodBigInt>;
181
+ to: z.ZodCodec<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>;
182
+ callData: z.ZodCodec<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>;
183
+ value: z.ZodOptional<z.ZodCodec<z.ZodUnion<[z.ZodString, z.ZodBigInt]>, z.ZodBigInt>>;
184
184
  }, z.core.$strip>>;
185
- redeemer: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>;
185
+ redeemer: z.ZodOptional<z.ZodCodec<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>>;
186
186
  }, z.core.$strip>;
187
187
  /**
188
188
  * {@link LiquidationDetails}
189
189
  **/
190
190
  declare const liquidationDetailsSchema: z.ZodObject<{
191
191
  chainId: z.ZodNumber;
192
- creditAccount: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
193
- creditManager: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
192
+ creditAccount: z.ZodCodec<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>;
193
+ creditManager: z.ZodCodec<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>;
194
194
  asset: z.ZodObject<{
195
195
  chainId: z.ZodNumber;
196
- address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
196
+ address: z.ZodCodec<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>;
197
197
  symbol: z.ZodString;
198
198
  name: z.ZodString;
199
199
  decimals: z.ZodNumber;
200
200
  assetType: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"Stable">, z.ZodLiteral<"ETH">, z.ZodLiteral<"BTC">]>>;
201
201
  }, z.core.$strip>;
202
202
  totalValue: z.ZodObject<{
203
- value: z.ZodBigInt;
203
+ value: z.ZodCodec<z.ZodUnion<[z.ZodString, z.ZodBigInt]>, z.ZodBigInt>;
204
204
  valueUsd: z.ZodNullable<z.ZodNumber>;
205
205
  token: z.ZodObject<{
206
206
  chainId: z.ZodNumber;
207
- address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
207
+ address: z.ZodCodec<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>;
208
208
  symbol: z.ZodString;
209
209
  name: z.ZodString;
210
210
  decimals: z.ZodNumber;
@@ -212,11 +212,11 @@ declare const liquidationDetailsSchema: z.ZodObject<{
212
212
  }, z.core.$strip>;
213
213
  }, z.core.$strip>;
214
214
  estimatedProfit: z.ZodObject<{
215
- value: z.ZodBigInt;
215
+ value: z.ZodCodec<z.ZodUnion<[z.ZodString, z.ZodBigInt]>, z.ZodBigInt>;
216
216
  valueUsd: z.ZodNullable<z.ZodNumber>;
217
217
  token: z.ZodObject<{
218
218
  chainId: z.ZodNumber;
219
- address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
219
+ address: z.ZodCodec<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>;
220
220
  symbol: z.ZodString;
221
221
  name: z.ZodString;
222
222
  decimals: z.ZodNumber;
@@ -227,11 +227,11 @@ declare const liquidationDetailsSchema: z.ZodObject<{
227
227
  paused: z.ZodBoolean;
228
228
  rwa: z.ZodBoolean;
229
229
  repaymentAmount: z.ZodObject<{
230
- value: z.ZodBigInt;
230
+ value: z.ZodCodec<z.ZodUnion<[z.ZodString, z.ZodBigInt]>, z.ZodBigInt>;
231
231
  valueUsd: z.ZodNullable<z.ZodNumber>;
232
232
  token: z.ZodObject<{
233
233
  chainId: z.ZodNumber;
234
- address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
234
+ address: z.ZodCodec<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>;
235
235
  symbol: z.ZodString;
236
236
  name: z.ZodString;
237
237
  decimals: z.ZodNumber;
@@ -239,11 +239,11 @@ declare const liquidationDetailsSchema: z.ZodObject<{
239
239
  }, z.core.$strip>;
240
240
  }, z.core.$strip>;
241
241
  receivedAssets: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
242
- value: z.ZodBigInt;
242
+ value: z.ZodCodec<z.ZodUnion<[z.ZodString, z.ZodBigInt]>, z.ZodBigInt>;
243
243
  valueUsd: z.ZodNullable<z.ZodNumber>;
244
244
  token: z.ZodObject<{
245
245
  chainId: z.ZodNumber;
246
- address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
246
+ address: z.ZodCodec<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>;
247
247
  symbol: z.ZodString;
248
248
  name: z.ZodString;
249
249
  decimals: z.ZodNumber;
@@ -251,18 +251,18 @@ declare const liquidationDetailsSchema: z.ZodObject<{
251
251
  }, z.core.$strip>;
252
252
  isDelayed: z.ZodLiteral<false>;
253
253
  }, z.core.$strip>, z.ZodObject<{
254
- value: z.ZodBigInt;
254
+ value: z.ZodCodec<z.ZodUnion<[z.ZodString, z.ZodBigInt]>, z.ZodBigInt>;
255
255
  valueUsd: z.ZodNullable<z.ZodNumber>;
256
256
  token: z.ZodObject<{
257
257
  chainId: z.ZodNumber;
258
- address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
258
+ address: z.ZodCodec<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>;
259
259
  symbol: z.ZodString;
260
260
  name: z.ZodString;
261
261
  decimals: z.ZodNumber;
262
262
  assetType: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"Stable">, z.ZodLiteral<"ETH">, z.ZodLiteral<"BTC">]>>;
263
263
  }, z.core.$strip>;
264
264
  isDelayed: z.ZodLiteral<true>;
265
- redeemer: z.ZodOptional<z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>>;
265
+ redeemer: z.ZodOptional<z.ZodCodec<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>>;
266
266
  claimableAt: z.ZodOptional<z.ZodNumber>;
267
267
  }, z.core.$strip>], "isDelayed">>;
268
268
  isLiquidatorEligible: z.ZodBoolean;
@@ -270,24 +270,24 @@ declare const liquidationDetailsSchema: z.ZodObject<{
270
270
  kycProtocol: z.ZodOptional<z.ZodString>;
271
271
  kycToken: z.ZodOptional<z.ZodObject<{
272
272
  chainId: z.ZodNumber;
273
- address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
273
+ address: z.ZodCodec<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>;
274
274
  symbol: z.ZodString;
275
275
  name: z.ZodString;
276
276
  decimals: z.ZodNumber;
277
277
  assetType: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"Stable">, z.ZodLiteral<"ETH">, z.ZodLiteral<"BTC">]>>;
278
278
  }, z.core.$strip>>;
279
279
  approve: z.ZodOptional<z.ZodObject<{
280
- value: z.ZodBigInt;
280
+ value: z.ZodCodec<z.ZodUnion<[z.ZodString, z.ZodBigInt]>, z.ZodBigInt>;
281
281
  valueUsd: z.ZodNullable<z.ZodNumber>;
282
282
  token: z.ZodObject<{
283
283
  chainId: z.ZodNumber;
284
- address: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
284
+ address: z.ZodCodec<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>;
285
285
  symbol: z.ZodString;
286
286
  name: z.ZodString;
287
287
  decimals: z.ZodNumber;
288
288
  assetType: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"Stable">, z.ZodLiteral<"ETH">, z.ZodLiteral<"BTC">]>>;
289
289
  }, z.core.$strip>;
290
- spender: z.ZodPipe<z.ZodString, z.ZodTransform<`0x${string}`, string>>;
290
+ spender: z.ZodCodec<z.ZodString, z.ZodCustom<`0x${string}`, `0x${string}`>>;
291
291
  }, z.core.$strip>>;
292
292
  }, z.core.$strip>;
293
293
  //#endregion
@@ -1,5 +1,6 @@
1
1
  import { Curator } from "./curators.js";
2
2
  import { Amount, AssetType, Bps, ChainId, Leverage, Timestamp, Token } from "./primitives.js";
3
+ import { Filterable } from "./filters.js";
3
4
  import { Address } from "viem";
4
5
  //#region src/model/opportunities.d.ts
5
6
  /**
@@ -350,48 +351,51 @@ declare function opportunityId(opportunity: Opportunity): OpportunityId;
350
351
  * The list is filtered in memory over final values, so there is no paging and
351
352
  * no sorting: a screen sorts what it got.
352
353
  *
353
- * Every criterion is optional and an omitted one matches any value, so an empty
354
- * filter is the same as no filter at all. Criteria combine with AND.
354
+ * Every condition is optional and an omitted one matches any value, so an
355
+ * empty filter is the same as no filter at all. A condition can also be set to
356
+ * `"all"` to say the same thing explicitly, which is what a UI whose state has
357
+ * an "any" option holds, see {@link Filterable}. Conditions combine with AND.
355
358
  **/
356
359
  interface OpportunityFilter {
357
360
  /**
358
361
  * Keep only pools or only strategies.
359
362
  **/
360
- kind?: OpportunityKind;
363
+ kind?: Filterable<OpportunityKind>;
361
364
  /**
362
365
  * Keep only opportunities on these chains.
363
366
  **/
364
- chainIds?: ChainId[];
367
+ chainIds?: Filterable<ChainId[]>;
365
368
  /**
366
369
  * Keep only opportunities whose {@link OpportunityBase.underlyingToken} is of
367
370
  * this class, which for an RWA market means the class of the token its
368
371
  * wrapper holds. An underlying that is not in the hardcoded table never
369
372
  * matches, so a set filter also drops unclassified rows.
370
373
  **/
371
- underlyingType?: AssetType;
374
+ underlyingType?: Filterable<AssetType>;
372
375
  /**
373
376
  * Keep only paused opportunities, or only unpaused ones.
374
377
  **/
375
- paused?: boolean;
378
+ paused?: Filterable<boolean>;
376
379
  /**
377
380
  * Keep only opportunities being wound down, or only the ones that are not.
378
381
  **/
379
- sunset?: boolean;
382
+ sunset?: Filterable<boolean>;
380
383
  /**
381
384
  * Keep only opportunities that accept RWA collateral, or only the ones that
382
385
  * do not.
383
386
  **/
384
- rwa?: boolean;
387
+ rwa?: Filterable<boolean>;
385
388
  }
386
389
  /**
387
- * Whether an opportunity satisfies every criterion of a filter.
390
+ * Whether an opportunity satisfies every condition of a filter.
388
391
  *
389
- * This is the single definition of what each criterion means: every source
392
+ * This is the single definition of what each condition means: every source
390
393
  * builds its rows first and runs them through here, so the chain and the
391
394
  * backend cannot disagree on what a filter selects.
392
395
  *
393
396
  * @param opportunity - Row to test.
394
- * @param filter - Criteria to test against. An absent filter matches anything.
397
+ * @param filter - Conditions to test against. An absent filter matches
398
+ * anything.
395
399
  **/
396
400
  declare function matchesOpportunityFilter(opportunity: Opportunity, filter?: OpportunityFilter): boolean;
397
401
  /**