File tree Expand file tree Collapse file tree 5 files changed +115
-99
lines changed
Expand file tree Collapse file tree 5 files changed +115
-99
lines changed Original file line number Diff line number Diff line change 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" ,
Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change 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" ,
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments