@gardenfi/utils 2.0.6-beta.1 → 2.0.6-beta.3
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/index.cjs +1 -1
- package/dist/index.js +20 -22
- package/dist/index10.cjs +1 -1
- package/dist/index10.js +19 -37
- package/dist/index100.cjs +1 -1
- package/dist/index100.js +128 -2
- package/dist/index101.cjs +1 -1
- package/dist/index101.js +113 -5
- package/dist/index102.cjs +1 -1
- package/dist/index102.js +78 -10
- package/dist/index103.cjs +1 -1
- package/dist/index103.js +2 -21
- package/dist/index104.cjs +1 -1
- package/dist/index104.js +17 -6
- package/dist/index105.cjs +1 -1
- package/dist/index105.js +19 -5
- package/dist/index106.cjs +1 -1
- package/dist/index106.js +15 -36
- package/dist/index107.cjs +1 -1
- package/dist/index107.js +222 -126
- package/dist/index108.cjs +2 -1
- package/dist/index108.js +3 -2
- package/dist/index109.cjs +1 -2
- package/dist/index109.js +35 -3
- package/dist/index11.cjs +1 -1
- package/dist/index11.js +134 -19
- package/dist/index110.cjs +1 -1
- package/dist/index110.js +16 -65
- package/dist/index111.cjs +1 -1
- package/dist/index111.js +2 -2
- package/dist/index112.cjs +1 -1
- package/dist/index112.js +68 -2
- package/dist/index113.cjs +1 -1
- package/dist/index113.js +2 -35
- package/dist/index114.cjs +1 -1
- package/dist/index114.js +1 -1
- package/dist/index115.cjs +1 -1
- package/dist/index115.js +1 -1
- package/dist/index117.cjs +1 -1
- package/dist/index117.js +1 -1
- package/dist/index12.cjs +1 -1
- package/dist/index12.js +10 -136
- package/dist/index13.cjs +1 -1
- package/dist/index13.js +2 -15
- package/dist/index14.cjs +1 -1
- package/dist/index14.js +34 -2
- package/dist/index15.cjs +1 -1
- package/dist/index15.js +17 -32
- package/dist/index16.cjs +1 -1
- package/dist/index16.js +183 -14
- package/dist/index17.cjs +1 -1
- package/dist/index17.js +92 -187
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +34 -92
- package/dist/index19.cjs +1 -1
- package/dist/index19.js +32 -36
- package/dist/index20.cjs +16 -1
- package/dist/index20.js +112 -30
- package/dist/index21.cjs +1 -16
- package/dist/index21.js +30 -113
- package/dist/index22.cjs +1 -1
- package/dist/index22.js +18 -31
- package/dist/index23.cjs +1 -1
- package/dist/index23.js +7 -17
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +44 -6
- package/dist/index25.cjs +1 -1
- package/dist/index25.js +21 -45
- package/dist/index26.cjs +1 -1
- package/dist/index26.js +8 -21
- package/dist/index27.cjs +1 -1
- package/dist/index27.js +31 -8
- package/dist/index28.cjs +1 -1
- package/dist/index28.js +26 -31
- package/dist/index29.cjs +2 -1
- package/dist/index29.js +64 -25
- package/dist/index30.cjs +1 -2
- package/dist/index30.js +50 -64
- package/dist/index31.cjs +1 -1
- package/dist/index31.js +12 -51
- package/dist/index32.cjs +1 -1
- package/dist/index32.js +24 -12
- package/dist/index33.cjs +1 -1
- package/dist/index33.js +75 -24
- package/dist/index34.cjs +1 -1
- package/dist/index34.js +22 -74
- package/dist/index35.cjs +1 -1
- package/dist/index35.js +7 -23
- package/dist/index36.cjs +1 -1
- package/dist/index36.js +32 -7
- package/dist/index37.cjs +1 -1
- package/dist/index37.js +14 -31
- package/dist/index38.cjs +1 -1
- package/dist/index38.js +2 -16
- package/dist/index39.cjs +1 -1
- package/dist/index39.js +9 -2
- package/dist/index4.cjs +1 -1
- package/dist/index4.js +2 -2
- package/dist/index40.cjs +1 -1
- package/dist/index40.js +20 -8
- package/dist/index41.cjs +1 -1
- package/dist/index41.js +12 -20
- package/dist/index42.cjs +1 -1
- package/dist/index42.js +33 -40
- package/dist/index43.cjs +1 -1
- package/dist/index43.js +6 -25
- package/dist/index44.cjs +2 -1
- package/dist/index44.js +59 -6
- package/dist/index45.cjs +1 -1
- package/dist/index45.js +2 -14
- package/dist/index46.cjs +1 -1
- package/dist/index46.js +6 -15
- package/dist/index47.cjs +1 -1
- package/dist/index47.js +4 -5
- package/dist/index48.cjs +1 -1
- package/dist/index48.js +11 -13
- package/dist/index49.cjs +5 -1
- package/dist/index49.js +56 -10
- package/dist/index50.cjs +2 -1
- package/dist/index50.js +32 -10
- package/dist/index51.cjs +1 -1
- package/dist/index51.js +5 -11
- package/dist/index52.cjs +1 -1
- package/dist/index52.js +3 -13
- package/dist/index53.cjs +1 -1
- package/dist/index53.js +20 -54
- package/dist/index54.cjs +1 -1
- package/dist/index54.js +12 -16
- package/dist/index55.cjs +1 -1
- package/dist/index55.js +55 -5
- package/dist/index56.cjs +1 -1
- package/dist/index56.js +3 -3
- package/dist/index57.cjs +1 -1
- package/dist/index57.js +19 -169
- package/dist/index58.cjs +1 -1
- package/dist/index58.js +11 -103
- package/dist/index59.cjs +1 -1
- package/dist/index59.js +8 -21
- package/dist/index6.cjs +1 -1
- package/dist/index6.js +22 -45
- package/dist/index60.cjs +1 -1
- package/dist/index60.js +9 -11
- package/dist/index61.cjs +1 -1
- package/dist/index61.js +11 -34
- package/dist/index62.cjs +1 -1
- package/dist/index62.js +6 -6
- package/dist/index63.cjs +1 -2
- package/dist/index63.js +13 -59
- package/dist/index64.cjs +1 -1
- package/dist/index64.js +33 -2
- package/dist/index65.cjs +1 -1
- package/dist/index65.js +14 -6
- package/dist/index66.cjs +1 -1
- package/dist/index66.js +64 -4
- package/dist/index67.cjs +1 -1
- package/dist/index67.js +27 -11
- package/dist/index68.cjs +1 -5
- package/dist/index68.js +3 -57
- package/dist/index69.cjs +1 -2
- package/dist/index69.js +3 -34
- package/dist/index7.cjs +1 -1
- package/dist/index7.js +2 -24
- package/dist/index70.cjs +1 -1
- package/dist/index70.js +13 -5
- package/dist/index71.cjs +1 -1
- package/dist/index71.js +41 -3
- package/dist/index72.cjs +1 -1
- package/dist/index72.js +5 -21
- package/dist/index73.cjs +1 -1
- package/dist/index73.js +8 -8
- package/dist/index74.cjs +1 -1
- package/dist/index74.js +102 -9
- package/dist/index75.cjs +1 -1
- package/dist/index75.js +190 -10
- package/dist/index76.cjs +1 -1
- package/dist/index76.js +17 -5
- package/dist/index77.cjs +1 -1
- package/dist/index77.js +10 -12
- package/dist/index78.cjs +1 -1
- package/dist/index78.js +19 -32
- package/dist/index79.cjs +1 -1
- package/dist/index79.js +25 -14
- package/dist/index8.cjs +1 -1
- package/dist/index8.js +100 -2
- package/dist/index80.cjs +1 -1
- package/dist/index80.js +6 -64
- package/dist/index81.cjs +1 -1
- package/dist/index81.js +13 -27
- package/dist/index82.cjs +1 -1
- package/dist/index82.js +16 -3
- package/dist/index83.cjs +1 -1
- package/dist/index83.js +5 -191
- package/dist/index84.cjs +1 -1
- package/dist/index84.js +13 -18
- package/dist/index85.cjs +1 -1
- package/dist/index85.js +10 -3
- package/dist/index86.cjs +1 -1
- package/dist/index86.js +16 -8
- package/dist/index87.cjs +1 -1
- package/dist/index87.js +169 -110
- package/dist/index88.cjs +1 -1
- package/dist/index88.js +6 -14
- package/dist/index89.cjs +1 -1
- package/dist/index89.js +9 -220
- package/dist/index9.cjs +1 -1
- package/dist/index9.js +34 -90
- package/dist/index90.cjs +1 -1
- package/dist/index90.js +34 -38
- package/dist/index91.cjs +1 -1
- package/dist/index91.js +2 -2
- package/dist/index92.cjs +1 -1
- package/dist/index92.js +5 -18
- package/dist/index93.cjs +1 -1
- package/dist/index93.js +10 -78
- package/dist/index94.cjs +1 -1
- package/dist/index94.js +2 -19
- package/dist/index95.cjs +1 -1
- package/dist/index95.js +40 -6
- package/dist/index96.cjs +1 -1
- package/dist/index96.js +16 -8
- package/dist/index97.cjs +1 -1
- package/dist/index97.js +6 -11
- package/dist/index98.cjs +1 -1
- package/dist/index98.js +5 -20
- package/dist/index99.cjs +1 -1
- package/dist/index99.js +33 -34
- package/dist/src/index.d.ts +0 -1
- package/dist/src/lib/auth/siwe/siwe.d.ts +1 -2
- package/package.json +2 -3
- package/dist/index118.cjs +0 -1
- package/dist/index118.js +0 -21
- package/dist/src/lib/digestKey/digestKey.d.ts +0 -12
package/dist/index99.js
CHANGED
|
@@ -1,41 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
strict: o
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
function s(e, f) {
|
|
12
|
-
if (typeof f == "number" && f > 0 && f > r(e) - 1)
|
|
13
|
-
throw new t({
|
|
14
|
-
offset: f,
|
|
15
|
-
position: "start",
|
|
16
|
-
size: r(e)
|
|
1
|
+
import { versionedHashVersionKzg as a } from "./index103.js";
|
|
2
|
+
import { BaseError as s } from "./index44.js";
|
|
3
|
+
class t extends s {
|
|
4
|
+
constructor({ maxSize: e, size: r }) {
|
|
5
|
+
super("Blob size is too large.", {
|
|
6
|
+
metaMessages: [`Max: ${e} bytes`, `Given: ${r} bytes`],
|
|
7
|
+
name: "BlobSizeTooLargeError"
|
|
17
8
|
});
|
|
9
|
+
}
|
|
18
10
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
position: "end",
|
|
24
|
-
size: r(e)
|
|
25
|
-
});
|
|
11
|
+
class d extends s {
|
|
12
|
+
constructor() {
|
|
13
|
+
super("Blob data must not be empty.", { name: "EmptyBlobError" });
|
|
14
|
+
}
|
|
26
15
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
16
|
+
class l extends s {
|
|
17
|
+
constructor({ hash: e, size: r }) {
|
|
18
|
+
super(`Versioned hash "${e}" size is invalid.`, {
|
|
19
|
+
metaMessages: ["Expected: 32", `Received: ${r}`],
|
|
20
|
+
name: "InvalidVersionedHashSizeError"
|
|
21
|
+
});
|
|
22
|
+
}
|
|
31
23
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
24
|
+
class c extends s {
|
|
25
|
+
constructor({ hash: e, version: r }) {
|
|
26
|
+
super(`Versioned hash "${e}" version is invalid.`, {
|
|
27
|
+
metaMessages: [
|
|
28
|
+
`Expected: ${a}`,
|
|
29
|
+
`Received: ${r}`
|
|
30
|
+
],
|
|
31
|
+
name: "InvalidVersionedHashVersionError"
|
|
32
|
+
});
|
|
33
|
+
}
|
|
36
34
|
}
|
|
37
35
|
export {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
t as BlobSizeTooLargeError,
|
|
37
|
+
d as EmptyBlobError,
|
|
38
|
+
l as InvalidVersionedHashSizeError,
|
|
39
|
+
c as InvalidVersionedHashVersionError
|
|
41
40
|
};
|
package/dist/src/index.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { AuthHeader, IAuth, SiweOpts } from '../auth.types';
|
|
|
2
2
|
import { AsyncResult, Result } from '@catalogfi/utils';
|
|
3
3
|
import { Url } from '../../url';
|
|
4
4
|
import { WalletClient } from 'viem';
|
|
5
|
-
import { DigestKey } from '../../digestKey/digestKey';
|
|
6
5
|
|
|
7
6
|
export declare class Siwe implements IAuth {
|
|
8
7
|
private readonly API;
|
|
@@ -12,7 +11,7 @@ export declare class Siwe implements IAuth {
|
|
|
12
11
|
private readonly signingStatement;
|
|
13
12
|
private readonly domain;
|
|
14
13
|
constructor(url: Url, walletClient: WalletClient, opts?: SiweOpts);
|
|
15
|
-
static fromDigestKey(url: Url, digestKey:
|
|
14
|
+
static fromDigestKey(url: Url, digestKey: string): Siwe;
|
|
16
15
|
verifyToken(token: string, account: string): Result<boolean, string>;
|
|
17
16
|
getToken(): AsyncResult<string, string>;
|
|
18
17
|
private signStatement;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gardenfi/utils",
|
|
3
|
-
"version": "2.0.6-beta.
|
|
3
|
+
"version": "2.0.6-beta.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "vite build",
|
|
@@ -36,8 +36,7 @@
|
|
|
36
36
|
"sideEffects": false,
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@simplewebauthn/browser": "^13.1.0",
|
|
39
|
-
"crypto-browserify": "^3.12.1",
|
|
40
39
|
"jwt-decode": "^4.0.0",
|
|
41
40
|
"viem": "^2.21.23"
|
|
42
41
|
}
|
|
43
|
-
}
|
|
42
|
+
}
|
package/dist/index118.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=BigInt(2**32-1),i=BigInt(32);function u(t,e=!1){return e?{h:Number(t&n),l:Number(t>>i&n)}:{h:Number(t>>i&n)|0,l:Number(t&n)|0}}function g(t,e=!1){let r=new Uint32Array(t.length),l=new Uint32Array(t.length);for(let o=0;o<t.length;o++){const{h:c,l:f}=u(t[o],e);[r[o],l[o]]=[c,f]}return[r,l]}const B=(t,e,r)=>t<<r|e>>>32-r,h=(t,e,r)=>e<<r|t>>>32-r,m=(t,e,r)=>e<<r-32|t>>>64-r,S=(t,e,r)=>t<<r-32|e>>>64-r;exports.fromBig=u;exports.rotlBH=m;exports.rotlBL=S;exports.rotlSH=B;exports.rotlSL=h;exports.split=g;
|
package/dist/index118.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
const o = /* @__PURE__ */ BigInt(4294967295), i = /* @__PURE__ */ BigInt(32);
|
|
2
|
-
function f(t, r = !1) {
|
|
3
|
-
return r ? { h: Number(t & o), l: Number(t >> i & o) } : { h: Number(t >> i & o) | 0, l: Number(t & o) | 0 };
|
|
4
|
-
}
|
|
5
|
-
function h(t, r = !1) {
|
|
6
|
-
let n = new Uint32Array(t.length), l = new Uint32Array(t.length);
|
|
7
|
-
for (let e = 0; e < t.length; e++) {
|
|
8
|
-
const { h: c, l: u } = f(t[e], r);
|
|
9
|
-
[n[e], l[e]] = [c, u];
|
|
10
|
-
}
|
|
11
|
-
return [n, l];
|
|
12
|
-
}
|
|
13
|
-
const g = (t, r, n) => t << n | r >>> 32 - n, m = (t, r, n) => r << n | t >>> 32 - n, A = (t, r, n) => r << n - 32 | t >>> 64 - n, B = (t, r, n) => t << n - 32 | r >>> 64 - n;
|
|
14
|
-
export {
|
|
15
|
-
f as fromBig,
|
|
16
|
-
A as rotlBH,
|
|
17
|
-
B as rotlBL,
|
|
18
|
-
g as rotlSH,
|
|
19
|
-
m as rotlSL,
|
|
20
|
-
h as split
|
|
21
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
export declare class DigestKey {
|
|
2
|
-
private _digestKey;
|
|
3
|
-
private _userId;
|
|
4
|
-
constructor(digestKey: string);
|
|
5
|
-
static from(digestKey: string): import('../result').Result<never, string> | import('../result').Result<DigestKey, never>;
|
|
6
|
-
static generateRandom(): import('../result').Result<never, string> | import('../result').Result<DigestKey, never>;
|
|
7
|
-
private static isValidDigestKey;
|
|
8
|
-
private static isValidPrivateKey;
|
|
9
|
-
private static generateRandomDigestKey;
|
|
10
|
-
get digestKey(): string;
|
|
11
|
-
get userId(): string;
|
|
12
|
-
}
|