@mento-protocol/mento-sdk 3.0.0 → 3.1.0-beta.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.
- package/dist/cache/routes.js +225 -1
- package/dist/cache/tokens.d.ts +1 -0
- package/dist/cache/tokens.js +31 -1
- package/dist/core/abis/reserve.d.ts +1 -0
- package/dist/core/abis/reserve.js +9 -1
- package/dist/core/constants/addresses.d.ts +5 -0
- package/dist/core/constants/addresses.js +29 -5
- package/dist/core/constants/chainId.d.ts +3 -1
- package/dist/core/constants/chainId.js +2 -0
- package/dist/core/types/pool.d.ts +1 -3
- package/dist/core/types/provider.d.ts +45 -0
- package/dist/core/types/provider.js +3 -0
- package/dist/esm/cache/routes.js +225 -1
- package/dist/esm/cache/tokens.js +31 -1
- package/dist/esm/core/abis/reserve.js +8 -0
- package/dist/esm/core/constants/addresses.js +28 -5
- package/dist/esm/core/constants/chainId.js +2 -0
- package/dist/esm/core/types/provider.js +1 -0
- package/dist/esm/index.js +6 -8
- package/dist/esm/services/index.js +0 -2
- package/dist/esm/services/liquidity/liquidityHelpers.js +2 -4
- package/dist/esm/services/pools/poolDetails.js +4 -10
- package/dist/esm/services/pools/poolDiscovery.js +6 -10
- package/dist/esm/services/tokens/tokenService.js +63 -11
- package/dist/esm/services/trading/TradingLimitsService.js +11 -23
- package/dist/esm/utils/chainConfig.js +49 -0
- package/dist/index.d.ts +6 -8
- package/dist/index.js +6 -8
- package/dist/services/index.d.ts +0 -2
- package/dist/services/index.js +0 -2
- package/dist/services/liquidity/liquidityHelpers.js +2 -4
- package/dist/services/pools/poolDetails.js +4 -10
- package/dist/services/pools/poolDiscovery.js +5 -9
- package/dist/services/tokens/tokenService.d.ts +17 -2
- package/dist/services/tokens/tokenService.js +61 -9
- package/dist/services/trading/TradingLimitsService.js +10 -22
- package/dist/utils/chainConfig.js +49 -0
- package/package.json +1 -1
package/dist/cache/routes.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// This file is auto-generated. Do not edit manually.
|
|
3
|
-
// Generated on 2026-03-
|
|
3
|
+
// Generated on 2026-03-10T11:55:17.883Z
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.cachedRoutes = void 0;
|
|
6
6
|
exports.getCachedRoutes = getCachedRoutes;
|
|
@@ -9,6 +9,230 @@ exports.getCachedRoutes = getCachedRoutes;
|
|
|
9
9
|
* Routes that don't exist for a chain will return an empty array
|
|
10
10
|
*/
|
|
11
11
|
exports.cachedRoutes = {
|
|
12
|
+
// Chain 143
|
|
13
|
+
143: [],
|
|
14
|
+
// Chain 10143
|
|
15
|
+
10143: [
|
|
16
|
+
{
|
|
17
|
+
"id": "USDC-USDm",
|
|
18
|
+
"tokens": [
|
|
19
|
+
{
|
|
20
|
+
"address": "0x534b2f3A21130d7a60830c2Df862319e593943A3",
|
|
21
|
+
"symbol": "USDC"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"address": "0x5eCc03111ad2A78F981A108759bc73BAE2AB31bc",
|
|
25
|
+
"symbol": "USDm"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"path": [
|
|
29
|
+
{
|
|
30
|
+
"factoryAddr": "0x353ED52bF8482027C0e0b9e3c0e5d96A9F680980",
|
|
31
|
+
"poolAddr": "0x7109E0A9B4623e90755b7e5c4e10F089E5Bf8bDb",
|
|
32
|
+
"token0": "0x534b2f3A21130d7a60830c2Df862319e593943A3",
|
|
33
|
+
"token1": "0x5eCc03111ad2A78F981A108759bc73BAE2AB31bc",
|
|
34
|
+
"poolType": "FPMM"
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
|
+
"costData": {
|
|
38
|
+
"totalCostPercent": 0.05,
|
|
39
|
+
"hops": [
|
|
40
|
+
{
|
|
41
|
+
"poolAddress": "0x7109E0A9B4623e90755b7e5c4e10F089E5Bf8bDb",
|
|
42
|
+
"costPercent": 0.05
|
|
43
|
+
}
|
|
44
|
+
]
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"id": "AUSD-USDm",
|
|
49
|
+
"tokens": [
|
|
50
|
+
{
|
|
51
|
+
"address": "0x502E67D3fE9302A5e4Ec1CFCDdbD6F34F9B9484B",
|
|
52
|
+
"symbol": "AUSD"
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"address": "0x5eCc03111ad2A78F981A108759bc73BAE2AB31bc",
|
|
56
|
+
"symbol": "USDm"
|
|
57
|
+
}
|
|
58
|
+
],
|
|
59
|
+
"path": [
|
|
60
|
+
{
|
|
61
|
+
"factoryAddr": "0x353ED52bF8482027C0e0b9e3c0e5d96A9F680980",
|
|
62
|
+
"poolAddr": "0x52716E8F44E417bE8F573F8A85cA8eD3DAe1eAE1",
|
|
63
|
+
"token0": "0x502E67D3fE9302A5e4Ec1CFCDdbD6F34F9B9484B",
|
|
64
|
+
"token1": "0x5eCc03111ad2A78F981A108759bc73BAE2AB31bc",
|
|
65
|
+
"poolType": "FPMM"
|
|
66
|
+
}
|
|
67
|
+
],
|
|
68
|
+
"costData": {
|
|
69
|
+
"totalCostPercent": 0.05,
|
|
70
|
+
"hops": [
|
|
71
|
+
{
|
|
72
|
+
"poolAddress": "0x52716E8F44E417bE8F573F8A85cA8eD3DAe1eAE1",
|
|
73
|
+
"costPercent": 0.05
|
|
74
|
+
}
|
|
75
|
+
]
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
"id": "AUSD-USDC",
|
|
80
|
+
"tokens": [
|
|
81
|
+
{
|
|
82
|
+
"address": "0x502E67D3fE9302A5e4Ec1CFCDdbD6F34F9B9484B",
|
|
83
|
+
"symbol": "AUSD"
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"address": "0x534b2f3A21130d7a60830c2Df862319e593943A3",
|
|
87
|
+
"symbol": "USDC"
|
|
88
|
+
}
|
|
89
|
+
],
|
|
90
|
+
"path": [
|
|
91
|
+
{
|
|
92
|
+
"factoryAddr": "0x353ED52bF8482027C0e0b9e3c0e5d96A9F680980",
|
|
93
|
+
"poolAddr": "0x7109E0A9B4623e90755b7e5c4e10F089E5Bf8bDb",
|
|
94
|
+
"token0": "0x534b2f3A21130d7a60830c2Df862319e593943A3",
|
|
95
|
+
"token1": "0x5eCc03111ad2A78F981A108759bc73BAE2AB31bc",
|
|
96
|
+
"poolType": "FPMM"
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
"factoryAddr": "0x353ED52bF8482027C0e0b9e3c0e5d96A9F680980",
|
|
100
|
+
"poolAddr": "0x52716E8F44E417bE8F573F8A85cA8eD3DAe1eAE1",
|
|
101
|
+
"token0": "0x502E67D3fE9302A5e4Ec1CFCDdbD6F34F9B9484B",
|
|
102
|
+
"token1": "0x5eCc03111ad2A78F981A108759bc73BAE2AB31bc",
|
|
103
|
+
"poolType": "FPMM"
|
|
104
|
+
}
|
|
105
|
+
],
|
|
106
|
+
"costData": {
|
|
107
|
+
"totalCostPercent": 0.099975,
|
|
108
|
+
"hops": [
|
|
109
|
+
{
|
|
110
|
+
"poolAddress": "0x7109E0A9B4623e90755b7e5c4e10F089E5Bf8bDb",
|
|
111
|
+
"costPercent": 0.05
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"poolAddress": "0x52716E8F44E417bE8F573F8A85cA8eD3DAe1eAE1",
|
|
115
|
+
"costPercent": 0.05
|
|
116
|
+
}
|
|
117
|
+
]
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"id": "GBPm-USDm",
|
|
122
|
+
"tokens": [
|
|
123
|
+
{
|
|
124
|
+
"address": "0x04de554E875c9797dC4ceBd834A9e99fa8fD5Df9",
|
|
125
|
+
"symbol": "GBPm"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"address": "0x5eCc03111ad2A78F981A108759bc73BAE2AB31bc",
|
|
129
|
+
"symbol": "USDm"
|
|
130
|
+
}
|
|
131
|
+
],
|
|
132
|
+
"path": [
|
|
133
|
+
{
|
|
134
|
+
"factoryAddr": "0x353ED52bF8482027C0e0b9e3c0e5d96A9F680980",
|
|
135
|
+
"poolAddr": "0x550D9EcB4C373510b8A41f5fB7D98E9E1c51A07e",
|
|
136
|
+
"token0": "0x04de554E875c9797dC4ceBd834A9e99fa8fD5Df9",
|
|
137
|
+
"token1": "0x5eCc03111ad2A78F981A108759bc73BAE2AB31bc",
|
|
138
|
+
"poolType": "FPMM"
|
|
139
|
+
}
|
|
140
|
+
],
|
|
141
|
+
"costData": {
|
|
142
|
+
"totalCostPercent": 0.15,
|
|
143
|
+
"hops": [
|
|
144
|
+
{
|
|
145
|
+
"poolAddress": "0x550D9EcB4C373510b8A41f5fB7D98E9E1c51A07e",
|
|
146
|
+
"costPercent": 0.15
|
|
147
|
+
}
|
|
148
|
+
]
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
"id": "GBPm-USDC",
|
|
153
|
+
"tokens": [
|
|
154
|
+
{
|
|
155
|
+
"address": "0x04de554E875c9797dC4ceBd834A9e99fa8fD5Df9",
|
|
156
|
+
"symbol": "GBPm"
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"address": "0x534b2f3A21130d7a60830c2Df862319e593943A3",
|
|
160
|
+
"symbol": "USDC"
|
|
161
|
+
}
|
|
162
|
+
],
|
|
163
|
+
"path": [
|
|
164
|
+
{
|
|
165
|
+
"factoryAddr": "0x353ED52bF8482027C0e0b9e3c0e5d96A9F680980",
|
|
166
|
+
"poolAddr": "0x550D9EcB4C373510b8A41f5fB7D98E9E1c51A07e",
|
|
167
|
+
"token0": "0x04de554E875c9797dC4ceBd834A9e99fa8fD5Df9",
|
|
168
|
+
"token1": "0x5eCc03111ad2A78F981A108759bc73BAE2AB31bc",
|
|
169
|
+
"poolType": "FPMM"
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
"factoryAddr": "0x353ED52bF8482027C0e0b9e3c0e5d96A9F680980",
|
|
173
|
+
"poolAddr": "0x7109E0A9B4623e90755b7e5c4e10F089E5Bf8bDb",
|
|
174
|
+
"token0": "0x534b2f3A21130d7a60830c2Df862319e593943A3",
|
|
175
|
+
"token1": "0x5eCc03111ad2A78F981A108759bc73BAE2AB31bc",
|
|
176
|
+
"poolType": "FPMM"
|
|
177
|
+
}
|
|
178
|
+
],
|
|
179
|
+
"costData": {
|
|
180
|
+
"totalCostPercent": 0.199925,
|
|
181
|
+
"hops": [
|
|
182
|
+
{
|
|
183
|
+
"poolAddress": "0x550D9EcB4C373510b8A41f5fB7D98E9E1c51A07e",
|
|
184
|
+
"costPercent": 0.15
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
"poolAddress": "0x7109E0A9B4623e90755b7e5c4e10F089E5Bf8bDb",
|
|
188
|
+
"costPercent": 0.05
|
|
189
|
+
}
|
|
190
|
+
]
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
"id": "AUSD-GBPm",
|
|
195
|
+
"tokens": [
|
|
196
|
+
{
|
|
197
|
+
"address": "0x502E67D3fE9302A5e4Ec1CFCDdbD6F34F9B9484B",
|
|
198
|
+
"symbol": "AUSD"
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
"address": "0x04de554E875c9797dC4ceBd834A9e99fa8fD5Df9",
|
|
202
|
+
"symbol": "GBPm"
|
|
203
|
+
}
|
|
204
|
+
],
|
|
205
|
+
"path": [
|
|
206
|
+
{
|
|
207
|
+
"factoryAddr": "0x353ED52bF8482027C0e0b9e3c0e5d96A9F680980",
|
|
208
|
+
"poolAddr": "0x550D9EcB4C373510b8A41f5fB7D98E9E1c51A07e",
|
|
209
|
+
"token0": "0x04de554E875c9797dC4ceBd834A9e99fa8fD5Df9",
|
|
210
|
+
"token1": "0x5eCc03111ad2A78F981A108759bc73BAE2AB31bc",
|
|
211
|
+
"poolType": "FPMM"
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"factoryAddr": "0x353ED52bF8482027C0e0b9e3c0e5d96A9F680980",
|
|
215
|
+
"poolAddr": "0x52716E8F44E417bE8F573F8A85cA8eD3DAe1eAE1",
|
|
216
|
+
"token0": "0x502E67D3fE9302A5e4Ec1CFCDdbD6F34F9B9484B",
|
|
217
|
+
"token1": "0x5eCc03111ad2A78F981A108759bc73BAE2AB31bc",
|
|
218
|
+
"poolType": "FPMM"
|
|
219
|
+
}
|
|
220
|
+
],
|
|
221
|
+
"costData": {
|
|
222
|
+
"totalCostPercent": 0.199925,
|
|
223
|
+
"hops": [
|
|
224
|
+
{
|
|
225
|
+
"poolAddress": "0x550D9EcB4C373510b8A41f5fB7D98E9E1c51A07e",
|
|
226
|
+
"costPercent": 0.15
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
"poolAddress": "0x52716E8F44E417bE8F573F8A85cA8eD3DAe1eAE1",
|
|
230
|
+
"costPercent": 0.05
|
|
231
|
+
}
|
|
232
|
+
]
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
],
|
|
12
236
|
// Chain 42220
|
|
13
237
|
42220: [
|
|
14
238
|
{
|
package/dist/cache/tokens.d.ts
CHANGED
package/dist/cache/tokens.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// This file is auto-generated. Do not edit manually.
|
|
3
|
-
// Generated on 2026-03-
|
|
3
|
+
// Generated on 2026-03-10T12:14:17.694Z
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.TOKEN_ADDRESSES_BY_CHAIN = exports.cachedTokens = exports.TokenSymbol = void 0;
|
|
6
6
|
exports.getCachedTokens = getCachedTokens;
|
|
@@ -13,6 +13,7 @@ exports.findTokenBySymbol = findTokenBySymbol;
|
|
|
13
13
|
var TokenSymbol;
|
|
14
14
|
(function (TokenSymbol) {
|
|
15
15
|
TokenSymbol["AUDm"] = "AUDm";
|
|
16
|
+
TokenSymbol["AUSD"] = "AUSD";
|
|
16
17
|
TokenSymbol["BRLm"] = "BRLm";
|
|
17
18
|
TokenSymbol["CADm"] = "CADm";
|
|
18
19
|
TokenSymbol["CELO"] = "CELO";
|
|
@@ -37,6 +38,29 @@ var TokenSymbol;
|
|
|
37
38
|
* Cached tokens indexed by chain ID
|
|
38
39
|
*/
|
|
39
40
|
exports.cachedTokens = {
|
|
41
|
+
// Chain 143
|
|
42
|
+
143: [],
|
|
43
|
+
// Chain 10143
|
|
44
|
+
10143: [
|
|
45
|
+
{
|
|
46
|
+
address: '0x5eCc03111ad2A78F981A108759bc73BAE2AB31bc',
|
|
47
|
+
symbol: TokenSymbol.USDm,
|
|
48
|
+
name: 'Mento Dollar',
|
|
49
|
+
decimals: 18,
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
address: '0x534b2f3A21130d7a60830c2Df862319e593943A3',
|
|
53
|
+
symbol: TokenSymbol.USDC,
|
|
54
|
+
name: 'USDC',
|
|
55
|
+
decimals: 6,
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
address: '0x502E67D3fE9302A5e4Ec1CFCDdbD6F34F9B9484B',
|
|
59
|
+
symbol: TokenSymbol.AUSD,
|
|
60
|
+
name: 'Mento Mock AUSD',
|
|
61
|
+
decimals: 6,
|
|
62
|
+
}
|
|
63
|
+
],
|
|
40
64
|
// Chain 42220
|
|
41
65
|
42220: [
|
|
42
66
|
{
|
|
@@ -289,6 +313,12 @@ exports.cachedTokens = {
|
|
|
289
313
|
* Useful for quickly looking up a token address by its symbol on a specific chain
|
|
290
314
|
*/
|
|
291
315
|
exports.TOKEN_ADDRESSES_BY_CHAIN = {
|
|
316
|
+
143: {},
|
|
317
|
+
10143: {
|
|
318
|
+
[TokenSymbol.USDm]: '0x5eCc03111ad2A78F981A108759bc73BAE2AB31bc',
|
|
319
|
+
[TokenSymbol.USDC]: '0x534b2f3A21130d7a60830c2Df862319e593943A3',
|
|
320
|
+
[TokenSymbol.AUSD]: '0x502E67D3fE9302A5e4Ec1CFCDdbD6F34F9B9484B',
|
|
321
|
+
},
|
|
292
322
|
42220: {
|
|
293
323
|
[TokenSymbol.USDm]: '0x765DE816845861e75A25fCA122bb6898B8B1282a',
|
|
294
324
|
[TokenSymbol.EURm]: '0xD8763CBa276a3738E6DE85b4b3bF5FDed6D6cA73',
|
|
@@ -1,10 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RESERVE_ABI = void 0;
|
|
3
|
+
exports.RESERVE_V2_ABI = exports.RESERVE_ABI = void 0;
|
|
4
4
|
const viem_1 = require("viem");
|
|
5
|
+
// Legacy Reserve (Celo)
|
|
5
6
|
exports.RESERVE_ABI = (0, viem_1.parseAbi)([
|
|
6
7
|
'function getTokens() view returns (address[])',
|
|
7
8
|
'function isToken(address) view returns (bool)',
|
|
8
9
|
'function isCollateralAsset(address) view returns (bool)',
|
|
9
10
|
]);
|
|
11
|
+
// ReserveV2 (Monad)
|
|
12
|
+
exports.RESERVE_V2_ABI = (0, viem_1.parseAbi)([
|
|
13
|
+
'function getStableAssets() view returns (address[])',
|
|
14
|
+
'function getCollateralAssets() view returns (address[])',
|
|
15
|
+
'function isStableAsset(address) view returns (bool)',
|
|
16
|
+
'function isCollateralAsset(address) view returns (bool)',
|
|
17
|
+
]);
|
|
10
18
|
//# sourceMappingURL=reserve.js.map
|
|
@@ -2,6 +2,11 @@ import { ChainId } from './chainId';
|
|
|
2
2
|
import { ContractAddresses, ContractAddressMap } from '../types';
|
|
3
3
|
export declare const addresses: ContractAddressMap;
|
|
4
4
|
export type Identifier = keyof ContractAddresses;
|
|
5
|
+
/**
|
|
6
|
+
* Get the address of a contract for a given chain, returning undefined if not found.
|
|
7
|
+
* Use this when the contract may not be deployed on the target chain.
|
|
8
|
+
*/
|
|
9
|
+
export declare function tryGetContractAddress(chainId: ChainId, contractName: Identifier): string | undefined;
|
|
5
10
|
/**
|
|
6
11
|
* Get the address of a contract for a given chain
|
|
7
12
|
* @param chainId - The chain ID
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addresses = void 0;
|
|
4
|
+
exports.tryGetContractAddress = tryGetContractAddress;
|
|
4
5
|
exports.getContractAddress = getContractAddress;
|
|
5
6
|
const chainId_1 = require("./chainId");
|
|
6
7
|
exports.addresses = {
|
|
@@ -33,6 +34,22 @@ exports.addresses = {
|
|
|
33
34
|
ReserveLiquidityStrategy: '0xa0fB8b16ce6AF3634fF9F3f4F40E49E1C1ae4f0B',
|
|
34
35
|
CDPLiquidityStrategy: '0x4e78BD9565341EAbe99cDC024acB044d9BDcB985',
|
|
35
36
|
},
|
|
37
|
+
[chainId_1.ChainId.MONAD_TESTNET]: {
|
|
38
|
+
// Oracles & Breakers
|
|
39
|
+
BreakerBox: '0x88869E30609D2C0E4032463D713328C6f541878e',
|
|
40
|
+
MedianDeltaBreaker: '0xf923C884F319b8866F67C5719A80E5cB4D0FAF2c',
|
|
41
|
+
SortedOracles: '0x85ed9ac57827132B8F60938F3165BC139E1F53cd',
|
|
42
|
+
ValueDeltaBreaker: '0xbbD0D093F5F11D16D4456FBd6229c9a3b70B8Aaf',
|
|
43
|
+
// DEX
|
|
44
|
+
Reserve: '0xbCdc1D0b92DfceEaa0FcD0a0D53355F4bF1DB8a7',
|
|
45
|
+
// Stable Tokens
|
|
46
|
+
StableToken: '0x5eCc03111ad2A78F981A108759bc73BAE2AB31bc', // USDm
|
|
47
|
+
// V3
|
|
48
|
+
FPMMFactory: '0x353ED52bF8482027C0e0b9e3c0e5d96A9F680980',
|
|
49
|
+
Router: '0xcf6cD45210b3ffE3cA28379C4683F1e60D0C2CCd',
|
|
50
|
+
ReserveLiquidityStrategy: '0x734bb3251Ec3f1A83f8f2A8609bcEF649D54EbF8',
|
|
51
|
+
},
|
|
52
|
+
[chainId_1.ChainId.MONAD]: {},
|
|
36
53
|
[chainId_1.ChainId.CELO_SEPOLIA]: {
|
|
37
54
|
// Oracles & Breakers
|
|
38
55
|
BreakerBox: '0x578bD46003B9D3fd4c3C3f47c98B329562a6a1dE',
|
|
@@ -60,6 +77,17 @@ exports.addresses = {
|
|
|
60
77
|
CDPLiquidityStrategy: '0x065AE7D4e207C8f4dca112D0B79E668cc7e93e03',
|
|
61
78
|
},
|
|
62
79
|
};
|
|
80
|
+
/**
|
|
81
|
+
* Get the address of a contract for a given chain, returning undefined if not found.
|
|
82
|
+
* Use this when the contract may not be deployed on the target chain.
|
|
83
|
+
*/
|
|
84
|
+
function tryGetContractAddress(chainId, contractName) {
|
|
85
|
+
const addressesForChain = exports.addresses[chainId];
|
|
86
|
+
if (!addressesForChain) {
|
|
87
|
+
return undefined;
|
|
88
|
+
}
|
|
89
|
+
return addressesForChain[contractName];
|
|
90
|
+
}
|
|
63
91
|
/**
|
|
64
92
|
* Get the address of a contract for a given chain
|
|
65
93
|
* @param chainId - The chain ID
|
|
@@ -68,11 +96,7 @@ exports.addresses = {
|
|
|
68
96
|
* @throws Error if the address is not found for the given chain
|
|
69
97
|
*/
|
|
70
98
|
function getContractAddress(chainId, contractName) {
|
|
71
|
-
const
|
|
72
|
-
if (!addressesForChain) {
|
|
73
|
-
throw new Error(`No addresses found for chain ID ${chainId}`);
|
|
74
|
-
}
|
|
75
|
-
const address = addressesForChain[contractName];
|
|
99
|
+
const address = tryGetContractAddress(chainId, contractName);
|
|
76
100
|
if (!address) {
|
|
77
101
|
throw new Error(`Address not found for contract ${contractName} on chain ID ${chainId}`);
|
|
78
102
|
}
|
|
@@ -5,5 +5,7 @@ var ChainId;
|
|
|
5
5
|
(function (ChainId) {
|
|
6
6
|
ChainId[ChainId["CELO"] = 42220] = "CELO";
|
|
7
7
|
ChainId[ChainId["CELO_SEPOLIA"] = 11142220] = "CELO_SEPOLIA";
|
|
8
|
+
ChainId[ChainId["MONAD_TESTNET"] = 10143] = "MONAD_TESTNET";
|
|
9
|
+
ChainId[ChainId["MONAD"] = 143] = "MONAD";
|
|
8
10
|
})(ChainId || (exports.ChainId = ChainId = {}));
|
|
9
11
|
//# sourceMappingURL=chainId.js.map
|
|
@@ -110,10 +110,8 @@ export interface FPMMPoolDetails extends Pool {
|
|
|
110
110
|
reserve1: bigint;
|
|
111
111
|
/** Block timestamp of last reserve update */
|
|
112
112
|
blockTimestampLast: bigint;
|
|
113
|
-
/** Pricing and oracle data (null when
|
|
113
|
+
/** Pricing and oracle data (null when FX market is closed) */
|
|
114
114
|
pricing: FPMMPricing | null;
|
|
115
|
-
/** Reason pricing data is unavailable, or null when pricing is present */
|
|
116
|
-
pricingUnavailableReason: string | null;
|
|
117
115
|
/** Fee configuration */
|
|
118
116
|
fees: FPMMFees;
|
|
119
117
|
/** Rebalancing state */
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export interface ContractCallOptions {
|
|
2
|
+
address: string;
|
|
3
|
+
abi: string[] | unknown[];
|
|
4
|
+
functionName: string;
|
|
5
|
+
args?: unknown[];
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Contract write options for building call parameters
|
|
9
|
+
*
|
|
10
|
+
* Configuration for building transaction call parameters for write operations.
|
|
11
|
+
* These parameters can be used by consumers to execute transactions themselves.
|
|
12
|
+
*/
|
|
13
|
+
export interface ContractWriteOptions extends ContractCallOptions {
|
|
14
|
+
/**
|
|
15
|
+
* Optional gas limit override
|
|
16
|
+
* If not provided, will be estimated automatically
|
|
17
|
+
*/
|
|
18
|
+
gasLimit?: bigint;
|
|
19
|
+
/**
|
|
20
|
+
* Transaction value in wei
|
|
21
|
+
* For payable functions only
|
|
22
|
+
*/
|
|
23
|
+
value?: bigint;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Call parameters for executing a contract transaction
|
|
27
|
+
*
|
|
28
|
+
* Contains all the data needed to execute a contract call.
|
|
29
|
+
* Consumers can use these parameters with their own wallet/signer to execute transactions.
|
|
30
|
+
*/
|
|
31
|
+
export interface CallParams {
|
|
32
|
+
/**
|
|
33
|
+
* Contract address to call
|
|
34
|
+
*/
|
|
35
|
+
to: string;
|
|
36
|
+
/**
|
|
37
|
+
* Encoded function call data (hex string)
|
|
38
|
+
*/
|
|
39
|
+
data: string;
|
|
40
|
+
/**
|
|
41
|
+
* Transaction value in wei (hex string with 0x prefix)
|
|
42
|
+
*/
|
|
43
|
+
value: string;
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=provider.d.ts.map
|