@gardenfi/utils 2.2.1-beta.1 → 2.2.1-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 +24 -24
- package/dist/index10.cjs +1 -1
- package/dist/index10.js +124 -2
- package/dist/index11.cjs +1 -1
- package/dist/index11.js +34 -114
- package/dist/index12.cjs +1 -1
- package/dist/index12.js +19 -37
- package/dist/index13.cjs +1 -1
- package/dist/index13.js +135 -19
- package/dist/index14.cjs +1 -1
- package/dist/index14.js +10 -137
- package/dist/index15.cjs +1 -1
- package/dist/index15.js +2 -15
- package/dist/index16.cjs +1 -1
- package/dist/index16.js +27 -2
- package/dist/index17.cjs +1 -1
- package/dist/index17.js +18 -26
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +102 -14
- package/dist/index24.cjs +1 -1
- package/dist/index24.js +12 -26
- package/dist/index25.cjs +1 -1
- package/dist/index25.js +58 -8
- package/dist/index26.cjs +16 -1
- package/dist/index26.js +113 -12
- package/dist/index27.cjs +1 -1
- package/dist/index27.js +32 -58
- package/dist/index28.cjs +1 -16
- package/dist/index28.js +24 -111
- package/dist/index29.cjs +1 -1
- package/dist/index29.js +7 -31
- package/dist/index7.cjs +1 -1
- package/dist/index7.js +8 -105
- package/dist/index8.cjs +1 -1
- package/dist/index8.js +22 -8
- package/dist/index9.cjs +1 -1
- package/dist/index9.js +2 -24
- package/dist/src/index.d.ts +2 -2
- package/dist/src/lib/approve.d.ts +1 -1
- package/dist/src/lib/auth/apikey/apikey.d.ts +1 -1
- package/dist/src/lib/auth/auth.types.d.ts +1 -1
- package/dist/src/lib/auth/passkey/passkey.d.ts +1 -1
- package/dist/src/lib/auth/passkey/passkeyLogin.d.ts +1 -1
- package/dist/src/lib/auth/siwe/siwe.d.ts +1 -1
- package/dist/src/lib/blockNumber/blockNumber.d.ts +1 -1
- package/dist/src/lib/digestKey/digestKey.d.ts +1 -1
- package/dist/src/lib/fetcher/index.d.ts +1 -0
- package/dist/src/lib/result/index.d.ts +1 -0
- package/dist/src/lib/tryCatch/index.d.ts +1 -0
- package/dist/src/lib/{tryCatch.d.ts → tryCatch/tryCatch.d.ts} +1 -1
- package/package.json +1 -1
- /package/dist/src/lib/{fetcher.d.ts → fetcher/fetcher.d.ts} +0 -0
- /package/dist/src/lib/{safeParseJson.d.ts → fetcher/safeParseJson.d.ts} +0 -0
- /package/dist/src/lib/{result.d.ts → result/result.d.ts} +0 -0
package/dist/index8.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class r extends URL{constructor(t,e){super(t,e)}endpoint(t){t.startsWith("/")||(t=`/${t}`);const e=`${this.pathname!=="/"?this.pathname:""}${t}`;return new r(e,this)}socket(){if(this.protocol==="https:")return this.origin.replace("https","wss");if(this.protocol==="http:")return this.origin.replace("http","ws");throw new Error("Invalid protocol")}addSearchParams(t){const e=new URLSearchParams(this.search);for(const s in t)e.set(s,t[s]);return new r(`${this.pathname}?${e.toString()}`,this)}}exports.Url=r;
|
package/dist/index8.js
CHANGED
|
@@ -1,12 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
class r extends URL {
|
|
2
|
+
constructor(t, s) {
|
|
3
|
+
super(t, s);
|
|
4
|
+
}
|
|
5
|
+
endpoint(t) {
|
|
6
|
+
t.startsWith("/") || (t = `/${t}`);
|
|
7
|
+
const s = `${this.pathname !== "/" ? this.pathname : ""}${t}`;
|
|
8
|
+
return new r(s, this);
|
|
9
|
+
}
|
|
10
|
+
socket() {
|
|
11
|
+
if (this.protocol === "https:")
|
|
12
|
+
return this.origin.replace("https", "wss");
|
|
13
|
+
if (this.protocol === "http:")
|
|
14
|
+
return this.origin.replace("http", "ws");
|
|
15
|
+
throw new Error("Invalid protocol");
|
|
16
|
+
}
|
|
17
|
+
addSearchParams(t) {
|
|
18
|
+
const s = new URLSearchParams(this.search);
|
|
19
|
+
for (const e in t)
|
|
20
|
+
s.set(e, t[e]);
|
|
21
|
+
return new r(`${this.pathname}?${s.toString()}`, this);
|
|
8
22
|
}
|
|
9
23
|
}
|
|
10
24
|
export {
|
|
11
|
-
|
|
25
|
+
r as Url
|
|
12
26
|
};
|
package/dist/index9.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e=(t=>(t.Authorization="Authorization",t.ApiKey="api-key",t))(e||{});exports.AuthHeaderEnum=e;
|
package/dist/index9.js
CHANGED
|
@@ -1,26 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
constructor(t, s) {
|
|
3
|
-
super(t, s);
|
|
4
|
-
}
|
|
5
|
-
endpoint(t) {
|
|
6
|
-
t.startsWith("/") || (t = `/${t}`);
|
|
7
|
-
const s = `${this.pathname !== "/" ? this.pathname : ""}${t}`;
|
|
8
|
-
return new r(s, this);
|
|
9
|
-
}
|
|
10
|
-
socket() {
|
|
11
|
-
if (this.protocol === "https:")
|
|
12
|
-
return this.origin.replace("https", "wss");
|
|
13
|
-
if (this.protocol === "http:")
|
|
14
|
-
return this.origin.replace("http", "ws");
|
|
15
|
-
throw new Error("Invalid protocol");
|
|
16
|
-
}
|
|
17
|
-
addSearchParams(t) {
|
|
18
|
-
const s = new URLSearchParams(this.search);
|
|
19
|
-
for (const e in t)
|
|
20
|
-
s.set(e, t[e]);
|
|
21
|
-
return new r(`${this.pathname}?${s.toString()}`, this);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
1
|
+
var o = /* @__PURE__ */ ((i) => (i.Authorization = "Authorization", i.ApiKey = "api-key", i))(o || {});
|
|
24
2
|
export {
|
|
25
|
-
|
|
3
|
+
o as AuthHeaderEnum
|
|
26
4
|
};
|
package/dist/src/index.d.ts
CHANGED
|
@@ -6,8 +6,8 @@ export * from './lib/utils';
|
|
|
6
6
|
export * from './lib/approve';
|
|
7
7
|
export * from './lib/blockNumber';
|
|
8
8
|
export * from './lib/eventBroker';
|
|
9
|
-
export * from './lib/result';
|
|
9
|
+
export * from './lib/result/result';
|
|
10
10
|
export * from './lib/digestKey/digestKey';
|
|
11
11
|
export * from './lib/fetcher';
|
|
12
12
|
export * from './lib/types';
|
|
13
|
-
export * from './lib/tryCatch';
|
|
13
|
+
export * from './lib/tryCatch/tryCatch';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { TransactionReceipt, WalletClient } from 'viem';
|
|
2
|
-
import { AsyncResult } from './result';
|
|
2
|
+
import { AsyncResult } from './result/result';
|
|
3
3
|
|
|
4
4
|
export declare const checkAllowanceAndApprove: (amount: number, tokenAddress: string, contractAddress: string, walletClient: WalletClient) => AsyncResult<string, string>;
|
|
5
5
|
export declare const waitForTransactionReceipt: (walletClient: WalletClient, hash: `0x${string}`, interval?: number, timeout?: number) => AsyncResult<TransactionReceipt, string>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Url } from '../../url';
|
|
2
2
|
import { PasskeyToken } from './passkey.types';
|
|
3
3
|
import { IStore } from '../../store';
|
|
4
|
-
import { AsyncResult, Result } from '../../result';
|
|
4
|
+
import { AsyncResult, Result } from '../../result/result';
|
|
5
5
|
|
|
6
6
|
export declare class PasskeyLogin {
|
|
7
7
|
private url;
|
|
@@ -2,7 +2,7 @@ import { AuthHeader, IAuth, SiweOpts } from '../auth.types';
|
|
|
2
2
|
import { Url } from '../../url';
|
|
3
3
|
import { WalletClient } from 'viem';
|
|
4
4
|
import { DigestKey } from '../../digestKey/digestKey';
|
|
5
|
-
import { AsyncResult, Result } from '../../result';
|
|
5
|
+
import { AsyncResult, Result } from '../../result/result';
|
|
6
6
|
|
|
7
7
|
export declare class Siwe implements IAuth {
|
|
8
8
|
private readonly url;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './fetcher';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './result';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './tryCatch';
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|