From 8a9f37f20739cf99fd82a4e4da63c0ef6ed69539 Mon Sep 17 00:00:00 2001 From: sstefdev Date: Tue, 17 Dec 2024 20:19:07 +0100 Subject: [PATCH 1/2] chore: update readme, fix uknown name for network --- packages/create-invoice-form/README.md | 30 ++++++++++++++++ packages/invoice-dashboard/README.md | 36 +++++++++++++++++-- .../src/lib/view-requests.svelte | 6 +++- shared/icons/network/network-icon.svelte | 2 +- 4 files changed, 69 insertions(+), 5 deletions(-) diff --git a/packages/create-invoice-form/README.md b/packages/create-invoice-form/README.md index 3b6dd51c..e7fabd25 100644 --- a/packages/create-invoice-form/README.md +++ b/packages/create-invoice-form/README.md @@ -24,6 +24,12 @@ npm install @requestnetwork/create-invoice-form You can directly pass props into the create-invoice-form web component without needing to create references or use workarounds. +##### Important Note on Currencies Prop + +- The currencies prop is now optional. +- If you include the currencies prop and follow the proper format, it will override the default currencies. +- To use the default currencies list, simply omit the currencies prop. + ```tsx import Head from "next/head"; import { config } from "@/utils/config"; @@ -53,6 +59,30 @@ export default function CreateInvoice() { } ``` +#### Example Override for Currencies + +If you need to customize the currencies list, ensure you follow the correct format: + +```ts +export const currencies: CurrencyTypes.CurrencyInput[] = [ + { + symbol: "FAU", + address: "0x370DE27fdb7D1Ff1e1BaA7D11c5820a324Cf623C", + network: "sepolia", + decimals: 18, + type: RequestLogicTypes.CURRENCY.ERC20, + }, + { + symbol: "ETH", + network: "sepolia", + decimals: 18, + type: RequestLogicTypes.CURRENCY.ETH, + }, +]; +``` + +When added, this will replace the default currencies list. To retain the defaults, do not include the `currencies` prop. + #### [initializeRN.ts](https://github.com/RequestNetwork/invoicing-template/blob/main/utils/initializeRN.ts) Initialize the `RequestNetwork` object using an Ethers `Signer` or Viem `WalletClient`. diff --git a/packages/invoice-dashboard/README.md b/packages/invoice-dashboard/README.md index 080f0a1d..a3fbd2df 100644 --- a/packages/invoice-dashboard/README.md +++ b/packages/invoice-dashboard/README.md @@ -24,6 +24,12 @@ npm install @requestnetwork/invoice-dashboard You can directly pass props into the invoice-dashboard web component without needing to create references or use workarounds. +##### Important Note on Currencies Prop + +- The currencies prop is now optional. +- If you include the currencies prop and follow the proper format, it will override the default currencies. +- To use the default currencies list, simply omit the currencies prop. + ```tsx import Head from "next/head"; import { config } from "@/utils/config"; @@ -53,6 +59,30 @@ export default function InvoiceDashboardPage() { } ``` +#### Example Override for Currencies + +If you need to customize the currencies list, ensure you follow the correct format: + +```ts +export const currencies: CurrencyTypes.CurrencyInput[] = [ + { + symbol: "FAU", + address: "0x370DE27fdb7D1Ff1e1BaA7D11c5820a324Cf623C", + network: "sepolia", + decimals: 18, + type: RequestLogicTypes.CURRENCY.ERC20, + }, + { + symbol: "ETH", + network: "sepolia", + decimals: 18, + type: RequestLogicTypes.CURRENCY.ETH, + }, +]; +``` + +When added, this will replace the default currencies list. To retain the defaults, do not include the `currencies` prop. + #### [initializeRN.ts](https://github.com/RequestNetwork/invoicing-template/blob/main/utils/initializeRN.ts) Initialize the `RequestNetwork` object using an Ethers `Signer` or Viem `WalletClient`. @@ -124,14 +154,14 @@ export const config: IConfig = { | Cancel Request | ❌ | | Add Stakeholder | ❌ | | Native Payment | ❌ | -| Conversion Payment | ❌ | +| Conversion Payment | ✅ | | Batch Payment | ❌ | | Declarative Payment | ❌ | | Swap-to-Pay Payment | ❌ | | Swap-to-Conversion Payment | ❌ | | Escrow Payment | ❌ | -| Improved UI and UX | ❌ | -| More Chains and Currencies | ❌ | +| Improved UI and UX | ✅ | +| More Chains and Currencies | ✅ | | More Configuration Options | ❌ | | Attachments | ❌ | diff --git a/packages/invoice-dashboard/src/lib/view-requests.svelte b/packages/invoice-dashboard/src/lib/view-requests.svelte index 513c15e7..0901bd90 100644 --- a/packages/invoice-dashboard/src/lib/view-requests.svelte +++ b/packages/invoice-dashboard/src/lib/view-requests.svelte @@ -445,6 +445,7 @@ await getRequests(); loading = false; }; + $: sliderValueForDecryption, enableDecryption(); @@ -726,7 +727,10 @@ {#if request.paymentCurrencies.length > 0} - + {:else} - {/if} diff --git a/shared/icons/network/network-icon.svelte b/shared/icons/network/network-icon.svelte index 7435ee02..4c312d0f 100644 --- a/shared/icons/network/network-icon.svelte +++ b/shared/icons/network/network-icon.svelte @@ -12,7 +12,7 @@
{#if showLabel} - {capitalize(network)} + {capitalize(network) || "Unknown"} {/if}
{/if} From 13f75329045a8bcbede5f2e4a970ab5fb6815e12 Mon Sep 17 00:00:00 2001 From: sstefdev Date: Wed, 18 Dec 2024 12:52:17 +0100 Subject: [PATCH 2/2] chore: update readme --- packages/create-invoice-form/README.md | 12 ++++++------ packages/invoice-dashboard/README.md | 14 +++++++------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/packages/create-invoice-form/README.md b/packages/create-invoice-form/README.md index e7fabd25..90502546 100644 --- a/packages/create-invoice-form/README.md +++ b/packages/create-invoice-form/README.md @@ -24,12 +24,6 @@ npm install @requestnetwork/create-invoice-form You can directly pass props into the create-invoice-form web component without needing to create references or use workarounds. -##### Important Note on Currencies Prop - -- The currencies prop is now optional. -- If you include the currencies prop and follow the proper format, it will override the default currencies. -- To use the default currencies list, simply omit the currencies prop. - ```tsx import Head from "next/head"; import { config } from "@/utils/config"; @@ -59,6 +53,12 @@ export default function CreateInvoice() { } ``` +### Important Note on Currencies Prop + +- The currencies prop is now optional. +- If you include the currencies prop and follow the proper format, it will override the default currencies. +- To use the default currencies list, simply omit the currencies prop. + #### Example Override for Currencies If you need to customize the currencies list, ensure you follow the correct format: diff --git a/packages/invoice-dashboard/README.md b/packages/invoice-dashboard/README.md index a3fbd2df..27415024 100644 --- a/packages/invoice-dashboard/README.md +++ b/packages/invoice-dashboard/README.md @@ -24,12 +24,6 @@ npm install @requestnetwork/invoice-dashboard You can directly pass props into the invoice-dashboard web component without needing to create references or use workarounds. -##### Important Note on Currencies Prop - -- The currencies prop is now optional. -- If you include the currencies prop and follow the proper format, it will override the default currencies. -- To use the default currencies list, simply omit the currencies prop. - ```tsx import Head from "next/head"; import { config } from "@/utils/config"; @@ -59,6 +53,12 @@ export default function InvoiceDashboardPage() { } ``` +### Important Note on Currencies Prop + +- The currencies prop is now optional. +- If you include the currencies prop and follow the proper format, it will override the default currencies. +- To use the default currencies list, simply omit the currencies prop. + #### Example Override for Currencies If you need to customize the currencies list, ensure you follow the correct format: @@ -153,7 +153,7 @@ export const config: IConfig = { | Accept Request | ❌ | | Cancel Request | ❌ | | Add Stakeholder | ❌ | -| Native Payment | ❌ | +| Native Payment | ✅ | | Conversion Payment | ✅ | | Batch Payment | ❌ | | Declarative Payment | ❌ |