Configure a Stream
Last updated
Last updated
DIMO Check-in
💡 This guide depicts the full flow on how to create/unset/check streams, which requires inputting private_key
of your wallet. We recommend hiding this private_key
interaction from your users by implementing a wallet integration.
Ensure that there is a vehicle that's connected to your wallet address.
We've built a simple application to help with creating a vehicle stream. Simply click on Create
under DIMO Buddy > Vehicles
> More
> Create vehicle stream
to create your vehicle stream. Once created, you should be able to see your stream with a link. The user interface also assists with checking the vehicle stream or deleting (unsetting) the stream.
Configure a new JSON RPC Provider: new ethers.providers.JsonRpcProvider(rpc)
Create a new signer using the private_key
of your wallet, and the provider object initiated in step 1: new ethers.Wallet(private_key.value || '', provider);
.
Saved ABI values from https://github.com/DIMO-Network/dimo-identity/blob/main/abis/DimoRegistry.json
Get the contract object using the DIMO registry address, ABI file, and signer.
Call the createVehicleStream
with your accessible vehicle token_id
to create the stream.
Developer Notes
When you create a stream, you are automatically a subscriber of it.
Same as Create a Stream from steps 1 to 4
Call the unsetVehicleStream
with your accessible vehicle token_id
to unset the stream.
Same as Create a Stream from steps 1 to 4
Call the getVehicleStream
with your accessible vehicle token_id
to check if a vehicle stream exists or not. Expect the stream ID to be returned if a stream for the vehicle already exist.