diff --git a/apps/examples/uma-vasp-cli/package.json b/apps/examples/uma-vasp-cli/package.json index 79d2737d..5a3f5cd3 100644 --- a/apps/examples/uma-vasp-cli/package.json +++ b/apps/examples/uma-vasp-cli/package.json @@ -45,7 +45,7 @@ "@inquirer/prompts": "^1.1.3", "@lightsparkdev/core": "1.2.6", "@lightsparkdev/lightspark-sdk": "1.8.8", - "@uma-sdk/core": "^1.2.0", + "@uma-sdk/core": "^1.2.3", "chalk": "^5.3.0", "commander": "^11.0.0" }, diff --git a/apps/examples/uma-vasp/package.json b/apps/examples/uma-vasp/package.json index 431b768c..3320106c 100644 --- a/apps/examples/uma-vasp/package.json +++ b/apps/examples/uma-vasp/package.json @@ -15,7 +15,7 @@ "dependencies": { "@lightsparkdev/core": "1.2.6", "@lightsparkdev/lightspark-sdk": "1.8.8", - "@uma-sdk/core": "^1.2.0", + "@uma-sdk/core": "^1.2.3", "express": "^4.18.2", "uuid": "^9.0.0", "zod": "^3.22.4" diff --git a/apps/examples/uma-vasp/src/SendingVasp.ts b/apps/examples/uma-vasp/src/SendingVasp.ts index 9644614b..173f9432 100644 --- a/apps/examples/uma-vasp/src/SendingVasp.ts +++ b/apps/examples/uma-vasp/src/SendingVasp.ts @@ -961,7 +961,7 @@ export default class SendingVasp { requestUrl: requestUrl, senderProfile: payerPofile, pubKeys: pubKeys, - umaVersion: invoice.umaVersion, + umaVersion: invoice.umaVersions, invoiceUUID: invoice.invoiceUUID }); } @@ -998,7 +998,7 @@ export default class SendingVasp { // invoice data / utxo callback / etc not required undefined, undefined, undefined ) - // In a real VASP, here you might push a notification to inform the sender that + // In a real VASP, here you might push a notification to inform the sender that // a new invoice has arrived. return { httpStatus: 200 diff --git a/packages/ui/package.json b/packages/ui/package.json index f082c158..5b325de8 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -63,6 +63,7 @@ "@simbathesailor/use-what-changed": "^2.0.0", "@svgr/core": "^8.1.0", "@tanstack/react-table": "^8.20.5", + "@uma-sdk/core": "^1.2.3", "@wojtekmaj/react-daterange-picker": "^5.5.0", "@wojtekmaj/react-datetimerange-picker": "^5.5.0", "@zxing/browser": "^0.1.1", diff --git a/packages/ui/src/hooks/useFields.tsx b/packages/ui/src/hooks/useFields.tsx index 23ded253..5d165f13 100644 --- a/packages/ui/src/hooks/useFields.tsx +++ b/packages/ui/src/hooks/useFields.tsx @@ -1,3 +1,4 @@ +import { isValidUmaAddress } from "@uma-sdk/core"; import { diff } from "deep-object-diff"; import { isObject } from "lodash-es"; import { useCallback, useEffect, useMemo, useRef, useState } from "react"; @@ -21,6 +22,7 @@ const defaultMsgs = { code: "Code must be eight characters long.", password: "Password must be at least eight characters.", required: "This field is required.", + umaAddress: "Please enter a valid UMA address.", }; const regexp = { @@ -56,6 +58,10 @@ export const v: Validators = { (msg = defaultMsgs.code) => (value) => value.trim().length !== 8 ? msg : false, + umaAddress: + (msg = defaultMsgs.umaAddress) => + (value) => + !isValidUmaAddress(value) ? msg : false, required: (msg = defaultMsgs.required) => (value) =>