@stacks/storage 6.17.0 → 7.0.0-beta.0
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.
- package/dist/esm/hub.d.ts +1 -1
- package/dist/esm/hub.js +5 -4
- package/dist/esm/hub.js.map +1 -1
- package/dist/esm/storage.d.ts +1 -1
- package/dist/esm/storage.js +3 -3
- package/dist/esm/storage.js.map +1 -1
- package/dist/hub.d.ts +1 -1
- package/dist/hub.js +7 -6
- package/dist/hub.js.map +1 -1
- package/dist/storage.d.ts +1 -1
- package/dist/storage.js +4 -4
- package/dist/storage.js.map +1 -1
- package/dist/umd/index.js +1 -1
- package/dist/umd/index.js.map +1 -1
- package/package.json +6 -6
- package/src/hub.ts +5 -3
- package/src/storage.ts +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacks/storage",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.0-beta.0",
|
|
4
4
|
"description": "Stacks storage library",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Hiro Systems PBC (https://hiro.so)",
|
|
@@ -20,10 +20,10 @@
|
|
|
20
20
|
"typecheck:watch": "npm run typecheck -- --watch"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@stacks/auth": "^
|
|
24
|
-
"@stacks/common": "^
|
|
25
|
-
"@stacks/encryption": "^
|
|
26
|
-
"@stacks/network": "^
|
|
23
|
+
"@stacks/auth": "^7.0.0-beta.0",
|
|
24
|
+
"@stacks/common": "^7.0.0-beta.0",
|
|
25
|
+
"@stacks/encryption": "^7.0.0-beta.0",
|
|
26
|
+
"@stacks/network": "^7.0.0-beta.0",
|
|
27
27
|
"base64-js": "^1.5.1",
|
|
28
28
|
"jsontokens": "^4.0.1"
|
|
29
29
|
},
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"bugs": {
|
|
56
56
|
"url": "https://github.com/blockstack/blockstack.js/issues"
|
|
57
57
|
},
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "08da6f728124b4c0b0615f86298cf259c2f5e2fa"
|
|
59
59
|
}
|
package/src/hub.ts
CHANGED
|
@@ -9,11 +9,11 @@ import {
|
|
|
9
9
|
NotEnoughProofError,
|
|
10
10
|
PayloadTooLargeError,
|
|
11
11
|
PreconditionFailedError,
|
|
12
|
+
PRIVATE_KEY_BYTES_COMPRESSED,
|
|
12
13
|
utf8ToBytes,
|
|
13
14
|
ValidationError,
|
|
14
15
|
} from '@stacks/common';
|
|
15
16
|
import {
|
|
16
|
-
compressPrivateKey,
|
|
17
17
|
ecSign,
|
|
18
18
|
getPublicKeyFromPrivate,
|
|
19
19
|
hashSha256Sync,
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
randomBytes,
|
|
22
22
|
Signature,
|
|
23
23
|
} from '@stacks/encryption';
|
|
24
|
-
import { createFetchFn, FetchFn } from '@stacks/
|
|
24
|
+
import { createFetchFn, FetchFn } from '@stacks/common';
|
|
25
25
|
import { fromByteArray } from 'base64-js';
|
|
26
26
|
import { TokenSigner } from 'jsontokens';
|
|
27
27
|
|
|
@@ -151,7 +151,9 @@ function makeLegacyAuthToken(challengeText: string, signerKeyHex: string): strin
|
|
|
151
151
|
}
|
|
152
152
|
if (parsedChallenge[0] === 'gaiahub' && parsedChallenge[3] === 'blockstack_storage_please_sign') {
|
|
153
153
|
const digest = hashSha256Sync(utf8ToBytes(challengeText));
|
|
154
|
-
const
|
|
154
|
+
const compressedPrivateKey =
|
|
155
|
+
signerKeyHex.length === PRIVATE_KEY_BYTES_COMPRESSED * 2 ? signerKeyHex : `${signerKeyHex}01`;
|
|
156
|
+
const signatureBytes = ecSign(digest, compressedPrivateKey);
|
|
155
157
|
// We only want the DER encoding so use toDERHex provided by @noble/secp256k1
|
|
156
158
|
const signature = Signature.fromCompact(bytesToHex(signatureBytes)).toDERHex();
|
|
157
159
|
|
package/src/storage.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { lookupProfile, NAME_LOOKUP_PATH, UserSession } from '@stacks/auth';
|
|
2
2
|
import {
|
|
3
|
-
BLOCKSTACK_DEFAULT_GAIA_HUB_URL,
|
|
4
3
|
DoesNotExist,
|
|
4
|
+
GAIA_URL,
|
|
5
5
|
GaiaHubError,
|
|
6
6
|
getGlobalObject,
|
|
7
7
|
InvalidStateError,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
signECDSA,
|
|
19
19
|
verifyECDSA,
|
|
20
20
|
} from '@stacks/encryption';
|
|
21
|
-
import { createFetchFn, FetchFn } from '@stacks/
|
|
21
|
+
import { createFetchFn, FetchFn } from '@stacks/common';
|
|
22
22
|
import { FileContentLoader } from './fileContentLoader';
|
|
23
23
|
import {
|
|
24
24
|
connectToGaiaHub,
|
|
@@ -804,7 +804,7 @@ export class Storage {
|
|
|
804
804
|
}
|
|
805
805
|
|
|
806
806
|
if (!userData.hubUrl) {
|
|
807
|
-
userData.hubUrl =
|
|
807
|
+
userData.hubUrl = GAIA_URL;
|
|
808
808
|
}
|
|
809
809
|
|
|
810
810
|
const gaiaConfig = await connectToGaiaHub(
|