Skip to content

Commit d08d6d7

Browse files
committed
feat: swap arg order for token helpers
1 parent aa6872f commit d08d6d7

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@mento-protocol/mento-sdk",
33
"description": "Official SDK for interacting with the Mento Protocol",
4-
"version": "1.12.0",
4+
"version": "1.14.0",
55
"license": "MIT",
66
"author": "Mento Labs",
77
"keywords": [

scripts/cacheTokens/tokensIndexGenerator.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,26 +149,26 @@ ${tokenAddressesMapping}
149149
150150
/**
151151
* Helper function to get token address by symbol for a specific chain
152-
* @param chainId - The chain ID
153152
* @param symbol - The token symbol
153+
* @param chainId - The chain ID
154154
* @returns The token address or undefined if not found
155155
*/
156156
export function getTokenAddress(
157-
chainId: number,
158-
symbol: TokenSymbol
157+
symbol: TokenSymbol,
158+
chainId: number
159159
): string | undefined {
160160
return TOKEN_ADDRESSES_BY_CHAIN[chainId]?.[symbol]
161161
}
162162
163163
/**
164164
* Helper function to find a token by symbol in the cached tokens
165-
* @param chainId - The chain ID
166165
* @param symbol - The token symbol to search for
166+
* @param chainId - The chain ID
167167
* @returns The token object or undefined if not found
168168
*/
169169
export function findTokenBySymbol(
170-
chainId: number,
171-
symbol: string
170+
symbol: string,
171+
chainId: number
172172
): Token | undefined {
173173
const tokens = getCachedTokensSync(chainId)
174174
return tokens.find((token) => token.symbol === symbol)

src/constants/tokens.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -164,26 +164,26 @@ export const TOKEN_ADDRESSES_BY_CHAIN: {
164164

165165
/**
166166
* Helper function to get token address by symbol for a specific chain
167-
* @param chainId - The chain ID
168167
* @param symbol - The token symbol
168+
* @param chainId - The chain ID
169169
* @returns The token address or undefined if not found
170170
*/
171171
export function getTokenAddress(
172-
chainId: number,
173-
symbol: TokenSymbol
172+
symbol: TokenSymbol,
173+
chainId: number
174174
): string | undefined {
175175
return TOKEN_ADDRESSES_BY_CHAIN[chainId]?.[symbol]
176176
}
177177

178178
/**
179179
* Helper function to find a token by symbol in the cached tokens
180-
* @param chainId - The chain ID
181180
* @param symbol - The token symbol to search for
181+
* @param chainId - The chain ID
182182
* @returns The token object or undefined if not found
183183
*/
184184
export function findTokenBySymbol(
185-
chainId: number,
186-
symbol: string
185+
symbol: string,
186+
chainId: number
187187
): Token | undefined {
188188
const tokens = getCachedTokensSync(chainId)
189189
return tokens.find((token) => token.symbol === symbol)

0 commit comments

Comments
 (0)