crossmint-sdk icon indicating copy to clipboard operation
crossmint-sdk copied to clipboard

Adds metamask example

Open guillermodoghel opened this issue 1 year ago • 0 comments

Adds an example on how implement embedded checkout using a direct metamask connection

signAndSendTransaction: async (transaction: Transaction) => {
                                if (!window.ethereum) {
                                    throw new Error("No ethereum provider");
                                }
                                return await window.ethereum
                                    .request({
                                        method: "eth_sendTransaction",
                                        params: [{
                                            from: account,
                                            to: transaction.to,
                                            value: transaction.value._hex,
                                            data: transaction.data,
                                        }],
                                    }) as string;
                            },

Screenshot 2023-11-13 at 2 34 53 PM

guillermodoghel avatar Nov 13 '23 17:11 guillermodoghel