@mento-protocol/mento-sdk 3.2.8 → 3.3.0-beta.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.
@@ -1,5 +1,5 @@
1
1
  // This file is auto-generated. Do not edit manually.
2
- // Generated on 2026-04-27T16:44:41.707Z
2
+ // Generated on 2026-05-06T12:39:32.137Z
3
3
  /**
4
4
  * Enum of all token symbols across all supported chains
5
5
  */
@@ -11,6 +11,7 @@ export var TokenSymbol;
11
11
  TokenSymbol["CADm"] = "CADm";
12
12
  TokenSymbol["CHFm"] = "CHFm";
13
13
  TokenSymbol["COPm"] = "COPm";
14
+ TokenSymbol["EURC"] = "EURC";
14
15
  TokenSymbol["EURm"] = "EURm";
15
16
  TokenSymbol["GBPm"] = "GBPm";
16
17
  TokenSymbol["GHSm"] = "GHSm";
@@ -250,6 +251,42 @@ export const cachedTokens = {
250
251
  decimals: 18,
251
252
  }
252
253
  ],
254
+ // Chain 80002
255
+ 80002: [
256
+ {
257
+ address: '0xfbD2d6a7C3Cb4491647173D6eCb2a4473521cd66',
258
+ symbol: TokenSymbol.USDC,
259
+ name: 'Mento Mock USDC',
260
+ decimals: 6,
261
+ },
262
+ {
263
+ address: '0x5eCc03111ad2A78F981A108759bc73BAE2AB31bc',
264
+ symbol: TokenSymbol.USDm,
265
+ name: 'Mento Dollar',
266
+ decimals: 18,
267
+ },
268
+ {
269
+ address: '0x666D0a83cDbf3eC62bDb624d9bFcD8F6345Ba7D0',
270
+ symbol: TokenSymbol.EURm,
271
+ name: 'Mento Euro',
272
+ decimals: 18,
273
+ }
274
+ ],
275
+ // Chain 84532
276
+ 84532: [
277
+ {
278
+ address: '0xe36C65cF840C16F45A0bd89628B89a9414DFda82',
279
+ symbol: TokenSymbol.EURC,
280
+ name: 'Mento Mock EURC',
281
+ decimals: 6,
282
+ },
283
+ {
284
+ address: '0x666D0a83cDbf3eC62bDb624d9bFcD8F6345Ba7D0',
285
+ symbol: TokenSymbol.EURm,
286
+ name: 'Mento Euro',
287
+ decimals: 18,
288
+ }
289
+ ],
253
290
  // Chain 11142220
254
291
  11142220: [
255
292
  {
@@ -414,6 +451,15 @@ export const TOKEN_ADDRESSES_BY_CHAIN = {
414
451
  [TokenSymbol.BRLm]: '0xe8537a3d056DA446677B9E9d6c5dB704EaAb4787',
415
452
  [TokenSymbol.XOFm]: '0x73F93dcc49cB8A239e2032663e9475dd5ef29A08',
416
453
  },
454
+ 80002: {
455
+ [TokenSymbol.USDC]: '0xfbD2d6a7C3Cb4491647173D6eCb2a4473521cd66',
456
+ [TokenSymbol.USDm]: '0x5eCc03111ad2A78F981A108759bc73BAE2AB31bc',
457
+ [TokenSymbol.EURm]: '0x666D0a83cDbf3eC62bDb624d9bFcD8F6345Ba7D0',
458
+ },
459
+ 84532: {
460
+ [TokenSymbol.EURC]: '0xe36C65cF840C16F45A0bd89628B89a9414DFda82',
461
+ [TokenSymbol.EURm]: '0x666D0a83cDbf3eC62bDb624d9bFcD8F6345Ba7D0',
462
+ },
417
463
  11142220: {
418
464
  [TokenSymbol.GBPm]: '0x85F5181Abdbf0e1814Fc4358582Ae07b8eBA3aF3',
419
465
  [TokenSymbol.USDm]: '0xdE9e4C3ce781b4bA68120d6261cbad65ce0aB00b',
@@ -53,6 +53,29 @@ export const addresses = {
53
53
  ReserveLiquidityStrategy: '0xa0fB8b16ce6AF3634fF9F3f4F40E49E1C1ae4f0B',
54
54
  OpenLiquidityStrategy: '0x54e2Ae8c8448912E17cE0b2453bAFB7B0D80E40f',
55
55
  },
56
+ [ChainId.POLYGON_AMOY]: {
57
+ BreakerBox: '0x88869E30609D2C0E4032463D713328C6f541878e',
58
+ MedianDeltaBreaker: '0xf923C884F319b8866F67C5719A80E5cB4D0FAF2c',
59
+ SortedOracles: '0x85ed9ac57827132B8F60938F3165BC139E1F53cd',
60
+ ValueDeltaBreaker: '0xbbD0D093F5F11D16D4456FBd6229c9a3b70B8Aaf',
61
+ Reserve: '0xbCdc1D0b92DfceEaa0FcD0a0D53355F4bF1DB8a7',
62
+ StableToken: '0x5eCc03111ad2A78F981A108759bc73BAE2AB31bc', // USDm
63
+ FPMMFactory: '0x353ED52bF8482027C0e0b9e3c0e5d96A9F680980',
64
+ Router: '0xcf6cD45210b3ffE3cA28379C4683F1e60D0C2CCd',
65
+ ReserveLiquidityStrategy: '0x734bb3251Ec3f1A83f8f2A8609bcEF649D54EbF8',
66
+ OpenLiquidityStrategy: '0xCCd2aD0603a08EBc14D223a983171ef18192e8c9',
67
+ },
68
+ [ChainId.BASE_SEPOLIA]: {
69
+ BreakerBox: '0x88869E30609D2C0E4032463D713328C6f541878e',
70
+ MedianDeltaBreaker: '0xf923C884F319b8866F67C5719A80E5cB4D0FAF2c',
71
+ SortedOracles: '0x85ed9ac57827132B8F60938F3165BC139E1F53cd',
72
+ ValueDeltaBreaker: '0xbbD0D093F5F11D16D4456FBd6229c9a3b70B8Aaf',
73
+ Reserve: '0xbCdc1D0b92DfceEaa0FcD0a0D53355F4bF1DB8a7',
74
+ StableToken: '0x666D0a83cDbf3eC62bDb624d9bFcD8F6345Ba7D0', // EURm
75
+ FPMMFactory: '0x353ED52bF8482027C0e0b9e3c0e5d96A9F680980',
76
+ Router: '0xcf6cD45210b3ffE3cA28379C4683F1e60D0C2CCd',
77
+ ReserveLiquidityStrategy: '0x734bb3251Ec3f1A83f8f2A8609bcEF649D54EbF8',
78
+ },
56
79
  [ChainId.CELO_SEPOLIA]: {
57
80
  // Oracles & Breakers
58
81
  BreakerBox: '0x578bD46003B9D3fd4c3C3f47c98B329562a6a1dE',
@@ -4,4 +4,6 @@ export var ChainId;
4
4
  ChainId[ChainId["CELO_SEPOLIA"] = 11142220] = "CELO_SEPOLIA";
5
5
  ChainId[ChainId["MONAD_TESTNET"] = 10143] = "MONAD_TESTNET";
6
6
  ChainId[ChainId["MONAD"] = 143] = "MONAD";
7
+ ChainId[ChainId["POLYGON_AMOY"] = 80002] = "POLYGON_AMOY";
8
+ ChainId[ChainId["BASE_SEPOLIA"] = 84532] = "BASE_SEPOLIA";
7
9
  })(ChainId || (ChainId = {}));
@@ -1,11 +1,16 @@
1
1
  import { RESERVE_ABI, RESERVE_V2_ABI, BIPOOL_MANAGER_ABI, ERC20_ABI } from '../../core/abis';
2
- import { getContractAddress, tryGetContractAddress, ChainId, RESERVE, BIPOOLMANAGER, } from '../../core/constants';
2
+ import { getContractAddress, tryGetContractAddress, ChainId, RESERVE, BIPOOLMANAGER } from '../../core/constants';
3
3
  import { retryOperation } from '../../utils';
4
4
  import { multicall } from '../../utils/multicall';
5
5
  /**
6
6
  * Chains that use ReserveV2 (v3) instead of the legacy Reserve contract.
7
7
  */
8
- const RESERVE_V2_CHAINS = new Set([ChainId.MONAD_TESTNET, ChainId.MONAD]);
8
+ const RESERVE_V2_CHAINS = new Set([
9
+ ChainId.MONAD_TESTNET,
10
+ ChainId.MONAD,
11
+ ChainId.POLYGON_AMOY,
12
+ ChainId.BASE_SEPOLIA,
13
+ ]);
9
14
  export class TokenService {
10
15
  constructor(publicClient, chainId) {
11
16
  this.publicClient = publicClient;
@@ -47,7 +52,7 @@ export class TokenService {
47
52
  if (missing.length === 0) {
48
53
  return results;
49
54
  }
50
- const multicallResults = await multicall(this.publicClient, missing.flatMap(({ address }) => ([
55
+ const multicallResults = await multicall(this.publicClient, missing.flatMap(({ address }) => [
51
56
  {
52
57
  address: address,
53
58
  abi: ERC20_ABI,
@@ -66,15 +71,13 @@ export class TokenService {
66
71
  functionName: 'decimals',
67
72
  args: [],
68
73
  },
69
- ])), { allowFailure: true });
74
+ ]), { allowFailure: true });
70
75
  const hydrated = await Promise.all(missing.map(async ({ address }, index) => {
71
76
  const resultOffset = index * 3;
72
77
  const name = multicallResults[resultOffset];
73
78
  const symbol = multicallResults[resultOffset + 1];
74
79
  const decimals = multicallResults[resultOffset + 2];
75
- if (name?.status === 'success' &&
76
- symbol?.status === 'success' &&
77
- decimals?.status === 'success') {
80
+ if (name?.status === 'success' && symbol?.status === 'success' && decimals?.status === 'success') {
78
81
  return {
79
82
  name: name.result,
80
83
  symbol: symbol.result,
@@ -1,4 +1,4 @@
1
- import { celo } from 'viem/chains';
1
+ import { celo, polygonAmoy, baseSepolia } from 'viem/chains';
2
2
  import { defineChain } from 'viem';
3
3
  import { ChainId } from '../core/constants/chainId';
4
4
  // Celo Sepolia chain definition (not available in viem/chains yet)
@@ -92,6 +92,10 @@ export function getDefaultRpcUrl(chainId) {
92
92
  return 'https://testnet-rpc.monad.xyz';
93
93
  case ChainId.MONAD:
94
94
  return 'https://rpc.monad.xyz';
95
+ case ChainId.POLYGON_AMOY:
96
+ return 'https://polygon-amoy.drpc.org';
97
+ case ChainId.BASE_SEPOLIA:
98
+ return 'https://base-sepolia.drpc.org';
95
99
  default:
96
100
  throw new Error(`Unsupported chain ID: ${chainId}`);
97
101
  }
@@ -112,6 +116,10 @@ export function getChainConfig(chainId) {
112
116
  return monadTestnet;
113
117
  case ChainId.MONAD:
114
118
  return monad;
119
+ case ChainId.POLYGON_AMOY:
120
+ return polygonAmoy;
121
+ case ChainId.BASE_SEPOLIA:
122
+ return baseSepolia;
115
123
  default:
116
124
  throw new Error(`Unsupported chain ID: ${chainId}`);
117
125
  }
@@ -8,7 +8,12 @@ const multicall_1 = require("../../utils/multicall");
8
8
  /**
9
9
  * Chains that use ReserveV2 (v3) instead of the legacy Reserve contract.
10
10
  */
11
- const RESERVE_V2_CHAINS = new Set([constants_1.ChainId.MONAD_TESTNET, constants_1.ChainId.MONAD]);
11
+ const RESERVE_V2_CHAINS = new Set([
12
+ constants_1.ChainId.MONAD_TESTNET,
13
+ constants_1.ChainId.MONAD,
14
+ constants_1.ChainId.POLYGON_AMOY,
15
+ constants_1.ChainId.BASE_SEPOLIA,
16
+ ]);
12
17
  class TokenService {
13
18
  constructor(publicClient, chainId) {
14
19
  this.publicClient = publicClient;
@@ -50,7 +55,7 @@ class TokenService {
50
55
  if (missing.length === 0) {
51
56
  return results;
52
57
  }
53
- const multicallResults = await (0, multicall_1.multicall)(this.publicClient, missing.flatMap(({ address }) => ([
58
+ const multicallResults = await (0, multicall_1.multicall)(this.publicClient, missing.flatMap(({ address }) => [
54
59
  {
55
60
  address: address,
56
61
  abi: abis_1.ERC20_ABI,
@@ -69,15 +74,13 @@ class TokenService {
69
74
  functionName: 'decimals',
70
75
  args: [],
71
76
  },
72
- ])), { allowFailure: true });
77
+ ]), { allowFailure: true });
73
78
  const hydrated = await Promise.all(missing.map(async ({ address }, index) => {
74
79
  const resultOffset = index * 3;
75
80
  const name = multicallResults[resultOffset];
76
81
  const symbol = multicallResults[resultOffset + 1];
77
82
  const decimals = multicallResults[resultOffset + 2];
78
- if (name?.status === 'success' &&
79
- symbol?.status === 'success' &&
80
- decimals?.status === 'success') {
83
+ if (name?.status === 'success' && symbol?.status === 'success' && decimals?.status === 'success') {
81
84
  return {
82
85
  name: name.result,
83
86
  symbol: symbol.result,
@@ -96,6 +96,10 @@ function getDefaultRpcUrl(chainId) {
96
96
  return 'https://testnet-rpc.monad.xyz';
97
97
  case chainId_1.ChainId.MONAD:
98
98
  return 'https://rpc.monad.xyz';
99
+ case chainId_1.ChainId.POLYGON_AMOY:
100
+ return 'https://polygon-amoy.drpc.org';
101
+ case chainId_1.ChainId.BASE_SEPOLIA:
102
+ return 'https://base-sepolia.drpc.org';
99
103
  default:
100
104
  throw new Error(`Unsupported chain ID: ${chainId}`);
101
105
  }
@@ -116,6 +120,10 @@ function getChainConfig(chainId) {
116
120
  return monadTestnet;
117
121
  case chainId_1.ChainId.MONAD:
118
122
  return monad;
123
+ case chainId_1.ChainId.POLYGON_AMOY:
124
+ return chains_1.polygonAmoy;
125
+ case chainId_1.ChainId.BASE_SEPOLIA:
126
+ return chains_1.baseSepolia;
119
127
  default:
120
128
  throw new Error(`Unsupported chain ID: ${chainId}`);
121
129
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mento-protocol/mento-sdk",
3
3
  "description": "Official SDK for interacting with the Mento Protocol",
4
- "version": "3.2.8",
4
+ "version": "3.3.0-beta.1",
5
5
  "license": "MIT",
6
6
  "author": "Mento Labs",
7
7
  "keywords": [