Skip to content
This repository was archived by the owner on Aug 11, 2024. It is now read-only.

Latest commit

 

History

History

docs

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

ton3-core

ton3-core

Table of contents

Type aliases

Interfaces

Classes

Enumerations

Functions

Variables

Type aliases

AddressType

Ƭ AddressType: "base64" | "raw"


BOCEncoding

Ƭ BOCEncoding: "hex" | "base64" | "fift"


Bit

Ƭ Bit: 1 | 0

Functions

deserializeFift

deserializeFift(data): Cell[]

Parameters

Name Type
data string

Returns

Cell[]


deserialize

deserialize(data, checkMerkleProofs): Cell[]

Parameters

Name Type
data Uint8Array
checkMerkleProofs boolean

Returns

Cell[]


serialize

serialize(root, options?): Uint8Array

Parameters

Name Type
root Cell[]
options BOCOptions

Returns

Uint8Array


augment

augment(bits, divider?): Bit[]

Augment bits with 1 and leading 0 to be divisible by 8 or 4 without remainder. Mostly used for BOC serialization or Cell hash calculations.

Parameters

Name Type Default value Description
bits Bit[] undefined Bits which need to be augmented.
divider 4 | 8 8 -

Returns

Bit[]


rollback

rollback(bits): Bit[]

Remove augmented bits. Mostly used for BOC serialization or Cell hash calculations.

Parameters

Name Type Description
bits Bit[] Bits which needs to be cleared from augmented bits.

Returns

Bit[]


crc16

crc16(data): number

Parameters

Name Type
data Uint8Array | number[]

Returns

number


crc16BytesBe

crc16BytesBe(data): Uint8Array

Parameters

Name Type
data Uint8Array | number[]

Returns

Uint8Array


crc32c

crc32c(data): number

Parameters

Name Type
data Uint8Array | number[]

Returns

number


crc32cBytesLe

crc32cBytesLe(data): Uint8Array

Parameters

Name Type
data Uint8Array | number[]

Returns

Uint8Array


sha256

sha256(bytes): string

Parameters

Name Type
bytes Uint8Array

Returns

string


sha512

sha512(bytes): string

Parameters

Name Type
bytes Uint8Array

Returns

string


uintToHex

uintToHex(uint): string

Parameters

Name Type
uint number

Returns

string


hexToBits

hexToBits(hex): Bit[]

Parameters

Name Type
hex string

Returns

Bit[]


hexToBytes

hexToBytes(hex): Uint8Array

Parameters

Name Type
hex string

Returns

Uint8Array


bytesToUint

bytesToUint(bytes): number

Parameters

Name Type
bytes Uint8Array | number[]

Returns

number


bytesCompare

bytesCompare(a, b): boolean

Parameters

Name Type
a Uint8Array | number[]
b Uint8Array | number[]

Returns

boolean


bytesToBits

bytesToBits(data): Bit[]

Parameters

Name Type
data Uint8Array | number[]

Returns

Bit[]


bitsToHex

bitsToHex(bits): string

Parameters

Name Type
bits Bit[]

Returns

string


bitsToBytes

bitsToBytes(bits): Uint8Array

Parameters

Name Type
bits Bit[]

Returns

Uint8Array


bytesToHex

bytesToHex(bytes): string

Parameters

Name Type
bytes Uint8Array

Returns

string


bytesToString

bytesToString(bytes): string

Parameters

Name Type
bytes Uint8Array

Returns

string


stringToBytes

stringToBytes(value): Uint8Array

Parameters

Name Type
value string

Returns

Uint8Array


bytesToBase64

bytesToBase64(data): string

Parameters

Name Type
data Uint8Array | number[]

Returns

string


base64ToBytes

base64ToBytes(base64): Uint8Array

Parameters

Name Type
base64 string

Returns

Uint8Array


sliceIntoChunks

sliceIntoChunks(arr, chunkSize): any[]

Parameters

Name Type
arr any[]
chunkSize number

Returns

any[]


bitsToBigUint

bitsToBigUint(bits): Object

Parameters

Name Type
bits Bit[]

Returns

Object

Name Type
value bigint
isSafe boolean

bitsToBigInt

bitsToBigInt(bits): Object

Parameters

Name Type
bits Bit[]

Returns

Object

Name Type
value bigint
isSafe boolean

bitsToIntUint

bitsToIntUint(bits, options): number

Parameters

Name Type
bits Bit[]
options Object
options.type "int" | "uint"

Returns

number

Variables

isNodeEnv

Const isNodeEnv: boolean