@biglup/cometa 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,8 @@
1
1
  declare const getLibCardanoCVersion: () => string;
2
+ declare const hexToUint8Array: (hexString: string) => Uint8Array;
3
+ declare const uint8ArrayToHex: (byteArray: Uint8Array) => string;
4
+ declare const utf8ToUint8Array: (str: string) => Uint8Array;
5
+ declare const uint8ArrayToUtf8: (uint8Array: Uint8Array) => string;
2
6
 
3
7
  declare const ready: () => Promise<void>;
4
8
  declare const getModule: () => any;
@@ -122,6 +126,30 @@ declare class CborWriter {
122
126
  getRefCount(): number;
123
127
  }
124
128
 
129
+ declare class Base58 {
130
+ private constructor();
131
+ static encode(data: Uint8Array): string;
132
+ static decode(encodedString: string): Uint8Array;
133
+ static encodeFromHex(hexString: string): string;
134
+ static decodeFromHex(base58String: string): string;
135
+ private static getEncodedLength;
136
+ private static getDecodedLength;
137
+ }
138
+
139
+ type Bech32DecodeResult = {
140
+ hrp: string;
141
+ data: Uint8Array;
142
+ hex: string;
143
+ };
144
+ declare class Bech32 {
145
+ private constructor();
146
+ static encode(hrp: string, data: Uint8Array): string;
147
+ static encodeFromHex(hrp: string, data: string): string;
148
+ static decode(encodedString: string): Bech32DecodeResult;
149
+ private static getEncodedLength;
150
+ private static getDecodedLength;
151
+ }
152
+
125
153
  declare const finalizationRegistry: FinalizationRegistry<{
126
154
  ptr: any;
127
155
  freeFunc: any;
@@ -138,4 +166,100 @@ declare class ProtocolVersion {
138
166
  setMinor(minor: number): void;
139
167
  }
140
168
 
141
- export { CborMajorType, CborReader, CborReaderState, CborSimpleValue, CborTag, CborWriter, ProtocolVersion, finalizationRegistry, getLibCardanoCVersion, getModule, isReady, ready };
169
+ declare class Crc32 {
170
+ private constructor();
171
+ static compute(data: Uint8Array): number;
172
+ static computeFromHex(hexString: string): number;
173
+ static computeFromUtf8(data: string): number;
174
+ }
175
+
176
+ declare class Pbkdf2HmacSha512 {
177
+ private constructor();
178
+ static compute(password: Uint8Array, salt: Uint8Array, iterations: number, derivedKeyLength: number): Uint8Array;
179
+ }
180
+
181
+ declare class Emip003 {
182
+ static encrypt(data: Uint8Array, passphrase: Uint8Array): Uint8Array;
183
+ static decrypt(encryptedData: Uint8Array, passphrase: Uint8Array): Uint8Array;
184
+ }
185
+
186
+ declare class Blake2b {
187
+ private constructor();
188
+ static computeHash(data: Uint8Array, hashLength: number): Uint8Array;
189
+ }
190
+
191
+ declare class Ed25519Signature {
192
+ ptr: number;
193
+ constructor(ptr: number);
194
+ static fromBytes(data: Uint8Array): Ed25519Signature;
195
+ static fromHex(hex: string): Ed25519Signature;
196
+ toBytes(): Uint8Array;
197
+ toHex(): string;
198
+ refCount(): number;
199
+ private getBytesSize;
200
+ private getHexSize;
201
+ }
202
+
203
+ declare class Ed25519PublicKey {
204
+ ptr: number;
205
+ constructor(ptr: number);
206
+ static fromBytes(data: Uint8Array): Ed25519PublicKey;
207
+ static fromHex(hex: string): Ed25519PublicKey;
208
+ toBytes(): Uint8Array;
209
+ toHex(): string;
210
+ verify(signature: Ed25519Signature, message: Uint8Array): boolean;
211
+ toHash(): Uint8Array;
212
+ toHashHex(): string;
213
+ refCount(): number;
214
+ private getBytesSize;
215
+ private getHexSize;
216
+ }
217
+
218
+ declare class Bip32PublicKey {
219
+ ptr: number;
220
+ constructor(ptr: number);
221
+ static fromBytes(data: Uint8Array): Bip32PublicKey;
222
+ static fromHex(hex: string): Bip32PublicKey;
223
+ toBytes(): Uint8Array;
224
+ toHex(): string;
225
+ derive(indices: number[]): Bip32PublicKey;
226
+ toEd25519Key(): Ed25519PublicKey;
227
+ toHash(): Uint8Array;
228
+ toHashHex(): string;
229
+ refCount(): number;
230
+ private getBytesSize;
231
+ private getHexSize;
232
+ }
233
+
234
+ declare class Ed25519PrivateKey {
235
+ ptr: number;
236
+ constructor(ptr: number);
237
+ static fromNormalBytes(data: Uint8Array): Ed25519PrivateKey;
238
+ static fromExtendedBytes(data: Uint8Array): Ed25519PrivateKey;
239
+ static fromNormalHex(hex: string): Ed25519PrivateKey;
240
+ static fromExtendedHex(hex: string): Ed25519PrivateKey;
241
+ toBytes(): Uint8Array;
242
+ toHex(): string;
243
+ sign(message: Uint8Array): Ed25519Signature;
244
+ getPublicKey(): Ed25519PublicKey;
245
+ refCount(): number;
246
+ private getBytesSize;
247
+ private getHexSize;
248
+ }
249
+
250
+ declare class Bip32PrivateKey {
251
+ ptr: number;
252
+ private constructor();
253
+ static fromBip39Entropy(password: Uint8Array, entropy: Uint8Array): Bip32PrivateKey;
254
+ static fromBytes(data: Uint8Array): Bip32PrivateKey;
255
+ static fromHex(hex: string): Bip32PrivateKey;
256
+ derive(indices: number[]): Bip32PrivateKey;
257
+ getPublicKey(): Bip32PublicKey;
258
+ toBytes(): Uint8Array;
259
+ toHex(): string;
260
+ toEd25519Key(): Ed25519PrivateKey;
261
+ refCount(): number;
262
+ private getBytesSize;
263
+ }
264
+
265
+ export { Base58, Bech32, type Bech32DecodeResult, Bip32PrivateKey, Bip32PublicKey, Blake2b, CborMajorType, CborReader, CborReaderState, CborSimpleValue, CborTag, CborWriter, Crc32, Ed25519PrivateKey, Ed25519PublicKey, Ed25519Signature, Emip003, Pbkdf2HmacSha512, ProtocolVersion, finalizationRegistry, getLibCardanoCVersion, getModule, hexToUint8Array, isReady, ready, uint8ArrayToHex, uint8ArrayToUtf8, utf8ToUint8Array };
@@ -1,4 +1,8 @@
1
1
  declare const getLibCardanoCVersion: () => string;
2
+ declare const hexToUint8Array: (hexString: string) => Uint8Array;
3
+ declare const uint8ArrayToHex: (byteArray: Uint8Array) => string;
4
+ declare const utf8ToUint8Array: (str: string) => Uint8Array;
5
+ declare const uint8ArrayToUtf8: (uint8Array: Uint8Array) => string;
2
6
 
3
7
  declare const ready: () => Promise<void>;
4
8
  declare const getModule: () => any;
@@ -122,6 +126,30 @@ declare class CborWriter {
122
126
  getRefCount(): number;
123
127
  }
124
128
 
129
+ declare class Base58 {
130
+ private constructor();
131
+ static encode(data: Uint8Array): string;
132
+ static decode(encodedString: string): Uint8Array;
133
+ static encodeFromHex(hexString: string): string;
134
+ static decodeFromHex(base58String: string): string;
135
+ private static getEncodedLength;
136
+ private static getDecodedLength;
137
+ }
138
+
139
+ type Bech32DecodeResult = {
140
+ hrp: string;
141
+ data: Uint8Array;
142
+ hex: string;
143
+ };
144
+ declare class Bech32 {
145
+ private constructor();
146
+ static encode(hrp: string, data: Uint8Array): string;
147
+ static encodeFromHex(hrp: string, data: string): string;
148
+ static decode(encodedString: string): Bech32DecodeResult;
149
+ private static getEncodedLength;
150
+ private static getDecodedLength;
151
+ }
152
+
125
153
  declare const finalizationRegistry: FinalizationRegistry<{
126
154
  ptr: any;
127
155
  freeFunc: any;
@@ -138,4 +166,100 @@ declare class ProtocolVersion {
138
166
  setMinor(minor: number): void;
139
167
  }
140
168
 
141
- export { CborMajorType, CborReader, CborReaderState, CborSimpleValue, CborTag, CborWriter, ProtocolVersion, finalizationRegistry, getLibCardanoCVersion, getModule, isReady, ready };
169
+ declare class Crc32 {
170
+ private constructor();
171
+ static compute(data: Uint8Array): number;
172
+ static computeFromHex(hexString: string): number;
173
+ static computeFromUtf8(data: string): number;
174
+ }
175
+
176
+ declare class Pbkdf2HmacSha512 {
177
+ private constructor();
178
+ static compute(password: Uint8Array, salt: Uint8Array, iterations: number, derivedKeyLength: number): Uint8Array;
179
+ }
180
+
181
+ declare class Emip003 {
182
+ static encrypt(data: Uint8Array, passphrase: Uint8Array): Uint8Array;
183
+ static decrypt(encryptedData: Uint8Array, passphrase: Uint8Array): Uint8Array;
184
+ }
185
+
186
+ declare class Blake2b {
187
+ private constructor();
188
+ static computeHash(data: Uint8Array, hashLength: number): Uint8Array;
189
+ }
190
+
191
+ declare class Ed25519Signature {
192
+ ptr: number;
193
+ constructor(ptr: number);
194
+ static fromBytes(data: Uint8Array): Ed25519Signature;
195
+ static fromHex(hex: string): Ed25519Signature;
196
+ toBytes(): Uint8Array;
197
+ toHex(): string;
198
+ refCount(): number;
199
+ private getBytesSize;
200
+ private getHexSize;
201
+ }
202
+
203
+ declare class Ed25519PublicKey {
204
+ ptr: number;
205
+ constructor(ptr: number);
206
+ static fromBytes(data: Uint8Array): Ed25519PublicKey;
207
+ static fromHex(hex: string): Ed25519PublicKey;
208
+ toBytes(): Uint8Array;
209
+ toHex(): string;
210
+ verify(signature: Ed25519Signature, message: Uint8Array): boolean;
211
+ toHash(): Uint8Array;
212
+ toHashHex(): string;
213
+ refCount(): number;
214
+ private getBytesSize;
215
+ private getHexSize;
216
+ }
217
+
218
+ declare class Bip32PublicKey {
219
+ ptr: number;
220
+ constructor(ptr: number);
221
+ static fromBytes(data: Uint8Array): Bip32PublicKey;
222
+ static fromHex(hex: string): Bip32PublicKey;
223
+ toBytes(): Uint8Array;
224
+ toHex(): string;
225
+ derive(indices: number[]): Bip32PublicKey;
226
+ toEd25519Key(): Ed25519PublicKey;
227
+ toHash(): Uint8Array;
228
+ toHashHex(): string;
229
+ refCount(): number;
230
+ private getBytesSize;
231
+ private getHexSize;
232
+ }
233
+
234
+ declare class Ed25519PrivateKey {
235
+ ptr: number;
236
+ constructor(ptr: number);
237
+ static fromNormalBytes(data: Uint8Array): Ed25519PrivateKey;
238
+ static fromExtendedBytes(data: Uint8Array): Ed25519PrivateKey;
239
+ static fromNormalHex(hex: string): Ed25519PrivateKey;
240
+ static fromExtendedHex(hex: string): Ed25519PrivateKey;
241
+ toBytes(): Uint8Array;
242
+ toHex(): string;
243
+ sign(message: Uint8Array): Ed25519Signature;
244
+ getPublicKey(): Ed25519PublicKey;
245
+ refCount(): number;
246
+ private getBytesSize;
247
+ private getHexSize;
248
+ }
249
+
250
+ declare class Bip32PrivateKey {
251
+ ptr: number;
252
+ private constructor();
253
+ static fromBip39Entropy(password: Uint8Array, entropy: Uint8Array): Bip32PrivateKey;
254
+ static fromBytes(data: Uint8Array): Bip32PrivateKey;
255
+ static fromHex(hex: string): Bip32PrivateKey;
256
+ derive(indices: number[]): Bip32PrivateKey;
257
+ getPublicKey(): Bip32PublicKey;
258
+ toBytes(): Uint8Array;
259
+ toHex(): string;
260
+ toEd25519Key(): Ed25519PrivateKey;
261
+ refCount(): number;
262
+ private getBytesSize;
263
+ }
264
+
265
+ export { Base58, Bech32, type Bech32DecodeResult, Bip32PrivateKey, Bip32PublicKey, Blake2b, CborMajorType, CborReader, CborReaderState, CborSimpleValue, CborTag, CborWriter, Crc32, Ed25519PrivateKey, Ed25519PublicKey, Ed25519Signature, Emip003, Pbkdf2HmacSha512, ProtocolVersion, finalizationRegistry, getLibCardanoCVersion, getModule, hexToUint8Array, isReady, ready, uint8ArrayToHex, uint8ArrayToUtf8, utf8ToUint8Array };