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
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"access": "public"
},
"dependencies": {
"@dfx.swiss/react": "^1.3.0-beta.234",
"@dfx.swiss/react-components": "^1.3.0-beta.234",
"@dfx.swiss/react": "^1.3.0-beta.235",
"@dfx.swiss/react-components": "^1.3.0-beta.235",
"@ledgerhq/hw-app-btc": "^6.24.1",
"@ledgerhq/hw-app-eth": "^6.33.7",
"@ledgerhq/hw-transport-webhid": "^6.27.19",
Expand Down
2 changes: 1 addition & 1 deletion src/__tests__/api/swap-api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ describe('Swap Process - API Integration', () => {
}
});

test('should create swap payment info for ETH -> USDT', async () => {
test.skip('should create swap payment info for ETH -> USDT', async () => {
const eth = swappableAssets.find((a) => a.name === 'ETH' && EVM_BLOCKCHAINS.includes(a.blockchain));
const usdt = swappableAssets.find((a) => a.name === 'USDT' && EVM_BLOCKCHAINS.includes(a.blockchain));

Expand Down
3 changes: 3 additions & 0 deletions src/contexts/wallet.context.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export const WalletBlockchains: { [w in WalletType]?: Blockchain[] } = {
Blockchain.GNOSIS,
Blockchain.HAQQ,
Blockchain.BINANCE_SMART_CHAIN,
Blockchain.CITREA,
Blockchain.CITREA_TESTNET,
Blockchain.SEPOLIA,
],
Expand All @@ -72,6 +73,7 @@ export const WalletBlockchains: { [w in WalletType]?: Blockchain[] } = {
Blockchain.GNOSIS,
Blockchain.HAQQ,
Blockchain.BINANCE_SMART_CHAIN,
Blockchain.CITREA,
Blockchain.CITREA_TESTNET,
Blockchain.SEPOLIA,
],
Expand All @@ -89,6 +91,7 @@ export const WalletBlockchains: { [w in WalletType]?: Blockchain[] } = {
Blockchain.GNOSIS,
Blockchain.HAQQ,
Blockchain.BINANCE_SMART_CHAIN,
Blockchain.CITREA,
Blockchain.CITREA_TESTNET,
Blockchain.SEPOLIA,
],
Expand Down
4 changes: 4 additions & 0 deletions src/hooks/blockchain.hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export function useBlockchain(): BlockchainInterface {
[Blockchain.BASE]: 'Base · ERC-20 token',
[Blockchain.GNOSIS]: 'Gnosis · ERC-20 token',
[Blockchain.HAQQ]: 'Haqq · ERC-20 token',
[Blockchain.CITREA]: 'Citrea · ERC-20 token',
[Blockchain.CITREA_TESTNET]: 'Citrea Testnet · ERC-20 token',
},
protocols: {
Expand All @@ -44,6 +45,7 @@ export function useBlockchain(): BlockchainInterface {
[Blockchain.BASE]: Protocol.ERC_20,
[Blockchain.GNOSIS]: Protocol.ERC_20,
[Blockchain.HAQQ]: Protocol.ERC_20,
[Blockchain.CITREA]: Protocol.ERC_20,
[Blockchain.CITREA_TESTNET]: Protocol.ERC_20,
},
mainToken: {
Expand All @@ -56,6 +58,7 @@ export function useBlockchain(): BlockchainInterface {
[Blockchain.BASE]: 'ETH',
[Blockchain.GNOSIS]: 'xDAI',
[Blockchain.HAQQ]: 'ISLM',
[Blockchain.CITREA]: 'cBTC',
[Blockchain.CITREA_TESTNET]: 'cBTC',
},
stringValue: {
Expand All @@ -78,6 +81,7 @@ export function useBlockchain(): BlockchainInterface {
[Blockchain.SOLANA]: 'Solana',
[Blockchain.TRON]: 'Tron',
[Blockchain.SPARK]: 'Spark',
[Blockchain.CITREA]: 'Citrea',
[Blockchain.CITREA_TESTNET]: 'Citrea Testnet',
},
};
Expand Down
6 changes: 3 additions & 3 deletions src/hooks/safe.hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ import {
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
import { CustodyOrderType, OrderPaymentInfo } from 'src/dto/order.dto';
import { CustodyAsset, CustodyBalance, CustodyHistory, CustodyHistoryEntry } from 'src/dto/safe.dto';
import { OrderFormData } from './order.hook';
import { downloadPdfFromString } from 'src/util/utils';
import { OrderFormData } from './order.hook';

const DEPOSIT_PAIRS: Record<string, string> = {
EUR: 'dEURO',
Expand Down Expand Up @@ -104,7 +104,7 @@ export function useSafe(): UseSafeResult {
await reloadUser();
} else {
setCustodyAddress(custodyAddr.address);
setCustodyBlockchains([Blockchain.ETHEREUM]);
setCustodyBlockchains([Blockchain.ETHEREUM, Blockchain.CITREA]);
if (!tokenStore.get('custody') && session?.address !== custodyAddr.address) {
const custodyToken = (await changeUserAddress(custodyAddr.address)).accessToken;
tokenStore.set('custody', custodyToken);
Expand Down Expand Up @@ -144,7 +144,7 @@ export function useSafe(): UseSafeResult {
}, [currencies]);

const availableAssets = useMemo(() => {
return getAssets([Blockchain.ETHEREUM], { buyable: true, comingSoon: false }).filter((a) =>
return getAssets([Blockchain.ETHEREUM, Blockchain.CITREA], { buyable: true, comingSoon: false }).filter((a) =>
Object.values(DEPOSIT_PAIRS).includes(a.name),
);
}, [getAssets]);
Expand Down
18 changes: 16 additions & 2 deletions src/hooks/web3.hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ const chainIds: { [id: number]: Blockchain } = {
[8453]: Blockchain.BASE,
[100]: Blockchain.GNOSIS,
[11235]: Blockchain.HAQQ,
[4114]: Blockchain.CITREA,
[5115]: Blockchain.CITREA_TESTNET,
};

Expand Down Expand Up @@ -169,6 +170,19 @@ export function useWeb3(): Web3Interface {
blockExplorerUrls: ['https://sepolia.etherscan.io/'],
};

case Blockchain.CITREA:
return {
chainId,
chainName: 'Citrea',
nativeCurrency: {
name: 'Bitcoin',
symbol: 'cBTC',
decimals: 18,
},
rpcUrls: ['https://rpc.citreascan.com'],
blockExplorerUrls: ['https://citreascan.com/'],
};

case Blockchain.CITREA_TESTNET:
return {
chainId,
Expand All @@ -178,8 +192,8 @@ export function useWeb3(): Web3Interface {
symbol: 'cBTC',
decimals: 18,
},
rpcUrls: ['https://rpc.testnet.citrea.xyz'],
blockExplorerUrls: ['https://explorer.testnet.citrea.xyz/'],
rpcUrls: ['https://rpc.testnet.citreascan.com'],
blockExplorerUrls: ['https://testnet.citreascan.com/'],
};

default:
Expand Down
29 changes: 26 additions & 3 deletions src/wagmi.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,28 @@ import { walletConnect } from '@wagmi/connectors';
import { createConfig, http } from '@wagmi/core';
import { arbitrum, base, bsc, mainnet, optimism, polygon, type Chain } from '@wagmi/core/chains';

const citrea: Chain = {
id: 4114,
name: 'Citrea',
nativeCurrency: {
decimals: 18,
name: 'cBTC',
symbol: 'cBTC',
},
rpcUrls: {
default: {
http: ['https://rpc.citreascan.com'],
},
},
blockExplorers: {
default: {
name: 'Citrea Explorer',
url: 'https://citreascan.com',
},
},
testnet: false,
};

const citreaTestnet: Chain = {
id: 5115,
name: 'Citrea Testnet',
Expand All @@ -12,13 +34,13 @@ const citreaTestnet: Chain = {
},
rpcUrls: {
default: {
http: ['https://rpc.testnet.citrea.xyz'],
http: ['https://rpc.testnet.citreascan.com'],
},
},
blockExplorers: {
default: {
name: 'Citrea Explorer',
url: 'https://explorer.testnet.citrea.xyz',
url: 'https://testnet.citreascan.com',
},
},
testnet: true,
Expand All @@ -27,7 +49,7 @@ const citreaTestnet: Chain = {
export const WALLET_CONNECT_PROJECT_ID = '8c8a3a14d25438a1e1b8f4d91d8d2674';

export const config = createConfig({
chains: [mainnet, bsc, arbitrum, optimism, polygon, base, citreaTestnet],
chains: [mainnet, bsc, arbitrum, optimism, polygon, base, citrea, citreaTestnet],
connectors: [
walletConnect({
projectId: WALLET_CONNECT_PROJECT_ID,
Expand All @@ -47,6 +69,7 @@ export const config = createConfig({
[arbitrum.id]: http(),
[optimism.id]: http(),
[base.id]: http(),
[citrea.id]: http(),
[citreaTestnet.id]: http(),
},
});
Loading