@hashgraphonline/standards-sdk 0.0.61 → 0.0.62
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/es/standards-sdk.es10.js +1 -1
- package/dist/es/standards-sdk.es100.js +3 -147
- package/dist/es/standards-sdk.es100.js.map +1 -1
- package/dist/es/standards-sdk.es101.js +13 -88
- package/dist/es/standards-sdk.es101.js.map +1 -1
- package/dist/es/standards-sdk.es102.js +4 -83
- package/dist/es/standards-sdk.es102.js.map +1 -1
- package/dist/es/standards-sdk.es103.js +39 -32
- package/dist/es/standards-sdk.es103.js.map +1 -1
- package/dist/es/standards-sdk.es104.js +40 -6
- package/dist/es/standards-sdk.es104.js.map +1 -1
- package/dist/es/standards-sdk.es105.js +34 -156
- package/dist/es/standards-sdk.es105.js.map +1 -1
- package/dist/es/standards-sdk.es106.js +74 -19
- package/dist/es/standards-sdk.es106.js.map +1 -1
- package/dist/es/standards-sdk.es107.js +3 -793
- package/dist/es/standards-sdk.es107.js.map +1 -1
- package/dist/es/standards-sdk.es108.js +2 -174
- package/dist/es/standards-sdk.es108.js.map +1 -1
- package/dist/es/standards-sdk.es109.js +2 -143
- package/dist/es/standards-sdk.es109.js.map +1 -1
- package/dist/es/standards-sdk.es110.js +33 -20
- package/dist/es/standards-sdk.es110.js.map +1 -1
- package/dist/es/standards-sdk.es111.js +32 -26
- package/dist/es/standards-sdk.es111.js.map +1 -1
- package/dist/es/standards-sdk.es112.js +9 -26
- package/dist/es/standards-sdk.es112.js.map +1 -1
- package/dist/es/standards-sdk.es113.js +33 -37
- package/dist/es/standards-sdk.es113.js.map +1 -1
- package/dist/es/standards-sdk.es14.js +3 -0
- package/dist/es/standards-sdk.es14.js.map +1 -1
- package/dist/es/standards-sdk.es17.js +1 -1
- package/dist/es/standards-sdk.es18.js +3 -3
- package/dist/es/standards-sdk.es18.js.map +1 -1
- package/dist/es/standards-sdk.es22.js +1041 -36
- package/dist/es/standards-sdk.es22.js.map +1 -1
- package/dist/es/standards-sdk.es23.js +6600 -21
- package/dist/es/standards-sdk.es23.js.map +1 -1
- package/dist/es/standards-sdk.es24.js +36 -6627
- package/dist/es/standards-sdk.es24.js.map +1 -1
- package/dist/es/standards-sdk.es25.js +48 -2
- package/dist/es/standards-sdk.es25.js.map +1 -1
- package/dist/es/standards-sdk.es26.js +2 -1041
- package/dist/es/standards-sdk.es26.js.map +1 -1
- package/dist/es/standards-sdk.es27.js +2 -2
- package/dist/es/standards-sdk.es34.js +2 -364
- package/dist/es/standards-sdk.es34.js.map +1 -1
- package/dist/es/standards-sdk.es35.js +83 -5
- package/dist/es/standards-sdk.es35.js.map +1 -1
- package/dist/es/standards-sdk.es36.js +21 -177
- package/dist/es/standards-sdk.es36.js.map +1 -1
- package/dist/es/standards-sdk.es37.js +137 -70
- package/dist/es/standards-sdk.es37.js.map +1 -1
- package/dist/es/standards-sdk.es38.js +87 -110
- package/dist/es/standards-sdk.es38.js.map +1 -1
- package/dist/es/standards-sdk.es39.js +190 -47
- package/dist/es/standards-sdk.es39.js.map +1 -1
- package/dist/es/standards-sdk.es4.js +1 -1
- package/dist/es/standards-sdk.es40.js +438 -10
- package/dist/es/standards-sdk.es40.js.map +1 -1
- package/dist/es/standards-sdk.es41.js +19 -91
- package/dist/es/standards-sdk.es41.js.map +1 -1
- package/dist/es/standards-sdk.es42.js +138 -3
- package/dist/es/standards-sdk.es42.js.map +1 -1
- package/dist/es/standards-sdk.es43.js +18 -2
- package/dist/es/standards-sdk.es43.js.map +1 -1
- package/dist/es/standards-sdk.es44.js +22 -106
- package/dist/es/standards-sdk.es44.js.map +1 -1
- package/dist/es/standards-sdk.es45.js +26 -71
- package/dist/es/standards-sdk.es45.js.map +1 -1
- package/dist/es/standards-sdk.es46.js +20 -5
- package/dist/es/standards-sdk.es46.js.map +1 -1
- package/dist/es/standards-sdk.es47.js +43 -4
- package/dist/es/standards-sdk.es47.js.map +1 -1
- package/dist/es/standards-sdk.es48.js +13 -216
- package/dist/es/standards-sdk.es48.js.map +1 -1
- package/dist/es/standards-sdk.es49.js +57 -54
- package/dist/es/standards-sdk.es49.js.map +1 -1
- package/dist/es/standards-sdk.es5.js +1 -1
- package/dist/es/standards-sdk.es50.js +1287 -67
- package/dist/es/standards-sdk.es50.js.map +1 -1
- package/dist/es/standards-sdk.es51.js +31 -3
- package/dist/es/standards-sdk.es51.js.map +1 -1
- package/dist/es/standards-sdk.es52.js +6 -3
- package/dist/es/standards-sdk.es52.js.map +1 -1
- package/dist/es/standards-sdk.es53.js +154 -27
- package/dist/es/standards-sdk.es53.js.map +1 -1
- package/dist/es/standards-sdk.es54.js +775 -45
- package/dist/es/standards-sdk.es54.js.map +1 -1
- package/dist/es/standards-sdk.es55.js +136 -43
- package/dist/es/standards-sdk.es55.js.map +1 -1
- package/dist/es/standards-sdk.es56.js +173 -9
- package/dist/es/standards-sdk.es56.js.map +1 -1
- package/dist/es/standards-sdk.es57.js +352 -53
- package/dist/es/standards-sdk.es57.js.map +1 -1
- package/dist/es/standards-sdk.es58.js +6 -6
- package/dist/es/standards-sdk.es58.js.map +1 -1
- package/dist/es/standards-sdk.es59.js +176 -12
- package/dist/es/standards-sdk.es59.js.map +1 -1
- package/dist/es/standards-sdk.es60.js +81 -7
- package/dist/es/standards-sdk.es60.js.map +1 -1
- package/dist/es/standards-sdk.es61.js +111 -42
- package/dist/es/standards-sdk.es61.js.map +1 -1
- package/dist/es/standards-sdk.es62.js +52 -2
- package/dist/es/standards-sdk.es62.js.map +1 -1
- package/dist/es/standards-sdk.es63.js +10 -136
- package/dist/es/standards-sdk.es63.js.map +1 -1
- package/dist/es/standards-sdk.es64.js +87 -162
- package/dist/es/standards-sdk.es64.js.map +1 -1
- package/dist/es/standards-sdk.es65.js +4 -13
- package/dist/es/standards-sdk.es65.js.map +1 -1
- package/dist/es/standards-sdk.es66.js +2 -13
- package/dist/es/standards-sdk.es66.js.map +1 -1
- package/dist/es/standards-sdk.es67.js +111 -30
- package/dist/es/standards-sdk.es67.js.map +1 -1
- package/dist/es/standards-sdk.es68.js +73 -14
- package/dist/es/standards-sdk.es68.js.map +1 -1
- package/dist/es/standards-sdk.es69.js +5 -3
- package/dist/es/standards-sdk.es69.js.map +1 -1
- package/dist/es/standards-sdk.es70.js +4 -3
- package/dist/es/standards-sdk.es70.js.map +1 -1
- package/dist/es/standards-sdk.es71.js +219 -14
- package/dist/es/standards-sdk.es71.js.map +1 -1
- package/dist/es/standards-sdk.es72.js +58 -5
- package/dist/es/standards-sdk.es72.js.map +1 -1
- package/dist/es/standards-sdk.es73.js +68 -38
- package/dist/es/standards-sdk.es73.js.map +1 -1
- package/dist/es/standards-sdk.es74.js +3 -40
- package/dist/es/standards-sdk.es74.js.map +1 -1
- package/dist/es/standards-sdk.es75.js +20 -36
- package/dist/es/standards-sdk.es75.js.map +1 -1
- package/dist/es/standards-sdk.es76.js +26 -77
- package/dist/es/standards-sdk.es76.js.map +1 -1
- package/dist/es/standards-sdk.es77.js +25 -418
- package/dist/es/standards-sdk.es77.js.map +1 -1
- package/dist/es/standards-sdk.es78.js +38 -2
- package/dist/es/standards-sdk.es78.js.map +1 -1
- package/dist/es/standards-sdk.es79.js +3 -119
- package/dist/es/standards-sdk.es79.js.map +1 -1
- package/dist/es/standards-sdk.es8.js +2 -2
- package/dist/es/standards-sdk.es80.js +419 -3
- package/dist/es/standards-sdk.es80.js.map +1 -1
- package/dist/es/standards-sdk.es81.js +2 -2
- package/dist/es/standards-sdk.es81.js.map +1 -1
- package/dist/es/standards-sdk.es82.js +120 -2
- package/dist/es/standards-sdk.es82.js.map +1 -1
- package/dist/es/standards-sdk.es83.js +30 -32
- package/dist/es/standards-sdk.es83.js.map +1 -1
- package/dist/es/standards-sdk.es84.js +60 -30
- package/dist/es/standards-sdk.es84.js.map +1 -1
- package/dist/es/standards-sdk.es85.js +50 -9
- package/dist/es/standards-sdk.es85.js.map +1 -1
- package/dist/es/standards-sdk.es86.js +9 -33
- package/dist/es/standards-sdk.es86.js.map +1 -1
- package/dist/es/standards-sdk.es87.js +65 -2
- package/dist/es/standards-sdk.es87.js.map +1 -1
- package/dist/es/standards-sdk.es88.js +5 -194
- package/dist/es/standards-sdk.es88.js.map +1 -1
- package/dist/es/standards-sdk.es89.js +14 -437
- package/dist/es/standards-sdk.es89.js.map +1 -1
- package/dist/es/standards-sdk.es9.js +1 -1
- package/dist/es/standards-sdk.es90.js +7 -25
- package/dist/es/standards-sdk.es90.js.map +1 -1
- package/dist/es/standards-sdk.es91.js +41 -135
- package/dist/es/standards-sdk.es91.js.map +1 -1
- package/dist/es/standards-sdk.es92.js +2 -18
- package/dist/es/standards-sdk.es92.js.map +1 -1
- package/dist/es/standards-sdk.es93.js +136 -29
- package/dist/es/standards-sdk.es93.js.map +1 -1
- package/dist/es/standards-sdk.es94.js +169 -26
- package/dist/es/standards-sdk.es94.js.map +1 -1
- package/dist/es/standards-sdk.es95.js +13 -21
- package/dist/es/standards-sdk.es95.js.map +1 -1
- package/dist/es/standards-sdk.es96.js +13 -44
- package/dist/es/standards-sdk.es96.js.map +1 -1
- package/dist/es/standards-sdk.es97.js +31 -17
- package/dist/es/standards-sdk.es97.js.map +1 -1
- package/dist/es/standards-sdk.es98.js +14 -60
- package/dist/es/standards-sdk.es98.js.map +1 -1
- package/dist/es/standards-sdk.es99.js +3 -1288
- package/dist/es/standards-sdk.es99.js.map +1 -1
- package/dist/es/utils/logger.d.ts +1 -0
- package/dist/es/utils/logger.d.ts.map +1 -1
- package/dist/umd/standards-sdk.umd.js +2 -2
- package/dist/umd/standards-sdk.umd.js.map +1 -1
- package/dist/umd/utils/logger.d.ts +1 -0
- package/dist/umd/utils/logger.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import Buffer from "./standards-sdk.es19.js";
|
|
2
2
|
import { KeyList, TopicCreateTransaction, Transaction, TopicMessageSubmitTransaction, Hbar } from "@hashgraph/sdk";
|
|
3
3
|
import { Logger } from "./standards-sdk.es14.js";
|
|
4
|
-
import { InscriptionSDK } from "./standards-sdk.
|
|
4
|
+
import { InscriptionSDK } from "./standards-sdk.es23.js";
|
|
5
5
|
import { HCS10BaseClient, Hcs10MemoType } from "./standards-sdk.es8.js";
|
|
6
6
|
import { m as mimeTypesExports } from "./standards-sdk.es20.js";
|
|
7
7
|
import { HCS11Client } from "./standards-sdk.es13.js";
|
|
@@ -1,151 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
function stringify(value) {
|
|
4
|
-
if (value == null) {
|
|
5
|
-
return "null";
|
|
6
|
-
}
|
|
7
|
-
if (Array.isArray(value)) {
|
|
8
|
-
return "[ " + value.map(stringify).join(", ") + " ]";
|
|
9
|
-
}
|
|
10
|
-
if (value instanceof Uint8Array) {
|
|
11
|
-
const HEX = "0123456789abcdef";
|
|
12
|
-
let result = "0x";
|
|
13
|
-
for (let i = 0; i < value.length; i++) {
|
|
14
|
-
result += HEX[value[i] >> 4];
|
|
15
|
-
result += HEX[value[i] & 15];
|
|
16
|
-
}
|
|
17
|
-
return result;
|
|
18
|
-
}
|
|
19
|
-
if (typeof value === "object" && typeof value.toJSON === "function") {
|
|
20
|
-
return stringify(value.toJSON());
|
|
21
|
-
}
|
|
22
|
-
switch (typeof value) {
|
|
23
|
-
case "boolean":
|
|
24
|
-
case "symbol":
|
|
25
|
-
return value.toString();
|
|
26
|
-
case "bigint":
|
|
27
|
-
return BigInt(value).toString();
|
|
28
|
-
case "number":
|
|
29
|
-
return value.toString();
|
|
30
|
-
case "string":
|
|
31
|
-
return JSON.stringify(value);
|
|
32
|
-
case "object": {
|
|
33
|
-
const keys = Object.keys(value);
|
|
34
|
-
keys.sort();
|
|
35
|
-
return "{ " + keys.map((k) => `${stringify(k)}: ${stringify(value[k])}`).join(", ") + " }";
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return `[ COULD NOT SERIALIZE ]`;
|
|
39
|
-
}
|
|
40
|
-
function isError(error, code) {
|
|
41
|
-
return error && error.code === code;
|
|
42
|
-
}
|
|
43
|
-
function makeError(message, code, info) {
|
|
44
|
-
let shortMessage = message;
|
|
45
|
-
{
|
|
46
|
-
const details = [];
|
|
47
|
-
if (info) {
|
|
48
|
-
if ("message" in info || "code" in info || "name" in info) {
|
|
49
|
-
throw new Error(`value will overwrite populated values: ${stringify(info)}`);
|
|
50
|
-
}
|
|
51
|
-
for (const key in info) {
|
|
52
|
-
if (key === "shortMessage") {
|
|
53
|
-
continue;
|
|
54
|
-
}
|
|
55
|
-
const value = info[key];
|
|
56
|
-
details.push(key + "=" + stringify(value));
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
details.push(`code=${code}`);
|
|
60
|
-
details.push(`version=${version}`);
|
|
61
|
-
if (details.length) {
|
|
62
|
-
message += " (" + details.join(", ") + ")";
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
let error;
|
|
66
|
-
switch (code) {
|
|
67
|
-
case "INVALID_ARGUMENT":
|
|
68
|
-
error = new TypeError(message);
|
|
69
|
-
break;
|
|
70
|
-
case "NUMERIC_FAULT":
|
|
71
|
-
case "BUFFER_OVERRUN":
|
|
72
|
-
error = new RangeError(message);
|
|
73
|
-
break;
|
|
74
|
-
default:
|
|
75
|
-
error = new Error(message);
|
|
76
|
-
}
|
|
77
|
-
defineProperties(error, { code });
|
|
78
|
-
if (info) {
|
|
79
|
-
Object.assign(error, info);
|
|
80
|
-
}
|
|
81
|
-
if (error.shortMessage == null) {
|
|
82
|
-
defineProperties(error, { shortMessage });
|
|
83
|
-
}
|
|
84
|
-
return error;
|
|
85
|
-
}
|
|
86
|
-
function assert(check, message, code, info) {
|
|
87
|
-
if (!check) {
|
|
88
|
-
throw makeError(message, code, info);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
function assertArgument(check, message, name, value) {
|
|
92
|
-
assert(check, message, "INVALID_ARGUMENT", { argument: name, value });
|
|
93
|
-
}
|
|
94
|
-
function assertArgumentCount(count, expectedCount, message) {
|
|
95
|
-
if (message == null) {
|
|
96
|
-
message = "";
|
|
97
|
-
}
|
|
98
|
-
if (message) {
|
|
99
|
-
message = ": " + message;
|
|
100
|
-
}
|
|
101
|
-
assert(count >= expectedCount, "missing argument" + message, "MISSING_ARGUMENT", {
|
|
102
|
-
count,
|
|
103
|
-
expectedCount
|
|
104
|
-
});
|
|
105
|
-
assert(count <= expectedCount, "too many arguments" + message, "UNEXPECTED_ARGUMENT", {
|
|
106
|
-
count,
|
|
107
|
-
expectedCount
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
["NFD", "NFC", "NFKD", "NFKC"].reduce((accum, form) => {
|
|
111
|
-
try {
|
|
112
|
-
if ("test".normalize(form) !== "test") {
|
|
113
|
-
throw new Error("bad");
|
|
114
|
-
}
|
|
115
|
-
;
|
|
116
|
-
if (form === "NFD") {
|
|
117
|
-
const check = String.fromCharCode(233).normalize("NFD");
|
|
118
|
-
const expected = String.fromCharCode(101, 769);
|
|
119
|
-
if (check !== expected) {
|
|
120
|
-
throw new Error("broken");
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
accum.push(form);
|
|
124
|
-
} catch (error) {
|
|
125
|
-
}
|
|
126
|
-
return accum;
|
|
127
|
-
}, []);
|
|
128
|
-
function assertPrivate(givenGuard, guard, className) {
|
|
129
|
-
if (className == null) {
|
|
130
|
-
className = "";
|
|
131
|
-
}
|
|
132
|
-
if (givenGuard !== guard) {
|
|
133
|
-
let method = className, operation = "new";
|
|
134
|
-
if (className) {
|
|
135
|
-
method += ".";
|
|
136
|
-
operation += " " + className;
|
|
137
|
-
}
|
|
138
|
-
assert(false, `private constructor; use ${method}from* methods`, "UNSUPPORTED_OPERATION", {
|
|
139
|
-
operation
|
|
140
|
-
});
|
|
141
|
-
}
|
|
1
|
+
function combineURLs(baseURL, relativeURL) {
|
|
2
|
+
return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL;
|
|
142
3
|
}
|
|
143
4
|
export {
|
|
144
|
-
|
|
145
|
-
assertArgument,
|
|
146
|
-
assertArgumentCount,
|
|
147
|
-
assertPrivate,
|
|
148
|
-
isError,
|
|
149
|
-
makeError
|
|
5
|
+
combineURLs as default
|
|
150
6
|
};
|
|
151
7
|
//# sourceMappingURL=standards-sdk.es100.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-sdk.es100.js","sources":["../../node_modules/ethers/lib.esm/utils/errors.js"],"sourcesContent":["/**\n * All errors in ethers include properties to ensure they are both\n * human-readable (i.e. ``.message``) and machine-readable (i.e. ``.code``).\n *\n * The [[isError]] function can be used to check the error ``code`` and\n * provide a type guard for the properties present on that error interface.\n *\n * @_section: api/utils/errors:Errors [about-errors]\n */\nimport { version } from \"../_version.js\";\nimport { defineProperties } from \"./properties.js\";\nfunction stringify(value) {\n if (value == null) {\n return \"null\";\n }\n if (Array.isArray(value)) {\n return \"[ \" + (value.map(stringify)).join(\", \") + \" ]\";\n }\n if (value instanceof Uint8Array) {\n const HEX = \"0123456789abcdef\";\n let result = \"0x\";\n for (let i = 0; i < value.length; i++) {\n result += HEX[value[i] >> 4];\n result += HEX[value[i] & 0xf];\n }\n return result;\n }\n if (typeof (value) === \"object\" && typeof (value.toJSON) === \"function\") {\n return stringify(value.toJSON());\n }\n switch (typeof (value)) {\n case \"boolean\":\n case \"symbol\":\n return value.toString();\n case \"bigint\":\n return BigInt(value).toString();\n case \"number\":\n return (value).toString();\n case \"string\":\n return JSON.stringify(value);\n case \"object\": {\n const keys = Object.keys(value);\n keys.sort();\n return \"{ \" + keys.map((k) => `${stringify(k)}: ${stringify(value[k])}`).join(\", \") + \" }\";\n }\n }\n return `[ COULD NOT SERIALIZE ]`;\n}\n/**\n * Returns true if the %%error%% matches an error thrown by ethers\n * that matches the error %%code%%.\n *\n * In TypeScript environments, this can be used to check that %%error%%\n * matches an EthersError type, which means the expected properties will\n * be set.\n *\n * @See [ErrorCodes](api:ErrorCode)\n * @example\n * try {\n * // code....\n * } catch (e) {\n * if (isError(e, \"CALL_EXCEPTION\")) {\n * // The Type Guard has validated this object\n * console.log(e.data);\n * }\n * }\n */\nexport function isError(error, code) {\n return (error && error.code === code);\n}\n/**\n * Returns true if %%error%% is a [[CallExceptionError].\n */\nexport function isCallException(error) {\n return isError(error, \"CALL_EXCEPTION\");\n}\n/**\n * Returns a new Error configured to the format ethers emits errors, with\n * the %%message%%, [[api:ErrorCode]] %%code%% and additional properties\n * for the corresponding EthersError.\n *\n * Each error in ethers includes the version of ethers, a\n * machine-readable [[ErrorCode]], and depending on %%code%%, additional\n * required properties. The error message will also include the %%message%%,\n * ethers version, %%code%% and all additional properties, serialized.\n */\nexport function makeError(message, code, info) {\n let shortMessage = message;\n {\n const details = [];\n if (info) {\n if (\"message\" in info || \"code\" in info || \"name\" in info) {\n throw new Error(`value will overwrite populated values: ${stringify(info)}`);\n }\n for (const key in info) {\n if (key === \"shortMessage\") {\n continue;\n }\n const value = (info[key]);\n // try {\n details.push(key + \"=\" + stringify(value));\n // } catch (error: any) {\n // console.log(\"MMM\", error.message);\n // details.push(key + \"=[could not serialize object]\");\n // }\n }\n }\n details.push(`code=${code}`);\n details.push(`version=${version}`);\n if (details.length) {\n message += \" (\" + details.join(\", \") + \")\";\n }\n }\n let error;\n switch (code) {\n case \"INVALID_ARGUMENT\":\n error = new TypeError(message);\n break;\n case \"NUMERIC_FAULT\":\n case \"BUFFER_OVERRUN\":\n error = new RangeError(message);\n break;\n default:\n error = new Error(message);\n }\n defineProperties(error, { code });\n if (info) {\n Object.assign(error, info);\n }\n if (error.shortMessage == null) {\n defineProperties(error, { shortMessage });\n }\n return error;\n}\n/**\n * Throws an EthersError with %%message%%, %%code%% and additional error\n * %%info%% when %%check%% is falsish..\n *\n * @see [[api:makeError]]\n */\nexport function assert(check, message, code, info) {\n if (!check) {\n throw makeError(message, code, info);\n }\n}\n/**\n * A simple helper to simply ensuring provided arguments match expected\n * constraints, throwing if not.\n *\n * In TypeScript environments, the %%check%% has been asserted true, so\n * any further code does not need additional compile-time checks.\n */\nexport function assertArgument(check, message, name, value) {\n assert(check, message, \"INVALID_ARGUMENT\", { argument: name, value: value });\n}\nexport function assertArgumentCount(count, expectedCount, message) {\n if (message == null) {\n message = \"\";\n }\n if (message) {\n message = \": \" + message;\n }\n assert(count >= expectedCount, \"missing argument\" + message, \"MISSING_ARGUMENT\", {\n count: count,\n expectedCount: expectedCount\n });\n assert(count <= expectedCount, \"too many arguments\" + message, \"UNEXPECTED_ARGUMENT\", {\n count: count,\n expectedCount: expectedCount\n });\n}\nconst _normalizeForms = [\"NFD\", \"NFC\", \"NFKD\", \"NFKC\"].reduce((accum, form) => {\n try {\n // General test for normalize\n /* c8 ignore start */\n if (\"test\".normalize(form) !== \"test\") {\n throw new Error(\"bad\");\n }\n ;\n /* c8 ignore stop */\n if (form === \"NFD\") {\n const check = String.fromCharCode(0xe9).normalize(\"NFD\");\n const expected = String.fromCharCode(0x65, 0x0301);\n /* c8 ignore start */\n if (check !== expected) {\n throw new Error(\"broken\");\n }\n /* c8 ignore stop */\n }\n accum.push(form);\n }\n catch (error) { }\n return accum;\n}, []);\n/**\n * Throws if the normalization %%form%% is not supported.\n */\nexport function assertNormalize(form) {\n assert(_normalizeForms.indexOf(form) >= 0, \"platform missing String.prototype.normalize\", \"UNSUPPORTED_OPERATION\", {\n operation: \"String.prototype.normalize\", info: { form }\n });\n}\n/**\n * Many classes use file-scoped values to guard the constructor,\n * making it effectively private. This facilitates that pattern\n * by ensuring the %%givenGaurd%% matches the file-scoped %%guard%%,\n * throwing if not, indicating the %%className%% if provided.\n */\nexport function assertPrivate(givenGuard, guard, className) {\n if (className == null) {\n className = \"\";\n }\n if (givenGuard !== guard) {\n let method = className, operation = \"new\";\n if (className) {\n method += \".\";\n operation += \" \" + className;\n }\n assert(false, `private constructor; use ${method}from* methods`, \"UNSUPPORTED_OPERATION\", {\n operation\n });\n }\n}\n//# sourceMappingURL=errors.js.map"],"names":[],"mappings":";;AAWA,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,SAAO,SAAS,eAAe,uBAAuB,SAAS,uBAAuB;AAAA,IAClF;AAAA,IACA;AAAA,EACR,CAAK;AACL;AACwB,CAAC,OAAO,OAAO,QAAQ,MAAM,EAAE,OAAO,CAAC,OAAO,SAAS;AAC3E,MAAI;AAGA,QAAI,OAAO,UAAU,IAAI,MAAM,QAAQ;AACnC,YAAM,IAAI,MAAM,KAAK;AAAA,IACjC;AACQ;AAEA,QAAI,SAAS,OAAO;AAChB,YAAM,QAAQ,OAAO,aAAa,GAAI,EAAE,UAAU,KAAK;AACvD,YAAM,WAAW,OAAO,aAAa,KAAM,GAAM;AAEjD,UAAI,UAAU,UAAU;AACpB,cAAM,IAAI,MAAM,QAAQ;AAAA,MACxC;AAAA,IAEA;AACQ,UAAM,KAAK,IAAI;AAAA,EACvB,SACW,OAAO;AAAA,EAAA;AACd,SAAO;AACX,GAAG,CAAE,CAAA;AAeE,SAAS,cAAc,YAAY,OAAO,WAAW;AACxD,MAAI,aAAa,MAAM;AACnB,gBAAY;AAAA,EACpB;AACI,MAAI,eAAe,OAAO;AACtB,QAAI,SAAS,WAAW,YAAY;AACpC,QAAI,WAAW;AACX,gBAAU;AACV,mBAAa,MAAM;AAAA,IAC/B;AACQ,WAAO,OAAO,4BAA4B,MAAM,iBAAiB,yBAAyB;AAAA,MACtF;AAAA,IACZ,CAAS;AAAA,EACT;AACA;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"standards-sdk.es100.js","sources":["../../node_modules/axios/lib/helpers/combineURLs.js"],"sourcesContent":["'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n *\n * @returns {string} The combined URL\n */\nexport default function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/?\\/$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n}\n"],"names":[],"mappings":"AAUe,SAAS,YAAY,SAAS,aAAa;AACxD,SAAO,cACH,QAAQ,QAAQ,UAAU,EAAE,IAAI,MAAM,YAAY,QAAQ,QAAQ,EAAE,IACpE;AACN;","x_google_ignoreList":[0]}
|
|
@@ -1,94 +1,19 @@
|
|
|
1
|
-
import
|
|
2
|
-
function
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
return value;
|
|
8
|
-
}
|
|
9
|
-
if (typeof value === "string" && value.match(/^0x(?:[0-9a-f][0-9a-f])*$/i)) {
|
|
10
|
-
const result = new Uint8Array((value.length - 2) / 2);
|
|
11
|
-
let offset = 2;
|
|
12
|
-
for (let i = 0; i < result.length; i++) {
|
|
13
|
-
result[i] = parseInt(value.substring(offset, offset + 2), 16);
|
|
14
|
-
offset += 2;
|
|
15
|
-
}
|
|
16
|
-
return result;
|
|
17
|
-
}
|
|
18
|
-
assertArgument(false, "invalid BytesLike value", name || "value", value);
|
|
19
|
-
}
|
|
20
|
-
function getBytes(value, name) {
|
|
21
|
-
return _getBytes(value, name, false);
|
|
22
|
-
}
|
|
23
|
-
function getBytesCopy(value, name) {
|
|
24
|
-
return _getBytes(value, name, true);
|
|
25
|
-
}
|
|
26
|
-
function isHexString(value, length) {
|
|
27
|
-
if (typeof value !== "string" || !value.match(/^0x[0-9A-Fa-f]*$/)) {
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
if (typeof length === "number" && value.length !== 2 + 2 * length) {
|
|
31
|
-
return false;
|
|
32
|
-
}
|
|
33
|
-
if (length === true && value.length % 2 !== 0) {
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
return true;
|
|
37
|
-
}
|
|
38
|
-
const HexCharacters = "0123456789abcdef";
|
|
39
|
-
function hexlify(data) {
|
|
40
|
-
const bytes = getBytes(data);
|
|
41
|
-
let result = "0x";
|
|
42
|
-
for (let i = 0; i < bytes.length; i++) {
|
|
43
|
-
const v = bytes[i];
|
|
44
|
-
result += HexCharacters[(v & 240) >> 4] + HexCharacters[v & 15];
|
|
45
|
-
}
|
|
46
|
-
return result;
|
|
47
|
-
}
|
|
48
|
-
function concat(datas) {
|
|
49
|
-
return "0x" + datas.map((d) => hexlify(d).substring(2)).join("");
|
|
50
|
-
}
|
|
51
|
-
function dataSlice(data, start, end) {
|
|
52
|
-
const bytes = getBytes(data);
|
|
53
|
-
if (end != null && end > bytes.length) {
|
|
54
|
-
assert(false, "cannot slice beyond data bounds", "BUFFER_OVERRUN", {
|
|
55
|
-
buffer: bytes,
|
|
56
|
-
length: bytes.length,
|
|
57
|
-
offset: end
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
return hexlify(bytes.slice(start == null ? 0 : start, end == null ? bytes.length : end));
|
|
61
|
-
}
|
|
62
|
-
function zeroPad(data, length, left) {
|
|
63
|
-
const bytes = getBytes(data);
|
|
64
|
-
assert(length >= bytes.length, "padding exceeds data length", "BUFFER_OVERRUN", {
|
|
65
|
-
buffer: new Uint8Array(bytes),
|
|
66
|
-
length,
|
|
67
|
-
offset: length + 1
|
|
68
|
-
});
|
|
69
|
-
const result = new Uint8Array(length);
|
|
70
|
-
result.fill(0);
|
|
71
|
-
if (left) {
|
|
72
|
-
result.set(bytes, length - bytes.length);
|
|
1
|
+
import AxiosError from "./standards-sdk.es68.js";
|
|
2
|
+
function settle(resolve, reject, response) {
|
|
3
|
+
const validateStatus = response.config.validateStatus;
|
|
4
|
+
if (!response.status || !validateStatus || validateStatus(response.status)) {
|
|
5
|
+
resolve(response);
|
|
73
6
|
} else {
|
|
74
|
-
|
|
7
|
+
reject(new AxiosError(
|
|
8
|
+
"Request failed with status code " + response.status,
|
|
9
|
+
[AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],
|
|
10
|
+
response.config,
|
|
11
|
+
response.request,
|
|
12
|
+
response
|
|
13
|
+
));
|
|
75
14
|
}
|
|
76
|
-
return hexlify(result);
|
|
77
|
-
}
|
|
78
|
-
function zeroPadValue(data, length) {
|
|
79
|
-
return zeroPad(data, length, true);
|
|
80
|
-
}
|
|
81
|
-
function zeroPadBytes(data, length) {
|
|
82
|
-
return zeroPad(data, length, false);
|
|
83
15
|
}
|
|
84
16
|
export {
|
|
85
|
-
|
|
86
|
-
dataSlice,
|
|
87
|
-
getBytes,
|
|
88
|
-
getBytesCopy,
|
|
89
|
-
hexlify,
|
|
90
|
-
isHexString,
|
|
91
|
-
zeroPadBytes,
|
|
92
|
-
zeroPadValue
|
|
17
|
+
settle as default
|
|
93
18
|
};
|
|
94
19
|
//# sourceMappingURL=standards-sdk.es101.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-sdk.es101.js","sources":["../../node_modules/
|
|
1
|
+
{"version":3,"file":"standards-sdk.es101.js","sources":["../../node_modules/axios/lib/core/settle.js"],"sourcesContent":["'use strict';\n\nimport AxiosError from './AxiosError.js';\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n *\n * @returns {object} The response.\n */\nexport default function settle(resolve, reject, response) {\n const validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],\n response.config,\n response.request,\n response\n ));\n }\n}\n"],"names":[],"mappings":";AAae,SAAS,OAAO,SAAS,QAAQ,UAAU;AACxD,QAAM,iBAAiB,SAAS,OAAO;AACvC,MAAI,CAAC,SAAS,UAAU,CAAC,kBAAkB,eAAe,SAAS,MAAM,GAAG;AAC1E,YAAQ,QAAQ;AAAA,EACpB,OAAS;AACL,WAAO,IAAI;AAAA,MACT,qCAAqC,SAAS;AAAA,MAC9C,CAAC,WAAW,iBAAiB,WAAW,gBAAgB,EAAE,KAAK,MAAM,SAAS,SAAS,GAAG,IAAI,CAAC;AAAA,MAC/F,SAAS;AAAA,MACT,SAAS;AAAA,MACT;AAAA,IACN,CAAK;AAAA,EACL;AACA;","x_google_ignoreList":[0]}
|
|
@@ -1,87 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const BN_0 = BigInt(0);
|
|
5
|
-
const BN_36 = BigInt(36);
|
|
6
|
-
function getChecksumAddress(address) {
|
|
7
|
-
address = address.toLowerCase();
|
|
8
|
-
const chars = address.substring(2).split("");
|
|
9
|
-
const expanded = new Uint8Array(40);
|
|
10
|
-
for (let i = 0; i < 40; i++) {
|
|
11
|
-
expanded[i] = chars[i].charCodeAt(0);
|
|
12
|
-
}
|
|
13
|
-
const hashed = getBytes(keccak256(expanded));
|
|
14
|
-
for (let i = 0; i < 40; i += 2) {
|
|
15
|
-
if (hashed[i >> 1] >> 4 >= 8) {
|
|
16
|
-
chars[i] = chars[i].toUpperCase();
|
|
17
|
-
}
|
|
18
|
-
if ((hashed[i >> 1] & 15) >= 8) {
|
|
19
|
-
chars[i + 1] = chars[i + 1].toUpperCase();
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
return "0x" + chars.join("");
|
|
23
|
-
}
|
|
24
|
-
const ibanLookup = {};
|
|
25
|
-
for (let i = 0; i < 10; i++) {
|
|
26
|
-
ibanLookup[String(i)] = String(i);
|
|
27
|
-
}
|
|
28
|
-
for (let i = 0; i < 26; i++) {
|
|
29
|
-
ibanLookup[String.fromCharCode(65 + i)] = String(10 + i);
|
|
30
|
-
}
|
|
31
|
-
const safeDigits = 15;
|
|
32
|
-
function ibanChecksum(address) {
|
|
33
|
-
address = address.toUpperCase();
|
|
34
|
-
address = address.substring(4) + address.substring(0, 2) + "00";
|
|
35
|
-
let expanded = address.split("").map((c) => {
|
|
36
|
-
return ibanLookup[c];
|
|
37
|
-
}).join("");
|
|
38
|
-
while (expanded.length >= safeDigits) {
|
|
39
|
-
let block = expanded.substring(0, safeDigits);
|
|
40
|
-
expanded = parseInt(block, 10) % 97 + expanded.substring(block.length);
|
|
41
|
-
}
|
|
42
|
-
let checksum = String(98 - parseInt(expanded, 10) % 97);
|
|
43
|
-
while (checksum.length < 2) {
|
|
44
|
-
checksum = "0" + checksum;
|
|
45
|
-
}
|
|
46
|
-
return checksum;
|
|
47
|
-
}
|
|
48
|
-
const Base36 = function() {
|
|
49
|
-
const result = {};
|
|
50
|
-
for (let i = 0; i < 36; i++) {
|
|
51
|
-
const key = "0123456789abcdefghijklmnopqrstuvwxyz"[i];
|
|
52
|
-
result[key] = BigInt(i);
|
|
53
|
-
}
|
|
54
|
-
return result;
|
|
55
|
-
}();
|
|
56
|
-
function fromBase36(value) {
|
|
57
|
-
value = value.toLowerCase();
|
|
58
|
-
let result = BN_0;
|
|
59
|
-
for (let i = 0; i < value.length; i++) {
|
|
60
|
-
result = result * BN_36 + Base36[value[i]];
|
|
61
|
-
}
|
|
62
|
-
return result;
|
|
63
|
-
}
|
|
64
|
-
function getAddress(address) {
|
|
65
|
-
assertArgument(typeof address === "string", "invalid address", "address", address);
|
|
66
|
-
if (address.match(/^(0x)?[0-9a-fA-F]{40}$/)) {
|
|
67
|
-
if (!address.startsWith("0x")) {
|
|
68
|
-
address = "0x" + address;
|
|
69
|
-
}
|
|
70
|
-
const result = getChecksumAddress(address);
|
|
71
|
-
assertArgument(!address.match(/([A-F].*[a-f])|([a-f].*[A-F])/) || result === address, "bad address checksum", "address", address);
|
|
72
|
-
return result;
|
|
73
|
-
}
|
|
74
|
-
if (address.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)) {
|
|
75
|
-
assertArgument(address.substring(2, 4) === ibanChecksum(address), "bad icap checksum", "address", address);
|
|
76
|
-
let result = fromBase36(address.substring(4)).toString(16);
|
|
77
|
-
while (result.length < 40) {
|
|
78
|
-
result = "0" + result;
|
|
79
|
-
}
|
|
80
|
-
return getChecksumAddress("0x" + result);
|
|
81
|
-
}
|
|
82
|
-
assertArgument(false, "invalid address", "address", address);
|
|
1
|
+
function parseProtocol(url) {
|
|
2
|
+
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
|
3
|
+
return match && match[1] || "";
|
|
83
4
|
}
|
|
84
5
|
export {
|
|
85
|
-
|
|
6
|
+
parseProtocol as default
|
|
86
7
|
};
|
|
87
8
|
//# sourceMappingURL=standards-sdk.es102.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-sdk.es102.js","sources":["../../node_modules/
|
|
1
|
+
{"version":3,"file":"standards-sdk.es102.js","sources":["../../node_modules/axios/lib/helpers/parseProtocol.js"],"sourcesContent":["'use strict';\n\nexport default function parseProtocol(url) {\n const match = /^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(url);\n return match && match[1] || '';\n}\n"],"names":[],"mappings":"AAEe,SAAS,cAAc,KAAK;AACzC,QAAM,QAAQ,4BAA4B,KAAK,GAAG;AAClD,SAAO,SAAS,MAAM,CAAC,KAAK;AAC9B;","x_google_ignoreList":[0]}
|
|
@@ -1,35 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
1
|
+
import speedometer from "./standards-sdk.es110.js";
|
|
2
|
+
import throttle from "./standards-sdk.es111.js";
|
|
3
|
+
import utils from "./standards-sdk.es57.js";
|
|
4
|
+
const progressEventReducer = (listener, isDownloadStream, freq = 3) => {
|
|
5
|
+
let bytesNotified = 0;
|
|
6
|
+
const _speedometer = speedometer(50, 250);
|
|
7
|
+
return throttle((e) => {
|
|
8
|
+
const loaded = e.loaded;
|
|
9
|
+
const total = e.lengthComputable ? e.total : void 0;
|
|
10
|
+
const progressBytes = loaded - bytesNotified;
|
|
11
|
+
const rate = _speedometer(progressBytes);
|
|
12
|
+
const inRange = loaded <= total;
|
|
13
|
+
bytesNotified = loaded;
|
|
14
|
+
const data = {
|
|
15
|
+
loaded,
|
|
16
|
+
total,
|
|
17
|
+
progress: total ? loaded / total : void 0,
|
|
18
|
+
bytes: progressBytes,
|
|
19
|
+
rate: rate ? rate : void 0,
|
|
20
|
+
estimated: rate && total && inRange ? (total - loaded) / rate : void 0,
|
|
21
|
+
event: e,
|
|
22
|
+
lengthComputable: total != null,
|
|
23
|
+
[isDownloadStream ? "download" : "upload"]: true
|
|
24
|
+
};
|
|
25
|
+
listener(data);
|
|
26
|
+
}, freq);
|
|
27
|
+
};
|
|
28
|
+
const progressEventDecorator = (total, throttled) => {
|
|
29
|
+
const lengthComputable = total != null;
|
|
30
|
+
return [(loaded) => throttled[0]({
|
|
31
|
+
lengthComputable,
|
|
32
|
+
total,
|
|
33
|
+
loaded
|
|
34
|
+
}), throttled[1]];
|
|
35
|
+
};
|
|
36
|
+
const asyncDecorator = (fn) => (...args) => utils.asap(() => fn(...args));
|
|
32
37
|
export {
|
|
33
|
-
|
|
38
|
+
asyncDecorator,
|
|
39
|
+
progressEventDecorator,
|
|
40
|
+
progressEventReducer
|
|
34
41
|
};
|
|
35
42
|
//# sourceMappingURL=standards-sdk.es103.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-sdk.es103.js","sources":["../../node_modules/
|
|
1
|
+
{"version":3,"file":"standards-sdk.es103.js","sources":["../../node_modules/axios/lib/helpers/progressEventReducer.js"],"sourcesContent":["import speedometer from \"./speedometer.js\";\nimport throttle from \"./throttle.js\";\nimport utils from \"../utils.js\";\n\nexport const progressEventReducer = (listener, isDownloadStream, freq = 3) => {\n let bytesNotified = 0;\n const _speedometer = speedometer(50, 250);\n\n return throttle(e => {\n const loaded = e.loaded;\n const total = e.lengthComputable ? e.total : undefined;\n const progressBytes = loaded - bytesNotified;\n const rate = _speedometer(progressBytes);\n const inRange = loaded <= total;\n\n bytesNotified = loaded;\n\n const data = {\n loaded,\n total,\n progress: total ? (loaded / total) : undefined,\n bytes: progressBytes,\n rate: rate ? rate : undefined,\n estimated: rate && total && inRange ? (total - loaded) / rate : undefined,\n event: e,\n lengthComputable: total != null,\n [isDownloadStream ? 'download' : 'upload']: true\n };\n\n listener(data);\n }, freq);\n}\n\nexport const progressEventDecorator = (total, throttled) => {\n const lengthComputable = total != null;\n\n return [(loaded) => throttled[0]({\n lengthComputable,\n total,\n loaded\n }), throttled[1]];\n}\n\nexport const asyncDecorator = (fn) => (...args) => utils.asap(() => fn(...args));\n"],"names":[],"mappings":";;;AAIY,MAAC,uBAAuB,CAAC,UAAU,kBAAkB,OAAO,MAAM;AAC5E,MAAI,gBAAgB;AACpB,QAAM,eAAe,YAAY,IAAI,GAAG;AAExC,SAAO,SAAS,OAAK;AACnB,UAAM,SAAS,EAAE;AACjB,UAAM,QAAQ,EAAE,mBAAmB,EAAE,QAAQ;AAC7C,UAAM,gBAAgB,SAAS;AAC/B,UAAM,OAAO,aAAa,aAAa;AACvC,UAAM,UAAU,UAAU;AAE1B,oBAAgB;AAEhB,UAAM,OAAO;AAAA,MACX;AAAA,MACA;AAAA,MACA,UAAU,QAAS,SAAS,QAAS;AAAA,MACrC,OAAO;AAAA,MACP,MAAM,OAAO,OAAO;AAAA,MACpB,WAAW,QAAQ,SAAS,WAAW,QAAQ,UAAU,OAAO;AAAA,MAChE,OAAO;AAAA,MACP,kBAAkB,SAAS;AAAA,MAC3B,CAAC,mBAAmB,aAAa,QAAQ,GAAG;AAAA,IAC7C;AAED,aAAS,IAAI;AAAA,EACd,GAAE,IAAI;AACT;AAEY,MAAC,yBAAyB,CAAC,OAAO,cAAc;AAC1D,QAAM,mBAAmB,SAAS;AAElC,SAAO,CAAC,CAAC,WAAW,UAAU,CAAC,EAAE;AAAA,IAC/B;AAAA,IACA;AAAA,IACA;AAAA,EACJ,CAAG,GAAG,UAAU,CAAC,CAAC;AAClB;AAEY,MAAC,iBAAiB,CAAC,OAAO,IAAI,SAAS,MAAM,KAAK,MAAM,GAAG,GAAG,IAAI,CAAC;","x_google_ignoreList":[0]}
|
|
@@ -1,9 +1,43 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import platform from "./standards-sdk.es90.js";
|
|
2
|
+
import utils from "./standards-sdk.es57.js";
|
|
3
|
+
import isURLSameOrigin from "./standards-sdk.es112.js";
|
|
4
|
+
import cookies from "./standards-sdk.es113.js";
|
|
5
|
+
import buildFullPath from "./standards-sdk.es86.js";
|
|
6
|
+
import mergeConfig from "./standards-sdk.es60.js";
|
|
7
|
+
import AxiosHeaders from "./standards-sdk.es71.js";
|
|
8
|
+
import buildURL from "./standards-sdk.es83.js";
|
|
9
|
+
const resolveConfig = (config) => {
|
|
10
|
+
const newConfig = mergeConfig({}, config);
|
|
11
|
+
let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth } = newConfig;
|
|
12
|
+
newConfig.headers = headers = AxiosHeaders.from(headers);
|
|
13
|
+
newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
|
|
14
|
+
if (auth) {
|
|
15
|
+
headers.set(
|
|
16
|
+
"Authorization",
|
|
17
|
+
"Basic " + btoa((auth.username || "") + ":" + (auth.password ? unescape(encodeURIComponent(auth.password)) : ""))
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
let contentType;
|
|
21
|
+
if (utils.isFormData(data)) {
|
|
22
|
+
if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {
|
|
23
|
+
headers.setContentType(void 0);
|
|
24
|
+
} else if ((contentType = headers.getContentType()) !== false) {
|
|
25
|
+
const [type, ...tokens] = contentType ? contentType.split(";").map((token) => token.trim()).filter(Boolean) : [];
|
|
26
|
+
headers.setContentType([type || "multipart/form-data", ...tokens].join("; "));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
if (platform.hasStandardBrowserEnv) {
|
|
30
|
+
withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
|
|
31
|
+
if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin(newConfig.url)) {
|
|
32
|
+
const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
|
|
33
|
+
if (xsrfValue) {
|
|
34
|
+
headers.set(xsrfHeaderName, xsrfValue);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return newConfig;
|
|
39
|
+
};
|
|
6
40
|
export {
|
|
7
|
-
|
|
41
|
+
resolveConfig as default
|
|
8
42
|
};
|
|
9
43
|
//# sourceMappingURL=standards-sdk.es104.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-sdk.es104.js","sources":["../../node_modules/
|
|
1
|
+
{"version":3,"file":"standards-sdk.es104.js","sources":["../../node_modules/axios/lib/helpers/resolveConfig.js"],"sourcesContent":["import platform from \"../platform/index.js\";\nimport utils from \"../utils.js\";\nimport isURLSameOrigin from \"./isURLSameOrigin.js\";\nimport cookies from \"./cookies.js\";\nimport buildFullPath from \"../core/buildFullPath.js\";\nimport mergeConfig from \"../core/mergeConfig.js\";\nimport AxiosHeaders from \"../core/AxiosHeaders.js\";\nimport buildURL from \"./buildURL.js\";\n\nexport default (config) => {\n const newConfig = mergeConfig({}, config);\n\n let {data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth} = newConfig;\n\n newConfig.headers = headers = AxiosHeaders.from(headers);\n\n newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);\n\n // HTTP basic authentication\n if (auth) {\n headers.set('Authorization', 'Basic ' +\n btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : ''))\n );\n }\n\n let contentType;\n\n if (utils.isFormData(data)) {\n if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {\n headers.setContentType(undefined); // Let the browser set it\n } else if ((contentType = headers.getContentType()) !== false) {\n // fix semicolon duplication issue for ReactNative FormData implementation\n const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];\n headers.setContentType([type || 'multipart/form-data', ...tokens].join('; '));\n }\n }\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n\n if (platform.hasStandardBrowserEnv) {\n withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));\n\n if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(newConfig.url))) {\n // Add xsrf header\n const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);\n\n if (xsrfValue) {\n headers.set(xsrfHeaderName, xsrfValue);\n }\n }\n }\n\n return newConfig;\n}\n\n"],"names":[],"mappings":";;;;;;;;AASA,MAAe,gBAAA,CAAC,WAAW;AACzB,QAAM,YAAY,YAAY,CAAE,GAAE,MAAM;AAExC,MAAI,EAAC,MAAM,eAAe,gBAAgB,gBAAgB,SAAS,KAAI,IAAI;AAE3E,YAAU,UAAU,UAAU,aAAa,KAAK,OAAO;AAEvD,YAAU,MAAM,SAAS,cAAc,UAAU,SAAS,UAAU,KAAK,UAAU,iBAAiB,GAAG,OAAO,QAAQ,OAAO,gBAAgB;AAG7I,MAAI,MAAM;AACR,YAAQ;AAAA,MAAI;AAAA,MAAiB,WAC3B,MAAM,KAAK,YAAY,MAAM,OAAO,KAAK,WAAW,SAAS,mBAAmB,KAAK,QAAQ,CAAC,IAAI,GAAG;AAAA,IACtG;AAAA,EACL;AAEE,MAAI;AAEJ,MAAI,M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