Server-side Blazor App tutorial
The XUMM.NET.SDK repository contains a server-side Blazor App including examples for all the Xumm API endpoints.
Configuring the sample project is done in 4 easy steps explained below.
1. Clone Repository
Clone the XUMM.NET.SDK repository to get started.
2. Xumm API Credentials
You need to create a new application in the Xumm Developer Console. If this will be your first application you need to register an account or continue with GitHub or Xumm.
After creating your new application, you will be redirected to a page showing your API Key
and API Secret
.
3. Configure API Credentials
Navigate to ~/examples/XUMM.Net.ServerApp/
and open appsettings.json
or create a copy to appsettings.Development.json
. Paste your API Key and Secret in the designated fields so you will have a configuration file such as:
{
"Xumm": {
"RestClientAddress": "https://xumm.app/api/v1",
"ApiKey": "0d1049ef-8f0b-4ea4-bcab-4b96fa7bdcc5",
"ApiSecret": "a4733bb3-4cbd-4e70-871c-6ab891f9f6db"
}
...
}
4. Explore the calls
Run the XUMM.NET.ServerApp
project by for example opening the solution file ~/src/XUMM.NET.SDK.sln
in Visual Studio and set the project XUMM.NET.ServerApp
as startup project and hit F5.
You can now play around with the implemented Xumm API calls.
User Sign In
You can find an example of the User Sign In method that also subscribe to a payload specific websocket to receive live status updates.
A message box will be shown indicating if the user signed or rejected the sign in request as shown below.
You can deploy the Blazor App and configure a Webhook URL in the Application Details sections of the Xumm Developer Console to receive webhooks.
The default pattern of the webhook URL is /Xumm/Webhook
but this can be changed in Program.cs
by changing app.MapXummControllerRoute();
to anything like:
app.MapXummControllerRoute(pattern: "/Webhooks/Xumm");
A simple implementation of caching the USER_TOKEN
is done in XummWebhookProcessor
to set an example on how the IXummWebhookProcessor
can be implemented.
Latest comments (0)