@@ -20,9 +20,12 @@ import {
2020 toWalletAddressUrl ,
2121 type ErrorWithKeyLike ,
2222} from '@/shared/helpers' ;
23- import type { WalletAddress } from '@interledger/open-payments' ;
2423import type { ConnectWalletPayload , Response } from '@/shared/messages' ;
25- import type { DeepReadonly , PopupTransientState } from '@/shared/types' ;
24+ import type {
25+ DeepReadonly ,
26+ PopupTransientState ,
27+ WalletInfo ,
28+ } from '@/shared/types' ;
2629
2730interface Inputs {
2831 walletAddressUrl : string ;
@@ -46,7 +49,7 @@ interface ConnectWalletFormProps {
4649 state ?: ConnectTransientState ;
4750 walletAddressPlaceholder ?: string ;
4851 saveValue ?: ( key : keyof Inputs , val : Inputs [ typeof key ] ) => void ;
49- getWalletInfo : ( walletAddressUrl : string ) => Promise < WalletAddress > ;
52+ getWalletInfo : ( walletAddressUrl : string ) => Promise < WalletInfo > ;
5053 connectWallet : ( data : ConnectWalletPayload ) => Promise < Response > ;
5154 clearConnectState : ( ) => Promise < unknown > ;
5255 onConnect ?: ( ) => void ;
@@ -102,7 +105,7 @@ export const ConnectWalletForm = ({
102105 ) ;
103106
104107 const [ walletAddressInfo , setWalletAddressInfo ] =
105- React . useState < WalletAddress | null > ( null ) ;
108+ React . useState < WalletInfo | null > ( null ) ;
106109
107110 const [ errors , setErrors ] = React . useState < Errors > ( {
108111 walletAddressUrl : null ,
@@ -244,7 +247,9 @@ export const ConnectWalletForm = ({
244247 }
245248 setErrors ( ( prev ) => ( { ...prev , keyPair : null , connect : null } ) ) ;
246249 const res = await connectWallet ( {
247- walletAddressUrl : toWalletAddressUrl ( walletAddress ) ,
250+ walletAddress :
251+ walletAddressInfo ??
252+ ( await getWalletInfo ( toWalletAddressUrl ( walletAddress ) ) ) ,
248253 amount,
249254 recurring,
250255 autoKeyAdd : ! skipAutoKeyShare ,
0 commit comments