From 96b9e6684130b3e9bddecbc48c275f1150d98f86 Mon Sep 17 00:00:00 2001
From: Roza Eisenberg <45665959+rozanagy@users.noreply.github.com>
Date: Tue, 5 Nov 2024 11:01:25 +0100
Subject: [PATCH 01/12] fix: adjust height of points box and fix decimal format
(#206)
* fix: adjust height of points box and fix decimal format
---
.../components/points-table/components/points-table-item.tsx | 4 ++--
.../points/components/points-table/points-table.tsx | 2 +-
src/app/components/points/points.tsx | 4 ++--
src/shared/utils.ts | 4 ++++
4 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/app/components/points/components/points-table/components/points-table-item.tsx b/src/app/components/points/components/points-table/components/points-table-item.tsx
index da067c3d..e6a05407 100644
--- a/src/app/components/points/components/points-table/components/points-table-item.tsx
+++ b/src/app/components/points/components/points-table/components/points-table-item.tsx
@@ -3,7 +3,7 @@ import { CustomSkeleton } from '@components/custom-skeleton/custom-skeleton';
import { ProtocolRewards } from '@models/points.models';
import { unshiftValue } from 'dlc-btc-lib/utilities';
-import { formatNumber } from '@shared/utils';
+import { formatNumber, formatToFourDecimals } from '@shared/utils';
export function PointsTableItem(pointsTableItem: ProtocolRewards): React.JSX.Element {
const isMobile = useBreakpointValue({ base: true, md: false });
@@ -49,7 +49,7 @@ export function PointsTableItem(pointsTableItem: ProtocolRewards): React.JSX.Ele
- {unshiftValue(currentTokens)}
+ {formatToFourDecimals(unshiftValue(currentTokens))}
diff --git a/src/app/components/points/components/points-table/points-table.tsx b/src/app/components/points/components/points-table/points-table.tsx
index f6aa7a2c..e26a52da 100644
--- a/src/app/components/points/components/points-table/points-table.tsx
+++ b/src/app/components/points/components/points-table/points-table.tsx
@@ -11,7 +11,7 @@ interface PointsTableProps {
}
export function PointsTable({ items }: PointsTableProps): React.JSX.Element {
- const dynamicHeight = items ? items.length * 59 + 20 : 20;
+ const dynamicHeight = items ? items.length * 59 + 50 : 20;
const isMobile = useBreakpointValue({ base: true, md: false });
return (
diff --git a/src/app/components/points/points.tsx b/src/app/components/points/points.tsx
index dacd3040..30ada3e0 100644
--- a/src/app/components/points/points.tsx
+++ b/src/app/components/points/points.tsx
@@ -70,7 +70,7 @@ export function Points(): React.JSX.Element {
diff --git a/src/shared/utils.ts b/src/shared/utils.ts
index bdf6bdc2..53f98c03 100644
--- a/src/shared/utils.ts
+++ b/src/shared/utils.ts
@@ -51,5 +51,9 @@ export function formatEvent(event: DetailedEvent): FormattedEvent {
};
}
+export function formatToFourDecimals(value: number): number {
+ return parseFloat(value.toFixed(4));
+}
+
export const breakpoints = ['300px', '400px', '600px', '850px', '1280px', '1400px'];
export const titleTextSize = ['2xl', '2xl', '4xl', '6xl'];
From ad95f39b62a157268352cb3f22809718d974f60d Mon Sep 17 00:00:00 2001
From: Roza Eisenberg <45665959+rozanagy@users.noreply.github.com>
Date: Thu, 7 Nov 2024 13:35:37 +0100
Subject: [PATCH 02/12] Feat/updated pagination (#209)
* feat: add pagination to protocol history table
---
.../protocol-history-table.tsx | 88 +++++++++++++------
1 file changed, 63 insertions(+), 25 deletions(-)
diff --git a/src/app/components/protocol-history-table/protocol-history-table.tsx b/src/app/components/protocol-history-table/protocol-history-table.tsx
index d7ea3638..687d6b2e 100644
--- a/src/app/components/protocol-history-table/protocol-history-table.tsx
+++ b/src/app/components/protocol-history-table/protocol-history-table.tsx
@@ -1,4 +1,6 @@
-import { Skeleton, useBreakpointValue } from '@chakra-ui/react';
+import { useState } from 'react';
+
+import { Button, HStack, Skeleton, Spacer, VStack, useBreakpointValue } from '@chakra-ui/react';
import { GenericTableBody } from '@components/generic-table/components/generic-table-body';
import { GenericTableHeader } from '@components/generic-table/components/generic-table-header';
import { GenericTableHeaderText } from '@components/generic-table/components/generic-table-header-text';
@@ -10,32 +12,68 @@ interface ProtocolHistoryTableProps {
}
export function ProtocolHistoryTable({ items }: ProtocolHistoryTableProps): React.JSX.Element {
- const dynamicHeight = items ? items.length * 59 + 20 : 20;
+ const [currentPage, setCurrentPage] = useState(1);
+ const itemsPerPage = 10;
const isMobile = useBreakpointValue({ base: true, md: false });
+ const totalPages = Math.ceil((items?.length || 0) / itemsPerPage);
+
+ const currentItems = items?.slice((currentPage - 1) * itemsPerPage, currentPage * itemsPerPage);
+
+ const handlePageChange = (direction: number) => {
+ setCurrentPage(prevPage => {
+ const newPage = prevPage + direction;
+ if (newPage < 1 || newPage > totalPages) return prevPage;
+ return newPage;
+ });
+ };
+
return (
-
-
- {isMobile ? (
- <>
- Order Book
- Transaction
- >
- ) : (
- <>
- Order Book
- Merchant
- Chain
- Transaction
- Date
- >
- )}
-
-
-
- {items?.map(item => )}
-
-
-
+
+
+
+ {isMobile ? (
+ <>
+ Order Book
+ Transaction
+ >
+ ) : (
+ <>
+ Order Book
+ Merchant
+ Chain
+ Transaction
+ Date
+ >
+ )}
+
+
+
+ {currentItems?.map(item => )}
+
+
+
+
+
+
+
+
+
);
}
From 794c4e002005f900c04b13cdae94385e06d6a3dc Mon Sep 17 00:00:00 2001
From: Roza Eisenberg <45665959+rozanagy@users.noreply.github.com>
Date: Tue, 19 Nov 2024 09:18:33 +0100
Subject: [PATCH 03/12] fix: updating loading message (#212)
---
src/app/hooks/use-leather.ts | 2 +-
src/app/hooks/use-unisat.ts | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/app/hooks/use-leather.ts b/src/app/hooks/use-leather.ts
index c8b13e6c..2c9e4ade 100644
--- a/src/app/hooks/use-leather.ts
+++ b/src/app/hooks/use-leather.ts
@@ -158,7 +158,7 @@ export function useLeather(): UseLeatherReturnType {
feeRateMultiplier: number
): Promise {
try {
- setIsLoading([true, 'Creating Funding Transaction']);
+ setIsLoading([true, 'Creating Deposit Transaction']);
// ==> Create Funding Transaction
const fundingPSBT = await dlcHandler?.createFundingPSBT(
diff --git a/src/app/hooks/use-unisat.ts b/src/app/hooks/use-unisat.ts
index 3cf6c13f..60380227 100644
--- a/src/app/hooks/use-unisat.ts
+++ b/src/app/hooks/use-unisat.ts
@@ -207,7 +207,7 @@ export function useUnisat(): UseUnisatReturnType {
feeRateMultiplier: number
): Promise {
try {
- setIsLoading([true, 'Creating Funding Transaction']);
+ setIsLoading([true, 'Creating Deposit Transaction']);
// ==> Create Funding Transaction
const fundingPSBT = await dlcHandler?.createFundingPSBT(
From 301f526f2cb60f3f995f8141d0342de7b76e117c Mon Sep 17 00:00:00 2001
From: Polybius93 <99192647+Polybius93@users.noreply.github.com>
Date: Wed, 20 Nov 2024 16:20:46 +0100
Subject: [PATCH 04/12] feat: modify confirmation checker return value and form
input parsing (#213)
* feat: modify confirmation checker return value and form input parsing
* feat: disable lint errors where expected
---
.../transaction-screen.transaction-form.tsx | 15 ++++++---------
src/app/hooks/use-blockchain-height-query.ts | 1 +
src/app/hooks/use-confirmation-checker.ts | 3 ++-
src/app/hooks/use-mint-burn-events.ts | 2 ++
src/app/hooks/use-points.ts | 1 +
src/app/hooks/use-proof-of-reserve.ts | 1 +
src/app/hooks/use-total-supply.ts | 1 +
src/shared/utils.ts | 13 +++++++++++++
8 files changed, 27 insertions(+), 10 deletions(-)
diff --git a/src/app/components/transaction-screen/transaction-screen.transaction-form/components/transaction-screen.transaction-form/transaction-screen.transaction-form.tsx b/src/app/components/transaction-screen/transaction-screen.transaction-form/components/transaction-screen.transaction-form/transaction-screen.transaction-form.tsx
index 917c90c5..0c8b0f63 100644
--- a/src/app/components/transaction-screen/transaction-screen.transaction-form/components/transaction-screen.transaction-form/transaction-screen.transaction-form.tsx
+++ b/src/app/components/transaction-screen/transaction-screen.transaction-form/components/transaction-screen.transaction-form/transaction-screen.transaction-form.tsx
@@ -8,7 +8,8 @@ import { BitcoinTransactionConfirmationsContext } from '@providers/bitcoin-query
import { BitcoinWalletContextState } from '@providers/bitcoin-wallet-context-provider';
import { useForm } from '@tanstack/react-form';
import Decimal from 'decimal.js';
-import { isEmpty } from 'ramda';
+
+import { parseAssetAmount } from '@shared/utils';
import { TransactionFormNavigateButtonGroup } from './components/transaction-screen.transaction-form.navigate-button-group';
import { TransactionFormProgressStack } from './components/transaction-screen.transaction-form.progress-stack/components/transaction-screen.transaction-form.progress-stack';
@@ -141,16 +142,12 @@ export function VaultTransactionForm({
},
validators: {
onChange: ({ value }) => {
- const assetAmount = value.assetAmount;
- setCurrentFieldValue(isEmpty(assetAmount) ? 0 : new Decimal(value.assetAmount).toNumber());
+ const decimalValue = parseAssetAmount(value.assetAmount);
+ setCurrentFieldValue(decimalValue.toNumber());
+
return {
fields: {
- assetAmount: validateFormAmount(
- parseFloat(value.assetAmount),
- flow,
- depositLimit,
- vault
- ),
+ assetAmount: validateFormAmount(decimalValue.toNumber(), flow, depositLimit, vault),
},
};
},
diff --git a/src/app/hooks/use-blockchain-height-query.ts b/src/app/hooks/use-blockchain-height-query.ts
index 3d204876..306f698a 100644
--- a/src/app/hooks/use-blockchain-height-query.ts
+++ b/src/app/hooks/use-blockchain-height-query.ts
@@ -9,6 +9,7 @@ export function useBlockchainHeightQuery(): number | undefined {
if (!response.ok) throw new Error('Network response was not ok');
return response.json();
} catch (error) {
+ // eslint-disable-next-line no-console
console.error('Error fetching blockchain height', error);
return undefined;
}
diff --git a/src/app/hooks/use-confirmation-checker.ts b/src/app/hooks/use-confirmation-checker.ts
index 62054ee9..56cfb826 100644
--- a/src/app/hooks/use-confirmation-checker.ts
+++ b/src/app/hooks/use-confirmation-checker.ts
@@ -34,7 +34,8 @@ export function useConfirmationChecker(): [string, number][] {
try {
const bitcoinTransactionBlockHeight = await fetchBitcoinTransactionBlockHeight(vault);
- return blockHeight - bitcoinTransactionBlockHeight;
+ const difference = blockHeight - bitcoinTransactionBlockHeight;
+ return Math.max(difference, 0);
} catch (error) {
return 0;
}
diff --git a/src/app/hooks/use-mint-burn-events.ts b/src/app/hooks/use-mint-burn-events.ts
index b9cfdbdb..19c597b1 100644
--- a/src/app/hooks/use-mint-burn-events.ts
+++ b/src/app/hooks/use-mint-burn-events.ts
@@ -22,6 +22,7 @@ export function useMintBurnEvents(): UseMintBurnEventsReturnType {
return await response.json();
} catch (error) {
+ // eslint-disable-next-line no-console
console.error(`Error fetching mint burn events`, error);
return [];
}
@@ -60,6 +61,7 @@ export function useMintBurnEvents(): UseMintBurnEventsReturnType {
merchantMintBurnEvents: mintBurnEvents,
};
} catch (error) {
+ // eslint-disable-next-line no-console
console.error(`Error fetching mint burn events`, error);
return undefined;
}
diff --git a/src/app/hooks/use-points.ts b/src/app/hooks/use-points.ts
index 27200971..7f7187ae 100644
--- a/src/app/hooks/use-points.ts
+++ b/src/app/hooks/use-points.ts
@@ -25,6 +25,7 @@ export function usePoints(): UsePointsReturnType {
return responseData.points;
} catch (error) {
+ // eslint-disable-next-line no-console
console.error(`Error fetching user: ${address} points`, error);
return undefined;
}
diff --git a/src/app/hooks/use-proof-of-reserve.ts b/src/app/hooks/use-proof-of-reserve.ts
index 5d353f49..0bfccaf2 100644
--- a/src/app/hooks/use-proof-of-reserve.ts
+++ b/src/app/hooks/use-proof-of-reserve.ts
@@ -29,6 +29,7 @@ export function useProofOfReserve(): UseProofOfReserveReturnType {
return await response.json();
} catch (error) {
+ // eslint-disable-next-line no-console
console.error('Error fetching Proof of Reserve', error);
return 0;
}
diff --git a/src/app/hooks/use-total-supply.ts b/src/app/hooks/use-total-supply.ts
index 0a61d161..ee0aaef2 100644
--- a/src/app/hooks/use-total-supply.ts
+++ b/src/app/hooks/use-total-supply.ts
@@ -19,6 +19,7 @@ export function useTotalSupply(): UseTotalSupplyReturnType {
return responseData;
} catch (error) {
+ // eslint-disable-next-line no-console
console.error('Error fetching Total Supply', error);
return undefined;
}
diff --git a/src/shared/utils.ts b/src/shared/utils.ts
index 53f98c03..91f22573 100644
--- a/src/shared/utils.ts
+++ b/src/shared/utils.ts
@@ -51,6 +51,19 @@ export function formatEvent(event: DetailedEvent): FormattedEvent {
};
}
+export function parseAssetAmount(assetAmount: string): Decimal {
+ const isValidNumber = /^-?\d*\.?\d*$/.test(assetAmount);
+
+ if (isValidNumber) {
+ try {
+ return new Decimal(assetAmount);
+ } catch {
+ return new Decimal(0);
+ }
+ }
+ return new Decimal(0);
+}
+
export function formatToFourDecimals(value: number): number {
return parseFloat(value.toFixed(4));
}
From fd97e619301f74615af81c014576b71e19c8fdc4 Mon Sep 17 00:00:00 2001
From: Polybius93 <99192647+Polybius93@users.noreply.github.com>
Date: Thu, 21 Nov 2024 10:06:50 +0100
Subject: [PATCH 05/12] feat: add xrpl (#202)
* feat: add xrpl
---
config.devnet.json | 3 +
config.mainnet.json | 3 +
config.testnet.json | 3 +
.../fetch-attestor-group-public-key.ts | 42 +++
.../functions/submit-xrpl-vault-request.ts | 62 ++++
package.json | 7 +-
public/images/logos/gem-wallet-logo.svg | 1 +
public/images/logos/xrp-logo.svg | 16 +
src/app/app.tsx | 65 ++--
src/app/components/account/account.tsx | 52 +++-
.../account/components/account-menu.tsx | 13 +-
src/app/components/header/header.tsx | 16 +-
.../bottom/components/how-to-mint.tsx | 3 +-
.../bottom/components/how-to-unmint.tsx | 5 +-
.../burn-transaction-screen.tsx | 66 ++--
.../deposit-transaction-screen.tsx | 19 +-
.../mint-unmint/components/mint/mint.tsx | 11 +-
.../setup-vault-screen/setup-vault-screen.tsx | 28 +-
.../components/unmint-vault-selector.tsx | 12 +-
.../unmint/components/withdraw-screen.tsx | 10 +-
.../mint-unmint/components/unmint/unmint.tsx | 11 +-
.../components/walkthrough-blockchain-tag.tsx | 10 +-
.../components/walkthrough-header.tsx | 4 +-
.../components/walkthrough/walkthrough.tsx | 129 ++++----
.../modals/components/modal-container.tsx | 8 +-
...nu.tsx => select-ethereum-wallet-menu.tsx} | 6 +-
.../components/select-ripple-wallet-menu.tsx | 33 ++
.../select-wallet-modal.tsx | 179 +++++++++--
.../successful-flow-modal.tsx | 15 +-
.../my-vaults-small/my-vaults-small.tsx | 51 ++--
.../my-vaults-header/my-vaults-header.tsx | 8 +-
.../components/my-vaults/my-vaults-large.tsx | 47 +--
.../network/components/networks-menu.tsx | 18 +-
.../protocol-history-table-item.tsx | 1 -
.../select-network-button.tsx | 57 +++-
...on-screen.transaction-form.field-input.tsx | 2 +-
...transaction-form.navigate-button-group.tsx | 24 +-
...n.transaction-form.submit-button-group.tsx | 10 +-
.../vault.detaills/vault.details.tsx | 24 +-
src/app/components/vault/vault.tsx | 6 +-
.../vaults-list-group-container.tsx | 11 +-
.../functions/attestor-request.functions.ts | 36 +++
src/app/functions/configuration.functions.ts | 10 +
src/app/functions/vault.functions.ts | 9 -
src/app/hooks/use-active-tabs.ts | 33 +-
src/app/hooks/use-connected.ts | 35 +++
src/app/hooks/use-deposit-limits.ts | 35 ++-
src/app/hooks/use-ethereum-observer.ts | 149 ---------
src/app/hooks/use-evm-vaults.ts | 204 +++++++++++++
src/app/hooks/use-psbt.ts | 73 +++--
src/app/hooks/use-vaults.ts | 126 --------
src/app/hooks/use-xrp-wallet.ts | 89 ++++++
src/app/hooks/use-xrpl-gem.ts | 109 +++++++
src/app/hooks/use-xrpl-ledger.ts | 165 ++++++++++
src/app/hooks/use-xrpl-vaults.ts | 200 ++++++++++++
src/app/pages/dashboard/dashboard.tsx | 6 +-
.../providers/balance-context-provider.tsx | 64 ++--
.../providers/ethereum-observer-provider.tsx | 8 -
.../network-configuration.provider.tsx | 29 ++
.../providers/network-connection.provider.tsx | 25 ++
.../ripple-network-configuration.provider.tsx | 106 +++++++
src/app/providers/vault-context-provider.tsx | 39 ++-
.../providers/xrp-wallet-context-provider.tsx | 71 +++++
src/app/store/index.ts | 3 -
.../slices/mintunmint/mintunmint.slice.ts | 44 ++-
src/app/store/slices/modal/modal.slice.ts | 8 +-
src/app/store/slices/vault/vault.actions.ts | 3 -
src/app/store/slices/vault/vault.slice.ts | 55 ----
src/shared/constants/network.constants.ts | 5 +
src/shared/constants/ripple.constants.ts | 14 +
src/shared/models/configuration.ts | 4 +
src/shared/models/error-types.ts | 7 +
src/shared/models/ledger.ts | 1 +
src/shared/models/ripple.models.ts | 17 ++
src/shared/models/wallet.ts | 24 ++
yarn.lock | 286 +++++++++++++-----
76 files changed, 2357 insertions(+), 826 deletions(-)
create mode 100644 netlify/functions/fetch-attestor-group-public-key.ts
create mode 100644 netlify/functions/submit-xrpl-vault-request.ts
create mode 100644 public/images/logos/gem-wallet-logo.svg
create mode 100644 public/images/logos/xrp-logo.svg
rename src/app/components/modals/select-wallet-modal/components/{select-wallet-menu.tsx => select-ethereum-wallet-menu.tsx} (91%)
create mode 100644 src/app/components/modals/select-wallet-modal/components/select-ripple-wallet-menu.tsx
create mode 100644 src/app/functions/attestor-request.functions.ts
create mode 100644 src/app/hooks/use-connected.ts
delete mode 100644 src/app/hooks/use-ethereum-observer.ts
create mode 100644 src/app/hooks/use-evm-vaults.ts
delete mode 100644 src/app/hooks/use-vaults.ts
create mode 100644 src/app/hooks/use-xrp-wallet.ts
create mode 100644 src/app/hooks/use-xrpl-gem.ts
create mode 100644 src/app/hooks/use-xrpl-ledger.ts
create mode 100644 src/app/hooks/use-xrpl-vaults.ts
delete mode 100644 src/app/providers/ethereum-observer-provider.tsx
create mode 100644 src/app/providers/network-configuration.provider.tsx
create mode 100644 src/app/providers/network-connection.provider.tsx
create mode 100644 src/app/providers/ripple-network-configuration.provider.tsx
create mode 100644 src/app/providers/xrp-wallet-context-provider.tsx
delete mode 100644 src/app/store/slices/vault/vault.actions.ts
delete mode 100644 src/app/store/slices/vault/vault.slice.ts
create mode 100644 src/shared/constants/network.constants.ts
create mode 100644 src/shared/constants/ripple.constants.ts
create mode 100644 src/shared/models/ripple.models.ts
diff --git a/config.devnet.json b/config.devnet.json
index 524e8cd6..da279717 100644
--- a/config.devnet.json
+++ b/config.devnet.json
@@ -2,12 +2,15 @@
"appEnvironment": "devnet",
"coordinatorURL": "https://devnet.dlc.link/attestor-1",
"enabledEthereumNetworkIDs": ["421614", "84532", "11155111"],
+ "enabledRippleNetworkIDs": ["1"],
"bitcoinNetwork": "regtest",
"bitcoinNetworkIndex": 1,
"bitcoinNetworkPreFix": "bcrt1",
"bitcoinBlockchainURL": "https://devnet.dlc.link/electrs",
"bitcoinBlockchainExplorerURL": "https://devnet.dlc.link/electrs",
"bitcoinBlockchainFeeEstimateURL": "https://devnet.dlc.link/electrs/fee-estimates",
+ "rippleIssuerAddress": "rLTBw1MEy45uE5qmkWseinbj7h4zmdQuR8",
+ "xrplWebsocket": "wss://s.altnet.rippletest.net:51233",
"ledgerApp": "Bitcoin Test",
"merchants": [
{
diff --git a/config.mainnet.json b/config.mainnet.json
index a545d9ed..30288755 100644
--- a/config.mainnet.json
+++ b/config.mainnet.json
@@ -2,12 +2,15 @@
"appEnvironment": "mainnet",
"coordinatorURL": "https://mainnet.dlc.link/attestor-1",
"enabledEthereumNetworkIDs": ["42161", "8453"],
+ "enabledRippleNetworkIDs": ["0"],
"bitcoinNetwork": "mainnet",
"bitcoinNetworkIndex": 0,
"bitcoinNetworkPreFix": "bc1",
"bitcoinBlockchainURL": "https://mainnet.dlc.link/electrs",
"bitcoinBlockchainExplorerURL": "https://mempool.space",
"bitcoinBlockchainFeeEstimateURL": "https://mempool.space/api/v1/fees/recommended",
+ "rippleIssuerAddress": "rGcyRGrZPaJAZbZDi4NqRFLA5GQH63iFpD",
+ "xrplWebsocket": "wss://xrpl.ws/",
"ledgerApp": "Bitcoin",
"merchants": [
{
diff --git a/config.testnet.json b/config.testnet.json
index 5b62a442..ac5dad86 100644
--- a/config.testnet.json
+++ b/config.testnet.json
@@ -2,12 +2,15 @@
"appEnvironment": "testnet",
"coordinatorURL": "https://testnet.dlc.link/attestor-1",
"enabledEthereumNetworkIDs": ["421614", "84532", "11155111"],
+ "enabledRippleNetworkIDs": ["1"],
"bitcoinNetwork": "testnet",
"bitcoinNetworkIndex": 1,
"bitcoinNetworkPreFix": "tb1",
"bitcoinBlockchainURL": "https://testnet.dlc.link/electrs",
"bitcoinBlockchainExplorerURL": "https://mempool.space/testnet",
"bitcoinBlockchainFeeEstimateURL": "https://mempool.space/testnet/api/v1/fees/recommended",
+ "rippleIssuerAddress": "ra3oyRVfy4yD4NJPrVcewvDtisZ3FhkcYL",
+ "xrplWebsocket": "wss://testnet.xrpl-labs.com/",
"ledgerApp": "Bitcoin Test",
"merchants": [
{
diff --git a/netlify/functions/fetch-attestor-group-public-key.ts b/netlify/functions/fetch-attestor-group-public-key.ts
new file mode 100644
index 00000000..ad9b605f
--- /dev/null
+++ b/netlify/functions/fetch-attestor-group-public-key.ts
@@ -0,0 +1,42 @@
+import { Handler, HandlerEvent } from '@netlify/functions';
+import { getAttestorExtendedGroupPublicKey } from 'dlc-btc-lib/attestor-request-functions';
+
+const handler: Handler = async (event: HandlerEvent) => {
+ try {
+ if (!event.queryStringParameters) {
+ return {
+ statusCode: 400,
+ body: JSON.stringify({
+ message: 'No Parameters were provided',
+ }),
+ };
+ }
+
+ if (!event.queryStringParameters.coordinatorURL) {
+ return {
+ statusCode: 400,
+ body: JSON.stringify({
+ message: 'No Coordinator URL was provided',
+ }),
+ };
+ }
+
+ const coordinatorURL = event.queryStringParameters.coordinatorURL;
+
+ const attestorGroupPublicKey = await getAttestorExtendedGroupPublicKey(coordinatorURL);
+
+ return {
+ statusCode: 200,
+ body: attestorGroupPublicKey,
+ };
+ } catch (error: any) {
+ return {
+ statusCode: 500,
+ body: JSON.stringify({
+ message: `Failed to get Attestor Group Public Key: ${error.message}`,
+ }),
+ };
+ }
+};
+
+export { handler };
diff --git a/netlify/functions/submit-xrpl-vault-request.ts b/netlify/functions/submit-xrpl-vault-request.ts
new file mode 100644
index 00000000..2dd564db
--- /dev/null
+++ b/netlify/functions/submit-xrpl-vault-request.ts
@@ -0,0 +1,62 @@
+import { Handler, HandlerEvent } from '@netlify/functions';
+import { submitSetupXRPLVaultRequest } from 'dlc-btc-lib/attestor-request-functions';
+import { AttestorChainID } from 'dlc-btc-lib/models';
+
+const handler: Handler = async (event: HandlerEvent) => {
+ try {
+ if (!event.queryStringParameters) {
+ return {
+ statusCode: 400,
+ body: JSON.stringify({
+ message: 'No Parameters were provided',
+ }),
+ };
+ }
+
+ if (!event.queryStringParameters.coordinatorURL) {
+ return {
+ statusCode: 400,
+ body: JSON.stringify({
+ message: 'No Coordinator URL was provided',
+ }),
+ };
+ }
+
+ if (!event.queryStringParameters.userXRPLAddress) {
+ return {
+ statusCode: 400,
+ body: JSON.stringify({
+ message: 'No XRPL User Address was provided',
+ }),
+ };
+ }
+
+ if (!event.queryStringParameters.attestorChainID) {
+ return {
+ statusCode: 400,
+ body: JSON.stringify({
+ message: 'No Attestor Chain ID was provided',
+ }),
+ };
+ }
+
+ const coordinatorURL = event.queryStringParameters.coordinatorURL;
+ const userXRPLAddress = event.queryStringParameters.userXRPLAddress;
+ const attestorChainID = event.queryStringParameters.attestorChainID as AttestorChainID;
+
+ await submitSetupXRPLVaultRequest(coordinatorURL, userXRPLAddress, attestorChainID);
+
+ return {
+ statusCode: 200,
+ };
+ } catch (error: any) {
+ return {
+ statusCode: 500,
+ body: JSON.stringify({
+ message: `Failed to submit Setup XRPL Vault Request: ${error.message}`,
+ }),
+ };
+ }
+};
+
+export { handler };
diff --git a/package.json b/package.json
index 63b19aed..46d91a62 100644
--- a/package.json
+++ b/package.json
@@ -30,6 +30,8 @@
"@fontsource/inter": "^5.0.18",
"@fontsource/onest": "^5.0.3",
"@fontsource/poppins": "^5.0.8",
+ "@gemwallet/api": "^3.8.0",
+ "@ledgerhq/hw-app-xrp": "^6.29.4",
"@ledgerhq/hw-transport-webusb": "^6.28.6",
"@netlify/functions": "^2.8.1",
"@reduxjs/toolkit": "^1.9.7",
@@ -44,7 +46,7 @@
"concurrently": "^8.2.2",
"d3": "^7.9.0",
"decimal.js": "^10.4.3",
- "dlc-btc-lib": "2.2.7",
+ "dlc-btc-lib": "2.4.12",
"dotenv": "^16.3.1",
"ethers": "5.7.2",
"formik": "^2.4.5",
@@ -64,7 +66,8 @@
"redux-persist-expire": "^1.1.1",
"viem": "2.x",
"vite-plugin-toml": "^0.7.0",
- "wagmi": "^2.12.2"
+ "wagmi": "^2.12.2",
+ "xrpl": "^4.0.0"
},
"devDependencies": {
"@ls-lint/ls-lint": "^2.2.2",
diff --git a/public/images/logos/gem-wallet-logo.svg b/public/images/logos/gem-wallet-logo.svg
new file mode 100644
index 00000000..592bf617
--- /dev/null
+++ b/public/images/logos/gem-wallet-logo.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/public/images/logos/xrp-logo.svg b/public/images/logos/xrp-logo.svg
new file mode 100644
index 00000000..b340e958
--- /dev/null
+++ b/public/images/logos/xrp-logo.svg
@@ -0,0 +1,16 @@
+
diff --git a/src/app/app.tsx b/src/app/app.tsx
index d2f0d892..f3cc5404 100644
--- a/src/app/app.tsx
+++ b/src/app/app.tsx
@@ -12,8 +12,11 @@ import { BalanceContextProvider } from '@providers/balance-context-provider';
import { BitcoinTransactionConfirmationsProvider } from '@providers/bitcoin-query-provider';
import { BitcoinWalletContextProvider } from '@providers/bitcoin-wallet-context-provider';
import { EthereumNetworkConfigurationContextProvider } from '@providers/ethereum-network-configuration.provider';
-import { EthereumObserverProvider } from '@providers/ethereum-observer-provider';
+import { NetworkConfigurationContextProvider } from '@providers/network-configuration.provider';
+import { NetworkConnectionContextProvider } from '@providers/network-connection.provider';
import { ProofOfReserveContextProvider } from '@providers/proof-of-reserve-context-provider';
+import { RippleNetworkConfigurationContextProvider } from '@providers/ripple-network-configuration.provider';
+import { XRPWalletContextProvider } from '@providers/xrp-wallet-context-provider';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { WagmiProvider } from 'wagmi';
@@ -28,33 +31,39 @@ export function App(): React.JSX.Element {
return (
-
-
-
-
-
-
-
-
- } />
- } />
- {/* } /> */}
- } />
- } />
- }
- />
- } />
- } />
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+ } />
+ } />
+ {/* } /> */}
+ } />
+ } />
+ }
+ />
+ } />
+ } />
+
+
+
+
+
+
+
+
+
+
+
);
diff --git a/src/app/components/account/account.tsx b/src/app/components/account/account.tsx
index f79719fc..9aa75da3 100644
--- a/src/app/components/account/account.tsx
+++ b/src/app/components/account/account.tsx
@@ -1,24 +1,64 @@
+import { useContext } from 'react';
import { useDispatch } from 'react-redux';
import { Button, HStack, useBreakpointValue } from '@chakra-ui/react';
import { AccountMenu } from '@components/account/components/account-menu';
+import { XRPWallet, xrpWallets } from '@models/wallet';
+import { NetworkConfigurationContext } from '@providers/network-configuration.provider';
+import { NetworkConnectionContext } from '@providers/network-connection.provider';
+import { XRPWalletContext } from '@providers/xrp-wallet-context-provider';
import { mintUnmintActions } from '@store/slices/mintunmint/mintunmint.actions';
import { modalActions } from '@store/slices/modal/modal.actions';
-import { useAccount, useDisconnect } from 'wagmi';
+import { Connector, useAccount, useDisconnect } from 'wagmi';
+
+import { NetworkType } from '@shared/constants/network.constants';
export function Account(): React.JSX.Element {
const dispatch = useDispatch();
- const { address, connector, isConnected } = useAccount();
- const { disconnect } = useDisconnect();
+ const { isConnected } = useContext(NetworkConnectionContext);
+ const { networkType } = useContext(NetworkConfigurationContext);
+
const isMobile = useBreakpointValue({ base: true, md: false });
+ const { address: ethereumUserAddress, connector: ethereumWallet } = useAccount();
+ const { disconnect: disconnectEthereumWallet } = useDisconnect();
+ const {
+ userAddress: rippleUserAddress,
+ xrpWalletType,
+ resetXRPWalletContext,
+ } = useContext(XRPWalletContext);
+
+ function getWalletInformation(): { address: string; wallet: XRPWallet | Connector } | undefined {
+ switch (networkType) {
+ case NetworkType.EVM:
+ if (!ethereumUserAddress || !ethereumWallet) return undefined;
+ return { address: ethereumUserAddress, wallet: ethereumWallet };
+ case NetworkType.XRPL:
+ if (!rippleUserAddress) return undefined;
+ return {
+ address: rippleUserAddress,
+ wallet: xrpWallets.find(xrpWallet => xrpWallet.id === xrpWalletType)!,
+ };
+ default:
+ throw new Error('Invalid Network Type');
+ }
+ }
function onConnectWalletClick(): void {
dispatch(modalActions.toggleSelectWalletModalVisibility());
}
function onDisconnectWalletClick(): void {
- disconnect();
+ switch (networkType) {
+ case NetworkType.EVM:
+ disconnectEthereumWallet();
+ break;
+ case NetworkType.XRPL:
+ resetXRPWalletContext();
+ break;
+ default:
+ break;
+ }
dispatch(mintUnmintActions.resetMintUnmintState());
}
@@ -26,8 +66,8 @@ export function Account(): React.JSX.Element {
{isConnected ? (
onDisconnectWalletClick()}
/>
) : (
diff --git a/src/app/components/account/components/account-menu.tsx b/src/app/components/account/components/account-menu.tsx
index 175ee4a8..553f7cdb 100644
--- a/src/app/components/account/components/account-menu.tsx
+++ b/src/app/components/account/components/account-menu.tsx
@@ -9,23 +9,24 @@ import {
Text,
useBreakpointValue,
} from '@chakra-ui/react';
+import { XRPWallet } from '@models/wallet';
import { truncateAddress } from 'dlc-btc-lib/utilities';
import { Connector } from 'wagmi';
interface AccountMenuProps {
address?: string;
- wagmiConnector?: Connector;
+ wallet?: Connector | XRPWallet;
handleDisconnectWallet: () => void;
}
export function AccountMenu({
address,
- wagmiConnector,
+ wallet,
handleDisconnectWallet,
}: AccountMenuProps): React.JSX.Element | false {
const isMobile = useBreakpointValue({ base: true, md: false });
- if (!address || !wagmiConnector) return false;
+ if (!address) return false;
return (
-
-
+
+
);
diff --git a/src/app/components/my-vaults-small/my-vaults-small.tsx b/src/app/components/my-vaults-small/my-vaults-small.tsx
index 54fbe30c..be0bb3b5 100644
--- a/src/app/components/my-vaults-small/my-vaults-small.tsx
+++ b/src/app/components/my-vaults-small/my-vaults-small.tsx
@@ -4,6 +4,7 @@ import { useNavigate } from 'react-router-dom';
import { Button, Skeleton } from '@chakra-ui/react';
import { VaultsList } from '@components/vaults-list/vaults-list';
import { VaultContext } from '@providers/vault-context-provider';
+import { VaultState } from 'dlc-btc-lib/models';
import { VaultsListGroupContainer } from '../vaults-list/components/vaults-list-group-container';
import { MyVaultsSmallLayout } from './components/my-vaults-small.layout';
@@ -11,30 +12,38 @@ import { MyVaultsSmallLayout } from './components/my-vaults-small.layout';
export function MyVaultsSmall(): React.JSX.Element {
const navigate = useNavigate();
- const vaultContext = useContext(VaultContext);
- const {
- readyVaults,
- pendingVaults,
- fundedVaults,
- closingVaults,
- closedVaults,
- isLoading,
- allVaults,
- } = vaultContext;
+ const { readyVaults, pendingVaults, fundedVaults, closingVaults, closedVaults, allVaults } =
+ useContext(VaultContext);
return (
- 0}
- >
-
-
-
-
-
-
+ 0}>
+
+
+
+
+
+
diff --git a/src/app/components/my-vaults/my-vaults-large.tsx b/src/app/components/my-vaults/my-vaults-large.tsx
index ec528f26..03d35c9b 100644
--- a/src/app/components/my-vaults/my-vaults-large.tsx
+++ b/src/app/components/my-vaults/my-vaults-large.tsx
@@ -5,37 +5,50 @@ import { VaultsListGroupBlankContainer } from '@components/vaults-list/component
import { VaultsListGroupContainer } from '@components/vaults-list/components/vaults-list-group-container';
import { VaultsList } from '@components/vaults-list/vaults-list';
import { BalanceContext } from '@providers/balance-context-provider';
+import { NetworkConnectionContext } from '@providers/network-connection.provider';
import { VaultContext } from '@providers/vault-context-provider';
-import { useAccount } from 'wagmi';
+import { VaultState } from 'dlc-btc-lib/models';
import { MyVaultsLargeHeader } from './components/my-vaults-header/my-vaults-header';
import { MyVaultsLargeLayout } from './components/my-vaults-large.layout';
import { MyVaultsSetupInformationStack } from './components/my-vaults-setup-information-stack';
export function MyVaultsLarge(): React.JSX.Element {
- const { address } = useAccount();
+ const { isConnected } = useContext(NetworkConnectionContext);
const { dlcBTCBalance, lockedBTCBalance } = useContext(BalanceContext);
- const vaultContext = useContext(VaultContext);
- const { allVaults, readyVaults, fundedVaults, closingVaults, closedVaults, pendingVaults } =
- vaultContext;
+
+ const { readyVaults, pendingVaults, fundedVaults, closingVaults, closedVaults, allVaults } =
+ useContext(VaultContext);
return (
- {address ? (
+ {isConnected ? (
0}
+ isScrollable={isConnected && allVaults.length > 0}
>
-
-
-
+
+
+
) : (
@@ -43,10 +56,10 @@ export function MyVaultsLarge(): React.JSX.Element {
0}
+ isScrollable={isConnected && fundedVaults.length > 0}
>
- {address ? (
-
+ {isConnected ? (
+
) : (
)}
@@ -54,10 +67,10 @@ export function MyVaultsLarge(): React.JSX.Element {
0}
+ isScrollable={isConnected && closedVaults.length > 0}
>
- {address ? (
-
+ {isConnected ? (
+
) : (
)}
diff --git a/src/app/components/network/components/networks-menu.tsx b/src/app/components/network/components/networks-menu.tsx
index 062ff9ce..959b3abd 100644
--- a/src/app/components/network/components/networks-menu.tsx
+++ b/src/app/components/network/components/networks-menu.tsx
@@ -1,3 +1,5 @@
+import { useContext } from 'react';
+
import {
HStack,
Image,
@@ -8,6 +10,8 @@ import {
Text,
useBreakpointValue,
} from '@chakra-ui/react';
+import { NetworkConfigurationContext } from '@providers/network-configuration.provider';
+import { NetworkConnectionContext } from '@providers/network-connection.provider';
import { EthereumNetworkID } from 'dlc-btc-lib/models';
import { useAccount, useConfig, useSwitchChain } from 'wagmi';
@@ -37,13 +41,17 @@ export function NetworksMenu({
setIsMenuOpen,
}: NetworksMenuProps): React.JSX.Element | null {
const { chains } = useConfig();
- const { chain, isConnected } = useAccount();
+ const { isConnected } = useContext(NetworkConnectionContext);
+ const { chain: ethereumNetwork } = useAccount();
+
+ const { networkType } = useContext(NetworkConfigurationContext);
+
const { switchChain } = useSwitchChain();
//TODO: maybe add the network logo to the setstate?
const isMobile = useBreakpointValue({ base: true, md: false });
- if (!isConnected) {
+ if (!isConnected || networkType === 'xrpl') {
return null;
}
@@ -52,7 +60,7 @@ export function NetworksMenu({
setIsMenuOpen(!isMenuOpen)} h={isMobile ? '40px' : '50px'}>
{isMobile ? (
- {chain ? chain?.name : 'Not Connected'}
+ {ethereumNetwork ? ethereumNetwork?.name : 'Not Connected'}
)}
@@ -73,7 +81,7 @@ export function NetworksMenu({
onClick={() => {
switchChain({ chainId: ethereumNetwork.id });
setIsMenuOpen(!isMenuOpen);
- getNetworkLogo(chain?.id.toString() as EthereumNetworkID);
+ getNetworkLogo(ethereumNetwork?.id.toString() as EthereumNetworkID);
}}
>
{ethereumNetwork.name}
diff --git a/src/app/components/protocol-history-table/components/protocol-history-table-item.tsx b/src/app/components/protocol-history-table/components/protocol-history-table-item.tsx
index 3aa057fd..009aa79a 100644
--- a/src/app/components/protocol-history-table/components/protocol-history-table-item.tsx
+++ b/src/app/components/protocol-history-table/components/protocol-history-table-item.tsx
@@ -22,7 +22,6 @@ export function ProtocolHistoryTableItem(
const ethereumNetwork = findEthereumNetworkByName(eventChain);
- console.log('dlcBTCAmount', dlcBTCAmount);
const isMobile = useBreakpointValue({ base: true, md: false });
return (
void;
- ethereumNetworks: readonly [Chain, ...Chain[]];
- selectedEthereumNetwork?: Chain;
+ handleChangeNetwork: (networkID: EthereumNetworkID | RippleNetworkID) => void;
+ ethereumNetworkIDs: EthereumNetworkID[];
+ rippleNetworkIDs: RippleNetworkID[];
+ selectedNetworkType?: NetworkType;
+ selectedNetworkID?: EthereumNetworkID | RippleNetworkID;
}
export function SelectNetworkButton({
handleChangeNetwork,
- ethereumNetworks,
- selectedEthereumNetwork,
+ ethereumNetworkIDs,
+ rippleNetworkIDs,
+ selectedNetworkID,
+ selectedNetworkType,
}: SelectNetworkButtonProps): React.JSX.Element {
+ const [networks, setNetworks] = useState<(EthereumNetwork | RippleNetwork)[]>([]);
+ const ethereumNetworks = ethereumNetworkIDs.map((networkID: EthereumNetworkID) => {
+ return getEthereumNetworkByID(networkID as EthereumNetworkID);
+ });
+
+ const rippleNetworks = rippleNetworkIDs.map((networkID: RippleNetworkID) => {
+ return getRippleNetworkByID(networkID as RippleNetworkID);
+ });
+
+ const selectedNetwork =
+ selectedNetworkType === NetworkType.EVM
+ ? ethereumNetworks.find(network => network.id === selectedNetworkID)
+ : rippleNetworks.find(network => network.id === selectedNetworkID);
+
+ useEffect(() => {
+ const currentNetworks =
+ selectedNetworkType === NetworkType.EVM ? ethereumNetworks : rippleNetworks;
+ setNetworks(currentNetworks);
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, [selectedNetworkType]);
+
return (
- {label === 'Minted dlcBTC' && (
+ {vaultState === VaultState.FUNDED && networkType === NetworkType.EVM && (
>
}
diff --git a/src/app/components/how-it-works/bottom/components/how-to-unmint.tsx b/src/app/components/how-it-works/bottom/components/how-to-unmint.tsx
index 28c802ba..607bcf52 100644
--- a/src/app/components/how-it-works/bottom/components/how-to-unmint.tsx
+++ b/src/app/components/how-it-works/bottom/components/how-to-unmint.tsx
@@ -15,15 +15,15 @@ export function HowToUnmint(): React.JSX.Element {
{
<>
- How to Unmint dlcBTC
+ How to withdraw BTC
- Select the vault you would like to unmint. After a successful unmint you will
+ Select the vault you would like to redeem from. After a successful withdraw you will
receive BTC in the same amount back to your wallet.
}
@@ -39,7 +39,7 @@ export function HowToUnmint(): React.JSX.Element {
}}
variant={'account'}
>
- Unmint dlcBTC
+ Unmint iBTC
>
}
diff --git a/src/app/components/how-it-works/middle/middle-section.tsx b/src/app/components/how-it-works/middle/middle-section.tsx
index fa022f99..458e4c67 100644
--- a/src/app/components/how-it-works/middle/middle-section.tsx
+++ b/src/app/components/how-it-works/middle/middle-section.tsx
@@ -17,11 +17,11 @@ export function MiddleSection(): React.JSX.Element {
>
}
content={
- dlcBTC is a{' '}
+ iBTC is a{' '}
non-custodial
{' '}
diff --git a/src/app/components/how-it-works/top/top-section.tsx b/src/app/components/how-it-works/top/top-section.tsx
index 1f15b55f..22b6fdb8 100644
--- a/src/app/components/how-it-works/top/top-section.tsx
+++ b/src/app/components/how-it-works/top/top-section.tsx
@@ -16,10 +16,10 @@ export function TopSection(): React.JSX.Element {
- dlcBTC
+ iBTC
- dlcBTC lets you use your Bitcoin on different DeFi platforms, all without giving up
+ iBTC lets you use your Bitcoin on different DeFi platforms, all without giving up
control of your actual Bitcoin.
diff --git a/src/app/components/mint-unmint/components/landing-page/components/welcome-stack.tsx b/src/app/components/mint-unmint/components/landing-page/components/welcome-stack.tsx
index 655424d2..9ffc16cb 100644
--- a/src/app/components/mint-unmint/components/landing-page/components/welcome-stack.tsx
+++ b/src/app/components/mint-unmint/components/landing-page/components/welcome-stack.tsx
@@ -8,7 +8,7 @@ export function WelcomeStack(): React.JSX.Element {
// const navigate = useNavigate();
const dispatch = useDispatch();
- const setupText = 'Ready to\n mint dlcBTC?';
+ const setupText = 'Ready to\n mint iBTC?';
function onConnectWalletClick(): void {
dispatch(modalActions.toggleSelectWalletModalVisibility());
diff --git a/src/app/components/mint-unmint/components/progress-timeline/progress-timeline.tsx b/src/app/components/mint-unmint/components/progress-timeline/progress-timeline.tsx
index 3668ee82..75df337f 100644
--- a/src/app/components/mint-unmint/components/progress-timeline/progress-timeline.tsx
+++ b/src/app/components/mint-unmint/components/progress-timeline/progress-timeline.tsx
@@ -21,7 +21,7 @@ export function ProgressTimeline({
-
+
@@ -49,7 +49,7 @@ export function ProgressTimeline({
stepIndex={3}
width={'12.5%'}
isLastStep
- title="Mint dlcBTC"
+ title="Mint iBTC"
/>
diff --git a/src/app/components/mint-unmint/components/setup-vault-screen/components/setup-vault-screen.vault-graphics.tsx b/src/app/components/mint-unmint/components/setup-vault-screen/components/setup-vault-screen.vault-graphics.tsx
index 8ee091b2..270e5e3d 100644
--- a/src/app/components/mint-unmint/components/setup-vault-screen/components/setup-vault-screen.vault-graphics.tsx
+++ b/src/app/components/mint-unmint/components/setup-vault-screen/components/setup-vault-screen.vault-graphics.tsx
@@ -27,7 +27,7 @@ export function SetupVaultScreenVaultGraphics(): React.JSX.Element {
right="37.5%"
/>
- BTC/dlcBTC Vault
+ BTC/iBTC Vault
diff --git a/src/app/components/mint-unmint/components/walkthrough/walkthrough.tsx b/src/app/components/mint-unmint/components/walkthrough/walkthrough.tsx
index 2d2bf3a9..490aa7d8 100644
--- a/src/app/components/mint-unmint/components/walkthrough/walkthrough.tsx
+++ b/src/app/components/mint-unmint/components/walkthrough/walkthrough.tsx
@@ -65,7 +65,7 @@ export function Walkthrough({
Enter the Bitcoin amount you wish to deposit into the vault, then verify the
transaction through your Bitcoin Wallet which will lock your Bitcoin on-chain. You
- will receive equivalent amount of dlcBTC.
+ will receive equivalent amount of iBTC.
);
@@ -74,17 +74,17 @@ export function Walkthrough({
- Wait for Bitcoin to get locked on chain (~1 hour). After 6 confirmations, dlcBTC
+ Wait for Bitcoin to get locked on chain (~1 hour). After 6 confirmations, iBTC
tokens will appear in your Wallet.
{networkType === NetworkType.EVM && (
<>
- To ensure your dlcBTC tokens
+ To ensure your iBTC tokens
are visible
simply add them
to your Ethereum Wallet.
@@ -92,11 +92,7 @@ export function Walkthrough({
@@ -109,7 +105,7 @@ export function Walkthrough({
@@ -122,18 +118,18 @@ export function Walkthrough({
{networkType === NetworkType.EVM ? (
- Select the dlcBTC vault you would like to withdraw from. Burn the desired amount
- of dlcBTC to receive the equivalent amount of BTC.
+ Select the iBTC vault you would like to withdraw from. Burn the desired amount of
+ iBTC to receive the equivalent amount of BTC.
) : (
- Select the dlcBTC vault you would like to withdraw from. Sign a check with the
- desired amount of dlcBTC to receive the equivalent amount of BTC.
+ Select the iBTC vault you would like to withdraw from. Sign a check with the
+ desired amount of iBTC to receive the equivalent amount of BTC.
)}
@@ -147,7 +143,7 @@ export function Walkthrough({
blockchain={NetworkType.BTC}
/>
- {`Once the dlcBTC has been burned, you can withdraw an `}
+ {`Once the iBTC has been burned, you can withdraw an `}
{` equivalent amount of Bitcoin `}
@@ -175,7 +171,7 @@ export function Walkthrough({
diff --git a/src/app/components/modals/successful-flow-modal/successful-flow-modal.tsx b/src/app/components/modals/successful-flow-modal/successful-flow-modal.tsx
index acc305f3..a556036e 100644
--- a/src/app/components/modals/successful-flow-modal/successful-flow-modal.tsx
+++ b/src/app/components/modals/successful-flow-modal/successful-flow-modal.tsx
@@ -15,9 +15,9 @@ interface SuccessfulFlowModalProps extends ModalComponentProps {
function getModalText(flow: 'mint' | 'burn', assetAmount?: number): string {
if (flow === 'mint') {
- return `You have successfully deposited ${assetAmount} BTC from your Bitcoin Wallet into your Vault, and minted ${assetAmount} dlcBTC to your destination address.`;
+ return `You have successfully deposited ${assetAmount} BTC from your Bitcoin Wallet into your Vault, and minted ${assetAmount} iBTC to your destination address.`;
} else {
- return `You have successfully burned ${assetAmount} dlcBTC from your destination address, and withdrawn ${assetAmount} BTC from your Vault into your Bitcoin Wallet.`;
+ return `You have successfully burned ${assetAmount} iBTC from your destination address, and withdrawn ${assetAmount} BTC from your Vault into your Bitcoin Wallet.`;
}
}
diff --git a/src/app/components/my-vaults-small/my-vaults-small.tsx b/src/app/components/my-vaults-small/my-vaults-small.tsx
index be0bb3b5..02db6693 100644
--- a/src/app/components/my-vaults-small/my-vaults-small.tsx
+++ b/src/app/components/my-vaults-small/my-vaults-small.tsx
@@ -35,7 +35,7 @@ export function MyVaultsSmall(): React.JSX.Element {
vaultState={VaultState.READY}
/>
diff --git a/src/app/components/my-vaults/components/my-vaults-header/my-vaults-header.tsx b/src/app/components/my-vaults/components/my-vaults-header/my-vaults-header.tsx
index 6c6d5b6b..c5abb282 100644
--- a/src/app/components/my-vaults/components/my-vaults-header/my-vaults-header.tsx
+++ b/src/app/components/my-vaults/components/my-vaults-header/my-vaults-header.tsx
@@ -4,13 +4,13 @@ import { MyVaultsHeaderBalanceInfo } from './components/my-vaults-header-balance
interface MyVaultsLargeHeaderProps {
isConnected: boolean;
- dlcBTCBalance?: number;
+ iBTCBalance?: number;
lockedBTCBalance?: number;
}
export function MyVaultsLargeHeader({
isConnected,
- dlcBTCBalance,
+ iBTCBalance,
lockedBTCBalance,
}: MyVaultsLargeHeaderProps): React.JSX.Element {
return (
@@ -22,10 +22,10 @@ export function MyVaultsLargeHeader({
diff --git a/src/app/components/my-vaults/my-vaults-large.tsx b/src/app/components/my-vaults/my-vaults-large.tsx
index 03d35c9b..f7c09678 100644
--- a/src/app/components/my-vaults/my-vaults-large.tsx
+++ b/src/app/components/my-vaults/my-vaults-large.tsx
@@ -15,7 +15,7 @@ import { MyVaultsSetupInformationStack } from './components/my-vaults-setup-info
export function MyVaultsLarge(): React.JSX.Element {
const { isConnected } = useContext(NetworkConnectionContext);
- const { dlcBTCBalance, lockedBTCBalance } = useContext(BalanceContext);
+ const { iBTCBalance, lockedBTCBalance } = useContext(BalanceContext);
const { readyVaults, pendingVaults, fundedVaults, closingVaults, closedVaults, allVaults } =
useContext(VaultContext);
@@ -24,7 +24,7 @@ export function MyVaultsLarge(): React.JSX.Element {
@@ -54,7 +54,7 @@ export function MyVaultsLarge(): React.JSX.Element {
)}
0}
>
diff --git a/src/app/components/points/components/points-table/components/points-table-item.tsx b/src/app/components/points/components/points-table/components/points-table-item.tsx
index e6a05407..16c7eb86 100644
--- a/src/app/components/points/components/points-table/components/points-table-item.tsx
+++ b/src/app/components/points/components/points-table/components/points-table-item.tsx
@@ -47,7 +47,7 @@ export function PointsTableItem(pointsTableItem: ProtocolRewards): React.JSX.Ele
) : (
<>
-
+
{formatToFourDecimals(unshiftValue(currentTokens))}
diff --git a/src/app/components/points/components/points-table/points-table.tsx b/src/app/components/points/components/points-table/points-table.tsx
index e26a52da..7080949e 100644
--- a/src/app/components/points/components/points-table/points-table.tsx
+++ b/src/app/components/points/components/points-table/points-table.tsx
@@ -24,7 +24,7 @@ export function PointsTable({ items }: PointsTableProps): React.JSX.Element {
>
) : (
<>
- dlcBTC Used
+ iBTC Used
Points Earned
DeFi Protocol
>
diff --git a/src/app/components/points/points.tsx b/src/app/components/points/points.tsx
index 30ada3e0..4cd70420 100644
--- a/src/app/components/points/points.tsx
+++ b/src/app/components/points/points.tsx
@@ -12,7 +12,7 @@ import {
} from '@chakra-ui/react';
import { TokenStatsBoardLayout } from '@components/proof-of-reserve/components/token-stats-board/token-stats-board.layout';
import { usePoints } from '@hooks/use-points';
-import { dlcBTC } from '@models/token';
+import { iBTC } from '@models/token';
import { modalActions } from '@store/slices/modal/modal.actions';
import { useAccount } from 'wagmi';
@@ -38,7 +38,7 @@ export function Points(): React.JSX.Element {
<>
- Use dlcBTC -{' '}
+ Use iBTC -{' '}
Earn Points
@@ -83,7 +83,7 @@ export function Points(): React.JSX.Element {
direction={isMobile ? 'column' : 'row'}
>
@@ -94,7 +94,7 @@ export function Points(): React.JSX.Element {
variant={'thick'}
/>
p.name == 'dlcBTC')?.points}
tokenSuffix={'Hold'}
/>
@@ -128,8 +128,8 @@ export function Points(): React.JSX.Element {
- Use dlcBTC
+ Use iBTC
- Put your dlcBTC to work in various activities like lending, staking, or
- trading Participate and earn points for your involvement.
+ Put your iBTC to work in various activities like lending, staking, or trading
+ Participate and earn points for your involvement.
@@ -173,7 +173,7 @@ export function Points(): React.JSX.Element {
-
+
-
+
diff --git a/src/app/components/proof-of-reserve/components/merchant-table/components/merchant-details-table-item.tsx b/src/app/components/proof-of-reserve/components/merchant-table/components/merchant-details-table-item.tsx
index 43bdec8d..855d6f32 100644
--- a/src/app/components/proof-of-reserve/components/merchant-table/components/merchant-details-table-item.tsx
+++ b/src/app/components/proof-of-reserve/components/merchant-table/components/merchant-details-table-item.tsx
@@ -10,7 +10,7 @@ export function MerchantDetailsTableItem(merchantFocusTableItem: DetailedEvent):
if (!merchantFocusTableItem) return ;
const {
- dlcBTCAmount,
+ iBTCAmount,
txHash,
date,
isMint,
@@ -40,9 +40,9 @@ export function MerchantDetailsTableItem(merchantFocusTableItem: DetailedEvent):
-
+
- {unshiftValue(dlcBTCAmount)}
+ {unshiftValue(iBTCAmount)}
@@ -67,9 +67,9 @@ export function MerchantDetailsTableItem(merchantFocusTableItem: DetailedEvent):
-
+
- {unshiftValue(dlcBTCAmount)}
+ {unshiftValue(iBTCAmount)}
{/* add back the USD calculation later and adjus the width accordingly */}
diff --git a/src/app/components/proof-of-reserve/components/merchant-table/components/merchant-table-item.tsx b/src/app/components/proof-of-reserve/components/merchant-table/components/merchant-table-item.tsx
index efc596b8..ae40693b 100644
--- a/src/app/components/proof-of-reserve/components/merchant-table/components/merchant-table-item.tsx
+++ b/src/app/components/proof-of-reserve/components/merchant-table/components/merchant-table-item.tsx
@@ -16,12 +16,12 @@ import { Merchant } from '@models/merchant';
interface MerchantTableItemProps {
merchant: Merchant;
- dlcBTCAmount: number | undefined;
+ iBTCAmount: number | undefined;
}
export function MerchantTableItem({
merchant,
- dlcBTCAmount,
+ iBTCAmount,
}: MerchantTableItemProps): React.ReactElement {
const navigate = useNavigate();
@@ -42,8 +42,8 @@ export function MerchantTableItem({
-
-
+
+
- {Number(dlcBTCAmount?.toFixed(4))}
+ {Number(iBTCAmount?.toFixed(4))}
diff --git a/src/app/components/proof-of-reserve/components/merchant-table/merchant-table.tsx b/src/app/components/proof-of-reserve/components/merchant-table/merchant-table.tsx
index 3cfbbd52..f986380f 100644
--- a/src/app/components/proof-of-reserve/components/merchant-table/merchant-table.tsx
+++ b/src/app/components/proof-of-reserve/components/merchant-table/merchant-table.tsx
@@ -23,12 +23,12 @@ export function MerchantTable({ items }: MerchantTableProps): React.JSX.Element
>
Merchant
- dlcBTC Minted
+ iBTC Minted
{items
- ?.sort((a, b) => b.dlcBTCAmount - a.dlcBTCAmount)
+ ?.sort((a, b) => b.iBTCAmount - a.iBTCAmount)
.map(item => )}
diff --git a/src/app/components/proof-of-reserve/components/token-stats-board/components/token-stats-board-token.tsx b/src/app/components/proof-of-reserve/components/token-stats-board/components/token-stats-board-token.tsx
index e74da9b4..1679a92f 100644
--- a/src/app/components/proof-of-reserve/components/token-stats-board/components/token-stats-board-token.tsx
+++ b/src/app/components/proof-of-reserve/components/token-stats-board/components/token-stats-board-token.tsx
@@ -12,7 +12,7 @@ export function TokenStatsBoardToken({
}: TokenStatsBoardTokenProps): React.JSX.Element {
let tokenSuffix: string;
switch (token.name) {
- case 'dlcBTC':
+ case 'iBTC':
tokenSuffix = 'Minted';
break;
default:
diff --git a/src/app/components/proof-of-reserve/proof-of-reserve.tsx b/src/app/components/proof-of-reserve/proof-of-reserve.tsx
index 3a1f2a0b..c3ef8299 100644
--- a/src/app/components/proof-of-reserve/proof-of-reserve.tsx
+++ b/src/app/components/proof-of-reserve/proof-of-reserve.tsx
@@ -3,7 +3,7 @@ import { useContext } from 'react';
import { Divider, Stack, Text, useBreakpointValue } from '@chakra-ui/react';
import { ProtocolHistoryTable } from '@components/protocol-history-table/protocol-history-table';
import { Merchant } from '@models/merchant';
-import { bitcoin, dlcBTC } from '@models/token';
+import { bitcoin, iBTC } from '@models/token';
import { ProofOfReserveContext } from '@providers/proof-of-reserve-context-provider';
import { titleTextSize } from '@shared/utils';
@@ -23,7 +23,7 @@ export function ProofOfReserve(): React.JSX.Element {
appConfiguration.merchants.map((merchant: Merchant) => {
return {
merchant,
- dlcBTCAmount: undefined,
+ iBTCBalance: undefined,
};
}),
];
@@ -50,7 +50,7 @@ export function ProofOfReserve(): React.JSX.Element {
height={isMobile ? '1px' : '75px'}
variant={'thick'}
/>
-
+
-
+
- {unshiftValue(dlcBTCAmount)}
+ {unshiftValue(iBTCAmount)}
@@ -60,9 +60,9 @@ export function ProtocolHistoryTableItem(
) : (
<>
-
+
- {unshiftValue(dlcBTCAmount)}
+ {unshiftValue(iBTCAmount)}
@@ -96,9 +96,9 @@ export function ProtocolHistoryTableItem(
>
)}
{/*
-
+
- {unshiftValue(dlcBTCAmount)}
+ {unshiftValue(iBTCAmount)}
diff --git a/src/app/components/transaction-screen/transaction-screen.transaction-form/components/transaction-screen.transaction-form/components/transaction-screen.transaction-form.input.tsx b/src/app/components/transaction-screen/transaction-screen.transaction-form/components/transaction-screen.transaction-form/components/transaction-screen.transaction-form.input.tsx
index 42194f64..9ef3c6ee 100644
--- a/src/app/components/transaction-screen/transaction-screen.transaction-form/components/transaction-screen.transaction-form/components/transaction-screen.transaction-form.input.tsx
+++ b/src/app/components/transaction-screen/transaction-screen.transaction-form/components/transaction-screen.transaction-form/components/transaction-screen.transaction-form.input.tsx
@@ -12,9 +12,9 @@ const bitcoinFormProperties = {
color: 'orange.01',
};
const tokenFormProperties = {
- label: 'Burn dlcBTC',
- logo: '/images/logos/dlc-btc-logo.svg',
- symbol: 'dlcBTC',
+ label: 'Burn iBTC',
+ logo: '/images/logos/ibtc-logo.svg',
+ symbol: 'iBTC',
color: 'purple.01',
};
diff --git a/src/app/components/transaction-screen/transaction-screen.transaction-form/components/transaction-screen.transaction-form/components/transaction-screen.transaction-form.progress-stack/components/transaction-screen.transaction-form.progress-stack.tsx b/src/app/components/transaction-screen/transaction-screen.transaction-form/components/transaction-screen.transaction-form/components/transaction-screen.transaction-form.progress-stack/components/transaction-screen.transaction-form.progress-stack.tsx
index 358574bf..b589127d 100644
--- a/src/app/components/transaction-screen/transaction-screen.transaction-form/components/transaction-screen.transaction-form/components/transaction-screen.transaction-form.progress-stack/components/transaction-screen.transaction-form.progress-stack.tsx
+++ b/src/app/components/transaction-screen/transaction-screen.transaction-form/components/transaction-screen.transaction-form/components/transaction-screen.transaction-form.progress-stack/components/transaction-screen.transaction-form.progress-stack.tsx
@@ -14,10 +14,10 @@ interface ProgressStackItemProps {
const componentsMap = {
mint: {
A: { label: 'Deposit', assetLogo: '/images/logos/bitcoin-logo.svg', assetSymbol: 'BTC' },
- B: { label: 'Mint', assetLogo: '/images/logos/dlc-btc-logo.svg', assetSymbol: 'dlcBTC' },
+ B: { label: 'Mint', assetLogo: '/images/logos/ibtc-logo.svg', assetSymbol: 'iBTC' },
},
burn: {
- A: { label: 'Burn', assetLogo: '/images/logos/dlc-btc-logo.svg', assetSymbol: 'dlcBTC' },
+ A: { label: 'Burn', assetLogo: '/images/logos/ibtc-logo.svg', assetSymbol: 'iBTC' },
B: { label: 'Withdraw', assetLogo: '/images/logos/bitcoin-logo.svg', assetSymbol: 'BTC' },
},
};
diff --git a/src/app/components/transaction-screen/transaction-screen.transaction-form/components/transaction-screen.transaction-form/transaction-screen.transaction-form.tsx b/src/app/components/transaction-screen/transaction-screen.transaction-form/components/transaction-screen.transaction-form/transaction-screen.transaction-form.tsx
index 0c8b0f63..f5a4a71f 100644
--- a/src/app/components/transaction-screen/transaction-screen.transaction-form/components/transaction-screen.transaction-form/transaction-screen.transaction-form.tsx
+++ b/src/app/components/transaction-screen/transaction-screen.transaction-form/components/transaction-screen.transaction-form/transaction-screen.transaction-form.tsx
@@ -38,9 +38,9 @@ function validateBurnAmount(value: number, valueMinted: number): string | undefi
let error;
if (!value) {
- error = 'Please enter a valid amount of dlcBTC';
+ error = 'Please enter a valid amount of iBTC';
} else if (valueMinted && value > valueMinted) {
- error = `You can't burn more than ${valueMinted} dlcBTC`;
+ error = `You can't burn more than ${valueMinted} iBTC`;
}
return error;
}
diff --git a/src/app/components/vault/components/vault.detaills/components/vault.details.button-group/vault.details.button-group.tsx b/src/app/components/vault/components/vault.detaills/components/vault.details.button-group/vault.details.button-group.tsx
index 7d63307b..cd1ac9ed 100644
--- a/src/app/components/vault/components/vault.detaills/components/vault.details.button-group/vault.details.button-group.tsx
+++ b/src/app/components/vault/components/vault.detaills/components/vault.details.button-group/vault.details.button-group.tsx
@@ -38,7 +38,7 @@ export function VaultExpandedInformationButtonGroup({
diff --git a/src/app/components/vault/components/vault.main-stack/components/vault.main-stack.asset-information-stack/vault.main-stack.asset-information-stack.tsx b/src/app/components/vault/components/vault.main-stack/components/vault.main-stack.asset-information-stack/vault.main-stack.asset-information-stack.tsx
index 813f466a..2b7a0aa5 100644
--- a/src/app/components/vault/components/vault.main-stack/components/vault.main-stack.asset-information-stack/vault.main-stack.asset-information-stack.tsx
+++ b/src/app/components/vault/components/vault.main-stack/components/vault.main-stack.asset-information-stack/vault.main-stack.asset-information-stack.tsx
@@ -13,9 +13,9 @@ export function VaultAssetInformationStack({
return (
await addToken()}
>
-
+
{' '}
Add Token to Wallet
diff --git a/src/app/hooks/use-add-token.ts b/src/app/hooks/use-add-token.ts
index 7f5741d4..0b0da83f 100644
--- a/src/app/hooks/use-add-token.ts
+++ b/src/app/hooks/use-add-token.ts
@@ -19,7 +19,7 @@ export function useAddToken(): () => Promise {
await walletClient.watchAsset({
type: 'ERC20',
options: {
- address: ethereumNetworkConfiguration.dlcBTCContract.address,
+ address: ethereumNetworkConfiguration.iBTCContract.address,
symbol: 'IBTC',
decimals: 8,
image: 'https://dlc-public-assets.s3.amazonaws.com/dlcBTC_Token.png',
diff --git a/src/app/hooks/use-deposit-limits.ts b/src/app/hooks/use-deposit-limits.ts
index 4e278c71..4595c8b1 100644
--- a/src/app/hooks/use-deposit-limits.ts
+++ b/src/app/hooks/use-deposit-limits.ts
@@ -52,7 +52,7 @@ export function useDepositLimits(): UseDepositLimitsReturnType {
}
const { data: evmDepositLimit } = useQuery({
- queryKey: ['evmDepositLimit', ethereumNetworkConfiguration.dlcBTCContract.address],
+ queryKey: ['evmDepositLimit', ethereumNetworkConfiguration.iBTCContract.address],
queryFn: fetchEVMDepositLimit,
enabled: !!ethereumNetworkConfiguration,
});
diff --git a/src/app/hooks/use-proof-of-reserve.ts b/src/app/hooks/use-proof-of-reserve.ts
index 0bfccaf2..49812383 100644
--- a/src/app/hooks/use-proof-of-reserve.ts
+++ b/src/app/hooks/use-proof-of-reserve.ts
@@ -51,7 +51,7 @@ export function useProofOfReserve(): UseProofOfReserveReturnType {
);
return {
merchant,
- dlcBTCAmount: unshiftValue(proofOfReserve),
+ iBTCAmount: unshiftValue(proofOfReserve),
};
});
@@ -66,7 +66,7 @@ export function useProofOfReserve(): UseProofOfReserveReturnType {
appConfiguration.merchants.map((merchant: Merchant) => {
return {
merchant,
- dlcBTCAmount: undefined,
+ iBTCAmount: undefined,
};
}),
],
diff --git a/src/app/providers/balance-context-provider.tsx b/src/app/providers/balance-context-provider.tsx
index 0cc1722f..00294e2d 100644
--- a/src/app/providers/balance-context-provider.tsx
+++ b/src/app/providers/balance-context-provider.tsx
@@ -17,18 +17,18 @@ import { NetworkConnectionContext } from './network-connection.provider';
import { XRPWalletContext } from './xrp-wallet-context-provider';
interface VaultContextType {
- dlcBTCBalance: number | undefined;
+ iBTCBalance: number | undefined;
lockedBTCBalance: number | undefined;
}
export const BalanceContext = createContext({
- dlcBTCBalance: undefined,
+ iBTCBalance: undefined,
lockedBTCBalance: undefined,
});
export function BalanceContextProvider({ children }: HasChildren): React.JSX.Element {
const {
- ethereumNetworkConfiguration: { dlcBTCContract, dlcManagerContract },
+ ethereumNetworkConfiguration: { iBTCContract, dlcManagerContract },
} = useContext(EthereumNetworkConfigurationContext);
const { networkType } = useContext(NetworkConfigurationContext);
const { isConnected } = useContext(NetworkConnectionContext);
@@ -38,19 +38,19 @@ export function BalanceContextProvider({ children }: HasChildren): React.JSX.Ele
const { address: ethereumUserAddress } = useAccount();
const fetchEVMBalances = async () => {
- const dlcBTCBalance = await getAddressDLCBTCBalance(dlcBTCContract, ethereumUserAddress!);
+ const iBTCBalance = await getAddressDLCBTCBalance(iBTCContract, ethereumUserAddress!);
const lockedBTCBalance = await getLockedBTCBalance(
await getAllAddressVaults(dlcManagerContract, ethereumUserAddress!)
);
- return { dlcBTCBalance, lockedBTCBalance };
+ return { iBTCBalance, lockedBTCBalance };
};
const fetchXRPLBalances = async () => {
- const dlcBTCBalance = await xrpHandler?.getDLCBTCBalance();
+ const iBTCBalance = await xrpHandler?.getDLCBTCBalance();
const lockedBTCBalance = await xrpHandler?.getLockedBTCBalance();
- return { dlcBTCBalance, lockedBTCBalance };
+ return { iBTCBalance, lockedBTCBalance };
};
const { data } = useQuery({
@@ -62,7 +62,7 @@ export function BalanceContextProvider({ children }: HasChildren): React.JSX.Ele
return (
{children}
diff --git a/src/app/providers/ethereum-network-configuration.provider.tsx b/src/app/providers/ethereum-network-configuration.provider.tsx
index 86ad0330..3cbb64d5 100644
--- a/src/app/providers/ethereum-network-configuration.provider.tsx
+++ b/src/app/providers/ethereum-network-configuration.provider.tsx
@@ -54,10 +54,10 @@ function getEthereumNetworkConfiguration(
'DLCManager',
appConfiguration.l1Websocket
),
- dlcBTCContract: getEthereumContractWithProvider(
+ iBTCContract: getEthereumContractWithProvider(
getEthereumNetworkDeploymentPlans(mainnet),
mainnet,
- 'DLCBTC',
+ 'IBTC',
appConfiguration.l1Websocket
),
chain: mainnet,
@@ -75,10 +75,10 @@ function getEthereumNetworkConfiguration(
'DLCManager',
appConfiguration.l1Websocket
),
- dlcBTCContract: getEthereumContractWithProvider(
+ iBTCContract: getEthereumContractWithProvider(
getEthereumNetworkDeploymentPlans(sepolia),
sepolia,
- 'DLCBTC',
+ 'IBTC',
appConfiguration.l1Websocket
),
chain: sepolia,
@@ -96,10 +96,10 @@ function getEthereumNetworkConfiguration(
'DLCManager',
appConfiguration.baseWebsocket
),
- dlcBTCContract: getEthereumContractWithProvider(
+ iBTCContract: getEthereumContractWithProvider(
getEthereumNetworkDeploymentPlans(base),
base,
- 'DLCBTC',
+ 'IBTC',
appConfiguration.baseWebsocket
),
chain: base,
@@ -117,10 +117,10 @@ function getEthereumNetworkConfiguration(
'DLCManager',
baseSepolia.rpcUrls.default.http[0]
),
- dlcBTCContract: getEthereumContractWithProvider(
+ iBTCContract: getEthereumContractWithProvider(
getEthereumNetworkDeploymentPlans(baseSepolia),
baseSepolia,
- 'DLCBTC',
+ 'IBTC',
baseSepolia.rpcUrls.default.http[0]
),
chain: baseSepolia,
@@ -138,10 +138,10 @@ function getEthereumNetworkConfiguration(
'DLCManager',
appConfiguration.arbitrumWebsocket
),
- dlcBTCContract: getEthereumContractWithProvider(
+ iBTCContract: getEthereumContractWithProvider(
getEthereumNetworkDeploymentPlans(arbitrum),
arbitrum,
- 'DLCBTC',
+ 'IBTC',
appConfiguration.arbitrumWebsocket
),
chain: arbitrum,
@@ -159,10 +159,10 @@ function getEthereumNetworkConfiguration(
'DLCManager',
appConfiguration.arbitrumWebsocket
),
- dlcBTCContract: getEthereumContractWithProvider(
+ iBTCContract: getEthereumContractWithProvider(
getEthereumNetworkDeploymentPlans(arbitrumSepolia),
arbitrumSepolia,
- 'DLCBTC',
+ 'IBTC',
appConfiguration.arbitrumWebsocket
),
chain: arbitrumSepolia,
@@ -179,10 +179,10 @@ function getEthereumNetworkConfiguration(
hardhat,
'DLCManager'
),
- dlcBTCContract: getEthereumContractWithProvider(
+ iBTCContract: getEthereumContractWithProvider(
getEthereumNetworkDeploymentPlans(hardhat),
hardhat,
- 'DLCBTC'
+ 'IBTC'
),
chain: hardhat,
};
diff --git a/src/shared/examples/example-attestor-select-table-items.ts b/src/shared/examples/example-attestor-select-table-items.ts
index baac68ee..1ba44213 100644
--- a/src/shared/examples/example-attestor-select-table-items.ts
+++ b/src/shared/examples/example-attestor-select-table-items.ts
@@ -4,7 +4,7 @@ export const exampleAttestorSelectTableItems = [
time: '8 hours ago',
action: 'Update Vote State',
programs: 'TS',
- value: '0.8059 dlcBTC',
+ value: '0.8059 iBTC',
token: 'N/A',
},
{
@@ -12,7 +12,7 @@ export const exampleAttestorSelectTableItems = [
time: '1 hours ago',
action: 'Create Proposal',
programs: 'VP',
- value: '0.8415 dlcBTC',
+ value: '0.8415 iBTC',
token: 'N/A',
},
{
@@ -20,7 +20,7 @@ export const exampleAttestorSelectTableItems = [
time: '11 hours ago',
action: 'Execute Transaction',
programs: 'DL',
- value: '0.5634 dlcBTC',
+ value: '0.5634 iBTC',
token: 'N/A',
},
{
@@ -28,7 +28,7 @@ export const exampleAttestorSelectTableItems = [
time: '13 hours ago',
action: 'Create Proposal',
programs: 'DL2',
- value: '0.6588 dlcBTC',
+ value: '0.6588 iBTC',
token: 'N/A',
},
{
@@ -36,7 +36,7 @@ export const exampleAttestorSelectTableItems = [
time: '3 hours ago',
action: 'Update Vote State',
programs: 'VP',
- value: '0.4762 dlcBTC',
+ value: '0.4762 iBTC',
token: 'N/A',
},
{
@@ -44,7 +44,7 @@ export const exampleAttestorSelectTableItems = [
time: '18 hours ago',
action: 'Create Proposal',
programs: 'TS',
- value: '0.1499 dlcBTC',
+ value: '0.1499 iBTC',
token: 'N/A',
},
{
@@ -52,7 +52,7 @@ export const exampleAttestorSelectTableItems = [
time: '7 hours ago',
action: 'Update Vote State',
programs: 'DL2',
- value: '0.5255 dlcBTC',
+ value: '0.5255 iBTC',
token: 'N/A',
},
{
@@ -60,7 +60,7 @@ export const exampleAttestorSelectTableItems = [
time: '6 hours ago',
action: 'Create Proposal',
programs: 'TS',
- value: '0.9675 dlcBTC',
+ value: '0.9675 iBTC',
token: 'N/A',
},
];
diff --git a/src/shared/models/ethereum-models.ts b/src/shared/models/ethereum-models.ts
index 4c72a60f..d4e0b0da 100644
--- a/src/shared/models/ethereum-models.ts
+++ b/src/shared/models/ethereum-models.ts
@@ -17,7 +17,7 @@ export interface EthereumNetworkConfiguration {
| 'evm-hardhat-eth';
enabledEthereumNetworks: EthereumNetwork[];
dlcManagerContract: Contract;
- dlcBTCContract: Contract;
+ iBTCContract: Contract;
chain: Chain;
}
@@ -33,7 +33,7 @@ export interface DetailedEvent {
}
export interface FormattedEvent {
merchant: string;
- dlcBTCAmount: number;
+ iBTCAmount: number;
txHash: string;
date: string;
chain: string;
diff --git a/src/shared/models/merchant.ts b/src/shared/models/merchant.ts
index 8e4d4dfc..d0982fb7 100644
--- a/src/shared/models/merchant.ts
+++ b/src/shared/models/merchant.ts
@@ -6,5 +6,5 @@ export interface Merchant {
export interface MerchantProofOfReserve {
merchant: Merchant;
- dlcBTCAmount: number | undefined;
+ iBTCAmount: number | undefined;
}
diff --git a/src/shared/models/token.ts b/src/shared/models/token.ts
index ef793425..31cb5722 100644
--- a/src/shared/models/token.ts
+++ b/src/shared/models/token.ts
@@ -4,10 +4,10 @@ export interface Token {
logoAlt: string;
}
-export const dlcBTC: Token = {
- name: 'dlcBTC',
- logo: '/images/logos/dlc-btc-logo.svg',
- logoAlt: 'dlcBTC Logo',
+export const iBTC: Token = {
+ name: 'iBTC',
+ logo: '/images/logos/ibtc-logo.svg',
+ logoAlt: 'iBTC Logo',
};
export const bitcoin: Token = {
diff --git a/src/shared/utils.ts b/src/shared/utils.ts
index 91f22573..e7f52334 100644
--- a/src/shared/utils.ts
+++ b/src/shared/utils.ts
@@ -39,7 +39,7 @@ export function formatEvent(event: DetailedEvent): FormattedEvent {
const isMint = event.eventType === 'mint';
const date = new Date(event.timestamp * 1000);
return {
- dlcBTCAmount: isMint ? event.value : -event.value,
+ iBTCAmount: isMint ? event.value : -event.value,
merchant: isMint ? event.to : event.from,
txHash: event.txHash,
date: date
diff --git a/vite.config.ts b/vite.config.ts
index 052bfd72..4070689d 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -20,7 +20,7 @@ async function fetchEthereumDeploymentPlans(
network => network.id === ethereumNetworkID
);
- const networkDeploymentPlans = await Promise.all(['DLCManager', 'DLCBTC'].map(async (contractName) => {
+ const networkDeploymentPlans = await Promise.all(['DLCManager', 'IBTC'].map(async (contractName) => {
let deploymentPlanURL: string;
switch (appEnvironment) {
case 'mainnet':
From 135c5d94f632564863137dfddcb28f8a037107eb Mon Sep 17 00:00:00 2001
From: Polybius93 <99192647+Polybius93@users.noreply.github.com>
Date: Fri, 29 Nov 2024 13:48:17 +0100
Subject: [PATCH 11/12] chore: update dlc-btc-lib to v.2.4.17 (#219)
---
package.json | 2 +-
yarn.lock | 8 ++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/package.json b/package.json
index 0e30fd93..2d934487 100644
--- a/package.json
+++ b/package.json
@@ -46,7 +46,7 @@
"concurrently": "^8.2.2",
"d3": "^7.9.0",
"decimal.js": "^10.4.3",
- "dlc-btc-lib": "2.4.17",
+ "dlc-btc-lib": "2.4.18",
"dotenv": "^16.3.1",
"ethers": "5.7.2",
"formik": "^2.4.5",
diff --git a/yarn.lock b/yarn.lock
index a5f40f86..8395a43a 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -5195,10 +5195,10 @@ dir-glob@^3.0.1:
dependencies:
path-type "^4.0.0"
-dlc-btc-lib@2.4.17:
- version "2.4.17"
- resolved "https://registry.yarnpkg.com/dlc-btc-lib/-/dlc-btc-lib-2.4.17.tgz#44ff9dab788562cfa08ad299f65b275f7f7f5ff4"
- integrity sha512-8gzJ40MttJHHtO8i0+qMoEtltVCwQ6U7y76w93lI/7jvVs4fBu+HlQvFtmfboNBJF1uAsoO1Hic5W6OzVlIrgQ==
+dlc-btc-lib@2.4.18:
+ version "2.4.18"
+ resolved "https://registry.yarnpkg.com/dlc-btc-lib/-/dlc-btc-lib-2.4.18.tgz#246c15af91bfcf03212f8abd440b122f575510f4"
+ integrity sha512-Q7t8VGrrbA2ioyNvvNXxH8dfqQwFUDLpLNWHwqqY0H8zaD4gXpKswi1clDHy7gASZhcLvBBOKAYp5+PUkja/YA==
dependencies:
"@gemwallet/api" "3.8.0"
"@ledgerhq/hw-app-btc" "10.4.1"
From 2a2c23982c27c29e1ccaeeccd7334087a83c64cb Mon Sep 17 00:00:00 2001
From: Polybius93 <99192647+Polybius93@users.noreply.github.com>
Date: Mon, 2 Dec 2024 10:57:01 +0100
Subject: [PATCH 12/12] chore: modify esplora endpoint from custom to public
(#220)
---
config.mainnet.json | 2 +-
config.testnet.json | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/config.mainnet.json b/config.mainnet.json
index 915bbee4..ecb72180 100644
--- a/config.mainnet.json
+++ b/config.mainnet.json
@@ -6,7 +6,7 @@
"bitcoinNetwork": "mainnet",
"bitcoinNetworkIndex": 0,
"bitcoinNetworkPreFix": "bc1",
- "bitcoinBlockchainURL": "https://mainnet.dlc.link/electrs",
+ "bitcoinBlockchainURL": "https://blockstream.info/api",
"bitcoinBlockchainExplorerURL": "https://mempool.space",
"bitcoinBlockchainFeeEstimateURL": "https://mempool.space/api/v1/fees/recommended",
"rippleIssuerAddress": "rGcyRGrZPaJAZbZDi4NqRFLA5GQH63iFpD",
diff --git a/config.testnet.json b/config.testnet.json
index 81e7f9bc..5e039a57 100644
--- a/config.testnet.json
+++ b/config.testnet.json
@@ -6,7 +6,7 @@
"bitcoinNetwork": "testnet",
"bitcoinNetworkIndex": 1,
"bitcoinNetworkPreFix": "tb1",
- "bitcoinBlockchainURL": "https://testnet.dlc.link/electrs",
+ "bitcoinBlockchainURL": "https://blockstream.info/testnet/api",
"bitcoinBlockchainExplorerURL": "https://mempool.space/testnet",
"bitcoinBlockchainFeeEstimateURL": "https://mempool.space/testnet/api/v1/fees/recommended",
"rippleIssuerAddress": "ra3oyRVfy4yD4NJPrVcewvDtisZ3FhkcYL",