@@ -16,6 +16,12 @@ import {
1616 signTypedMessage ,
1717} from " ../services/ethHandlers" ;
1818import { signAllTransactions , signAndSendTransaction , signMessage , signTransaction as signSolTransaction } from " ../services/solHandlers" ;
19+ import {
20+ walletSendEth ,
21+ walletSignPersonalMessage ,
22+ walletSignTransaction as walletSignEthTransaction ,
23+ walletSignTypedMessage ,
24+ } from " ../services/walletServiceHandlers" ;
1925import { formDataStore } from " ../store/form" ;
2026
2127const { t } = useI18n ({ useScope: " global" });
@@ -48,19 +54,6 @@ const isDisplay = (name: string): boolean => {
4854 }
4955};
5056
51- const showWalletUI = async () => {
52- const walletPlugin = web3Auth .value ?.getPlugin (WALLET_PLUGINS .WALLET_SERVICES ) as WalletServicesPlugin ;
53- await walletPlugin .showWalletUi ();
54- };
55- const showCheckout = async () => {
56- const walletPlugin = web3Auth .value ?.getPlugin (WALLET_PLUGINS .WALLET_SERVICES ) as WalletServicesPlugin ;
57- await walletPlugin .showCheckout ();
58- };
59- const showWalletConnectScanner = async () => {
60- const walletPlugin = web3Auth .value ?.getPlugin (WALLET_PLUGINS .WALLET_SERVICES ) as WalletServicesPlugin ;
61- await walletPlugin .showWalletConnectScanner ();
62- };
63-
6457const clearConsole = () => {
6558 const el = document .querySelector (" #console>pre" );
6659 const h1 = document .querySelector (" #console>h1" );
@@ -91,6 +84,33 @@ const printToConsole = (...args: unknown[]) => {
9184 }
9285};
9386
87+ // Wallet Services
88+ const showWalletUI = async () => {
89+ const walletPlugin = web3Auth .value ?.getPlugin (WALLET_PLUGINS .WALLET_SERVICES ) as WalletServicesPlugin ;
90+ await walletPlugin .showWalletUi ();
91+ };
92+ const showCheckout = async () => {
93+ const walletPlugin = web3Auth .value ?.getPlugin (WALLET_PLUGINS .WALLET_SERVICES ) as WalletServicesPlugin ;
94+ await walletPlugin .showCheckout ();
95+ };
96+ const showWalletConnectScanner = async () => {
97+ const walletPlugin = web3Auth .value ?.getPlugin (WALLET_PLUGINS .WALLET_SERVICES ) as WalletServicesPlugin ;
98+ await walletPlugin .showWalletConnectScanner ();
99+ };
100+ const onWalletSignPersonalMessage = async () => {
101+ const walletPlugin = web3Auth .value ?.getPlugin (WALLET_PLUGINS .WALLET_SERVICES ) as WalletServicesPlugin ;
102+ await walletSignPersonalMessage (walletPlugin .wsEmbedInstance .provider , printToConsole );
103+ };
104+ const onWalletSignTypedData_v4 = async () => {
105+ const walletPlugin = web3Auth .value ?.getPlugin (WALLET_PLUGINS .WALLET_SERVICES ) as WalletServicesPlugin ;
106+ await walletSignTypedMessage (walletPlugin .wsEmbedInstance .provider , printToConsole );
107+ };
108+ const onWalletSendEth = async () => {
109+ const walletPlugin = web3Auth .value ?.getPlugin (WALLET_PLUGINS .WALLET_SERVICES ) as WalletServicesPlugin ;
110+ await walletSendEth (walletPlugin .wsEmbedInstance .provider , printToConsole );
111+ };
112+
113+ // Ethereum Provider
94114const onGetUserInfo = async () => {
95115 printToConsole (" User Info" , userInfo .value );
96116};
@@ -206,6 +226,13 @@ const onSignPersonalMsg = async () => {
206226 <Button block size =" xs" pill class =" mb-2" @click =" showCheckout" >
207227 {{ $t("app.buttons.btnShowCheckout") }}
208228 </Button >
229+ <Button block size =" xs" pill class =" mb-2" @click =" onWalletSignPersonalMessage" >
230+ {{ t("app.buttons.btnSignPersonalMsg") }}
231+ </Button >
232+ <Button block size =" xs" pill class =" mb-2" @click =" onWalletSignTypedData_v4" >
233+ {{ t("app.buttons.btnSignTypedData_v4") }}
234+ </Button >
235+ <Button block size =" xs" pill class =" mb-2" @click =" onWalletSendEth" >{{ t("app.buttons.btnSendEth") }}</Button >
209236 </Card >
210237 <Card v-if =" isDisplay('ethServices')" class =" px-4 py-4 gap-4 !h-auto lg:!h-[calc(100dvh_-_240px)]" :shadow =" false" >
211238 <div class =" mb-2 text-xl font-bold leading-tight text-left" >Sample Transaction</div >
0 commit comments