Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- added: Add additional `approve` transaction for tokens that require allowances to be 0 before updating, like USDT on Ethereum
- changed: Support multiple pre transactions
- changed: Enable Zcash swaps on LetsExchange and ChangeNow using transparent addresses

## 2.38.0 (2025-11-03)

Expand Down
20 changes: 14 additions & 6 deletions src/swap/central/changenow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import {
SwapOrder
} from '../../util/swapHelpers'
import { convertRequest, getAddress, memoType } from '../../util/utils'
import { EdgeSwapRequestPlugin } from '../types'
import { EdgeSwapRequestPlugin, StringMap } from '../types'

const pluginId = 'changenow'

Expand All @@ -58,9 +58,11 @@ const uri = 'https://api.changenow.io/v2/'

const INVALID_CURRENCY_CODES: InvalidCurrencyCodes = {
from: {},
to: {
zcash: ['ZEC']
}
to: {}
}

const addressTypeMap: StringMap = {
zcash: 'transparentAddress'
}

/**
Expand Down Expand Up @@ -204,8 +206,14 @@ export function makeChangeNowPlugin(

// Grab addresses:
const [fromAddress, toAddress] = await Promise.all([
getAddress(request.fromWallet),
getAddress(request.toWallet)
getAddress(
request.fromWallet,
addressTypeMap[request.fromWallet.currencyInfo.pluginId]
),
getAddress(
request.toWallet,
addressTypeMap[request.toWallet.currencyInfo.pluginId]
)
])

const changenowCodes = await getChainAndTokenCodes(
Expand Down
20 changes: 15 additions & 5 deletions src/swap/central/letsexchange.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
SwapOrder
} from '../../util/swapHelpers'
import { convertRequest, getAddress, memoType } from '../../util/utils'
import { asNumberString, EdgeSwapRequestPlugin } from '../types'
import { asNumberString, EdgeSwapRequestPlugin, StringMap } from '../types'
import { asOptionalBlank } from './changenow'

const pluginId = 'letsexchange'
Expand Down Expand Up @@ -70,8 +70,12 @@ const asInfoReply = asObject({
amount: asNumberString
})
const INVALID_CURRENCY_CODES: InvalidCurrencyCodes = {
from: { zcash: ['ZEC'] },
to: { zcash: ['ZEC'] }
from: {},
to: {}
}

const addressTypeMap: StringMap = {
zcash: 'transparentAddress'
}

// See https://letsexchange.io/exchange-pairs for list of supported currencies
Expand Down Expand Up @@ -242,8 +246,14 @@ export function makeLetsExchangePlugin(

// Grab addresses:
const [fromAddress, toAddress] = await Promise.all([
getAddress(request.fromWallet),
getAddress(request.toWallet)
getAddress(
request.fromWallet,
addressTypeMap[request.fromWallet.currencyInfo.pluginId]
),
getAddress(
request.toWallet,
addressTypeMap[request.toWallet.currencyInfo.pluginId]
)
])

// HBAR support: Disable if the "to" wallet is not yet activated, pending
Expand Down
Loading