Skip to content

Commit 21d33ee

Browse files
fix: using deprecated method for retrieving currencies from currency manager (#103)
Co-authored-by: MantisClone <david.huntmateo@request.network>
1 parent c30100d commit 21d33ee

File tree

2 files changed

+25
-8
lines changed

2 files changed

+25
-8
lines changed

packages/invoice-dashboard/src/lib/dashboard/invoice-view.svelte

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@
3939
export let isRequestPayed: boolean;
4040
4141
let network = request?.currencyInfo?.network || "mainnet";
42-
let currency = currencyManager.fromAddress(request?.currencyInfo?.value);
42+
// FIXME: Use a non deprecated function
43+
let currency = currencyManager.from(
44+
request?.currencyInfo.value,
45+
request?.currencyInfo.network
46+
);
4347
let statuses: any = [];
4448
let isPaid = false;
4549
let loading = false;
@@ -99,7 +103,11 @@
99103
$: {
100104
wallet = wallet;
101105
network = request?.currencyInfo?.network || "mainnet";
102-
currency = currencyManager.fromAddress(request?.currencyInfo?.value);
106+
// FIXME: Use a non deprecated function
107+
currency = currencyManager.from(
108+
request?.currencyInfo.value,
109+
request?.currencyInfo.network
110+
);
103111
}
104112
105113
const checkInvoice = async () => {

packages/invoice-dashboard/src/lib/view-requests.svelte

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@
8686
type: Types.Identity.TYPE.ETHEREUM_ADDRESS,
8787
value: signer,
8888
});
89+
8990
requests = requestsData
9091
?.map((request) => request.getData())
9192
.sort((a, b) => b.timestamp - a.timestamp);
@@ -482,11 +483,17 @@
482483
<td>
483484
{formatUnits(
484485
BigInt(request.expectedAmount),
485-
currencyManager.fromAddress(request.currencyInfo.value)
486-
?.decimals ?? 18
486+
// FIXME: Use a non deprecated function
487+
currencyManager.from(
488+
request.currencyInfo.value,
489+
request.currencyInfo.network
490+
)?.decimals ?? 18
487491
)}
488-
{currencyManager.fromAddress(request.currencyInfo.value)
489-
?.symbol}
492+
<!-- FIXME: Use a non deprecated function -->
493+
{currencyManager.from(
494+
request.currencyInfo.value,
495+
request.currencyInfo.network
496+
)?.symbol}
490497
</td>
491498
<td> {checkStatus(request)}</td>
492499
<td
@@ -496,8 +503,10 @@
496503
try {
497504
await exportToPDF(
498505
request,
499-
currencyManager.fromAddress(
500-
request?.currencyInfo?.value
506+
// FIXME: Use a non deprecated function
507+
currencyManager.from(
508+
request.currencyInfo.value,
509+
request.currencyInfo.network
501510
),
502511
config.logo
503512
);

0 commit comments

Comments
 (0)