@@ -18,6 +18,8 @@ public partial class EcosystemWallet : PrivateKeyWallet
1818 private readonly string _email ;
1919 private readonly string _phoneNumber ;
2020 private readonly string _authProvider ;
21+ private readonly string _ecosystemId ;
22+ private readonly string _ecosystemPartnerId ;
2123
2224 private string _address ;
2325
@@ -26,9 +28,21 @@ public partial class EcosystemWallet : PrivateKeyWallet
2628 private const string EMBEDDED_WALLET_PATH_V1 = $ "{ EMBEDDED_WALLET_BASE_PATH } /v1";
2729 private const string ENCLAVE_PATH = $ "{ EMBEDDED_WALLET_PATH_V1 } /enclave-wallet";
2830
29- private EcosystemWallet ( ThirdwebClient client , EmbeddedWallet embeddedWallet , IThirdwebHttpClient httpClient , string email , string phoneNumber , string authProvider , IThirdwebWallet siweSigner )
31+ private EcosystemWallet (
32+ string ecosystemId ,
33+ string ecosystemPartnerId ,
34+ ThirdwebClient client ,
35+ EmbeddedWallet embeddedWallet ,
36+ IThirdwebHttpClient httpClient ,
37+ string email ,
38+ string phoneNumber ,
39+ string authProvider ,
40+ IThirdwebWallet siweSigner
41+ )
3042 : base ( client , null )
3143 {
44+ this . _ecosystemId = ecosystemId ;
45+ this . _ecosystemPartnerId = ecosystemPartnerId ;
3246 this . _embeddedWallet = embeddedWallet ;
3347 this . _httpClient = httpClient ;
3448 this . _email = email ;
@@ -79,6 +93,7 @@ public static async Task<EcosystemWallet> Create(
7993 AuthProvider . Line => "Line" ,
8094 AuthProvider . Guest => "Guest" ,
8195 AuthProvider . X => "X" ,
96+ AuthProvider . Coinbase => "Coinbase" ,
8297 AuthProvider . Default => string . IsNullOrEmpty ( email ) ? "Phone" : "Email" ,
8398 _ => throw new ArgumentException ( "Invalid AuthProvider" ) ,
8499 } ;
@@ -113,12 +128,12 @@ public static async Task<EcosystemWallet> Create(
113128 try
114129 {
115130 var userAddress = await ResumeEnclaveSession ( enclaveHttpClient , embeddedWallet , email , phoneNumber , authproviderStr ) . ConfigureAwait ( false ) ;
116- return new EcosystemWallet ( client , embeddedWallet , enclaveHttpClient , email , phoneNumber , authproviderStr , siweSigner ) { _address = userAddress } ;
131+ return new EcosystemWallet ( ecosystemId , ecosystemPartnerId , client , embeddedWallet , enclaveHttpClient , email , phoneNumber , authproviderStr , siweSigner ) { _address = userAddress } ;
117132 }
118133 catch
119134 {
120135 enclaveHttpClient . RemoveHeader ( "Authorization" ) ;
121- return new EcosystemWallet ( client , embeddedWallet , enclaveHttpClient , email , phoneNumber , authproviderStr , siweSigner ) { _address = null } ;
136+ return new EcosystemWallet ( ecosystemId , ecosystemPartnerId , client , embeddedWallet , enclaveHttpClient , email , phoneNumber , authproviderStr , siweSigner ) { _address = null } ;
122137 }
123138 }
124139
@@ -329,6 +344,7 @@ public async Task<List<LinkedAccount>> LinkAccount(
329344 case "Telegram" :
330345 case "Line" :
331346 case "X" :
347+ case "Coinbase" :
332348 serverRes = await walletToLink . PreAuth_OAuth ( isMobile ?? false , browserOpenAction , mobileRedirectScheme , browser ) . ConfigureAwait ( false ) ;
333349 break ;
334350 default :
@@ -450,6 +466,11 @@ public async Task<string> LoginWithOtp(string otp)
450466 var redirectUrl = isMobile ? mobileRedirectScheme : "http://localhost:8789/" ;
451467 var loginUrl = await this . _embeddedWallet . FetchHeadlessOauthLoginLinkAsync ( this . _authProvider , platform ) . ConfigureAwait ( false ) ;
452468 loginUrl = platform == "web" ? loginUrl : $ "{ loginUrl } ?platform={ platform } &redirectUrl={ redirectUrl } &developerClientId={ this . Client . ClientId } &authOption={ this . _authProvider } ";
469+ loginUrl = $ "{ loginUrl } &ecosystemId={ this . _ecosystemId } ";
470+ if ( ! string . IsNullOrEmpty ( this . _ecosystemPartnerId ) )
471+ {
472+ loginUrl = $ "{ loginUrl } &ecosystemPartnerId={ this . _ecosystemPartnerId } ";
473+ }
453474
454475 browser ??= new InAppWalletBrowser ( ) ;
455476 var browserResult = await browser . Login ( this . Client , loginUrl , redirectUrl , browserOpenAction , cancellationToken ) . ConfigureAwait ( false ) ;
0 commit comments