Skip to content

Commit 8b63c2c

Browse files
fix: stellar eurc payment state
1 parent 7c449b3 commit 8b63c2c

File tree

5 files changed

+115
-99
lines changed

5 files changed

+115
-99
lines changed

examples/nextjs-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"@headlessui/react": "^2.2.0",
1515
"@rainbow-me/rainbowkit": "^2.2.8",
1616
"@rozoai/intent-common": "0.1.8",
17-
"@rozoai/intent-pay": "0.1.12",
17+
"@rozoai/intent-pay": "0.1.13",
1818
"@tanstack/react-query": "^5.51.11",
1919
"@types/react-syntax-highlighter": "^15.5.13",
2020
"@wagmi/core": "^2.22.0",

packages/connectkit/bundle-analysis.html

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

packages/connectkit/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@rozoai/intent-pay",
33
"private": false,
4-
"version": "0.1.12",
4+
"version": "0.1.13",
55
"author": "RozoAI",
66
"homepage": "https://github.com/RozoAI/intent-pay",
77
"license": "BSD-2-Clause",

packages/connectkit/src/hooks/usePaymentState.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ import {
2929
rozoSolana,
3030
rozoSolanaUSDC,
3131
rozoStellar,
32+
rozoStellarEURC,
3233
rozoStellarUSDC,
3334
solana,
3435
WalletPaymentOption,
@@ -1011,12 +1012,27 @@ export function usePaymentState({
10111012
}
10121013

10131014
const destinationAddress = rozoPayment.destAddress;
1014-
const issuer = rozoStellarUSDC.token.split(":")[1];
1015+
// const issuer = rozoStellarUSDC.token.split(":")[1];
10151016

10161017
// Setup Stellar payment
10171018
await stellarKit.setWallet(String(stellarConnector?.id ?? "freighter"));
10181019
const sourceAccount = await stellarServer.loadAccount(stellarPublicKey);
1019-
const destAsset = new Asset("USDC", issuer);
1020+
1021+
let issuer = "";
1022+
if (walletPaymentOption.required.token.token === rozoStellarUSDC.token) {
1023+
issuer = rozoStellarUSDC.token.split(":")[1];
1024+
} else if (
1025+
walletPaymentOption.required.token.token === rozoStellarEURC.token
1026+
) {
1027+
issuer = rozoStellarEURC.token.split(":")[1];
1028+
} else {
1029+
throw new Error("Unsupported token");
1030+
}
1031+
1032+
const destAsset = new Asset(
1033+
walletPaymentOption.required.token.symbol,
1034+
issuer
1035+
);
10201036
const fee = String(await stellarServer.fetchBaseFee());
10211037

10221038
// Build transaction

0 commit comments

Comments
 (0)