@iris-credit/core-sdk 0.0.0

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 (73) hide show
  1. package/LICENSE +21 -0
  2. package/lib/cjs/abis/blm.d.ts +192 -0
  3. package/lib/cjs/abis/blm.js +251 -0
  4. package/lib/cjs/abis/errors.d.ts +441 -0
  5. package/lib/cjs/abis/errors.js +558 -0
  6. package/lib/cjs/abis/index.d.ts +4 -0
  7. package/lib/cjs/abis/index.js +20 -0
  8. package/lib/cjs/abis/iris.d.ts +1448 -0
  9. package/lib/cjs/abis/iris.js +1850 -0
  10. package/lib/cjs/abis/whitelist-blm.d.ts +235 -0
  11. package/lib/cjs/abis/whitelist-blm.js +307 -0
  12. package/lib/cjs/addresses.d.ts +12 -0
  13. package/lib/cjs/addresses.js +17 -0
  14. package/lib/cjs/chain.d.ts +35 -0
  15. package/lib/cjs/chain.js +40 -0
  16. package/lib/cjs/constants.d.ts +14 -0
  17. package/lib/cjs/constants.js +18 -0
  18. package/lib/cjs/index.d.ts +7 -0
  19. package/lib/cjs/index.js +23 -0
  20. package/lib/cjs/math/MathLib.d.ts +26 -0
  21. package/lib/cjs/math/MathLib.js +88 -0
  22. package/lib/cjs/math/index.d.ts +1 -0
  23. package/lib/cjs/math/index.js +17 -0
  24. package/lib/cjs/package.json +1 -0
  25. package/lib/cjs/signatures/authorization.d.ts +20 -0
  26. package/lib/cjs/signatures/authorization.js +25 -0
  27. package/lib/cjs/signatures/erc2612.d.ts +34 -0
  28. package/lib/cjs/signatures/erc2612.js +26 -0
  29. package/lib/cjs/signatures/index.d.ts +4 -0
  30. package/lib/cjs/signatures/index.js +20 -0
  31. package/lib/cjs/signatures/permit2.d.ts +33 -0
  32. package/lib/cjs/signatures/permit2.js +41 -0
  33. package/lib/cjs/signatures/quote.d.ts +34 -0
  34. package/lib/cjs/signatures/quote.js +40 -0
  35. package/lib/cjs/types.d.ts +9 -0
  36. package/lib/cjs/types.js +7 -0
  37. package/lib/esm/abis/blm.d.ts +192 -0
  38. package/lib/esm/abis/blm.js +248 -0
  39. package/lib/esm/abis/errors.d.ts +441 -0
  40. package/lib/esm/abis/errors.js +555 -0
  41. package/lib/esm/abis/index.d.ts +4 -0
  42. package/lib/esm/abis/index.js +4 -0
  43. package/lib/esm/abis/iris.d.ts +1448 -0
  44. package/lib/esm/abis/iris.js +1847 -0
  45. package/lib/esm/abis/whitelist-blm.d.ts +235 -0
  46. package/lib/esm/abis/whitelist-blm.js +304 -0
  47. package/lib/esm/addresses.d.ts +12 -0
  48. package/lib/esm/addresses.js +13 -0
  49. package/lib/esm/chain.d.ts +35 -0
  50. package/lib/esm/chain.js +38 -0
  51. package/lib/esm/constants.d.ts +14 -0
  52. package/lib/esm/constants.js +15 -0
  53. package/lib/esm/index.d.ts +7 -0
  54. package/lib/esm/index.js +7 -0
  55. package/lib/esm/math/MathLib.d.ts +26 -0
  56. package/lib/esm/math/MathLib.js +86 -0
  57. package/lib/esm/math/index.d.ts +1 -0
  58. package/lib/esm/math/index.js +1 -0
  59. package/lib/esm/package.json +1 -0
  60. package/lib/esm/signatures/authorization.d.ts +20 -0
  61. package/lib/esm/signatures/authorization.js +21 -0
  62. package/lib/esm/signatures/erc2612.d.ts +34 -0
  63. package/lib/esm/signatures/erc2612.js +22 -0
  64. package/lib/esm/signatures/index.d.ts +4 -0
  65. package/lib/esm/signatures/index.js +4 -0
  66. package/lib/esm/signatures/permit2.d.ts +33 -0
  67. package/lib/esm/signatures/permit2.js +37 -0
  68. package/lib/esm/signatures/quote.d.ts +34 -0
  69. package/lib/esm/signatures/quote.js +36 -0
  70. package/lib/esm/types.d.ts +9 -0
  71. package/lib/esm/types.js +3 -0
  72. package/package.json +39 -0
  73. package/src/index.ts +7 -0
@@ -0,0 +1,235 @@
1
+ export declare const whitelistBlmAbi: readonly [{
2
+ readonly type: "constructor";
3
+ readonly inputs: readonly [{
4
+ readonly name: "iris";
5
+ readonly type: "address";
6
+ readonly internalType: "address";
7
+ }];
8
+ readonly stateMutability: "nonpayable";
9
+ }, {
10
+ readonly type: "function";
11
+ readonly name: "IRIS";
12
+ readonly inputs: readonly [];
13
+ readonly outputs: readonly [{
14
+ readonly name: "";
15
+ readonly type: "address";
16
+ readonly internalType: "contract IIris";
17
+ }];
18
+ readonly stateMutability: "view";
19
+ }, {
20
+ readonly type: "function";
21
+ readonly name: "bondRequirement";
22
+ readonly inputs: readonly [{
23
+ readonly name: "quote";
24
+ readonly type: "tuple";
25
+ readonly internalType: "struct Quote";
26
+ readonly components: readonly [{
27
+ readonly name: "borrower";
28
+ readonly type: "address";
29
+ readonly internalType: "address";
30
+ }, {
31
+ readonly name: "solver";
32
+ readonly type: "address";
33
+ readonly internalType: "address";
34
+ }, {
35
+ readonly name: "receiver";
36
+ readonly type: "address";
37
+ readonly internalType: "address";
38
+ }, {
39
+ readonly name: "blm";
40
+ readonly type: "address";
41
+ readonly internalType: "address";
42
+ }, {
43
+ readonly name: "collateralToken";
44
+ readonly type: "address";
45
+ readonly internalType: "address";
46
+ }, {
47
+ readonly name: "debtToken";
48
+ readonly type: "address";
49
+ readonly internalType: "address";
50
+ }, {
51
+ readonly name: "collateral";
52
+ readonly type: "uint256";
53
+ readonly internalType: "uint256";
54
+ }, {
55
+ readonly name: "debt";
56
+ readonly type: "uint256";
57
+ readonly internalType: "uint256";
58
+ }, {
59
+ readonly name: "fixedRate";
60
+ readonly type: "uint256";
61
+ readonly internalType: "uint256";
62
+ }, {
63
+ readonly name: "duration";
64
+ readonly type: "uint256";
65
+ readonly internalType: "uint256";
66
+ }, {
67
+ readonly name: "overdueRate";
68
+ readonly type: "uint256";
69
+ readonly internalType: "uint256";
70
+ }, {
71
+ readonly name: "overduePeriod";
72
+ readonly type: "uint256";
73
+ readonly internalType: "uint256";
74
+ }, {
75
+ readonly name: "bond";
76
+ readonly type: "uint256";
77
+ readonly internalType: "uint256";
78
+ }, {
79
+ readonly name: "bondLltv";
80
+ readonly type: "uint256";
81
+ readonly internalType: "uint256";
82
+ }, {
83
+ readonly name: "venueBitmap";
84
+ readonly type: "uint256";
85
+ readonly internalType: "uint256";
86
+ }, {
87
+ readonly name: "venueId";
88
+ readonly type: "uint256";
89
+ readonly internalType: "uint256";
90
+ }, {
91
+ readonly name: "deadline";
92
+ readonly type: "uint256";
93
+ readonly internalType: "uint256";
94
+ }, {
95
+ readonly name: "nonce";
96
+ readonly type: "uint256";
97
+ readonly internalType: "uint256";
98
+ }, {
99
+ readonly name: "data";
100
+ readonly type: "bytes";
101
+ readonly internalType: "bytes";
102
+ }];
103
+ }];
104
+ readonly outputs: readonly [{
105
+ readonly name: "";
106
+ readonly type: "uint256";
107
+ readonly internalType: "uint256";
108
+ }];
109
+ readonly stateMutability: "view";
110
+ }, {
111
+ readonly type: "function";
112
+ readonly name: "intercept";
113
+ readonly inputs: readonly [{
114
+ readonly name: "";
115
+ readonly type: "address";
116
+ readonly internalType: "address";
117
+ }];
118
+ readonly outputs: readonly [{
119
+ readonly name: "";
120
+ readonly type: "uint256";
121
+ readonly internalType: "uint256";
122
+ }];
123
+ readonly stateMutability: "view";
124
+ }, {
125
+ readonly type: "function";
126
+ readonly name: "isWhitelisted";
127
+ readonly inputs: readonly [{
128
+ readonly name: "";
129
+ readonly type: "address";
130
+ readonly internalType: "address";
131
+ }];
132
+ readonly outputs: readonly [{
133
+ readonly name: "";
134
+ readonly type: "bool";
135
+ readonly internalType: "bool";
136
+ }];
137
+ readonly stateMutability: "view";
138
+ }, {
139
+ readonly type: "function";
140
+ readonly name: "setIsWhitelisted";
141
+ readonly inputs: readonly [{
142
+ readonly name: "account";
143
+ readonly type: "address";
144
+ readonly internalType: "address";
145
+ }, {
146
+ readonly name: "newIsWhitelisted";
147
+ readonly type: "bool";
148
+ readonly internalType: "bool";
149
+ }];
150
+ readonly outputs: readonly [];
151
+ readonly stateMutability: "nonpayable";
152
+ }, {
153
+ readonly type: "function";
154
+ readonly name: "setParams";
155
+ readonly inputs: readonly [{
156
+ readonly name: "token";
157
+ readonly type: "address";
158
+ readonly internalType: "address";
159
+ }, {
160
+ readonly name: "newSlope";
161
+ readonly type: "uint256";
162
+ readonly internalType: "uint256";
163
+ }, {
164
+ readonly name: "newIntercept";
165
+ readonly type: "uint256";
166
+ readonly internalType: "uint256";
167
+ }];
168
+ readonly outputs: readonly [];
169
+ readonly stateMutability: "nonpayable";
170
+ }, {
171
+ readonly type: "function";
172
+ readonly name: "slope";
173
+ readonly inputs: readonly [{
174
+ readonly name: "";
175
+ readonly type: "address";
176
+ readonly internalType: "address";
177
+ }];
178
+ readonly outputs: readonly [{
179
+ readonly name: "";
180
+ readonly type: "uint256";
181
+ readonly internalType: "uint256";
182
+ }];
183
+ readonly stateMutability: "view";
184
+ }, {
185
+ readonly type: "event";
186
+ readonly name: "SetIsWhitelisted";
187
+ readonly inputs: readonly [{
188
+ readonly name: "account";
189
+ readonly type: "address";
190
+ readonly indexed: true;
191
+ readonly internalType: "address";
192
+ }, {
193
+ readonly name: "isWhitelisted";
194
+ readonly type: "bool";
195
+ readonly indexed: false;
196
+ readonly internalType: "bool";
197
+ }];
198
+ readonly anonymous: false;
199
+ }, {
200
+ readonly type: "event";
201
+ readonly name: "SetParams";
202
+ readonly inputs: readonly [{
203
+ readonly name: "token";
204
+ readonly type: "address";
205
+ readonly indexed: false;
206
+ readonly internalType: "address";
207
+ }, {
208
+ readonly name: "newSlope";
209
+ readonly type: "uint256";
210
+ readonly indexed: false;
211
+ readonly internalType: "uint256";
212
+ }, {
213
+ readonly name: "newIntercept";
214
+ readonly type: "uint256";
215
+ readonly indexed: false;
216
+ readonly internalType: "uint256";
217
+ }];
218
+ readonly anonymous: false;
219
+ }, {
220
+ readonly type: "error";
221
+ readonly name: "ParamsTooHigh";
222
+ readonly inputs: readonly [];
223
+ }, {
224
+ readonly type: "error";
225
+ readonly name: "Unauthorized";
226
+ readonly inputs: readonly [];
227
+ }, {
228
+ readonly type: "error";
229
+ readonly name: "ZeroAddress";
230
+ readonly inputs: readonly [];
231
+ }, {
232
+ readonly type: "error";
233
+ readonly name: "ZeroAmount";
234
+ readonly inputs: readonly [];
235
+ }];
@@ -0,0 +1,304 @@
1
+ export const whitelistBlmAbi = [
2
+ {
3
+ type: "constructor",
4
+ inputs: [
5
+ {
6
+ name: "iris",
7
+ type: "address",
8
+ internalType: "address",
9
+ },
10
+ ],
11
+ stateMutability: "nonpayable",
12
+ },
13
+ {
14
+ type: "function",
15
+ name: "IRIS",
16
+ inputs: [],
17
+ outputs: [
18
+ {
19
+ name: "",
20
+ type: "address",
21
+ internalType: "contract IIris",
22
+ },
23
+ ],
24
+ stateMutability: "view",
25
+ },
26
+ {
27
+ type: "function",
28
+ name: "bondRequirement",
29
+ inputs: [
30
+ {
31
+ name: "quote",
32
+ type: "tuple",
33
+ internalType: "struct Quote",
34
+ components: [
35
+ {
36
+ name: "borrower",
37
+ type: "address",
38
+ internalType: "address",
39
+ },
40
+ {
41
+ name: "solver",
42
+ type: "address",
43
+ internalType: "address",
44
+ },
45
+ {
46
+ name: "receiver",
47
+ type: "address",
48
+ internalType: "address",
49
+ },
50
+ {
51
+ name: "blm",
52
+ type: "address",
53
+ internalType: "address",
54
+ },
55
+ {
56
+ name: "collateralToken",
57
+ type: "address",
58
+ internalType: "address",
59
+ },
60
+ {
61
+ name: "debtToken",
62
+ type: "address",
63
+ internalType: "address",
64
+ },
65
+ {
66
+ name: "collateral",
67
+ type: "uint256",
68
+ internalType: "uint256",
69
+ },
70
+ {
71
+ name: "debt",
72
+ type: "uint256",
73
+ internalType: "uint256",
74
+ },
75
+ {
76
+ name: "fixedRate",
77
+ type: "uint256",
78
+ internalType: "uint256",
79
+ },
80
+ {
81
+ name: "duration",
82
+ type: "uint256",
83
+ internalType: "uint256",
84
+ },
85
+ {
86
+ name: "overdueRate",
87
+ type: "uint256",
88
+ internalType: "uint256",
89
+ },
90
+ {
91
+ name: "overduePeriod",
92
+ type: "uint256",
93
+ internalType: "uint256",
94
+ },
95
+ {
96
+ name: "bond",
97
+ type: "uint256",
98
+ internalType: "uint256",
99
+ },
100
+ {
101
+ name: "bondLltv",
102
+ type: "uint256",
103
+ internalType: "uint256",
104
+ },
105
+ {
106
+ name: "venueBitmap",
107
+ type: "uint256",
108
+ internalType: "uint256",
109
+ },
110
+ {
111
+ name: "venueId",
112
+ type: "uint256",
113
+ internalType: "uint256",
114
+ },
115
+ {
116
+ name: "deadline",
117
+ type: "uint256",
118
+ internalType: "uint256",
119
+ },
120
+ {
121
+ name: "nonce",
122
+ type: "uint256",
123
+ internalType: "uint256",
124
+ },
125
+ {
126
+ name: "data",
127
+ type: "bytes",
128
+ internalType: "bytes",
129
+ },
130
+ ],
131
+ },
132
+ ],
133
+ outputs: [
134
+ {
135
+ name: "",
136
+ type: "uint256",
137
+ internalType: "uint256",
138
+ },
139
+ ],
140
+ stateMutability: "view",
141
+ },
142
+ {
143
+ type: "function",
144
+ name: "intercept",
145
+ inputs: [
146
+ {
147
+ name: "",
148
+ type: "address",
149
+ internalType: "address",
150
+ },
151
+ ],
152
+ outputs: [
153
+ {
154
+ name: "",
155
+ type: "uint256",
156
+ internalType: "uint256",
157
+ },
158
+ ],
159
+ stateMutability: "view",
160
+ },
161
+ {
162
+ type: "function",
163
+ name: "isWhitelisted",
164
+ inputs: [
165
+ {
166
+ name: "",
167
+ type: "address",
168
+ internalType: "address",
169
+ },
170
+ ],
171
+ outputs: [
172
+ {
173
+ name: "",
174
+ type: "bool",
175
+ internalType: "bool",
176
+ },
177
+ ],
178
+ stateMutability: "view",
179
+ },
180
+ {
181
+ type: "function",
182
+ name: "setIsWhitelisted",
183
+ inputs: [
184
+ {
185
+ name: "account",
186
+ type: "address",
187
+ internalType: "address",
188
+ },
189
+ {
190
+ name: "newIsWhitelisted",
191
+ type: "bool",
192
+ internalType: "bool",
193
+ },
194
+ ],
195
+ outputs: [],
196
+ stateMutability: "nonpayable",
197
+ },
198
+ {
199
+ type: "function",
200
+ name: "setParams",
201
+ inputs: [
202
+ {
203
+ name: "token",
204
+ type: "address",
205
+ internalType: "address",
206
+ },
207
+ {
208
+ name: "newSlope",
209
+ type: "uint256",
210
+ internalType: "uint256",
211
+ },
212
+ {
213
+ name: "newIntercept",
214
+ type: "uint256",
215
+ internalType: "uint256",
216
+ },
217
+ ],
218
+ outputs: [],
219
+ stateMutability: "nonpayable",
220
+ },
221
+ {
222
+ type: "function",
223
+ name: "slope",
224
+ inputs: [
225
+ {
226
+ name: "",
227
+ type: "address",
228
+ internalType: "address",
229
+ },
230
+ ],
231
+ outputs: [
232
+ {
233
+ name: "",
234
+ type: "uint256",
235
+ internalType: "uint256",
236
+ },
237
+ ],
238
+ stateMutability: "view",
239
+ },
240
+ {
241
+ type: "event",
242
+ name: "SetIsWhitelisted",
243
+ inputs: [
244
+ {
245
+ name: "account",
246
+ type: "address",
247
+ indexed: true,
248
+ internalType: "address",
249
+ },
250
+ {
251
+ name: "isWhitelisted",
252
+ type: "bool",
253
+ indexed: false,
254
+ internalType: "bool",
255
+ },
256
+ ],
257
+ anonymous: false,
258
+ },
259
+ {
260
+ type: "event",
261
+ name: "SetParams",
262
+ inputs: [
263
+ {
264
+ name: "token",
265
+ type: "address",
266
+ indexed: false,
267
+ internalType: "address",
268
+ },
269
+ {
270
+ name: "newSlope",
271
+ type: "uint256",
272
+ indexed: false,
273
+ internalType: "uint256",
274
+ },
275
+ {
276
+ name: "newIntercept",
277
+ type: "uint256",
278
+ indexed: false,
279
+ internalType: "uint256",
280
+ },
281
+ ],
282
+ anonymous: false,
283
+ },
284
+ {
285
+ type: "error",
286
+ name: "ParamsTooHigh",
287
+ inputs: [],
288
+ },
289
+ {
290
+ type: "error",
291
+ name: "Unauthorized",
292
+ inputs: [],
293
+ },
294
+ {
295
+ type: "error",
296
+ name: "ZeroAddress",
297
+ inputs: [],
298
+ },
299
+ {
300
+ type: "error",
301
+ name: "ZeroAmount",
302
+ inputs: [],
303
+ },
304
+ ];
@@ -0,0 +1,12 @@
1
+ import type { Address } from "viem";
2
+ export interface ChainAddresses {
3
+ readonly iris: Address;
4
+ readonly permit2: Address;
5
+ }
6
+ export declare const CHAIN_ADDRESSES: {
7
+ 1: {
8
+ iris: "0x0000000000000000000000000000000000000000";
9
+ permit2: `0x${string}`;
10
+ };
11
+ };
12
+ export declare const getChainAddresses: (chainId: 1) => ChainAddresses;
@@ -0,0 +1,13 @@
1
+ import { ChainId } from "./chain.js";
2
+ // Permit2 is deployed at the same canonical address on every chain.
3
+ const PERMIT2_ADDRESS = "0x000000000022D473030F116dDEE9F6B43aC78BA3";
4
+ export const CHAIN_ADDRESSES = {
5
+ [ChainId.EthMainnet]: {
6
+ // TODO: Iris is not yet deployed to mainnet. Replace with the deployed address.
7
+ iris: "0x0000000000000000000000000000000000000000",
8
+ permit2: PERMIT2_ADDRESS,
9
+ },
10
+ };
11
+ export const getChainAddresses = (chainId) => {
12
+ return CHAIN_ADDRESSES[chainId];
13
+ };
@@ -0,0 +1,35 @@
1
+ export declare const ChainId: {
2
+ readonly EthMainnet: 1;
3
+ };
4
+ export type ChainId = (typeof ChainId)[keyof typeof ChainId];
5
+ export interface ChainMetadata {
6
+ readonly name: string;
7
+ readonly id: ChainId;
8
+ readonly explorerUrl: string;
9
+ readonly nativeCurrency: {
10
+ readonly name: string;
11
+ readonly symbol: string;
12
+ readonly decimals: number;
13
+ };
14
+ readonly identifier: string;
15
+ }
16
+ export declare namespace ChainUtils {
17
+ const toHexChainId: (chainId: 1) => string;
18
+ const getExplorerUrl: (chainId: 1) => string;
19
+ const getExplorerAddressUrl: (chainId: 1, address: string) => string;
20
+ const getExplorerTransactionUrl: (chainId: 1, tx: string) => string;
21
+ const supportedChainIds: 1[];
22
+ const CHAIN_METADATA: {
23
+ 1: {
24
+ name: string;
25
+ id: 1;
26
+ nativeCurrency: {
27
+ name: string;
28
+ symbol: string;
29
+ decimals: number;
30
+ };
31
+ explorerUrl: string;
32
+ identifier: string;
33
+ };
34
+ };
35
+ }
@@ -0,0 +1,38 @@
1
+ import { values } from "@iris-credit/iris-ts";
2
+ export const ChainId = {
3
+ EthMainnet: 1,
4
+ // BaseMainnet: 8453,
5
+ };
6
+ export { ChainUtils };
7
+ var ChainUtils;
8
+ (function (ChainUtils) {
9
+ ChainUtils.toHexChainId = (chainId) => {
10
+ return `0x${chainId.toString(16)}`;
11
+ };
12
+ ChainUtils.getExplorerUrl = (chainId) => {
13
+ return ChainUtils.CHAIN_METADATA[chainId].explorerUrl;
14
+ };
15
+ ChainUtils.getExplorerAddressUrl = (chainId, address) => {
16
+ return `${ChainUtils.getExplorerUrl(chainId)}/address/${address}`;
17
+ };
18
+ ChainUtils.getExplorerTransactionUrl = (chainId, tx) => {
19
+ return `${ChainUtils.getExplorerUrl(chainId)}/tx/${tx}`;
20
+ };
21
+ ChainUtils.supportedChainIds = values(ChainId);
22
+ ChainUtils.CHAIN_METADATA = {
23
+ [ChainId.EthMainnet]: {
24
+ name: "Ethereum",
25
+ id: ChainId.EthMainnet,
26
+ nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
27
+ explorerUrl: "https://etherscan.io",
28
+ identifier: "mainnet",
29
+ },
30
+ // [ChainId.BaseMainnet]: {
31
+ // name: "Base",
32
+ // id: ChainId.BaseMainnet,
33
+ // nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
34
+ // explorerUrl: "https://basescan.org",
35
+ // identifier: "base",
36
+ // },
37
+ };
38
+ })(ChainUtils || (ChainUtils = {}));
@@ -0,0 +1,14 @@
1
+ export declare const BP = 100000000000000n;
2
+ export declare const ORACLE_PRICE_SCALE = 1000000000000000000000000000000000000n;
3
+ export declare const SECONDS_PER_YEAR: bigint;
4
+ export declare const MIN_DURATION: bigint;
5
+ export declare const MAX_DURATION: bigint;
6
+ export declare const MAX_FIXED_RATE = 1000000000000000000n;
7
+ export declare const MAX_OVERDUE_RATE = 1000000000000000000n;
8
+ export declare const MAX_OVERDUE_PERIOD: bigint;
9
+ export declare const MAX_LIF = 150000000000000000n;
10
+ export declare const TIME_TO_MAX_LIF: bigint;
11
+ export declare const MAX_BOND_LIF = 50000000000000000n;
12
+ export declare const LIQUIDATION_CURSOR = 500000000000000000n;
13
+ export declare const MAX_FEE = 400000000000000000n;
14
+ export declare const QUOTE_TTL: bigint;
@@ -0,0 +1,15 @@
1
+ import { Time } from "@iris-credit/iris-ts";
2
+ export const BP = 100000000000000n; // 1e14
3
+ export const ORACLE_PRICE_SCALE = 1000000000000000000000000000000000000n; // 1e36
4
+ export const SECONDS_PER_YEAR = Time.s.from.y(1n); // 365 days
5
+ export const MIN_DURATION = Time.s.from.d(1n);
6
+ export const MAX_DURATION = Time.s.from.y(2n);
7
+ export const MAX_FIXED_RATE = 1000000000000000000n; // 1e18 (100%)
8
+ export const MAX_OVERDUE_RATE = 1000000000000000000n; // 1e18
9
+ export const MAX_OVERDUE_PERIOD = Time.s.from.d(30n);
10
+ export const MAX_LIF = 150000000000000000n; // 0.15e18
11
+ export const TIME_TO_MAX_LIF = Time.s.from.min(15n);
12
+ export const MAX_BOND_LIF = 50000000000000000n; // 0.05e18
13
+ export const LIQUIDATION_CURSOR = 500000000000000000n; // 0.5e18
14
+ export const MAX_FEE = 400000000000000000n; // 0.4e18 (40%)
15
+ export const QUOTE_TTL = Time.s.from.min(2n);
@@ -0,0 +1,7 @@
1
+ export * from "./types.js";
2
+ export * from "./chain.js";
3
+ export * from "./constants.js";
4
+ export * from "./addresses.js";
5
+ export * from "./signatures/index.js";
6
+ export * from "./math/index.js";
7
+ export * from "./abis/index.js";
@@ -0,0 +1,7 @@
1
+ export * from "./types.js";
2
+ export * from "./chain.js";
3
+ export * from "./constants.js";
4
+ export * from "./addresses.js";
5
+ export * from "./signatures/index.js";
6
+ export * from "./math/index.js";
7
+ export * from "./abis/index.js";