|
74 | 74 |
|
75 | 75 | #region Ecosystem Wallet
|
76 | 76 |
|
77 |
| -var ecosystemWallet = await EcosystemWallet.Create(client: client, ecosystemId: "ecosystem.the-bonfire", email: "firekeeper+bonfire3@thirdweb.com"); |
78 |
| - |
79 |
| -if (!await ecosystemWallet.IsConnected()) |
80 |
| -{ |
81 |
| - _ = await ecosystemWallet.SendOTP(); |
82 |
| - Console.WriteLine("Enter OTP:"); |
83 |
| - var otp = Console.ReadLine(); |
84 |
| - _ = await ecosystemWallet.LoginWithOtp(otp); |
85 |
| -} |
86 |
| -var ecosystemWalletAddress = await ecosystemWallet.GetAddress(); |
87 |
| -Console.WriteLine($"Ecosystem Wallet address: {ecosystemWalletAddress}"); |
88 |
| - |
89 |
| -var ecosystemPersonalSignature = await ecosystemWallet.PersonalSign("Hello, Thirdweb!"); |
90 |
| -Console.WriteLine($"Ecosystem Wallet personal sign: {ecosystemPersonalSignature}"); |
91 |
| -var isValidPersonal = (await ecosystemWallet.RecoverAddressFromPersonalSign("Hello, Thirdweb!", ecosystemPersonalSignature)) == ecosystemWalletAddress; |
92 |
| -Console.WriteLine($"Ecosystem Wallet personal sign valid: {isValidPersonal}"); |
93 |
| - |
94 |
| -var ecosystemTypedSignature = await ecosystemWallet.SignTypedDataV4( |
95 |
| - /*lang=json,strict*/ |
96 |
| - "{\"types\": {\"EIP712Domain\": [{\"name\": \"name\",\"type\": \"string\"},{\"name\": \"version\",\"type\": \"string\"},{\"name\": \"chainId\",\"type\": \"uint256\"},{\"name\": \"verifyingContract\",\"type\": \"address\"}],\"Person\": [{\"name\": \"name\",\"type\": \"string\"},{\"name\": \"wallet\",\"type\": \"address\"}],\"Mail\": [{\"name\": \"from\",\"type\": \"Person\"},{\"name\": \"to\",\"type\": \"Person\"},{\"name\": \"contents\",\"type\": \"string\"}]},\"primaryType\": \"Mail\",\"domain\": {\"name\": \"Ether Mail\",\"version\": \"1\",\"chainId\": 1,\"verifyingContract\": \"0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC\"},\"message\": {\"from\": {\"name\": \"Cow\",\"wallet\": \"0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826\"},\"to\": {\"name\": \"Bob\",\"wallet\": \"0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB\"},\"contents\": \"Hello, Bob!\"}}" |
97 |
| -); |
98 |
| -Console.WriteLine($"Ecosystem Wallet typed sign: {ecosystemTypedSignature}"); |
| 77 | +// var ecosystemWallet = await EcosystemWallet.Create(client: client, ecosystemId: "ecosystem.the-bonfire", authProvider: AuthProvider.Google); |
| 78 | + |
| 79 | +// if (!await ecosystemWallet.IsConnected()) |
| 80 | +// { |
| 81 | +// _ = await ecosystemWallet.LoginWithOauth( |
| 82 | +// isMobile: false, |
| 83 | +// (url) => |
| 84 | +// { |
| 85 | +// var psi = new ProcessStartInfo { FileName = url, UseShellExecute = true }; |
| 86 | +// _ = Process.Start(psi); |
| 87 | +// }, |
| 88 | +// "thirdweb://", |
| 89 | +// new InAppWalletBrowser() |
| 90 | +// ); |
| 91 | +// } |
| 92 | +// var ecosystemWalletAddress = await ecosystemWallet.GetAddress(); |
| 93 | +// Console.WriteLine($"Ecosystem Wallet address: {ecosystemWalletAddress}"); |
| 94 | + |
| 95 | +// var ecosystemPersonalSignature = await ecosystemWallet.PersonalSign("Hello, Thirdweb!"); |
| 96 | +// Console.WriteLine($"Ecosystem Wallet personal sign: {ecosystemPersonalSignature}"); |
| 97 | +// var isValidPersonal = (await ecosystemWallet.RecoverAddressFromPersonalSign("Hello, Thirdweb!", ecosystemPersonalSignature)) == ecosystemWalletAddress; |
| 98 | +// Console.WriteLine($"Ecosystem Wallet personal sign valid: {isValidPersonal}"); |
| 99 | + |
| 100 | +// var ecosystemTypedSignature = await ecosystemWallet.SignTypedDataV4( |
| 101 | +// /*lang=json,strict*/ |
| 102 | +// "{\"types\": {\"EIP712Domain\": [{\"name\": \"name\",\"type\": \"string\"},{\"name\": \"version\",\"type\": \"string\"},{\"name\": \"chainId\",\"type\": \"uint256\"},{\"name\": \"verifyingContract\",\"type\": \"address\"}],\"Person\": [{\"name\": \"name\",\"type\": \"string\"},{\"name\": \"wallet\",\"type\": \"address\"}],\"Mail\": [{\"name\": \"from\",\"type\": \"Person\"},{\"name\": \"to\",\"type\": \"Person\"},{\"name\": \"contents\",\"type\": \"string\"}]},\"primaryType\": \"Mail\",\"domain\": {\"name\": \"Ether Mail\",\"version\": \"1\",\"chainId\": 1,\"verifyingContract\": \"0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC\"},\"message\": {\"from\": {\"name\": \"Cow\",\"wallet\": \"0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826\"},\"to\": {\"name\": \"Bob\",\"wallet\": \"0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB\"},\"contents\": \"Hello, Bob!\"}}" |
| 103 | +// ); |
| 104 | +// Console.WriteLine($"Ecosystem Wallet typed sign: {ecosystemTypedSignature}"); |
99 | 105 |
|
100 | 106 | // var ecosystemSmartWallet = await SmartWallet.Create(ecosystemWallet, 421614);
|
101 | 107 |
|
|
0 commit comments