@@ -208,6 +220,22 @@ function RouteComponent() {
500 USDC
+
+
+ Receiving At
+
+ {vpa}
+
+
+
+
+ Receiving Amount
+
+ {intentQuery.data?.railAmount ? toTokens(BigInt(intentQuery.data?.railAmount), 2) : "..."} INR
+
+
+
+
@@ -237,6 +265,7 @@ function RouteComponent() {
className="w-full btn-glossy"
onClick={() => commitSolutionMutation.mutate()}
>
+ {commitSolutionMutation.isPending && }
Confirm Payment
{
+ if (!winningSolution) throw new Error("INVALID STATE");
+ if (!account) throw new Error("Please connect wallet");
+
+ const zkUpiContract = getContract({
+ address: zkRailUPI,
+ chain: baseSepolia,
+ client
+ });
+
+
+ const transaction = prepareContractCall({
+ contract: zkUpiContract,
+ method: "function settle(bytes32)" as const,
+ params: [intentIdToBytes32(intentId)]
+ });
+
+ const { transactionHash } = await sendAndConfirmTransaction({
+ account,
+ transaction,
+ });
+
+ console.log(transactionHash);
+
+ await intentAggregatorApi.post(`solutions/${winningSolution.id}/settle`, {
+ json: {
+ settlementTxHash: transactionHash
+ }
+ });
+ // return await client.post(`/intents/${intentId}/settle`).json()
+ },
+ onError: (err) => {
+ console.error(err);
+ }
+ })
+
+
+
+ return (
+
+
+
Payment Status
+
+ {isUpiConfirmed &&
+ <>
+ {
+ intentQuery.data?.state !== "SETTLED" ?
+ <>
+
Confirm you have received the payment to settle the transaction and receive your 50% collateral.
+
settleMutation.mutate()}
+ >
+ {settleMutation.isPending && }
+ Settle Payment
+
+
+
+
+ Didn't Receive Payment
+
+
+
+
+ Warning
+
+ If you have not received the payment, you will receive your original amount + the bond amount (500 USDC) after 48 hours.
+
+
+
+
+
+ If you maliciously do not confirm the payment despite the taker having made the payment, the maker can submit a zkproof of this transaction. If the zkproof is verified on-chain, you will lose the bond amount. It's better to settle the payment once received.
+
+
+
+
+
+ > :
+ Done
+
+ }
+ >}
+
+
+ )
+}
+
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index bda94df..121897d 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -137,6 +137,9 @@ importers:
react-dom:
specifier: ^18.3.1
version: 18.3.1(react@18.3.1)
+ react-qr-code:
+ specifier: ^2.0.15
+ version: 2.0.15(react@18.3.1)
sonner:
specifier: ^1.7.0
version: 1.7.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
@@ -183,6 +186,9 @@ importers:
packages/upi-taker:
dependencies:
+ '@radix-ui/react-dialog':
+ specifier: ^1.1.2
+ version: 1.1.2(@types/react-dom@18.3.2)(@types/react@18.3.14)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)
'@radix-ui/react-slot':
specifier: ^1.1.0
version: 1.1.0(@types/react@18.3.14)(react@18.3.1)
@@ -3364,9 +3370,15 @@ packages:
process-warning@1.0.0:
resolution: {integrity: sha512-du4wfLyj4yCZq1VupnVSZmRsPJsNuxoDQFdCFHLaYiEbFBD7QE0a+I4D7hOxrVnh78QE/YipFAj9lXHiXocV+Q==}
+ prop-types@15.8.1:
+ resolution: {integrity: sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==}
+
proxy-compare@2.5.1:
resolution: {integrity: sha512-oyfc0Tx87Cpwva5ZXezSp5V9vht1c7dZBhvuV/y3ctkgMVUmiAGDVeeB0dKhGSyT0v1ZTEQYpe/RXlBVBNuCLA==}
+ qr.js@0.0.0:
+ resolution: {integrity: sha512-c4iYnWb+k2E+vYpRimHqSu575b1/wKl4XFeJGpFmrJQz5I88v9aY2czh7s0w36srfCM1sXgC/xpoJz5dJfq+OQ==}
+
qrcode@1.5.3:
resolution: {integrity: sha512-puyri6ApkEHYiVl4CFzo1tDkAZ+ATcnbJrJ6RiBM1Fhctdn/ix9MTE3hRph33omisEbC/2fcfemsseiKgBPKZg==}
engines: {node: '>=10.13.0'}
@@ -3403,6 +3415,11 @@ packages:
peerDependencies:
react: ^16.8.0 || ^17.0.0 || ^18.0.0
+ react-qr-code@2.0.15:
+ resolution: {integrity: sha512-MkZcjEXqVKqXEIMVE0mbcGgDpkfSdd8zhuzXEl9QzYeNcw8Hq2oVIzDLWuZN2PQBwM5PWjc2S31K8Q1UbcFMfw==}
+ peerDependencies:
+ react: '*'
+
react-refresh@0.14.2:
resolution: {integrity: sha512-jCvmsr+1IUSMUyzOkRcvnVbX3ZYC6g9TDrDbFuFmRDq7PD4yaGbLKNQL6k2jnArV8hjYxh7hVhAZB6s9HDGpZA==}
engines: {node: '>=0.10.0'}
@@ -7272,8 +7289,16 @@ snapshots:
process-warning@1.0.0: {}
+ prop-types@15.8.1:
+ dependencies:
+ loose-envify: 1.4.0
+ object-assign: 4.1.1
+ react-is: 16.13.1
+
proxy-compare@2.5.1: {}
+ qr.js@0.0.0: {}
+
qrcode@1.5.3:
dependencies:
dijkstrajs: 1.0.3
@@ -7313,6 +7338,12 @@ snapshots:
react: 18.3.1
use-deep-compare-effect: 1.8.1(react@18.3.1)
+ react-qr-code@2.0.15(react@18.3.1):
+ dependencies:
+ prop-types: 15.8.1
+ qr.js: 0.0.0
+ react: 18.3.1
+
react-refresh@0.14.2: {}
react-remove-scroll-bar@2.3.6(@types/react@18.3.14)(react@18.3.1):