@gardenfi/wallet-connectors 0.1.0-beta.1
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/README.md +0 -0
- package/dist/index.cjs +1 -0
- package/dist/index.js +9 -0
- package/dist/index10.cjs +1 -0
- package/dist/index10.js +134 -0
- package/dist/index11.cjs +1 -0
- package/dist/index11.js +46 -0
- package/dist/index12.cjs +1 -0
- package/dist/index12.js +233 -0
- package/dist/index13.cjs +1 -0
- package/dist/index13.js +8 -0
- package/dist/index14.cjs +2 -0
- package/dist/index14.js +133 -0
- package/dist/index15.cjs +1 -0
- package/dist/index15.js +70 -0
- package/dist/index16.cjs +1 -0
- package/dist/index16.js +89 -0
- package/dist/index17.cjs +1 -0
- package/dist/index17.js +31 -0
- package/dist/index18.cjs +1 -0
- package/dist/index18.js +11 -0
- package/dist/index19.cjs +1 -0
- package/dist/index19.js +77 -0
- package/dist/index2.cjs +1 -0
- package/dist/index2.js +106 -0
- package/dist/index20.cjs +1 -0
- package/dist/index20.js +6 -0
- package/dist/index21.cjs +1 -0
- package/dist/index21.js +4 -0
- package/dist/index22.cjs +1 -0
- package/dist/index22.js +83 -0
- package/dist/index23.cjs +1 -0
- package/dist/index23.js +54 -0
- package/dist/index24.cjs +1 -0
- package/dist/index24.js +8 -0
- package/dist/index25.cjs +1 -0
- package/dist/index25.js +7 -0
- package/dist/index26.cjs +2 -0
- package/dist/index26.js +173 -0
- package/dist/index27.cjs +3 -0
- package/dist/index27.js +53 -0
- package/dist/index28.cjs +1 -0
- package/dist/index28.js +71 -0
- package/dist/index29.cjs +1 -0
- package/dist/index29.js +19 -0
- package/dist/index3.cjs +1 -0
- package/dist/index3.js +30 -0
- package/dist/index30.cjs +1 -0
- package/dist/index30.js +58 -0
- package/dist/index31.cjs +1 -0
- package/dist/index31.js +31 -0
- package/dist/index32.cjs +1 -0
- package/dist/index32.js +8 -0
- package/dist/index33.cjs +1 -0
- package/dist/index33.js +51 -0
- package/dist/index34.cjs +1 -0
- package/dist/index34.js +8 -0
- package/dist/index35.cjs +1 -0
- package/dist/index35.js +13 -0
- package/dist/index36.cjs +1 -0
- package/dist/index36.js +9 -0
- package/dist/index37.cjs +2 -0
- package/dist/index37.js +30 -0
- package/dist/index38.cjs +1 -0
- package/dist/index38.js +4 -0
- package/dist/index39.cjs +1 -0
- package/dist/index39.js +71 -0
- package/dist/index4.cjs +1 -0
- package/dist/index4.js +30 -0
- package/dist/index40.cjs +1 -0
- package/dist/index40.js +141 -0
- package/dist/index41.cjs +1 -0
- package/dist/index41.js +15 -0
- package/dist/index42.cjs +1 -0
- package/dist/index42.js +9 -0
- package/dist/index43.cjs +1 -0
- package/dist/index43.js +33 -0
- package/dist/index44.cjs +1 -0
- package/dist/index44.js +13 -0
- package/dist/index45.cjs +1 -0
- package/dist/index45.js +6 -0
- package/dist/index46.cjs +1 -0
- package/dist/index46.js +6 -0
- package/dist/index47.cjs +1 -0
- package/dist/index47.js +14 -0
- package/dist/index48.cjs +1 -0
- package/dist/index48.js +7 -0
- package/dist/index49.cjs +1 -0
- package/dist/index49.js +35 -0
- package/dist/index5.cjs +1 -0
- package/dist/index5.js +5 -0
- package/dist/index50.cjs +1 -0
- package/dist/index50.js +33 -0
- package/dist/index51.cjs +1 -0
- package/dist/index51.js +30 -0
- package/dist/index52.cjs +1 -0
- package/dist/index52.js +63 -0
- package/dist/index53.cjs +1 -0
- package/dist/index53.js +5 -0
- package/dist/index54.cjs +1 -0
- package/dist/index54.js +4 -0
- package/dist/index55.cjs +1 -0
- package/dist/index55.js +4 -0
- package/dist/index56.cjs +1 -0
- package/dist/index56.js +19 -0
- package/dist/index57.cjs +1 -0
- package/dist/index57.js +15 -0
- package/dist/index58.cjs +1 -0
- package/dist/index58.js +37 -0
- package/dist/index59.cjs +1 -0
- package/dist/index59.js +32 -0
- package/dist/index6.cjs +1 -0
- package/dist/index6.js +69 -0
- package/dist/index7.cjs +1 -0
- package/dist/index7.js +69 -0
- package/dist/index8.cjs +1 -0
- package/dist/index8.js +61 -0
- package/dist/index9.cjs +1 -0
- package/dist/index9.js +95 -0
- package/dist/src/bitcoin/bitcoin.types.d.ts +53 -0
- package/dist/src/bitcoin/btcWalletsProvider.d.ts +41 -0
- package/dist/src/bitcoin/constants.d.ts +27 -0
- package/dist/src/bitcoin/index.d.ts +3 -0
- package/dist/src/bitcoin/providers/okx/okx.types.d.ts +33 -0
- package/dist/src/bitcoin/providers/okx/provider.d.ts +28 -0
- package/dist/src/bitcoin/providers/phantom/phantom.types.d.ts +30 -0
- package/dist/src/bitcoin/providers/phantom/provider.d.ts +31 -0
- package/dist/src/bitcoin/providers/unisat/provider.d.ts +27 -0
- package/dist/src/bitcoin/providers/unisat/unisat.types.d.ts +19 -0
- package/dist/src/bitcoin/providers/xdefi/provider.d.ts +24 -0
- package/dist/src/bitcoin/providers/xdefi/xdefi.types.d.ts +17 -0
- package/dist/src/bitcoin/providers/xverse/provider.d.ts +30 -0
- package/dist/src/bitcoin/providers/xverse/xverse.types.d.ts +7 -0
- package/dist/src/bitcoin/utils.d.ts +4 -0
- package/dist/src/index.d.ts +1 -0
- package/package.json +45 -0
package/dist/index15.js
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import i from "./index12.js";
|
|
2
|
+
import h from "./index26.js";
|
|
3
|
+
const c = (s) => s instanceof h ? { ...s } : s;
|
|
4
|
+
function C(s, o) {
|
|
5
|
+
o = o || {};
|
|
6
|
+
const f = {};
|
|
7
|
+
function d(t, e, r) {
|
|
8
|
+
return i.isPlainObject(t) && i.isPlainObject(e) ? i.merge.call({ caseless: r }, t, e) : i.isPlainObject(e) ? i.merge({}, e) : i.isArray(e) ? e.slice() : e;
|
|
9
|
+
}
|
|
10
|
+
function u(t, e, r) {
|
|
11
|
+
if (i.isUndefined(e)) {
|
|
12
|
+
if (!i.isUndefined(t))
|
|
13
|
+
return d(void 0, t, r);
|
|
14
|
+
} else return d(t, e, r);
|
|
15
|
+
}
|
|
16
|
+
function a(t, e) {
|
|
17
|
+
if (!i.isUndefined(e))
|
|
18
|
+
return d(void 0, e);
|
|
19
|
+
}
|
|
20
|
+
function n(t, e) {
|
|
21
|
+
if (i.isUndefined(e)) {
|
|
22
|
+
if (!i.isUndefined(t))
|
|
23
|
+
return d(void 0, t);
|
|
24
|
+
} else return d(void 0, e);
|
|
25
|
+
}
|
|
26
|
+
function l(t, e, r) {
|
|
27
|
+
if (r in o)
|
|
28
|
+
return d(t, e);
|
|
29
|
+
if (r in s)
|
|
30
|
+
return d(void 0, t);
|
|
31
|
+
}
|
|
32
|
+
const g = {
|
|
33
|
+
url: a,
|
|
34
|
+
method: a,
|
|
35
|
+
data: a,
|
|
36
|
+
baseURL: n,
|
|
37
|
+
transformRequest: n,
|
|
38
|
+
transformResponse: n,
|
|
39
|
+
paramsSerializer: n,
|
|
40
|
+
timeout: n,
|
|
41
|
+
timeoutMessage: n,
|
|
42
|
+
withCredentials: n,
|
|
43
|
+
withXSRFToken: n,
|
|
44
|
+
adapter: n,
|
|
45
|
+
responseType: n,
|
|
46
|
+
xsrfCookieName: n,
|
|
47
|
+
xsrfHeaderName: n,
|
|
48
|
+
onUploadProgress: n,
|
|
49
|
+
onDownloadProgress: n,
|
|
50
|
+
decompress: n,
|
|
51
|
+
maxContentLength: n,
|
|
52
|
+
maxBodyLength: n,
|
|
53
|
+
beforeRedirect: n,
|
|
54
|
+
transport: n,
|
|
55
|
+
httpAgent: n,
|
|
56
|
+
httpsAgent: n,
|
|
57
|
+
cancelToken: n,
|
|
58
|
+
socketPath: n,
|
|
59
|
+
responseEncoding: n,
|
|
60
|
+
validateStatus: l,
|
|
61
|
+
headers: (t, e) => u(c(t), c(e), !0)
|
|
62
|
+
};
|
|
63
|
+
return i.forEach(Object.keys(Object.assign({}, s, o)), function(e) {
|
|
64
|
+
const r = g[e] || u, m = r(s[e], o[e], e);
|
|
65
|
+
i.isUndefined(m) && r !== l || (f[e] = m);
|
|
66
|
+
}), f;
|
|
67
|
+
}
|
|
68
|
+
export {
|
|
69
|
+
C as default
|
|
70
|
+
};
|
package/dist/index16.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const r=require("./index12.cjs"),a=require("./index23.cjs"),p=require("./index34.cjs"),S=require("./index22.cjs"),h=require("./index35.cjs"),m=require("./index36.cjs"),O=require("./index17.cjs");function y(t,e,n){if(r.isString(t))try{return(e||JSON.parse)(t),r.trim(t)}catch(i){if(i.name!=="SyntaxError")throw i}return(0,JSON.stringify)(t)}const c={transitional:p,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){const i=n.getContentType()||"",o=i.indexOf("application/json")>-1,f=r.isObject(e);if(f&&r.isHTMLForm(e)&&(e=new FormData(e)),r.isFormData(e))return o?JSON.stringify(O(e)):e;if(r.isArrayBuffer(e)||r.isBuffer(e)||r.isStream(e)||r.isFile(e)||r.isBlob(e)||r.isReadableStream(e))return e;if(r.isArrayBufferView(e))return e.buffer;if(r.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(f){if(i.indexOf("application/x-www-form-urlencoded")>-1)return h(e,this.formSerializer).toString();if((s=r.isFileList(e))||i.indexOf("multipart/form-data")>-1){const l=this.env&&this.env.FormData;return S(s?{"files[]":e}:e,l&&new l,this.formSerializer)}}return f||o?(n.setContentType("application/json",!1),y(e)):e}],transformResponse:[function(e){const n=this.transitional||c.transitional,i=n&&n.forcedJSONParsing,o=this.responseType==="json";if(r.isResponse(e)||r.isReadableStream(e))return e;if(e&&r.isString(e)&&(i&&!this.responseType||o)){const u=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(e)}catch(s){if(u)throw s.name==="SyntaxError"?a.from(s,a.ERR_BAD_RESPONSE,this,null,this.response):s}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:m.classes.FormData,Blob:m.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};r.forEach(["delete","get","head","post","put","patch"],t=>{c.headers[t]={}});module.exports=c;
|
package/dist/index16.js
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import t from "./index12.js";
|
|
2
|
+
import p from "./index23.js";
|
|
3
|
+
import u from "./index34.js";
|
|
4
|
+
import S from "./index22.js";
|
|
5
|
+
import h from "./index35.js";
|
|
6
|
+
import l from "./index36.js";
|
|
7
|
+
import O from "./index17.js";
|
|
8
|
+
function y(e, r, i) {
|
|
9
|
+
if (t.isString(e))
|
|
10
|
+
try {
|
|
11
|
+
return (r || JSON.parse)(e), t.trim(e);
|
|
12
|
+
} catch (n) {
|
|
13
|
+
if (n.name !== "SyntaxError")
|
|
14
|
+
throw n;
|
|
15
|
+
}
|
|
16
|
+
return (0, JSON.stringify)(e);
|
|
17
|
+
}
|
|
18
|
+
const a = {
|
|
19
|
+
transitional: u,
|
|
20
|
+
adapter: ["xhr", "http", "fetch"],
|
|
21
|
+
transformRequest: [function(r, i) {
|
|
22
|
+
const n = i.getContentType() || "", s = n.indexOf("application/json") > -1, f = t.isObject(r);
|
|
23
|
+
if (f && t.isHTMLForm(r) && (r = new FormData(r)), t.isFormData(r))
|
|
24
|
+
return s ? JSON.stringify(O(r)) : r;
|
|
25
|
+
if (t.isArrayBuffer(r) || t.isBuffer(r) || t.isStream(r) || t.isFile(r) || t.isBlob(r) || t.isReadableStream(r))
|
|
26
|
+
return r;
|
|
27
|
+
if (t.isArrayBufferView(r))
|
|
28
|
+
return r.buffer;
|
|
29
|
+
if (t.isURLSearchParams(r))
|
|
30
|
+
return i.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), r.toString();
|
|
31
|
+
let o;
|
|
32
|
+
if (f) {
|
|
33
|
+
if (n.indexOf("application/x-www-form-urlencoded") > -1)
|
|
34
|
+
return h(r, this.formSerializer).toString();
|
|
35
|
+
if ((o = t.isFileList(r)) || n.indexOf("multipart/form-data") > -1) {
|
|
36
|
+
const c = this.env && this.env.FormData;
|
|
37
|
+
return S(
|
|
38
|
+
o ? { "files[]": r } : r,
|
|
39
|
+
c && new c(),
|
|
40
|
+
this.formSerializer
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return f || s ? (i.setContentType("application/json", !1), y(r)) : r;
|
|
45
|
+
}],
|
|
46
|
+
transformResponse: [function(r) {
|
|
47
|
+
const i = this.transitional || a.transitional, n = i && i.forcedJSONParsing, s = this.responseType === "json";
|
|
48
|
+
if (t.isResponse(r) || t.isReadableStream(r))
|
|
49
|
+
return r;
|
|
50
|
+
if (r && t.isString(r) && (n && !this.responseType || s)) {
|
|
51
|
+
const m = !(i && i.silentJSONParsing) && s;
|
|
52
|
+
try {
|
|
53
|
+
return JSON.parse(r);
|
|
54
|
+
} catch (o) {
|
|
55
|
+
if (m)
|
|
56
|
+
throw o.name === "SyntaxError" ? p.from(o, p.ERR_BAD_RESPONSE, this, null, this.response) : o;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
return r;
|
|
60
|
+
}],
|
|
61
|
+
/**
|
|
62
|
+
* A timeout in milliseconds to abort a request. If set to 0 (default) a
|
|
63
|
+
* timeout is not created.
|
|
64
|
+
*/
|
|
65
|
+
timeout: 0,
|
|
66
|
+
xsrfCookieName: "XSRF-TOKEN",
|
|
67
|
+
xsrfHeaderName: "X-XSRF-TOKEN",
|
|
68
|
+
maxContentLength: -1,
|
|
69
|
+
maxBodyLength: -1,
|
|
70
|
+
env: {
|
|
71
|
+
FormData: l.classes.FormData,
|
|
72
|
+
Blob: l.classes.Blob
|
|
73
|
+
},
|
|
74
|
+
validateStatus: function(r) {
|
|
75
|
+
return r >= 200 && r < 300;
|
|
76
|
+
},
|
|
77
|
+
headers: {
|
|
78
|
+
common: {
|
|
79
|
+
Accept: "application/json, text/plain, */*",
|
|
80
|
+
"Content-Type": void 0
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
t.forEach(["delete", "get", "head", "post", "put", "patch"], (e) => {
|
|
85
|
+
a.headers[e] = {};
|
|
86
|
+
});
|
|
87
|
+
export {
|
|
88
|
+
a as default
|
|
89
|
+
};
|
package/dist/index17.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const u=require("./index12.cjs");function f(e){return u.matchAll(/\w+|\[(\w*)]/g,e).map(r=>r[0]==="[]"?"":r[1]||r[0])}function y(e){const r={},o=Object.keys(e);let i;const n=o.length;let c;for(i=0;i<n;i++)c=o[i],r[c]=e[c];return r}function b(e){function r(o,i,n,c){let s=o[c++];if(s==="__proto__")return!0;const t=Number.isFinite(+s),l=c>=o.length;return s=!s&&u.isArray(n)?n.length:s,l?(u.hasOwnProp(n,s)?n[s]=[n[s],i]:n[s]=i,!t):((!n[s]||!u.isObject(n[s]))&&(n[s]=[]),r(o,i,n[s],c)&&u.isArray(n[s])&&(n[s]=y(n[s])),!t)}if(u.isFormData(e)&&u.isFunction(e.entries)){const o={};return u.forEachEntry(e,(i,n)=>{r(f(i),n,o,0)}),o}return null}module.exports=b;
|
package/dist/index17.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import u from "./index12.js";
|
|
2
|
+
function f(e) {
|
|
3
|
+
return u.matchAll(/\w+|\[(\w*)]/g, e).map((o) => o[0] === "[]" ? "" : o[1] || o[0]);
|
|
4
|
+
}
|
|
5
|
+
function y(e) {
|
|
6
|
+
const o = {}, r = Object.keys(e);
|
|
7
|
+
let i;
|
|
8
|
+
const n = r.length;
|
|
9
|
+
let c;
|
|
10
|
+
for (i = 0; i < n; i++)
|
|
11
|
+
c = r[i], o[c] = e[c];
|
|
12
|
+
return o;
|
|
13
|
+
}
|
|
14
|
+
function m(e) {
|
|
15
|
+
function o(r, i, n, c) {
|
|
16
|
+
let s = r[c++];
|
|
17
|
+
if (s === "__proto__") return !0;
|
|
18
|
+
const t = Number.isFinite(+s), l = c >= r.length;
|
|
19
|
+
return s = !s && u.isArray(n) ? n.length : s, l ? (u.hasOwnProp(n, s) ? n[s] = [n[s], i] : n[s] = i, !t) : ((!n[s] || !u.isObject(n[s])) && (n[s] = []), o(r, i, n[s], c) && u.isArray(n[s]) && (n[s] = y(n[s])), !t);
|
|
20
|
+
}
|
|
21
|
+
if (u.isFormData(e) && u.isFunction(e.entries)) {
|
|
22
|
+
const r = {};
|
|
23
|
+
return u.forEachEntry(e, (i, n) => {
|
|
24
|
+
o(f(i), n, r, 0);
|
|
25
|
+
}), r;
|
|
26
|
+
}
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
m as default
|
|
31
|
+
};
|
package/dist/index18.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const r=require("./index23.cjs"),c=require("./index12.cjs");function t(e,i,n){r.call(this,e??"canceled",r.ERR_CANCELED,i,n),this.name="CanceledError"}c.inherits(t,r,{__CANCEL__:!0});module.exports=t;
|
package/dist/index18.js
ADDED
package/dist/index19.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const u=require("./index18.cjs");class c{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(r){t=r});const s=this;this.promise.then(n=>{if(!s._listeners)return;let r=s._listeners.length;for(;r-- >0;)s._listeners[r](n);s._listeners=null}),this.promise.then=n=>{let r;const o=new Promise(i=>{s.subscribe(i),r=i}).then(n);return o.cancel=function(){s.unsubscribe(r)},o},e(function(r,o,i){s.reason||(s.reason=new u(r,o,i),t(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);t!==-1&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=s=>{e.abort(s)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new c(function(n){e=n}),cancel:e}}}module.exports=c;
|
package/dist/index19.js
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import u from "./index18.js";
|
|
2
|
+
class c {
|
|
3
|
+
constructor(e) {
|
|
4
|
+
if (typeof e != "function")
|
|
5
|
+
throw new TypeError("executor must be a function.");
|
|
6
|
+
let t;
|
|
7
|
+
this.promise = new Promise(function(r) {
|
|
8
|
+
t = r;
|
|
9
|
+
});
|
|
10
|
+
const s = this;
|
|
11
|
+
this.promise.then((n) => {
|
|
12
|
+
if (!s._listeners) return;
|
|
13
|
+
let r = s._listeners.length;
|
|
14
|
+
for (; r-- > 0; )
|
|
15
|
+
s._listeners[r](n);
|
|
16
|
+
s._listeners = null;
|
|
17
|
+
}), this.promise.then = (n) => {
|
|
18
|
+
let r;
|
|
19
|
+
const o = new Promise((i) => {
|
|
20
|
+
s.subscribe(i), r = i;
|
|
21
|
+
}).then(n);
|
|
22
|
+
return o.cancel = function() {
|
|
23
|
+
s.unsubscribe(r);
|
|
24
|
+
}, o;
|
|
25
|
+
}, e(function(r, o, i) {
|
|
26
|
+
s.reason || (s.reason = new u(r, o, i), t(s.reason));
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Throws a `CanceledError` if cancellation has been requested.
|
|
31
|
+
*/
|
|
32
|
+
throwIfRequested() {
|
|
33
|
+
if (this.reason)
|
|
34
|
+
throw this.reason;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Subscribe to the cancel signal
|
|
38
|
+
*/
|
|
39
|
+
subscribe(e) {
|
|
40
|
+
if (this.reason) {
|
|
41
|
+
e(this.reason);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
this._listeners ? this._listeners.push(e) : this._listeners = [e];
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Unsubscribe from the cancel signal
|
|
48
|
+
*/
|
|
49
|
+
unsubscribe(e) {
|
|
50
|
+
if (!this._listeners)
|
|
51
|
+
return;
|
|
52
|
+
const t = this._listeners.indexOf(e);
|
|
53
|
+
t !== -1 && this._listeners.splice(t, 1);
|
|
54
|
+
}
|
|
55
|
+
toAbortSignal() {
|
|
56
|
+
const e = new AbortController(), t = (s) => {
|
|
57
|
+
e.abort(s);
|
|
58
|
+
};
|
|
59
|
+
return this.subscribe(t), e.signal.unsubscribe = () => this.unsubscribe(t), e.signal;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Returns an object that contains a new `CancelToken` and a function that, when called,
|
|
63
|
+
* cancels the `CancelToken`.
|
|
64
|
+
*/
|
|
65
|
+
static source() {
|
|
66
|
+
let e;
|
|
67
|
+
return {
|
|
68
|
+
token: new c(function(n) {
|
|
69
|
+
e = n;
|
|
70
|
+
}),
|
|
71
|
+
cancel: e
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
export {
|
|
76
|
+
c as default
|
|
77
|
+
};
|
package/dist/index2.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("react"),c=require("./index5.cjs"),b=require("./index6.cjs"),s=require("@catalogfi/utils"),B=require("./index7.cjs"),E=require("./index8.cjs"),A=require("./index9.cjs"),T=require("./index10.cjs"),w=r.createContext({}),C=({children:d})=>{const[o,u]=r.useState(),[v,n]=r.useState(),[f,l]=r.useState(),[P,p]=r.useState({}),g=async(e,t)=>{let i;return t?i=await e.connect(t):i=await e.connect(c.Network.MAINNET),i.error?s.Err(i.error):(u(i.val.provider),n(i.val.address),l(i.val.network),s.Ok(s.Void))},k=()=>o?(o.disconnect(),s.Ok(s.Void)):s.Err("No provider to disconnect"),x=r.useCallback(async()=>{if(!o)return;const e=await o.getAccounts();if(e.error){console.error("Error getting accounts:",e.error);return}n(e.val[0]);const t=await o.getNetwork();if(t.error){console.error("Error getting network:",t.error);return}l(t.val)},[o]),a=(e,t)=>{p(i=>({...i,[e]:t}))},W=async()=>{if(window.okxwallet&&window.okxwallet.bitcoin&&window.okxwallet.bitcoinTestnet){const e=new b.OKXProvider(window.okxwallet.bitcoin,window.okxwallet.bitcoinTestnet);a(c.BitcoinWallets.OKX_WALLET,e);const t=await e.getAccounts();n(t.val[0])}if(window.unisat){const e=new B.UnisatProvider(window.unisat);a(c.BitcoinWallets.UNISAT,e);const t=await e.getAccounts();n(t.val[0])}if(window.XverseProviders&&window.XverseProviders.BitcoinProvider){const e=new E.XverseProvider(window.XverseProviders.BitcoinProvider);a(c.BitcoinWallets.XVERSE,e);const t=await e.getAccounts();n(t.val[0])}if(window.xfi&&window.xfi.bitcoin){const e=new A.XdefiProvider(window.xfi.bitcoin);a(c.BitcoinWallets.XDEFI,e);const t=await e.getAccounts();n(t.val[0])}if(window.phantom&&window.phantom.bitcoin){const e=new T.PhantomProvider(window.phantom.bitcoin);a(c.BitcoinWallets.PHANTOM,e);const t=await e.getAccounts();n(t.val[0])}};return r.useEffect(()=>{W()},[]),r.useEffect(()=>{if(o)return o.on("accountsChanged",e=>{n(e.val)}),()=>{o.off("accountsChanged",e=>{n(e.val)})}},[o]),r.createElement(w.Provider,{value:{walletList:P,connect:g,provider:o,account:v,network:f,updateAccount:x,disconnect:k}},d)},h=()=>{const d=r.useContext(w);if(!d)throw new Error("useBitcoinWallet must be used within BTCWalletProvider");return d};exports.BTCWalletProvider=C;exports.useBitcoinWallet=h;
|
package/dist/index2.js
ADDED
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import T, { createContext as h, useState as a, useCallback as C, useEffect as d, useContext as W } from "react";
|
|
2
|
+
import { Network as X, BitcoinWallets as c } from "./index5.js";
|
|
3
|
+
import { OKXProvider as N } from "./index6.js";
|
|
4
|
+
import { Err as l, Ok as v, Void as u } from "@catalogfi/utils";
|
|
5
|
+
import { UnisatProvider as B } from "./index7.js";
|
|
6
|
+
import { XverseProvider as L } from "./index8.js";
|
|
7
|
+
import { XdefiProvider as O } from "./index9.js";
|
|
8
|
+
import { PhantomProvider as y } from "./index10.js";
|
|
9
|
+
const f = h(
|
|
10
|
+
{}
|
|
11
|
+
), F = ({ children: s }) => {
|
|
12
|
+
const [e, m] = a(), [P, r] = a(), [p, w] = a(), [x, k] = a({}), g = async (t, o) => {
|
|
13
|
+
let n;
|
|
14
|
+
return o ? n = await t.connect(o) : n = await t.connect(X.MAINNET), n.error ? l(n.error) : (m(n.val.provider), r(n.val.address), w(n.val.network), v(u));
|
|
15
|
+
}, A = () => e ? (e.disconnect(), v(u)) : l("No provider to disconnect"), E = C(async () => {
|
|
16
|
+
if (!e) return;
|
|
17
|
+
const t = await e.getAccounts();
|
|
18
|
+
if (t.error) {
|
|
19
|
+
console.error("Error getting accounts:", t.error);
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
r(t.val[0]);
|
|
23
|
+
const o = await e.getNetwork();
|
|
24
|
+
if (o.error) {
|
|
25
|
+
console.error("Error getting network:", o.error);
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
w(o.val);
|
|
29
|
+
}, [e]), i = (t, o) => {
|
|
30
|
+
k((n) => ({
|
|
31
|
+
...n,
|
|
32
|
+
[t]: o
|
|
33
|
+
}));
|
|
34
|
+
}, b = async () => {
|
|
35
|
+
if (window.okxwallet && window.okxwallet.bitcoin && window.okxwallet.bitcoinTestnet) {
|
|
36
|
+
const t = new N(
|
|
37
|
+
window.okxwallet.bitcoin,
|
|
38
|
+
window.okxwallet.bitcoinTestnet
|
|
39
|
+
);
|
|
40
|
+
i(c.OKX_WALLET, t);
|
|
41
|
+
const o = await t.getAccounts();
|
|
42
|
+
r(o.val[0]);
|
|
43
|
+
}
|
|
44
|
+
if (window.unisat) {
|
|
45
|
+
const t = new B(window.unisat);
|
|
46
|
+
i(c.UNISAT, t);
|
|
47
|
+
const o = await t.getAccounts();
|
|
48
|
+
r(o.val[0]);
|
|
49
|
+
}
|
|
50
|
+
if (window.XverseProviders && window.XverseProviders.BitcoinProvider) {
|
|
51
|
+
const t = new L(
|
|
52
|
+
window.XverseProviders.BitcoinProvider
|
|
53
|
+
);
|
|
54
|
+
i(c.XVERSE, t);
|
|
55
|
+
const o = await t.getAccounts();
|
|
56
|
+
r(o.val[0]);
|
|
57
|
+
}
|
|
58
|
+
if (window.xfi && window.xfi.bitcoin) {
|
|
59
|
+
const t = new O(window.xfi.bitcoin);
|
|
60
|
+
i(c.XDEFI, t);
|
|
61
|
+
const o = await t.getAccounts();
|
|
62
|
+
r(o.val[0]);
|
|
63
|
+
}
|
|
64
|
+
if (window.phantom && window.phantom.bitcoin) {
|
|
65
|
+
const t = new y(window.phantom.bitcoin);
|
|
66
|
+
i(c.PHANTOM, t);
|
|
67
|
+
const o = await t.getAccounts();
|
|
68
|
+
r(o.val[0]);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
return d(() => {
|
|
72
|
+
b();
|
|
73
|
+
}, []), d(() => {
|
|
74
|
+
if (e)
|
|
75
|
+
return e.on("accountsChanged", (t) => {
|
|
76
|
+
r(t.val);
|
|
77
|
+
}), () => {
|
|
78
|
+
e.off("accountsChanged", (t) => {
|
|
79
|
+
r(t.val);
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
}, [e]), /* @__PURE__ */ T.createElement(
|
|
83
|
+
f.Provider,
|
|
84
|
+
{
|
|
85
|
+
value: {
|
|
86
|
+
walletList: x,
|
|
87
|
+
connect: g,
|
|
88
|
+
provider: e,
|
|
89
|
+
account: P,
|
|
90
|
+
network: p,
|
|
91
|
+
updateAccount: E,
|
|
92
|
+
disconnect: A
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
s
|
|
96
|
+
);
|
|
97
|
+
}, H = () => {
|
|
98
|
+
const s = W(f);
|
|
99
|
+
if (!s)
|
|
100
|
+
throw new Error("useBitcoinWallet must be used within BTCWalletProvider");
|
|
101
|
+
return s;
|
|
102
|
+
};
|
|
103
|
+
export {
|
|
104
|
+
F as BTCWalletProvider,
|
|
105
|
+
H as useBitcoinWallet
|
|
106
|
+
};
|
package/dist/index20.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function n(t){return!!(t&&t.__CANCEL__)}module.exports=n;
|
package/dist/index20.js
ADDED
package/dist/index21.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e="1.7.7";exports.VERSION=e;
|
package/dist/index21.js
ADDED
package/dist/index22.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const n=require("./index12.cjs"),E=require("./index23.cjs");function B(i){return n.isPlainObject(i)||n.isArray(i)}function h(i){return n.endsWith(i,"[]")?i.slice(0,-2):i}function O(i,e,s){return i?i.concat(e).map(function(o,d){return o=h(o),!s&&d?"["+o+"]":o}).join(s?".":""):e}function T(i){return n.isArray(i)&&!i.some(B)}const S=n.toFlatObject(n,{},null,function(e){return/^is[A-Z]/.test(e)});function U(i,e,s){if(!n.isObject(i))throw new TypeError("target must be an object");e=e||new FormData,s=n.toFlatObject(s,{metaTokens:!0,dots:!1,indexes:!1},!1,function(t,u){return!n.isUndefined(u[t])});const p=s.metaTokens,o=s.visitor||m,d=s.dots,w=s.indexes,j=(s.Blob||typeof Blob<"u"&&Blob)&&n.isSpecCompliantForm(e);if(!n.isFunction(o))throw new TypeError("visitor must be a function");function l(r){if(r===null)return"";if(n.isDate(r))return r.toISOString();if(!j&&n.isBlob(r))throw new E("Blob is not supported. Use a Buffer instead.");return n.isArrayBuffer(r)||n.isTypedArray(r)?j&&typeof Blob=="function"?new Blob([r]):Buffer.from(r):r}function m(r,t,u){let c=r;if(r&&!u&&typeof r=="object"){if(n.endsWith(t,"{}"))t=p?t:t.slice(0,-2),r=JSON.stringify(r);else if(n.isArray(r)&&T(r)||(n.isFileList(r)||n.endsWith(t,"[]"))&&(c=n.toArray(r)))return t=h(t),c.forEach(function(b,x){!(n.isUndefined(b)||b===null)&&e.append(w===!0?O([t],x,d):w===null?t:t+"[]",l(b))}),!1}return B(r)?!0:(e.append(O(u,t,d),l(r)),!1)}const a=[],F=Object.assign(S,{defaultVisitor:m,convertValue:l,isVisitable:B});function A(r,t){if(!n.isUndefined(r)){if(a.indexOf(r)!==-1)throw Error("Circular reference detected in "+t.join("."));a.push(r),n.forEach(r,function(c,f){(!(n.isUndefined(c)||c===null)&&o.call(e,c,n.isString(f)?f.trim():f,t,F))===!0&&A(c,t?t.concat(f):[f])}),a.pop()}}if(!n.isObject(i))throw new TypeError("data must be an object");return A(i),e}module.exports=U;
|
package/dist/index22.js
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import t from "./index12.js";
|
|
2
|
+
import E from "./index23.js";
|
|
3
|
+
function p(i) {
|
|
4
|
+
return t.isPlainObject(i) || t.isArray(i);
|
|
5
|
+
}
|
|
6
|
+
function h(i) {
|
|
7
|
+
return t.endsWith(i, "[]") ? i.slice(0, -2) : i;
|
|
8
|
+
}
|
|
9
|
+
function O(i, e, s) {
|
|
10
|
+
return i ? i.concat(e).map(function(o, d) {
|
|
11
|
+
return o = h(o), !s && d ? "[" + o + "]" : o;
|
|
12
|
+
}).join(s ? "." : "") : e;
|
|
13
|
+
}
|
|
14
|
+
function T(i) {
|
|
15
|
+
return t.isArray(i) && !i.some(p);
|
|
16
|
+
}
|
|
17
|
+
const S = t.toFlatObject(t, {}, null, function(e) {
|
|
18
|
+
return /^is[A-Z]/.test(e);
|
|
19
|
+
});
|
|
20
|
+
function W(i, e, s) {
|
|
21
|
+
if (!t.isObject(i))
|
|
22
|
+
throw new TypeError("target must be an object");
|
|
23
|
+
e = e || new FormData(), s = t.toFlatObject(s, {
|
|
24
|
+
metaTokens: !0,
|
|
25
|
+
dots: !1,
|
|
26
|
+
indexes: !1
|
|
27
|
+
}, !1, function(n, u) {
|
|
28
|
+
return !t.isUndefined(u[n]);
|
|
29
|
+
});
|
|
30
|
+
const B = s.metaTokens, o = s.visitor || j, d = s.dots, m = s.indexes, w = (s.Blob || typeof Blob < "u" && Blob) && t.isSpecCompliantForm(e);
|
|
31
|
+
if (!t.isFunction(o))
|
|
32
|
+
throw new TypeError("visitor must be a function");
|
|
33
|
+
function l(r) {
|
|
34
|
+
if (r === null) return "";
|
|
35
|
+
if (t.isDate(r))
|
|
36
|
+
return r.toISOString();
|
|
37
|
+
if (!w && t.isBlob(r))
|
|
38
|
+
throw new E("Blob is not supported. Use a Buffer instead.");
|
|
39
|
+
return t.isArrayBuffer(r) || t.isTypedArray(r) ? w && typeof Blob == "function" ? new Blob([r]) : Buffer.from(r) : r;
|
|
40
|
+
}
|
|
41
|
+
function j(r, n, u) {
|
|
42
|
+
let c = r;
|
|
43
|
+
if (r && !u && typeof r == "object") {
|
|
44
|
+
if (t.endsWith(n, "{}"))
|
|
45
|
+
n = B ? n : n.slice(0, -2), r = JSON.stringify(r);
|
|
46
|
+
else if (t.isArray(r) && T(r) || (t.isFileList(r) || t.endsWith(n, "[]")) && (c = t.toArray(r)))
|
|
47
|
+
return n = h(n), c.forEach(function(b, x) {
|
|
48
|
+
!(t.isUndefined(b) || b === null) && e.append(
|
|
49
|
+
// eslint-disable-next-line no-nested-ternary
|
|
50
|
+
m === !0 ? O([n], x, d) : m === null ? n : n + "[]",
|
|
51
|
+
l(b)
|
|
52
|
+
);
|
|
53
|
+
}), !1;
|
|
54
|
+
}
|
|
55
|
+
return p(r) ? !0 : (e.append(O(u, n, d), l(r)), !1);
|
|
56
|
+
}
|
|
57
|
+
const a = [], F = Object.assign(S, {
|
|
58
|
+
defaultVisitor: j,
|
|
59
|
+
convertValue: l,
|
|
60
|
+
isVisitable: p
|
|
61
|
+
});
|
|
62
|
+
function A(r, n) {
|
|
63
|
+
if (!t.isUndefined(r)) {
|
|
64
|
+
if (a.indexOf(r) !== -1)
|
|
65
|
+
throw Error("Circular reference detected in " + n.join("."));
|
|
66
|
+
a.push(r), t.forEach(r, function(c, f) {
|
|
67
|
+
(!(t.isUndefined(c) || c === null) && o.call(
|
|
68
|
+
e,
|
|
69
|
+
c,
|
|
70
|
+
t.isString(f) ? f.trim() : f,
|
|
71
|
+
n,
|
|
72
|
+
F
|
|
73
|
+
)) === !0 && A(c, n ? n.concat(f) : [f]);
|
|
74
|
+
}), a.pop();
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
if (!t.isObject(i))
|
|
78
|
+
throw new TypeError("data must be an object");
|
|
79
|
+
return A(i), e;
|
|
80
|
+
}
|
|
81
|
+
export {
|
|
82
|
+
W as default
|
|
83
|
+
};
|
package/dist/index23.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const c=require("./index12.cjs");function e(t,i,o,E,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",i&&(this.code=i),o&&(this.config=o),E&&(this.request=E),s&&(this.response=s,this.status=s.status?s.status:null)}c.inherits(e,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:c.toJSONObject(this.config),code:this.code,status:this.status}}});const u=e.prototype,R={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{R[t]={value:t}});Object.defineProperties(e,R);Object.defineProperty(u,"isAxiosError",{value:!0});e.from=(t,i,o,E,s,a)=>{const r=Object.create(u);return c.toFlatObject(t,r,function(h){return h!==Error.prototype},n=>n!=="isAxiosError"),e.call(r,t.message,i,o,E,s),r.cause=t,r.name=t.name,a&&Object.assign(r,a),r};module.exports=e;
|
package/dist/index23.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import a from "./index12.js";
|
|
2
|
+
function e(t, i, o, E, r) {
|
|
3
|
+
Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = t, this.name = "AxiosError", i && (this.code = i), o && (this.config = o), E && (this.request = E), r && (this.response = r, this.status = r.status ? r.status : null);
|
|
4
|
+
}
|
|
5
|
+
a.inherits(e, Error, {
|
|
6
|
+
toJSON: function() {
|
|
7
|
+
return {
|
|
8
|
+
// Standard
|
|
9
|
+
message: this.message,
|
|
10
|
+
name: this.name,
|
|
11
|
+
// Microsoft
|
|
12
|
+
description: this.description,
|
|
13
|
+
number: this.number,
|
|
14
|
+
// Mozilla
|
|
15
|
+
fileName: this.fileName,
|
|
16
|
+
lineNumber: this.lineNumber,
|
|
17
|
+
columnNumber: this.columnNumber,
|
|
18
|
+
stack: this.stack,
|
|
19
|
+
// Axios
|
|
20
|
+
config: a.toJSONObject(this.config),
|
|
21
|
+
code: this.code,
|
|
22
|
+
status: this.status
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
const R = e.prototype, u = {};
|
|
27
|
+
[
|
|
28
|
+
"ERR_BAD_OPTION_VALUE",
|
|
29
|
+
"ERR_BAD_OPTION",
|
|
30
|
+
"ECONNABORTED",
|
|
31
|
+
"ETIMEDOUT",
|
|
32
|
+
"ERR_NETWORK",
|
|
33
|
+
"ERR_FR_TOO_MANY_REDIRECTS",
|
|
34
|
+
"ERR_DEPRECATED",
|
|
35
|
+
"ERR_BAD_RESPONSE",
|
|
36
|
+
"ERR_BAD_REQUEST",
|
|
37
|
+
"ERR_CANCELED",
|
|
38
|
+
"ERR_NOT_SUPPORT",
|
|
39
|
+
"ERR_INVALID_URL"
|
|
40
|
+
// eslint-disable-next-line func-names
|
|
41
|
+
].forEach((t) => {
|
|
42
|
+
u[t] = { value: t };
|
|
43
|
+
});
|
|
44
|
+
Object.defineProperties(e, u);
|
|
45
|
+
Object.defineProperty(R, "isAxiosError", { value: !0 });
|
|
46
|
+
e.from = (t, i, o, E, r, c) => {
|
|
47
|
+
const s = Object.create(R);
|
|
48
|
+
return a.toFlatObject(t, s, function(h) {
|
|
49
|
+
return h !== Error.prototype;
|
|
50
|
+
}, (n) => n !== "isAxiosError"), e.call(s, t.message, i, o, E, r), s.cause = t, s.name = t.name, c && Object.assign(s, c), s;
|
|
51
|
+
};
|
|
52
|
+
export {
|
|
53
|
+
e as default
|
|
54
|
+
};
|
package/dist/index24.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function t(r){return function(n){return r.apply(null,n)}}module.exports=t;
|
package/dist/index24.js
ADDED
package/dist/index25.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const s=require("./index12.cjs");function i(r){return s.isObject(r)&&r.isAxiosError===!0}module.exports=i;
|
package/dist/index25.js
ADDED
package/dist/index26.cjs
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";const i=require("./index12.cjs"),S=require("./index37.cjs"),h=Symbol("internals");function l(r){return r&&String(r).trim().toLowerCase()}function m(r){return r===!1||r==null?r:i.isArray(r)?r.map(m):String(r)}function A(r){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let s;for(;s=n.exec(r);)t[s[1]]=s[2];return t}const E=r=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(r.trim());function b(r,t,n,s,e){if(i.isFunction(s))return s.call(this,t,n);if(e&&(t=n),!!i.isString(t)){if(i.isString(s))return t.indexOf(s)!==-1;if(i.isRegExp(s))return s.test(t)}}function H(r){return r.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,s)=>n.toUpperCase()+s)}function d(r,t){const n=i.toCamelCase(" "+t);["get","set","has"].forEach(s=>{Object.defineProperty(r,s+n,{value:function(e,o,f){return this[s].call(this,t,e,o,f)},configurable:!0})})}class g{constructor(t){t&&this.set(t)}set(t,n,s){const e=this;function o(c,u,a){const y=l(u);if(!y)throw new Error("header name must be a non-empty string");const p=i.findKey(e,y);(!p||e[p]===void 0||a===!0||a===void 0&&e[p]!==!1)&&(e[p||u]=m(c))}const f=(c,u)=>i.forEach(c,(a,y)=>o(a,y,u));if(i.isPlainObject(t)||t instanceof this.constructor)f(t,n);else if(i.isString(t)&&(t=t.trim())&&!E(t))f(S(t),n);else if(i.isHeaders(t))for(const[c,u]of t.entries())o(u,c,s);else t!=null&&o(n,t,s);return this}get(t,n){if(t=l(t),t){const s=i.findKey(this,t);if(s){const e=this[s];if(!n)return e;if(n===!0)return A(e);if(i.isFunction(n))return n.call(this,e,s);if(i.isRegExp(n))return n.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=l(t),t){const s=i.findKey(this,t);return!!(s&&this[s]!==void 0&&(!n||b(this,this[s],s,n)))}return!1}delete(t,n){const s=this;let e=!1;function o(f){if(f=l(f),f){const c=i.findKey(s,f);c&&(!n||b(s,s[c],c,n))&&(delete s[c],e=!0)}}return i.isArray(t)?t.forEach(o):o(t),e}clear(t){const n=Object.keys(this);let s=n.length,e=!1;for(;s--;){const o=n[s];(!t||b(this,this[o],o,t,!0))&&(delete this[o],e=!0)}return e}normalize(t){const n=this,s={};return i.forEach(this,(e,o)=>{const f=i.findKey(s,o);if(f){n[f]=m(e),delete n[o];return}const c=t?H(o):String(o).trim();c!==o&&delete n[o],n[c]=m(e),s[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return i.forEach(this,(s,e)=>{s!=null&&s!==!1&&(n[e]=t&&i.isArray(s)?s.join(", "):s)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|
2
|
+
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const s=new this(t);return n.forEach(e=>s.set(e)),s}static accessor(t){const s=(this[h]=this[h]={accessors:{}}).accessors,e=this.prototype;function o(f){const c=l(f);s[c]||(d(e,f),s[c]=!0)}return i.isArray(t)?t.forEach(o):o(t),this}}g.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);i.reduceDescriptors(g.prototype,({value:r},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>r,set(s){this[n]=s}}});i.freezeMethods(g);module.exports=g;
|