@fuel-ts/account 0.0.0-rc-2143-20240514195947 → 0.0.0-rc-2143-20240514211533
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.
Potentially problematic release.
This version of @fuel-ts/account might be problematic. Click here for more details.
- package/dist/index.global.js +231 -456
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +3 -35
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1 -33
- package/dist/index.mjs.map +1 -1
- package/dist/mnemonic/mnemonic.d.ts.map +1 -1
- package/dist/mnemonic/utils.d.ts +0 -1
- package/dist/mnemonic/utils.d.ts.map +1 -1
- package/dist/test-utils.global.js +229 -454
- package/dist/test-utils.global.js.map +1 -1
- package/dist/test-utils.js +3 -35
- package/dist/test-utils.js.map +1 -1
- package/dist/test-utils.mjs +1 -33
- package/dist/test-utils.mjs.map +1 -1
- package/package.json +15 -15
package/dist/index.js
CHANGED
@@ -8224,38 +8224,6 @@ var Language = /* @__PURE__ */ ((Language2) => {
|
|
8224
8224
|
var import_errors18 = require("@fuel-ts/errors");
|
8225
8225
|
var import_hasher4 = require("@fuel-ts/hasher");
|
8226
8226
|
var import_utils32 = require("@fuel-ts/utils");
|
8227
|
-
function toUtf8Bytes(stri) {
|
8228
|
-
const str = stri.normalize("NFKD");
|
8229
|
-
const result = [];
|
8230
|
-
for (let i = 0; i < str.length; i += 1) {
|
8231
|
-
const c = str.charCodeAt(i);
|
8232
|
-
if (c < 128) {
|
8233
|
-
result.push(c);
|
8234
|
-
} else if (c < 2048) {
|
8235
|
-
result.push(c >> 6 | 192);
|
8236
|
-
result.push(c & 63 | 128);
|
8237
|
-
} else if ((c & 64512) === 55296) {
|
8238
|
-
i += 1;
|
8239
|
-
const c2 = str.charCodeAt(i);
|
8240
|
-
if (i >= str.length || (c2 & 64512) !== 56320) {
|
8241
|
-
throw new import_errors18.FuelError(
|
8242
|
-
import_errors18.ErrorCode.INVALID_INPUT_PARAMETERS,
|
8243
|
-
"Invalid UTF-8 in the input string."
|
8244
|
-
);
|
8245
|
-
}
|
8246
|
-
const pair = 65536 + ((c & 1023) << 10) + (c2 & 1023);
|
8247
|
-
result.push(pair >> 18 | 240);
|
8248
|
-
result.push(pair >> 12 & 63 | 128);
|
8249
|
-
result.push(pair >> 6 & 63 | 128);
|
8250
|
-
result.push(pair & 63 | 128);
|
8251
|
-
} else {
|
8252
|
-
result.push(c >> 12 | 224);
|
8253
|
-
result.push(c >> 6 & 63 | 128);
|
8254
|
-
result.push(c & 63 | 128);
|
8255
|
-
}
|
8256
|
-
}
|
8257
|
-
return Uint8Array.from(result);
|
8258
|
-
}
|
8259
8227
|
function getLowerMask(bits) {
|
8260
8228
|
return (1 << bits) - 1;
|
8261
8229
|
}
|
@@ -8328,7 +8296,7 @@ function mnemonicWordsToEntropy(words, wordlist) {
|
|
8328
8296
|
}
|
8329
8297
|
|
8330
8298
|
// src/mnemonic/mnemonic.ts
|
8331
|
-
var MasterSecret = toUtf8Bytes("Bitcoin seed");
|
8299
|
+
var MasterSecret = (0, import_utils33.toUtf8Bytes)("Bitcoin seed");
|
8332
8300
|
var MainnetPRV = "0x0488ade4";
|
8333
8301
|
var TestnetPRV = "0x04358394";
|
8334
8302
|
var MNEMONIC_SIZES = [12, 15, 18, 21, 24];
|
@@ -8412,8 +8380,8 @@ var Mnemonic = class {
|
|
8412
8380
|
*/
|
8413
8381
|
static mnemonicToSeed(phrase, passphrase = "") {
|
8414
8382
|
assertMnemonic(getWords(phrase));
|
8415
|
-
const phraseBytes = toUtf8Bytes(getPhrase(phrase));
|
8416
|
-
const salt = toUtf8Bytes(`mnemonic${passphrase}`);
|
8383
|
+
const phraseBytes = (0, import_utils33.toUtf8Bytes)(getPhrase(phrase));
|
8384
|
+
const salt = (0, import_utils33.toUtf8Bytes)(`mnemonic${passphrase}`);
|
8417
8385
|
return (0, import_crypto4.pbkdf2)(phraseBytes, salt, 2048, 64, "sha512");
|
8418
8386
|
}
|
8419
8387
|
/**
|