Developer License

License Mechanism

Issuing a DIMO Developer License
Setting a signer and sharing vehicle permissions with a DIMO Developer License

License Issuance

Step 1: Approving the Dev License to use of $DIMO

To start issuing a Developer License, you will first need to approve the Developer License Contract (0x9A9D2E717bB005B240094ba761Ff074d392C7C85) to be a spender of DIMO tokens in your spender wallet. To do so, you will need to call the approve function on the DIMO Token Contract (0x...61db) after connecting your spender wallet.

Here, the transaction should always go through even if you don't have $DIMO in your wallet. But be aware that not having enough $DIMO in your wallet will cause failed transactions in the next step.

Approving Developer License to spend your $DIMO

The approve function takes in two input parameters:

Input
Type
Description

spender*

address

The 0x address of the Developer License Contract (0x...7C85)

amount*

uint256

The amount of DIMO tokens you want to approve the Dev License to spend, in units of wei. To approve 1 $DIMO, append 18 zeros to convert into wei. You can also use https://eth-converter.com/ to facilitate the calculation.


Step 2: Issue the Dev License

This is also known as Create an App if you are familiar with how most integrations work. Once you have approved the spending and have enough $DIMO in your spender wallet, head over to the Developer License Contract (0x...7C85) and issue the Developer License.

There are 4 ways to issue a Developer License:

  1. Issue in DIMO Credits

    This function is used when you are issuing the Developer License to the account that you used for issuance in DIMO Credits.

  2. Issue in DIMO Credits to a targeted address

    This function is used when you are issuing the Developer License to another account other than the one that you are using to issue the license. This function spends DIMO Credits in order to perform the issuance.

  3. Issue in DIMO Tokens

    This function is used when you are issuing the Developer License to the account that you used for issuance in DIMO Tokens.

  4. Issue in DIMO Tokens to a targeted address

    This function is used when you are issuing the Developer License to another account other than the one that you are using to issue the license. This function spends DIMO Tokens in order to perform the issuance.

The 4 different ways of issuing a Developer License

Your DIMO Developer License is granted as you trigger the issuance, sign the transaction, and when the transaction is marked as complete. A successful transaction will return a few things: tokenId, owner, and clientId. The tokenId is your public ID for your Developer License, the owner being the holder account, and the clientId is what you will need to obtain access to the DIMO API.


License Configurations

Step 3: Configuring the Dev License

You will need a set of clientId and domain to get started with the API access. The clientId is obtained in Step 2: Issue the Dev License while you still need to configure the domain on the Developer License by calling setRedirectUri.

Set Domain (aka Redirect URI)

This function is used to configure the domain needed for the authentication steps. With a combination of clientId and an enabled domain, you will be able to exchange for an access_token to the DIMO API.

Setting a domain for your app, simply set enabled to true

Step 4: Enable Signer(s)

Signers are essentially the trusted signer wallets to perform the wallet-based authentication flow. The Developer License (aka your app) has a clientId and a domain, but in order for you to authenticate and obtain a valid access_token to the DIMO API, you will need to provide a signer wallet. By default, a Developer License that was created will not have any signer provisioned, even if you are the holder of the license.

Enable Signer

Enabling a signer on your Developer License

This function is used to enable a signer on the Developer License. By indicating the tokenId of your Developer License, and the signer's address, the successful transaction here will grant you access to authenticate with the DIMO Auth Server.

Input
Type
Description

tokenId*

uint256

The identifer to your Developer License.

signer*

address

The 0x address of the wallet that's approved as a signer.

Last updated

Was this helpful?