Skip to main content
Version: 3.2.0

SURI

Before running any script with the avn-api, let's set your AvN mnemonic or secret seed generated via the accounts page. There are two ways you can set this:

export AVN_SURI=<mnemonic OR secret seed>

Your secret URI (SURI) could either be a mnemonic (seed phrase) or the secret seed (private key) of your account.

tip

For windows users, here's a guide on how to set your environment variable.

Examples

You can export your SURI, in your CLI, in the format of any of the examples below

export AVN_SURI='flag dynamic laptop often park illegal equip curve game blame junior warm'

OR

export AVN_SURI=0x5392ca60a61aea99fce14358798de93c1bc11c3696a905718738c71fae539c24 // this is from the generated example account

This does not return anything.



If no URL is passed the API will run in offline mode, exposing ONLY core utilities and can be initialised using the below:

const avnSdk = new AvnApi(null, singleUserOptions); // null here has replaced the gateway url and configures the use as offline mode.
note

Throughout this document options may be replaced with singleUserOptions or multiUserOptions. If you're not defining an options object, replace options with empty curly brackets i.e. {}.

danger

It's important that you keep the mnemonic/seed secret safe and not expose it anywhere else. If this data is compromised, you could lose your funds.