Environment

Create a new environment

import { ARK } from "@arkecosystem/platform-sdk-ark";
import { Environment } from "@arkecosystem/platform-sdk-profiles";
import { Request } from "@arkecosystem/platform-sdk-http-bent";

new Environment({
    coins: { ARK },
    httpClient: new Request(),
    storage: "localstorage"
});

Profiles

These methods are accessible through env.profiles() which exposes a ProfileRepository instance.

Fill the profile using the provided data

env.profiles().fill(profileData);

Get a list of all profiles

env.profiles().all();

Get the first stored profile

env.profiles().first();

Get the last stored profile

env.profiles().last();

Get all associated profile keys

env.profiles().keys();

Get all associated profile values

env.profiles().values();

Find the profile for the given Id

env.profiles().findById("uuid");

Find the profile for the given name

env.profiles().findByName("John Doe");

Create a new profile for the given name

env.profiles().create("John Doe");

Check if a data for the given key exists

env.profiles().has(jane.id());

Forget the profile for the given Id (Use with caution!)

env.profiles().forget("uuid");

Forget all profile data (Use with caution!)

env.profiles().flush();

Get the count of stored profiles

env.profiles().count();

Get the profile as a data Object

env.profiles().toObject();
2021 © ARK.io | All rights reserved An ARK.io Product