@gardenfi/utils 2.4.6-beta.1 → 2.4.6-beta.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.
- package/dist/index100.cjs +1 -1
- package/dist/index100.js +2 -2
- package/dist/index121.cjs +1 -1
- package/dist/index121.js +1 -1
- package/dist/index16.cjs +1 -1
- package/dist/index16.js +2 -2
- package/dist/index18.cjs +1 -1
- package/dist/index18.js +2 -2
- package/dist/index197.cjs +1 -1
- package/dist/index197.js +3 -3
- package/dist/index226.cjs +1 -1
- package/dist/index226.js +2 -2
- package/dist/index229.cjs +1 -1
- package/dist/index229.js +2 -2
- package/dist/index230.cjs +1 -1
- package/dist/index230.js +1 -1
- package/dist/index242.cjs +1 -1
- package/dist/index242.js +3 -3
- package/dist/index26.cjs +1 -1
- package/dist/index26.js +2 -2
- package/dist/index262.cjs +2 -1
- package/dist/index262.js +40 -102
- package/dist/index263.cjs +1 -1
- package/dist/index263.js +2 -7
- package/dist/index264.cjs +1 -1
- package/dist/index264.js +5 -224
- package/dist/index265.cjs +1 -1
- package/dist/index265.js +10 -6
- package/dist/index266.cjs +1 -1
- package/dist/index266.js +20 -7
- package/dist/index267.cjs +1 -1
- package/dist/index267.js +8 -26
- package/dist/index268.cjs +1 -1
- package/dist/index268.js +66 -5
- package/dist/index269.cjs +1 -2
- package/dist/index269.js +64 -40
- package/dist/index270.cjs +1 -1
- package/dist/index270.js +187 -2
- package/dist/index271.cjs +1 -1
- package/dist/index271.js +20 -8
- package/dist/index272.cjs +1 -1
- package/dist/index272.js +40 -17
- package/dist/index273.cjs +1 -1
- package/dist/index273.js +76 -8
- package/dist/index274.cjs +1 -1
- package/dist/index274.js +40 -66
- package/dist/index275.cjs +1 -1
- package/dist/index275.js +15 -64
- package/dist/index276.cjs +1 -1
- package/dist/index276.js +12 -185
- package/dist/index277.cjs +1 -1
- package/dist/index277.js +11 -21
- package/dist/index278.cjs +2 -1
- package/dist/index278.js +18 -42
- package/dist/index279.cjs +1 -1
- package/dist/index279.js +13 -75
- package/dist/index28.cjs +1 -1
- package/dist/index28.js +31 -27
- package/dist/index280.cjs +1 -1
- package/dist/index280.js +11 -40
- package/dist/index281.cjs +1 -1
- package/dist/index281.js +6 -16
- package/dist/index282.cjs +1 -1
- package/dist/index282.js +7 -14
- package/dist/index283.cjs +1 -1
- package/dist/index283.js +25 -11
- package/dist/index284.cjs +1 -2
- package/dist/index284.js +19 -18
- package/dist/index285.cjs +1 -1
- package/dist/index285.js +145 -13
- package/dist/index286.cjs +1 -1
- package/dist/index286.js +103 -11
- package/dist/index287.cjs +1 -1
- package/dist/index287.js +6 -19
- package/dist/index288.cjs +1 -1
- package/dist/index288.js +219 -141
- package/dist/index29.cjs +1 -1
- package/dist/index29.js +12 -8
- package/dist/index293.cjs +1 -1
- package/dist/index293.js +2 -2
- package/dist/index295.cjs +1 -1
- package/dist/index295.js +41 -10
- package/dist/index296.cjs +1 -1
- package/dist/index296.js +77 -18
- package/dist/index297.cjs +1 -1
- package/dist/index297.js +2 -43
- package/dist/index298.cjs +1 -1
- package/dist/index298.js +10 -77
- package/dist/index299.cjs +1 -1
- package/dist/index299.js +20 -2
- package/dist/index30.cjs +1 -1
- package/dist/index30.js +27 -31
- package/dist/index300.cjs +1 -1
- package/dist/index300.js +68 -698
- package/dist/index301.cjs +1 -1
- package/dist/index301.js +685 -126
- package/dist/index302.cjs +1 -1
- package/dist/index302.js +124 -186
- package/dist/index303.cjs +1 -1
- package/dist/index303.js +200 -67
- package/dist/index31.cjs +1 -1
- package/dist/index31.js +8 -12
- package/dist/index55.cjs +1 -1
- package/dist/index55.js +1 -1
- package/package.json +1 -1
package/dist/index31.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=e=>{try{return JSON.parse(e)}catch{return e}};exports.safeParseJson=r;
|
package/dist/index31.js
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
name: i,
|
|
9
|
-
type: "publicClient"
|
|
10
|
-
}).extend(c);
|
|
11
|
-
}
|
|
1
|
+
const t = (r) => {
|
|
2
|
+
try {
|
|
3
|
+
return JSON.parse(r);
|
|
4
|
+
} catch {
|
|
5
|
+
return r;
|
|
6
|
+
}
|
|
7
|
+
};
|
|
12
8
|
export {
|
|
13
|
-
|
|
9
|
+
t as safeParseJson
|
|
14
10
|
};
|
package/dist/index55.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index52.cjs"),j=require("./index222.cjs"),u=require("./index47.cjs"),l=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./index52.cjs"),j=require("./index222.cjs"),u=require("./index47.cjs"),l=require("./index277.cjs");function C(s,i={}){return{async request(h){var w;const{body:r,onRequest:o=i.onRequest,onResponse:p=i.onResponse,timeout:d=i.timeout??1e4}=h,f={...i.fetchOptions??{},...h.fetchOptions??{}},{headers:q,method:m,signal:T}=f;try{const t=await j.withTimeout(async({signal:a})=>{const c={...f,body:Array.isArray(r)?u.stringify(r.map(g=>({jsonrpc:"2.0",id:g.id??l.idCache.take(),...g}))):u.stringify({jsonrpc:"2.0",id:r.id??l.idCache.take(),...r}),headers:{"Content-Type":"application/json",...q},method:m||"POST",signal:T||(d>0?a:null)},R=new Request(s,c),y=await(o==null?void 0:o(R,c))??{...c,url:s};return await fetch(y.url??s,y)},{errorInstance:new n.TimeoutError({body:r,url:s}),timeout:d,signal:!0});p&&await p(t);let e;if((w=t.headers.get("Content-Type"))!=null&&w.startsWith("application/json"))e=await t.json();else{e=await t.text();try{e=JSON.parse(e||"{}")}catch(a){if(t.ok)throw a;e={error:e}}}if(!t.ok)throw new n.HttpRequestError({body:r,details:u.stringify(e.error)||t.statusText,headers:t.headers,status:t.status,url:s});return e}catch(t){throw t instanceof n.HttpRequestError||t instanceof n.TimeoutError?t:new n.HttpRequestError({body:r,cause:t,url:s})}}}}exports.getHttpRpcClient=C;
|
package/dist/index55.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TimeoutError as g, HttpRequestError as c } from "./index52.js";
|
|
2
2
|
import { withTimeout as k } from "./index222.js";
|
|
3
3
|
import { stringify as p } from "./index47.js";
|
|
4
|
-
import { idCache as l } from "./
|
|
4
|
+
import { idCache as l } from "./index277.js";
|
|
5
5
|
function H(s, o = {}) {
|
|
6
6
|
return {
|
|
7
7
|
async request(h) {
|