Skip to content

Commit ade1fc1

Browse files
authored
Merge pull request #3452 from DFXswiss/develop
Release: develop -> main
2 parents 47be0bd + db86884 commit ade1fc1

5 files changed

Lines changed: 42 additions & 15 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
module.exports = class AddEdgeWallet1773740800000 {
2+
name = 'AddEdgeWallet1773740800000';
3+
4+
async up(queryRunner) {
5+
await queryRunner.query(`
6+
IF NOT EXISTS (SELECT 1 FROM "dbo"."wallet" WHERE "name" = 'Edge')
7+
INSERT INTO "dbo"."wallet" (
8+
"name", "isKycClient", "amlRules", "autoTradeApproval",
9+
"mailConfig", "usesDummyAddresses", "displayFraudWarning", "buySpecificIbanEnabled"
10+
) VALUES (
11+
'Edge', 0, '0', 1,
12+
'BuyCrypto;BuyFiat;RefReward;Info', 0, 0, 0
13+
)
14+
`);
15+
}
16+
17+
async down(queryRunner) {
18+
await queryRunner.query(`DELETE FROM "dbo"."wallet" WHERE "name" = 'Edge'`);
19+
}
20+
};

src/integration/blockchain/shared/util/blockchain.util.ts

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,9 @@ export function txExplorerUrl(blockchain: Blockchain, txId: string): string | un
5151
const txPath = TxPaths[blockchain];
5252
if (!baseUrl || !txPath) return undefined;
5353

54-
// ICP token txIds have format "canisterId:blockIndex" — extract block index only
54+
// ICP token txIds have format "canisterId:blockIndex"
5555
if (blockchain === Blockchain.INTERNET_COMPUTER && txId.includes(':')) {
56-
const blockIndex = txId.split(':')[1];
57-
return `${baseUrl}/${txPath}/${blockIndex}`;
56+
return icpTokenTxUrl(baseUrl, txPath, txId);
5857
}
5958

6059
return `${baseUrl}/${txPath}/${txId}`;
@@ -73,6 +72,20 @@ export function addressExplorerUrl(blockchain: Blockchain, address: string): str
7372

7473
// --- HELPERS --- //
7574

75+
// ICP token canister ID to dashboard path mapping
76+
const IcpTokenDashboardPaths: Record<string, string> = {
77+
'mxzaz-hqaaa-aaaar-qaada-cai': 'bitcoin', // ckBTC
78+
};
79+
80+
function icpTokenTxUrl(baseUrl: string, txPath: string, txId: string): string | undefined {
81+
const [canisterId, blockIndex] = txId.split(':');
82+
83+
const tokenPath = IcpTokenDashboardPaths[canisterId];
84+
if (!tokenPath) return undefined;
85+
86+
return `${baseUrl}/${tokenPath}/${txPath}/${blockIndex}`;
87+
}
88+
7689
const BlockchainExplorerUrls: { [b in Blockchain]: string } = {
7790
[Blockchain.DEFICHAIN]: 'https://defiscan.live',
7891
[Blockchain.BITCOIN]: 'https://mempool.space',

src/shared/models/asset/dto/asset-dto.mapper.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ export class AssetDtoMapper {
2424
sellable: asset.sellable,
2525
instantBuyable: asset.instantBuyable,
2626
instantSellable: asset.instantSellable,
27-
cardBuyable: asset.cardBuyable,
28-
cardSellable: asset.cardSellable,
27+
cardBuyable: false,
28+
cardSellable: false,
2929
blockchain: asset.blockchain,
3030
sortOrder: asset.sortOrder,
3131
};

src/shared/models/fiat/dto/fiat-dto.mapper.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ export class FiatDtoMapper {
1313
name: fiat.name,
1414
buyable: fiat.buyable,
1515
sellable: fiat.sellable,
16-
cardBuyable: fiat.cardBuyable,
17-
cardSellable: fiat.cardSellable,
16+
cardBuyable: false,
17+
cardSellable: false,
1818
instantBuyable: fiat.instantBuyable,
1919
instantSellable: fiat.instantSellable,
2020
};
@@ -37,10 +37,7 @@ export class FiatDtoMapper {
3737
fiat.instantBuyable || fiat.instantSellable
3838
? this.convert(spec.minVolume, Config.tradingLimits.yearlyDefault, fiat)
3939
: this.zeroLimits,
40-
[FiatPaymentMethod.CARD]:
41-
fiat.cardBuyable || fiat.cardSellable
42-
? this.convert(spec.minVolume, Config.tradingLimits.cardDefault, fiat)
43-
: this.zeroLimits,
40+
[FiatPaymentMethod.CARD]: this.zeroLimits,
4441
},
4542
allowedIbanCountries,
4643
});

src/shared/services/payment-info.service.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,7 @@ export class PaymentInfoService {
4848
throw this.createError('Asset blockchain mismatch', QuoteError.ASSET_UNSUPPORTED, forQuote);
4949

5050
if ('paymentMethod' in dto && dto.paymentMethod === FiatPaymentMethod.CARD) {
51-
if (!dto.currency.cardSellable)
52-
throw this.createError('Currency not sellable via Card', QuoteError.CURRENCY_UNSUPPORTED, forQuote);
53-
if (!dto.asset.cardBuyable)
54-
throw this.createError('Asset not buyable via Card', QuoteError.ASSET_UNSUPPORTED, forQuote);
51+
throw this.createError('Card payments are not supported', QuoteError.PAYMENT_METHOD_NOT_ALLOWED, forQuote);
5552
} else if ('paymentMethod' in dto && dto.paymentMethod === FiatPaymentMethod.INSTANT) {
5653
if (!dto.currency.instantSellable)
5754
throw this.createError('Currency not sellable via Instant', QuoteError.CURRENCY_UNSUPPORTED, forQuote);

0 commit comments

Comments
 (0)