Security and Authentication
The Topl endpoints use API keys to allow access. You can obtain your API key through creating a project in the BaaS developer portal (please view the guide for BaaS Developer Portal Onboarding for the details on how to setup your first project).

To access the APIs, include the API key in the HTTP Header of your HTTP request:
x-api-key:yourapisecret
Alternatively, you can add the API key into the Requests module object of a BramblJS instance (using our BramblJS library).
Examples
Please note!!
You must replace
yourapisecret
or YOUR_API_KEY in the examples with your actual API key provided by ToplIn addition, you must replace {{myProjectId}} with the actual projectId provided by Topl
Network Prefix
There are two BaaS network prefixes. If you want to use the main net, set networkPrefix = toplnet otherwise set networkPrefix = valhalla for using the test net
const BramblJS = require('brambljs');
const brambl = new BramblJS({
networkPrefix: "valhalla", // applies to Requests and KeyManager
password: "topl_the_world!",
Requests: {
url: "https://valhalla.torus.topl.network/{{myProjectId}}", // make sure that the project ID from the BaaS portal is included.
apiKey: "YOUR_API_KEY" // set api key for network
}
});
Additionally, you must provide a project ID for each request made. Your Project ID can also be found in the BaaS Portal.

Important
Note that our BaaS offering has a rate limit defined at 5 requests per second. Please contact us if that is not sufficient for your use case!
Updated over 1 year ago