Socket
Book a DemoInstallSign in
Socket

@dfinity/utils

Package Overview
Dependencies
Maintainers
10
Versions
985
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dfinity/utils

A collection of utilities and constants for NNS/SNS projects.

Source
npmnpm
Version
0.0.1-next-2022-09-15
Version published
Weekly downloads
12K
-15.16%
Maintainers
10
Weekly downloads
 
Created
Source

utils-js

A collection of utilities and constants for NNS/SNS projects.

npm version GitHub license

Table of contents

Installation

You can use utils-js by installing it in your project.

npm i @dfinity/utils

The bundle needs peer dependencies, be sure that following resources are available in your project as well.

npm i @dfinity/agent @dfinity/candid @dfinity/principal

Features

utils-js implements following features:

:toolbox: Functions

:gear: defaultAgent

FunctionType
defaultAgent() => Agent

:gear: createServices

FunctionType
createServices<T>({ options: { canisterId, serviceOverride, certifiedServiceOverride, agent: agentOption, }, idlFactory, certifiedIdlFactory, }: { options: RequiredCanisterOptions<T>; idlFactory: InterfaceFactory; certifiedIdlFactory: InterfaceFactory; }) => { ...; }

:gear: assertNonNullish

FunctionType
assertNonNullish<T>(value: T, message?: string) => asserts value is NonNullable<T>

:gear: toNullable

FunctionType
toNullable<T>(value?: T) => [] or [T]

:gear: fromNullable

FunctionType
fromNullable<T>(value: [] or [T]) => T

:gear: fromDefinedNullable

FunctionType
fromDefinedNullable<T>(value: [] or [T]) => T

:factory: NullishError

Constructors

public

Parameters:

  • message

Keywords

internet computer

FAQs

Package last updated on 15 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts