Skip to content

Commit

Permalink
Merge pull request #168 from peanutprotocol/feat/update-squid-interfaces
Browse files Browse the repository at this point in the history
[TASK-7014] feat: update squid interfaces
  • Loading branch information
Hugo0 authored Nov 20, 2024
2 parents e7ee437 + 282b406 commit f2292c9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/consts/interfaces.consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -243,11 +243,14 @@ export interface ISquidChain {
}

export interface ISquidToken {
active: boolean
chainId: string
address: string
decimals: number
name: string
symbol: string
logoURI: string
usdPrice: number
}

export interface ICreateClaimXChainPayload {
Expand Down
11 changes: 9 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2199,7 +2199,11 @@ async function getXChainOptionsForLink({
sourceChainId,
tokenType,
}: interfaces.IGetCrossChainOptionsForLinkParams): Promise<
Array<interfaces.ISquidChain & { tokens: interfaces.ISquidToken[] }>
Array<
interfaces.ISquidChain & {
tokens: Pick<interfaces.ISquidToken, 'chainId' | 'address' | 'name' | 'symbol' | 'logoURI'>[]
}
>
> {
if (tokenType > 1) {
throw new interfaces.SDKStatus(
Expand All @@ -2221,7 +2225,10 @@ async function getXChainOptionsForLink({

const supportedTokens = await getSquidTokens({ isTestnet })

const supportedTokensMap = new Map<string, interfaces.ISquidToken[]>()
const supportedTokensMap = new Map<
string,
Pick<interfaces.ISquidToken, 'chainId' | 'address' | 'name' | 'symbol' | 'logoURI'>[]
>()

supportedTokens.forEach(({ chainId, address, name, symbol, logoURI }) => {
if (!supportedTokensMap.has(chainId)) {
Expand Down

0 comments on commit f2292c9

Please sign in to comment.