Skip to content
Open
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
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@
"@argent/login": "^0.1.0-beta.4",
"@coinbase/wallet-sdk": "^4.0.3",
"@creit.tech/stellar-wallets-kit": "^1.9.5",
"@cryptorubic/core": "1.6.6",
"@cryptorubic/web3": "1.6.6",
"@cryptorubic/core": "1.7.0-alpha.clearswap.4",
"@cryptorubic/web3": "1.7.0-alpha.clearswap.4",
"@hakimio/ngx-google-analytics": "^15.0.0",
"@hinkal/common": "0.2.33",
"@maskito/angular": "^3.11.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,16 @@ export abstract class OnChainTrade<T = unknown> {

public readonly warnings: ErrorInterface[];

public readonly useProxy: boolean;

protected constructor(
apiResponse: QuoteResponseInterface,
protected readonly sdkLegacyService: SdkLegacyService,
private readonly rubicApiService: RubicApiService
) {
this.rubicId = apiResponse.id;
this.warnings = apiResponse.warnings;
this.useProxy = apiResponse.useRubicContract;
}

/**
Expand All @@ -138,9 +141,8 @@ export abstract class OnChainTrade<T = unknown> {
this.checkWalletConnected();
}

if (!isApprovableAdapter(this.chainAdapter)) {
return false;
}
if (!isApprovableAdapter(this.chainAdapter)) return false;
if (!this.spenderAddress) return false;

// Native coin in METIS can be Token required approve
if (this.from.isNative && this.from.blockchain !== BLOCKCHAIN_NAME.METIS) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import {
EvmTransactionConfig,
FailedToCheckForTransactionReceiptError,
parseError,
RubicSdkError,
SolanaAdapter
} from '@cryptorubic/web3';
import { SdkLegacyService } from '@app/core/services/sdk/sdk-legacy/sdk-legacy.service';
Expand Down Expand Up @@ -61,7 +60,7 @@ export abstract class SolanaOnChainTrade extends OnChainTrade {
};

protected get spenderAddress(): string {
throw new RubicSdkError('No spender address!');
return '';
}

protected override get chainAdapter(): SolanaAdapter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ import { OnChainTrade } from '../on-chain-trade';
import {
EvmBasicTransactionOptions,
FailedToCheckForTransactionReceiptError,
parseError,
RubicSdkError
parseError
} from '@cryptorubic/web3';
import { SdkLegacyService } from '@app/core/services/sdk/sdk-legacy/sdk-legacy.service';
import { RubicApiService } from '@app/core/services/sdk/sdk-legacy/rubic-api/rubic-api.service';
Expand Down Expand Up @@ -60,7 +59,7 @@ export abstract class StellarOnChainTrade extends OnChainTrade {
};

protected get spenderAddress(): string {
throw new RubicSdkError('No spender address!');
return '';
}

protected override get chainAdapter(): StellarAdapter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {
EvmBasicTransactionOptions,
FailedToCheckForTransactionReceiptError,
parseError,
RubicSdkError,
SuiAdapter
} from '@cryptorubic/web3';
import { SdkLegacyService } from '@app/core/services/sdk/sdk-legacy/sdk-legacy.service';
Expand Down Expand Up @@ -62,7 +61,7 @@ export abstract class SuiOnChainTrade extends OnChainTrade {
};

protected get spenderAddress(): string {
throw new RubicSdkError('No spender address!');
return '';
}

protected override get chainAdapter(): SuiAdapter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export abstract class TonOnChainTrade extends OnChainTrade {
private readonly apiResponse: QuoteResponseInterface | null = null;

protected get spenderAddress(): string {
throw new RubicSdkError('No spender address!');
return '';
}

protected override get chainAdapter(): TonAdapter {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ export class SolanaStandardAdapter
: undefined;
}

public async signTransaction(
tx: Transaction | VersionedTransaction
): Promise<Transaction | VersionedTransaction> {
public async signTransaction<T extends Transaction | VersionedTransaction>(tx: T): Promise<T> {
const account = this.wallet.accounts[0];

const serialized = tx.serialize({
Expand All @@ -44,10 +42,10 @@ export class SolanaStandardAdapter
});

if ('version' in tx && tx.version === 0) {
return VersionedTransaction.deserialize(signed.signedTransaction);
return VersionedTransaction.deserialize(signed.signedTransaction) as T;
}

return Transaction.from(signed.signedTransaction);
return Transaction.from(signed.signedTransaction) as T;
}

async signAllTransactions(_txs: Transaction[]): Promise<Transaction[]> {
Expand Down
5 changes: 5 additions & 0 deletions src/app/features/trade/constants/bridge-providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,11 @@ export const BRIDGE_PROVIDERS: Record<BridgeType, ProviderInfo> = {
image: `${imageBasePath}changenow.png`,
name: 'ChangeNOW'
},
clearswap_bridge: {
color: '#ffffff',
image: `assets/images/icons/providers/on-chain/clearswap.svg`,
name: 'Clearswap'
},
connext: {
averageTime: 5,
color: '#8e28fe',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ export const onChainBlacklistProviders: OnChainTradeType[] = [
...new Set([
...Object.values(onChainBlacklist)
.filter(providersPerChain => providersPerChain.length)
.flat(),
ON_CHAIN_TRADE_TYPE.CLEARSWAP
.flat()
])
];
16 changes: 8 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2426,18 +2426,18 @@
tweetnacl "^1.0.3"
tweetnacl-util "^0.15.1"

"@cryptorubic/core@1.6.6":
version "1.6.6"
resolved "https://registry.yarnpkg.com/@cryptorubic/core/-/core-1.6.6.tgz#5cc08b013ce556a7f3dd792e924d5d711fadbc51"
integrity sha512-6I+UysXgdXOrbOpfIwh4iDarGhKmfa79QjI6gtCLLaDxD++zozN4p6EiRMrva69Tj4bKlTAjPzXIXWB5WWmn2A==
"@cryptorubic/core@1.7.0-alpha.clearswap.4":
version "1.7.0-alpha.clearswap.4"
resolved "https://registry.yarnpkg.com/@cryptorubic/core/-/core-1.7.0-alpha.clearswap.4.tgz#bff055506da509572e80718ef7715223d89893f3"
integrity sha512-YHjvoaEbKxbyy55yGzTf+K4KYHwkIBG6iqLneFXLJ6/9hrzzrrgivlXvW5OA5F7v2jELO4glvM5K34v0L2bv4g==
dependencies:
bignumber.js "9.1.2"
tslib "*"

"@cryptorubic/web3@1.6.6":
version "1.6.6"
resolved "https://registry.yarnpkg.com/@cryptorubic/web3/-/web3-1.6.6.tgz#7d5d19ed62328ef092a91414b7b86a0c848e9043"
integrity sha512-kjifV9+SS2rUtYmm/9FjK/gUfrSqAiT4sLjtYTEWYcSVVTA+lheuwmWfopTJN6BFJmAznbAhVG+pnm2Em8ge2w==
"@cryptorubic/web3@1.7.0-alpha.clearswap.4":
version "1.7.0-alpha.clearswap.4"
resolved "https://registry.yarnpkg.com/@cryptorubic/web3/-/web3-1.7.0-alpha.clearswap.4.tgz#2ab3f4b554d0b8ed530dbb6301d104939df88ba5"
integrity sha512-rPdbgmY44hn/QXZuyyV95G2yR2GODiygZfAKlzY58y8Qu30fDAYWuy0khiju+X1teyJZj1uDCH6LSN/FOMzYeA==
dependencies:
"@ethersproject/bignumber" "^5.8.0"
"@mysten/sui" "^1.24.0"
Expand Down
Loading