Skip to content

Latest commit

 

History

History
113 lines (71 loc) · 1.94 KB

utils.md

File metadata and controls

113 lines (71 loc) · 1.94 KB

zilswap-sdk / Exports / utils

Module: utils

Table of contents

Functions

Functions

contractInitToMap

Const contractInitToMap(params): Object

Converts Value[] array to map of string values. Value.type is ignored, all values are returned as string.

sample input:

 [{
   name: 'address',
   type: 'ByStr20',
   value: '0xbadbeef',
 }, {
   name: 'balance',
   type: 'UInt28',
   value: '100000000',
 }]

output:

 {
   address: '0xbadbeef',
   balance: '100000000',
 }

Parameters

Name Type Description
params Value[] parameters in Value[] array representation

Returns

Object

mapped object representation - refer to sample output

Defined in

utils.ts:150


isLocalStorageAvailable

Const isLocalStorageAvailable(): boolean

Returns

boolean

Defined in

utils.ts:100


toPositiveQa

Const toPositiveQa(input, unitOrDecimals): BN

Parameters

Name Type
input string | number | BN
unitOrDecimals number | Zil | Li | Qa

Returns

BN

Defined in

utils.ts:40


unitlessBigNumber

Const unitlessBigNumber(str): BigNumber

Parameters

Name Type
str string

Returns

BigNumber

Defined in

utils.ts:32