MATTR Wallet SDK React Native / Exports / codec
- DeflateError
- InflateError
- InvalidBase32DecodeError
- InvalidBase64DecodeError
- InvalidBase64URLDecodeError
- InvalidCborldDecodeError
- InvalidCborldEncodeError
- InvalidJSONError
- MultiHash
- MultiHashError
- base32Decode
- base32DecodeToString
- base32Encode
- base32EncodeFromString
- base64Decode
- base64DecodeToString
- base64Encode
- base64EncodeFromString
- base64UrlDecode
- base64UrlDecodeToObject
- base64UrlEncode
- base64UrlEncodeFromObject
- base64UrlEncodeFromString
- base64UrlEncodeNoPadding
- bytesToString
- canonicalMultiHash
- decodeCborld
- deflate
- encodeCborld
- inflate
- stringToBytes
Ƭ DeflateError: DeflateError
Ƭ InflateError: InflateError
Ƭ InvalidBase32DecodeError: InvalidBase32DecodeError
Ƭ InvalidBase64DecodeError: InvalidBase64DecodeError
Ƭ InvalidBase64URLDecodeError: InvalidBase64URLDecodeError
Ƭ InvalidCborldDecodeError: InvalidCborldDecodeError
Ƭ InvalidCborldEncodeError: InvalidCborldEncodeError
Ƭ InvalidJSONError: InvalidJSONError
Ƭ MultiHash: MultiHash
Ƭ MultiHashError: MultiHashError
• MultiHash: typeof MultiHash
▸ base32Decode(base32String
): Result
<Uint8Array
, InvalidBase32DecodeError
>
Base32 decode to Uint8Array
Name | Type |
---|---|
base32String |
string |
Result
<Uint8Array
, InvalidBase32DecodeError
>
A Result containing the decoded Uint8Array on ok or a InvalidBase32DecodeError on error
▸ base32DecodeToString(base32String
): Result
<string
, InvalidBase32DecodeError
>
Base32 decode to a string
Name | Type | Description |
---|---|---|
base32String |
string |
The base32 encoded string |
Result
<string
, InvalidBase32DecodeError
>
A Result containing the decoded string on ok or a InvalidBase32DecodeError on error
▸ base32Encode(byteArray
): string
Base32 encode an Uint8Array
Name | Type | Description |
---|---|---|
byteArray |
Uint8Array |
The bytes to encode |
string
The string of the encoded bytes
▸ base32EncodeFromString(str
): string
Base32 encode a string
Name | Type | Description |
---|---|---|
str |
string |
The string to encode |
string
The base32 encoded string
▸ base64Decode(base64String
): Result
<Uint8Array
, InvalidBase64DecodeError
>
Base64 decode to Uint8Array
Name | Type | Description |
---|---|---|
base64String |
string |
The base64 encoded string |
Result
<Uint8Array
, InvalidBase64DecodeError
>
A Result containing the decoded Uint8Array on ok or a InvalidBase64DecodeError on error
▸ base64DecodeToString(base64String
): Result
<string
, InvalidBase64DecodeError
>
Base64 decode to a string
Name | Type | Description |
---|---|---|
base64String |
string |
The base64 encoded string |
Result
<string
, InvalidBase64DecodeError
>
A Result containing the decoded string on ok or a InvalidBase64DecodeError on error
▸ base64Encode(byteArray
): string
Base64 encode an Uint8Array
Name | Type | Description |
---|---|---|
byteArray |
Uint8Array |
The bytes to encode |
string
The string of the encoded bytes
▸ base64EncodeFromString(str
): string
Base64 encode a string
Name | Type | Description |
---|---|---|
str |
string |
The string to encode |
string
The base64 encoded string
▸ base64UrlDecode(base64urlString
): Result
<Uint8Array
, InvalidBase64URLDecodeError
>
Base64URL decode to Uint8Array
Name | Type | Description |
---|---|---|
base64urlString |
string |
The base64url encoded string |
Result
<Uint8Array
, InvalidBase64URLDecodeError
>
A Result containing the decoded Uint8Array on ok or a InvalidBase64URLDecodeError on error
▸ base64UrlDecodeToObject(base64urlString
): Result
<object
, InvalidBase64URLDecodeError
| InvalidJSONError
>
Base64URL decode to an object
Name | Type | Description |
---|---|---|
base64urlString |
string |
The base64url encoded string |
Result
<object
, InvalidBase64URLDecodeError
| InvalidJSONError
>
A Result containing the decoded object on ok or a InvalidBase64URLDecodeError or InvalidJSONError on error
▸ base64UrlEncode(byteArray
): string
Base64URL encode an Uint8Array
Name | Type | Description |
---|---|---|
byteArray |
Uint8Array |
The bytes to encode |
string
The string of the encoded bytes
▸ base64UrlEncodeFromObject(obj
): string
Base64URL encode an object
Name | Type | Description |
---|---|---|
obj |
Record <string , unknown > |
The object to create the encoded string from |
string
The string of the encoded object
▸ base64UrlEncodeFromString(str
): string
Base64URL encode a string
Name | Type | Description |
---|---|---|
str |
string |
The string to encode |
string
The base64url encoded string
▸ base64UrlEncodeNoPadding(bytes
): string
Base64URL encode with no padding from an Uint8Array to a string
Name | Type | Description |
---|---|---|
bytes |
Uint8Array |
The bytes to encode |
string
The base64url encoded string
▸ bytesToString(bytes
): string
Convert a Uint8Array to a string
Name | Type | Description |
---|---|---|
bytes |
Uint8Array |
The bytes to convert to a string |
string
The string result from the converted bytes
▸ canonicalMultiHash(input
, hashAlgorithm
): Result
<Uint8Array
, MultiHashError
>
Creates a canonical multihash of the input object by canonicalizing the object.
Name | Type | Description |
---|---|---|
input |
Record <string , unknown > |
The object to canonicalize and then hash |
hashAlgorithm |
Sha256 |
The algorithm to hash and encode the data with |
Result
<Uint8Array
, MultiHashError
>
A Result containing the encoded Uint8Array on ok or a MultiHashError on error
▸ decodeCborld(byteArray
, documentLoader
): ResultAsync
<unknown
, InvalidCborldDecodeError
>
Decode CBOR-LD bytes intoto JSON-LD document
Name | Type | Description |
---|---|---|
byteArray |
Uint8Array |
The cborld bytes |
documentLoader |
DocumentLoader |
The document loader to resolve contexts |
ResultAsync
<unknown
, InvalidCborldDecodeError
>
A ResultAsync containing the decoded object on ok or a InvalidCborldDecodeError on error
▸ deflate(data
): Result
<Uint8Array
, DeflateError
>
Deflate compression
Name | Type | Description |
---|---|---|
data |
Uint8Array |
The data to be compressed |
Result
<Uint8Array
, DeflateError
>
A Result containing the compressed Uint8Array on ok or a DeflateError on error
▸ encodeCborld(jsonldDocument
, documentLoader
): ResultAsync
<Uint8Array
, InvalidCborldEncodeError
>
Encode a JSON-LD document into CBOR-LD bytes
Name | Type | Description |
---|---|---|
jsonldDocument |
Record <string , unknown > |
The json document to encode |
documentLoader |
DocumentLoader |
The document loader to resolve contexts |
ResultAsync
<Uint8Array
, InvalidCborldEncodeError
>
A ResultAsync containing the decoded cborld bytes on ok or a InvalidCborldEncodeError on error
▸ inflate(data
): Result
<Uint8Array
, InflateError
>
Inflate decompression
Name | Type | Description |
---|---|---|
data |
Uint8Array |
The data to be decompressed |
Result
<Uint8Array
, InflateError
>
A Result containing the decompressed Uint8Array on ok or a InflateError on error
▸ stringToBytes(str
): Uint8Array
Convert a string to an Uint8Array
Name | Type | Description |
---|---|---|
str |
string |
The string to convert to bytes |
Uint8Array
The bytes result from the converted string