Skip to content

Commit

Permalink
Merge pull request #110 from CityOfZion/CU-86a5au9aq-1
Browse files Browse the repository at this point in the history
CU-86a5au9aq-Swap Lib - Initial Research, Planning and Implementation
  • Loading branch information
thiagocbalducci authored Nov 5, 2024
2 parents b3d4eb5 + 6f92fda commit 7e341bf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@cityofzion/bs-swap",
"comment": "Fix find in available token",
"type": "patch"
}
],
"packageName": "@cityofzion/bs-swap"
}
4 changes: 2 additions & 2 deletions packages/bs-swap/src/services/SimpleSwapService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ export class SimpleSwapService<BSName extends string = string> implements SwapSe
let simpleSwapCurrency: SimpleSwapApiCurrency<BSName> | null = null

if (token) {
simpleSwapCurrency = this.#availableTokensToUse.value.find(item => item.symbol === token.symbol) ?? null
simpleSwapCurrency = this.#availableTokensToUse.value.find(item => item.id === token.id) ?? null
if (!simpleSwapCurrency) throw new Error('You are trying to use a token that is not available')
}

Expand Down Expand Up @@ -234,7 +234,7 @@ export class SimpleSwapService<BSName extends string = string> implements SwapSe
let simpleSwapCurrency: SimpleSwapApiCurrency<BSName> | null = null

if (token) {
simpleSwapCurrency = this.#availableTokensToReceive.value.find(item => item.symbol === token.symbol) ?? null
simpleSwapCurrency = this.#availableTokensToReceive.value.find(item => item.id === token.id) ?? null
if (!simpleSwapCurrency) throw new Error('You are trying to use a token that is not available')
}

Expand Down

0 comments on commit 7e341bf

Please sign in to comment.