What is a solution to using the scanning of a QR code to execute a smart contract function on Ethereum? - qr-code

So I have been working with Ethereum's metamask, and implemented web app where the user can come while being logged into metamask, and call a function on my smart contract via metamask. Tutorials for this exist and it's not very hard.
I want to implement calling a smart contract, when a user comes into a store ([physically). I want to do it the following way:
Some customer comes in and uses some application $A on his phone, which may be a wallet app or some other application that has access to his ethereum wallet.
On my POS application, I will render a QR code.
When he scans the QR code with his mobile phone, it is equivalent to either:
sending ethereum funds to our company account, while I am able to verify that this has happened via an event, or
he calls a function on a smart contract. This seems more appealing because I know that you can send events via smart contract calls.
So my question is:
Do any applications that have the functionality of application $A exist, are they widely used?
What can I use to implement exposing a QR code which is effectively some form of visual API for my program?

What you need is a library in your application to create a QR code. This QR code will need to be created for the function/method you need to call on the smart contract. You can use https://github.com/jibrelnetwork/ethereum-qr-code/blob/master/README.md
The QR code will be scanned by the user using the wallet on their mobile phone app wallet. This transaction will trigger the smart contract function and allow your application to proceed forward.
Hope this helps.
Cheers,

Answer to Q1:
Yes, there are applications like this(i made one myself). Most existing mobile wallets use this approach, for eg. Tenx.
Answer to Q2:
Sorry but this question is not totally clear to me. Are you asking for some sort of library for creating a QR code?

Related

Bidirectional communication between R and Microsoft Teams - any ideas?

I am working on a small project trying to control some steps of a workflow in a web application using MS teams. My idea is to use R as an intermediate step between the application (which has a number of API endpoints I can call from R) and Microsoft Teams chats (or channels). Users would then use a set of keywords in the chat to lead to an action in the application. For example they might use "publish ABC-123" in a specific chat and this would lead to the application publishing document ABC-123 somewhere via R which would orchestrate everything.
I have a couple of ideas but there are drawbacks:
I thought originally about using microsoft365r. We have an app registered in Microsoft 365 which would allow us to monitor a specific chat for messages that trigger actions in R. The problem with this approach is that we would need to have the R code running and checking MS Teams every couple of minutes. It is certainly doable, but not very elegant.
Another option could be setting up a plumber API and an outgoing webhook in MS Teams. This seems like the ideal way to do it, but webhooks in MS Teams require https and as far as I understand this is not straightforward to implement in plumber.
I would appreciate any ideas on how to do this. I know I am not very specific, but mostly looking for high level pointers of what I could look at. Many thanks!
You actually have a bunch of options for this:
Create a bot directly in code, e.g. per https://learn.microsoft.com/en-us/microsoftteams/platform/bots/what-are-bots . There's a bit of a learning curve of course, and it depends on whether you have development skills outside of r, e.g. python, .net, whatever. The bot would then call your code as needed.
Create a no-code bot using Power Virtual Agents. This is the equivalent, for bots, of Power Apps or Power Automate, if you're familiar with those.
Create a workflow, either in Power Automate or Azure Logic Apps, that can listen for and respond to messages. This is kind of similar to a bot, but with finer scope (and therefore less capability). If you want it to call out to your app, e.g. to an endpoint, you'd need a Premium Connecter for Power Automate, or you can use an Azure Logic App directly (uses the same engine, but the pricing model is different for these and Power Automate is a little easier to work with.
Outgoing webhook - you can implement these as standalone, but actually from your use case it sounds like a bot would be better anyway, and it's kind of what you need to build to make this kind of webhook work properly anyway.

Is it possible to login with Firebase and REST API at the same time?

I have a mobile app that does two things. The first one is to use Firebase to implement a chat. On the other side, the apps, uses a REST API to retrieve some info from a database and do some writes on it. Simple as that. The app provides a login system: two text fields and a button. The user provides an email address and a password then I used the standard Firebase function to do the login using signInWithEmailAndPassword(). The thing is that I should use the same credentials to do the login using the REST API to access the other database. At first I decided to do the call to Firebase and to the REST API in the same function. One other possible solution could be a web service. I'll explain how. A web services written in Python, PHP or JavaScript generates a JWT token that is sent to the mobile app after the user asks to sign in. I'm pretty sure that this is possible like shown here: https://firebase.google.com/docs/auth/admin. The latter seems too over-complicated to me. Now, the question is. Can someone suggest a solution, the most simple one, that can be used is a scenario like this? Thanks all in advance.

DocuSign integration tests

I am writing an application that should interact with DocuSign to create envelopes and then download the signed document when all the signatories have signed.
There are several other use cases, but that does not matter for this question.
I am wondering what is the best way to write automated integration tests.
Do I need to automate the interaction of the signatories withe DocuSign? This would mean that I have to receive the email, click the link, etc...
Even if it seems possible, it does not seem ideal. Is there a way to "simulate" in a dev environment the actions of the signatories?
There has been a lot of talks if a document can be signed without viewing it. And the conclusion was that NO, user cannot sign a document without viewing it. User has to view/see what is to be signed. So, that part needs to be automated using Selenium or one of its "flavors" or pretty much any UI automation you are comfortable with. And Yes, that involves receiving email, clicking the link, opening a document and signing it. You can use a Mailinator or any other email service which API you can leverage to facilitate things for you.
As for other parts of DocuSign integration automation it is encouraged to use API (makes things more stable).
So, very simple workflow steps would look like this:
Use API to prepare environment, sent variables and values (in your product and in DocuSign)
Send envelope for signing using DocuSign API
Get the link to the document
Sign using UI automation
Do verification (of envelope status and more) using DocuSign API

Feasible to extend WebChat control to connect with Signal R

I have a use case where I want to build a portal for Agent Login and Registry and allow conversation to be transferred from Bot to an agent.
Looking at this article for possibilities -
https://blogs.msdn.microsoft.com/jamiedalton/2017/08/10/microsoft-bot-framework-handing-off-to-a-human-for-agentssupervisors-with-c-and-the-botbuilder-sdk/
The handoff should happen from customer using webchat and bot logic is coded in C#. The steps that I could think of -
User asks for handoff
The Bot logic connects the conversation to signalr hub on server side
The next conversation takes place directly using this hub.
Need to know if someone implemented such use case. What should be approach for creating this?
Look over the intermediator bot sample. It is designed to work with v4 of the BotFramework demonstrating bot-to-human hand-off in C#. You will, of course, need to adapt it to work with SignalR. But, I don't see any reason it couldn't be configured to do so.

Watson Conversation - Storing and managing context for users in the application

We are using Watson Conversation service for ChatBot functionality. We want to configure a standard sequence of communication with users using Dialog and intents and entities.
We are writing the application is java to communicate with the Conversation service via RESTful API.
I understand we have to maintain the context and pass it between the application and Conversation until the conversation ends.
In order to achieve this, I understand we need to store and manage the context for each user in our application.
Could anyone please clarify if my understanding is correct? Also is Java a right fit for this functionality?
Thanks
Each conversation has its own conversation_id and its own context in the Json sent from the service. So, you don't have to store each context in your application. You could, but it is not necessary.
The usual way to use this is, when you get an answer from the Conversation Service, you store the context object, update it and send it back. In the next iteration, the service is going to send the context inside the Json again. If you use the same conversation_id, you should be able to send and receive the context, so, you don't need to store it.
There are a number of SDK's for different languages which make this easier for you.
https://github.com/watson-developer-cloud

Resources