@mento-protocol/mento-sdk 1.12.0 → 1.13.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/README.md CHANGED
@@ -16,19 +16,16 @@ yarn add @mento-protocol/mento-sdk
16
16
 
17
17
  You can find example usages of the SDK in the [mento-sdk-examples](https://github.com/mento-protocol/mento-sdk-examples) repository. For in-depth documentation and walk through explanations please see the [SDK section](https://docs.mento.org/mento/developers/mento-sdk) of the Mento docs.
18
18
 
19
- ## Tradable Pairs Cache
19
+ ## Tokens & Tradable Pairs Cache
20
20
 
21
- Anytime we launch a new stable token, we need to update the tradable pairs cache.
21
+ Anytime we launch a new stable token, we need to update the tokens & tradable pairs caches.
22
22
 
23
- The `yarn cacheTradablePairs` script generates a TypeScript file containing a list of all tradable pairs on the Mento protocol. This file is used to cache the tradable pairs in the SDK and avoid costly re-fetching from the network.
24
-
25
- ```sh
26
- yarn cacheTradablePairs
27
- ```
23
+ - The `yarn cacheTokens` script generates a TypeScript file containing a list of all tradable Tokens on the Mento protocol. This cache can be used by UIs to avoid costly async token data lookups.
24
+ - The `yarn cacheTradablePairs` script generates a TypeScript file containing a list of all tradable pairs on the Mento protocol. This file is used to cache the tradable pairs in the SDK and avoid costly re-fetching from the network.
28
25
 
29
26
  ## Token Graph Visualization
30
27
 
31
- Current token connectivity on Celo Mainnet (last updated: 2025-09-19):
28
+ Current token connectivity on Celo Mainnet (last updated: 2025-10-02):
32
29
 
33
30
  ```mermaid
34
31
  graph TD
@@ -52,7 +49,6 @@ graph TD
52
49
  cNGN --- cUSD
53
50
  cKES --- cUSD
54
51
  cUSD --- eXOF
55
-
56
52
  ```
57
53
 
58
54
  **Network Stats:** 20 tokens, 19 direct trading pairs
@@ -1,3 +1,4 @@
1
1
  export * from './addresses';
2
2
  export * from './currencies';
3
+ export * from './tokens';
3
4
  export * from './tradablePairs';
@@ -16,4 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./addresses"), exports);
18
18
  __exportStar(require("./currencies"), exports);
19
+ __exportStar(require("./tokens"), exports);
19
20
  __exportStar(require("./tradablePairs"), exports);
@@ -0,0 +1,2 @@
1
+ import { Token } from '../mento';
2
+ export declare const tokens11142220: readonly Token[];
@@ -0,0 +1,127 @@
1
+ "use strict";
2
+ // This file is auto-generated. Do not edit manually.
3
+ // Generated on 2025-10-02T13:52:20.427Z
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.tokens11142220 = void 0;
6
+ exports.tokens11142220 = [
7
+ {
8
+ "address": "0x9883d788d40F1C7595a780ed881Ea833C7743B4B",
9
+ "symbol": "axlEUROC",
10
+ "name": "Mento Mock axlEUROC",
11
+ "decimals": 18
12
+ },
13
+ {
14
+ "address": "0x6285De9DA7C1d329C0451628638908915002d9d1",
15
+ "symbol": "axlUSDC",
16
+ "name": "Mento Mock axlUSDC",
17
+ "decimals": 18
18
+ },
19
+ {
20
+ "address": "0x5873Faeb42F3563dcD77F0fbbdA818E6d6DA3139",
21
+ "symbol": "cAUD",
22
+ "name": "Celo Australian Dollar",
23
+ "decimals": 18
24
+ },
25
+ {
26
+ "address": "0xF151c9a13b78C84f93f50B8b3bC689fedc134F60",
27
+ "symbol": "cCAD",
28
+ "name": "Celo Canadian Dollar",
29
+ "decimals": 18
30
+ },
31
+ {
32
+ "address": "0x284E9b7B623eAE866914b7FA0eB720C2Bb3C2980",
33
+ "symbol": "cCHF",
34
+ "name": "Celo Swiss Franc",
35
+ "decimals": 18
36
+ },
37
+ {
38
+ "address": "0x5F8d55c3627d2dc0a2B4afa798f877242F382F67",
39
+ "symbol": "cCOP",
40
+ "name": "Celo Colombian Peso",
41
+ "decimals": 18
42
+ },
43
+ {
44
+ "address": "0x471EcE3750Da237f93B8E339c536989b8978a438",
45
+ "symbol": "CELO",
46
+ "name": "Celo native asset",
47
+ "decimals": 18
48
+ },
49
+ {
50
+ "address": "0xA99dC247d6b7B2E3ab48a1fEE101b83cD6aCd82a",
51
+ "symbol": "cEUR",
52
+ "name": "Celo Euro",
53
+ "decimals": 18
54
+ },
55
+ {
56
+ "address": "0x85F5181Abdbf0e1814Fc4358582Ae07b8eBA3aF3",
57
+ "symbol": "cGBP",
58
+ "name": "Celo British Pound",
59
+ "decimals": 18
60
+ },
61
+ {
62
+ "address": "0x5e94B8C872bD47BC4255E60ECBF44D5E66e7401C",
63
+ "symbol": "cGHS",
64
+ "name": "Celo Ghanaian Cedi",
65
+ "decimals": 18
66
+ },
67
+ {
68
+ "address": "0x85Bee67D435A39f7467a8a9DE34a5B73D25Df426",
69
+ "symbol": "cJPY",
70
+ "name": "Celo Japanese Yen",
71
+ "decimals": 18
72
+ },
73
+ {
74
+ "address": "0xC7e4635651E3e3Af82b61d3E23c159438daE3BbF",
75
+ "symbol": "cKES",
76
+ "name": "Celo Kenyan Shilling",
77
+ "decimals": 18
78
+ },
79
+ {
80
+ "address": "0x3d5ae86F34E2a82771496D140daFAEf3789dF888",
81
+ "symbol": "cNGN",
82
+ "name": "Celo Nigerian Naira",
83
+ "decimals": 18
84
+ },
85
+ {
86
+ "address": "0x2294298942fdc79417DE9E0D740A4957E0e7783a",
87
+ "symbol": "cREAL",
88
+ "name": "Celo Brazilian Real",
89
+ "decimals": 18
90
+ },
91
+ {
92
+ "address": "0xdE9e4C3ce781b4bA68120d6261cbad65ce0aB00b",
93
+ "symbol": "cUSD",
94
+ "name": "Celo Dollar",
95
+ "decimals": 18
96
+ },
97
+ {
98
+ "address": "0x10CCfB235b0E1Ed394bACE4560C3ed016697687e",
99
+ "symbol": "cZAR",
100
+ "name": "Celo South African Rand",
101
+ "decimals": 18
102
+ },
103
+ {
104
+ "address": "0x5505b70207aE3B826c1A7607F19F3Bf73444A082",
105
+ "symbol": "eXOF",
106
+ "name": "ECO CFA",
107
+ "decimals": 18
108
+ },
109
+ {
110
+ "address": "0x0352976d940a2C3FBa0C3623198947Ee1d17869E",
111
+ "symbol": "PUSO",
112
+ "name": "PUSO",
113
+ "decimals": 18
114
+ },
115
+ {
116
+ "address": "0xBD63e46Be8eF8D89dFde3054E7b9ECAEb8Ad83e9",
117
+ "symbol": "USDC",
118
+ "name": "Mento Mock USDC",
119
+ "decimals": 18
120
+ },
121
+ {
122
+ "address": "0xCA53d9b72646B254d29EBeEb4c5cde7BB4bb59e0",
123
+ "symbol": "USDT",
124
+ "name": "Mento Mock USDT",
125
+ "decimals": 18
126
+ }
127
+ ];
@@ -0,0 +1,2 @@
1
+ import { Token } from '../mento';
2
+ export declare const tokens42220: readonly Token[];
@@ -0,0 +1,127 @@
1
+ "use strict";
2
+ // This file is auto-generated. Do not edit manually.
3
+ // Generated on 2025-10-02T13:54:27.948Z
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.tokens42220 = void 0;
6
+ exports.tokens42220 = [
7
+ {
8
+ "address": "0x061cc5a2C863E0C1Cb404006D559dB18A34C762d",
9
+ "symbol": "axlEUROC",
10
+ "name": "Axelar Wrapped EUROC",
11
+ "decimals": 6
12
+ },
13
+ {
14
+ "address": "0xEB466342C4d449BC9f53A865D5Cb90586f405215",
15
+ "symbol": "axlUSDC",
16
+ "name": "Axelar Wrapped USDC",
17
+ "decimals": 6
18
+ },
19
+ {
20
+ "address": "0x7175504C455076F15c04A2F90a8e352281F492F9",
21
+ "symbol": "cAUD",
22
+ "name": "Celo Australian Dollar",
23
+ "decimals": 18
24
+ },
25
+ {
26
+ "address": "0xff4Ab19391af240c311c54200a492233052B6325",
27
+ "symbol": "cCAD",
28
+ "name": "Celo Canadian Dollar",
29
+ "decimals": 18
30
+ },
31
+ {
32
+ "address": "0xb55a79F398E759E43C95b979163f30eC87Ee131D",
33
+ "symbol": "cCHF",
34
+ "name": "Celo Swiss Franc",
35
+ "decimals": 18
36
+ },
37
+ {
38
+ "address": "0x8A567e2aE79CA692Bd748aB832081C45de4041eA",
39
+ "symbol": "cCOP",
40
+ "name": "Celo Colombian Peso",
41
+ "decimals": 18
42
+ },
43
+ {
44
+ "address": "0x471EcE3750Da237f93B8E339c536989b8978a438",
45
+ "symbol": "CELO",
46
+ "name": "Celo native asset",
47
+ "decimals": 18
48
+ },
49
+ {
50
+ "address": "0xD8763CBa276a3738E6DE85b4b3bF5FDed6D6cA73",
51
+ "symbol": "cEUR",
52
+ "name": "Celo Euro",
53
+ "decimals": 18
54
+ },
55
+ {
56
+ "address": "0xCCF663b1fF11028f0b19058d0f7B674004a40746",
57
+ "symbol": "cGBP",
58
+ "name": "Celo British Pound",
59
+ "decimals": 18
60
+ },
61
+ {
62
+ "address": "0xfAeA5F3404bbA20D3cc2f8C4B0A888F55a3c7313",
63
+ "symbol": "cGHS",
64
+ "name": "Celo Ghanaian Cedi",
65
+ "decimals": 18
66
+ },
67
+ {
68
+ "address": "0xc45eCF20f3CD864B32D9794d6f76814aE8892e20",
69
+ "symbol": "cJPY",
70
+ "name": "Celo Japanese Yen",
71
+ "decimals": 18
72
+ },
73
+ {
74
+ "address": "0x456a3D042C0DbD3db53D5489e98dFb038553B0d0",
75
+ "symbol": "cKES",
76
+ "name": "Celo Kenyan Shilling",
77
+ "decimals": 18
78
+ },
79
+ {
80
+ "address": "0xE2702Bd97ee33c88c8f6f92DA3B733608aa76F71",
81
+ "symbol": "cNGN",
82
+ "name": "Celo Nigerian Naira",
83
+ "decimals": 18
84
+ },
85
+ {
86
+ "address": "0xe8537a3d056DA446677B9E9d6c5dB704EaAb4787",
87
+ "symbol": "cREAL",
88
+ "name": "Celo Brazilian Real",
89
+ "decimals": 18
90
+ },
91
+ {
92
+ "address": "0x765DE816845861e75A25fCA122bb6898B8B1282a",
93
+ "symbol": "cUSD",
94
+ "name": "Celo Dollar",
95
+ "decimals": 18
96
+ },
97
+ {
98
+ "address": "0x4c35853A3B4e647fD266f4de678dCc8fEC410BF6",
99
+ "symbol": "cZAR",
100
+ "name": "Celo South African Rand",
101
+ "decimals": 18
102
+ },
103
+ {
104
+ "address": "0x73F93dcc49cB8A239e2032663e9475dd5ef29A08",
105
+ "symbol": "eXOF",
106
+ "name": "ECO CFA",
107
+ "decimals": 18
108
+ },
109
+ {
110
+ "address": "0x105d4A9306D2E55a71d2Eb95B81553AE1dC20d7B",
111
+ "symbol": "PUSO",
112
+ "name": "PUSO",
113
+ "decimals": 18
114
+ },
115
+ {
116
+ "address": "0x48065fbBE25f71C9282ddf5e1cD6D6A887483D5e",
117
+ "symbol": "USD₮",
118
+ "name": "Tether USD",
119
+ "decimals": 6
120
+ },
121
+ {
122
+ "address": "0xcebA9300f2b948710d2653dD7B07f33A8B32118C",
123
+ "symbol": "USDC",
124
+ "name": "USDC",
125
+ "decimals": 6
126
+ }
127
+ ];
@@ -0,0 +1,2 @@
1
+ import { Token } from '../mento';
2
+ export declare const tokens44787: readonly Token[];
@@ -0,0 +1,127 @@
1
+ "use strict";
2
+ // This file is auto-generated. Do not edit manually.
3
+ // Generated on 2025-10-02T13:54:36.998Z
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.tokens44787 = void 0;
6
+ exports.tokens44787 = [
7
+ {
8
+ "address": "0x6e673502c5b55F3169657C004e5797fFE5be6653",
9
+ "symbol": "BridgedEUROC",
10
+ "name": "mockBridgedEUROC",
11
+ "decimals": 6
12
+ },
13
+ {
14
+ "address": "0x87D61dA3d668797786D73BC674F053f87111570d",
15
+ "symbol": "BridgedUSDC",
16
+ "name": "mockBridgedUSDC",
17
+ "decimals": 6
18
+ },
19
+ {
20
+ "address": "0x84CBD49F5aE07632B6B88094E81Cce8236125Fe0",
21
+ "symbol": "cAUD",
22
+ "name": "Celo Australian Dollar",
23
+ "decimals": 18
24
+ },
25
+ {
26
+ "address": "0x02EC9E0D2Fd73e89168C1709e542a48f58d7B133",
27
+ "symbol": "cCAD",
28
+ "name": "Celo Canadian Dollar",
29
+ "decimals": 18
30
+ },
31
+ {
32
+ "address": "0xADC57C2C34aD021Df4421230a6532F4e2E1dCE4F",
33
+ "symbol": "cCHF",
34
+ "name": "Celo Swiss Franc",
35
+ "decimals": 18
36
+ },
37
+ {
38
+ "address": "0xe6A57340f0df6E020c1c0a80bC6E13048601f0d4",
39
+ "symbol": "cCOP",
40
+ "name": "Celo Colombian Peso",
41
+ "decimals": 18
42
+ },
43
+ {
44
+ "address": "0xF194afDf50B03e69Bd7D057c1Aa9e10c9954E4C9",
45
+ "symbol": "CELO",
46
+ "name": "Celo native asset",
47
+ "decimals": 18
48
+ },
49
+ {
50
+ "address": "0x10c892A6EC43a53E45D0B916B4b7D383B1b78C0F",
51
+ "symbol": "cEUR",
52
+ "name": "Celo Euro",
53
+ "decimals": 18
54
+ },
55
+ {
56
+ "address": "0x47f2Fb88105155a18c390641C8a73f1402B2BB12",
57
+ "symbol": "cGBP",
58
+ "name": "Celo British Pound",
59
+ "decimals": 18
60
+ },
61
+ {
62
+ "address": "0x295B66bE7714458Af45E6A6Ea142A5358A6cA375",
63
+ "symbol": "cGHS",
64
+ "name": "cGHS",
65
+ "decimals": 18
66
+ },
67
+ {
68
+ "address": "0x2E51F41238cA36a421C9B8b3e189e8Cc7653FE67",
69
+ "symbol": "cJPY",
70
+ "name": "Celo Japanese Yen",
71
+ "decimals": 18
72
+ },
73
+ {
74
+ "address": "0x1E0433C1769271ECcF4CFF9FDdD515eefE6CdF92",
75
+ "symbol": "cKES",
76
+ "name": "Celo Kenyan Shilling",
77
+ "decimals": 18
78
+ },
79
+ {
80
+ "address": "0x4a5b03B8b16122D330306c65e4CA4BC5Dd6511d0",
81
+ "symbol": "cNGN",
82
+ "name": "Celo Nigerian Naira",
83
+ "decimals": 18
84
+ },
85
+ {
86
+ "address": "0xE4D517785D091D3c54818832dB6094bcc2744545",
87
+ "symbol": "cREAL",
88
+ "name": "Celo Brazilian Real",
89
+ "decimals": 18
90
+ },
91
+ {
92
+ "address": "0x874069Fa1Eb16D44d622F2e0Ca25eeA172369bC1",
93
+ "symbol": "cUSD",
94
+ "name": "Celo Dollar",
95
+ "decimals": 18
96
+ },
97
+ {
98
+ "address": "0x1e5b44015Ff90610b54000DAad31C89b3284df4d",
99
+ "symbol": "cZAR",
100
+ "name": "Celo South African Rand",
101
+ "decimals": 18
102
+ },
103
+ {
104
+ "address": "0xB0FA15e002516d0301884059c0aaC0F0C72b019D",
105
+ "symbol": "eXOF",
106
+ "name": "ECO CFA",
107
+ "decimals": 18
108
+ },
109
+ {
110
+ "address": "0x5E0E3c9419C42a1B04e2525991FB1A2C467AB8bF",
111
+ "symbol": "PUSO",
112
+ "name": "PUSO",
113
+ "decimals": 18
114
+ },
115
+ {
116
+ "address": "0x2F25deB3848C207fc8E0c34035B3Ba7fC157602B",
117
+ "symbol": "USDC",
118
+ "name": "USDC",
119
+ "decimals": 6
120
+ },
121
+ {
122
+ "address": "0xBba91F588d031469ABCCA566FE80fB1Ad8Ee3287",
123
+ "symbol": "USDT",
124
+ "name": "mockNativeUSDT",
125
+ "decimals": 6
126
+ }
127
+ ];
@@ -0,0 +1,67 @@
1
+ import { Token } from '../mento';
2
+ /**
3
+ * Gets cached tokens for a specific chain ID
4
+ * @param chainId - The chain ID to get cached tokens for
5
+ * @returns Promise resolving to the cached tokens or undefined if not available
6
+ */
7
+ export declare function getCachedTokens(chainId: number): Promise<readonly Token[] | undefined>;
8
+ /**
9
+ * Synchronously gets cached tokens for a specific chain ID
10
+ * Note: This function throws if no cached tokens are available.
11
+ * Use getCachedTokens() for async loading or when you want to handle missing cache gracefully.
12
+ *
13
+ * @param chainId - The chain ID to get cached tokens for
14
+ * @returns The cached tokens
15
+ * @throws Error if no cached tokens are available for the chain
16
+ */
17
+ export declare function getCachedTokensSync(chainId: number): readonly Token[];
18
+ /**
19
+ * Type-safe token symbols available across all chains
20
+ * Note: Not all tokens are available on all chains - check TOKEN_ADDRESSES_BY_CHAIN
21
+ */
22
+ export declare enum TokenSymbol {
23
+ BridgedEUROC = "BridgedEUROC",
24
+ BridgedUSDC = "BridgedUSDC",
25
+ CELO = "CELO",
26
+ PUSO = "PUSO",
27
+ USDC = "USDC",
28
+ USDT = "USDT",
29
+ USD_ = "USD\u20AE",
30
+ axlEUROC = "axlEUROC",
31
+ axlUSDC = "axlUSDC",
32
+ cAUD = "cAUD",
33
+ cCAD = "cCAD",
34
+ cCHF = "cCHF",
35
+ cCOP = "cCOP",
36
+ cEUR = "cEUR",
37
+ cGBP = "cGBP",
38
+ cGHS = "cGHS",
39
+ cJPY = "cJPY",
40
+ cKES = "cKES",
41
+ cNGN = "cNGN",
42
+ cREAL = "cREAL",
43
+ cUSD = "cUSD",
44
+ cZAR = "cZAR",
45
+ eXOF = "eXOF"
46
+ }
47
+ /**
48
+ * Token addresses mapped by chain ID and symbol
49
+ * Use this for type-safe token address lookups
50
+ */
51
+ export declare const TOKEN_ADDRESSES_BY_CHAIN: {
52
+ [chainId: number]: Partial<Record<TokenSymbol, string>>;
53
+ };
54
+ /**
55
+ * Helper function to get token address by symbol for a specific chain
56
+ * @param chainId - The chain ID
57
+ * @param symbol - The token symbol
58
+ * @returns The token address or undefined if not found
59
+ */
60
+ export declare function getTokenAddress(chainId: number, symbol: TokenSymbol): string | undefined;
61
+ /**
62
+ * Helper function to find a token by symbol in the cached tokens
63
+ * @param chainId - The chain ID
64
+ * @param symbol - The token symbol to search for
65
+ * @returns The token object or undefined if not found
66
+ */
67
+ export declare function findTokenBySymbol(chainId: number, symbol: string): Token | undefined;