Testing plugin features
Let's do a few tests with Polkadot API element.
Last updated
Let's do a few tests with Polkadot API element.
Last updated
There's a field RPC URL, you can leave it empty, the plugin will connect to Polkadot mainnet RPC automatically in this case.
Find it in the same category where are the plugin elements, and drag and drop it on the page. 2. Click in the text field, you will see a blue button that says, Insert dynamic data, click on it, and then select Polkadot API. You will see a list of all , select Last Block Nr
Now to get the result in this action, we need to run the plugin function (action) to get the latest block.
We will call this action when we will click a button. In the same way you added the text element, add a button on your page. In the button settings, click Start/Edit workflow
Workflow is where all the actions/functions are made. It is the logic of your app.
Click on add an action field, and look for Last Block in the Element Actions category
Open your page by clicking on Preview button (see Bubble basics page). Click on the button and see result in the text field that we have added earlier.
In the app editor, click on the button then do these steps (See the video bellow)
As in previous steps, open preview, you will notice that you can't click the button instantly when page loads, it depends on how fast the API loads.
The function we tested above is a simple one without any parameters. Let's try the action to get the balance for the given address.
In the same way we did before, add an input and a new button on the page. On the new button, click Start/Edit workflow, it will open a separate workflow for this button specifically.
In the same way we added Last Block action, look for Get Balance of Address action and add it. You will notice that it has a field Address
Click in this field and then on the button insert dynamic data that will appear. Select the input that we were added earlier and then the value of it.
We will do it the same way we did when showing the last block number. Add a new text element, and using the dynamic button, select Polkadot API Get balance result
Here is my result
Sometimes the API can take longer to load, the plugin have a state that shows if it is ready to be used. Let's add this to our button, we will make it disabled if the API is still loading.
You can open the demo page in the , see how it works from the inside with other features implemented. In the same way we implement API features, you can implement the features from keyring element or any other element.