@hashgraphonline/standards-sdk 0.0.78 → 0.0.80
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/hcs-10/base-client.d.ts +10 -0
- package/dist/es/hcs-10/base-client.d.ts.map +1 -1
- package/dist/es/hcs-10/browser.d.ts.map +1 -1
- package/dist/es/standards-sdk.es100.js +2 -16
- package/dist/es/standards-sdk.es100.js.map +1 -1
- package/dist/es/standards-sdk.es101.js +15 -4
- package/dist/es/standards-sdk.es101.js.map +1 -1
- package/dist/es/standards-sdk.es102.js +409 -39
- package/dist/es/standards-sdk.es102.js.map +1 -1
- package/dist/es/standards-sdk.es103.js +170 -36
- package/dist/es/standards-sdk.es103.js.map +1 -1
- package/dist/es/standards-sdk.es104.js +140 -34
- package/dist/es/standards-sdk.es104.js.map +1 -1
- package/dist/es/standards-sdk.es105.js +3 -78
- package/dist/es/standards-sdk.es105.js.map +1 -1
- package/dist/es/standards-sdk.es106.js +2 -21
- package/dist/es/standards-sdk.es106.js.map +1 -1
- package/dist/es/standards-sdk.es107.js +2 -27
- package/dist/es/standards-sdk.es107.js.map +1 -1
- package/dist/es/standards-sdk.es108.js +33 -25
- package/dist/es/standards-sdk.es108.js.map +1 -1
- package/dist/es/standards-sdk.es109.js +32 -37
- package/dist/es/standards-sdk.es109.js.map +1 -1
- package/dist/es/standards-sdk.es110.js +9 -34
- package/dist/es/standards-sdk.es110.js.map +1 -1
- package/dist/es/standards-sdk.es111.js +32 -31
- package/dist/es/standards-sdk.es111.js.map +1 -1
- package/dist/es/standards-sdk.es112.js +2282 -9
- package/dist/es/standards-sdk.es112.js.map +1 -1
- package/dist/es/standards-sdk.es113.js +19 -32
- package/dist/es/standards-sdk.es113.js.map +1 -1
- package/dist/es/standards-sdk.es114.js +27 -3
- package/dist/es/standards-sdk.es114.js.map +1 -1
- package/dist/es/standards-sdk.es115.js +26 -2
- package/dist/es/standards-sdk.es115.js.map +1 -1
- package/dist/es/standards-sdk.es116.js +38 -2
- package/dist/es/standards-sdk.es116.js.map +1 -1
- package/dist/es/standards-sdk.es12.js +1 -1
- package/dist/es/standards-sdk.es14.js +1 -1
- package/dist/es/standards-sdk.es17.js +1 -1
- package/dist/es/standards-sdk.es18.js +2 -2
- package/dist/es/standards-sdk.es21.js +1041 -5
- package/dist/es/standards-sdk.es21.js.map +1 -1
- package/dist/es/standards-sdk.es23.js +36 -7190
- package/dist/es/standards-sdk.es23.js.map +1 -1
- package/dist/es/standards-sdk.es24.js +48 -36
- package/dist/es/standards-sdk.es24.js.map +1 -1
- package/dist/es/standards-sdk.es25.js +7163 -21
- package/dist/es/standards-sdk.es25.js.map +1 -1
- package/dist/es/standards-sdk.es26.js +3 -1041
- package/dist/es/standards-sdk.es26.js.map +1 -1
- package/dist/es/standards-sdk.es27.js +2 -3
- package/dist/es/standards-sdk.es27.js.map +1 -1
- package/dist/es/standards-sdk.es29.js +5 -2
- package/dist/es/standards-sdk.es29.js.map +1 -1
- package/dist/es/standards-sdk.es33.js +363 -3
- package/dist/es/standards-sdk.es33.js.map +1 -1
- package/dist/es/standards-sdk.es34.js +4 -7134
- package/dist/es/standards-sdk.es34.js.map +1 -1
- package/dist/es/standards-sdk.es35.js +179 -3
- package/dist/es/standards-sdk.es35.js.map +1 -1
- package/dist/es/standards-sdk.es36.js +75 -95
- package/dist/es/standards-sdk.es36.js.map +1 -1
- package/dist/es/standards-sdk.es37.js +114 -2
- package/dist/es/standards-sdk.es37.js.map +1 -1
- package/dist/es/standards-sdk.es38.js +51 -15
- package/dist/es/standards-sdk.es38.js.map +1 -1
- package/dist/es/standards-sdk.es39.js +9 -408
- 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 +84 -351
- package/dist/es/standards-sdk.es40.js.map +1 -1
- package/dist/es/standards-sdk.es41.js +3 -5
- package/dist/es/standards-sdk.es41.js.map +1 -1
- package/dist/es/standards-sdk.es42.js +2 -179
- package/dist/es/standards-sdk.es42.js.map +1 -1
- package/dist/es/standards-sdk.es43.js +104 -72
- package/dist/es/standards-sdk.es43.js.map +1 -1
- package/dist/es/standards-sdk.es44.js +70 -110
- package/dist/es/standards-sdk.es44.js.map +1 -1
- package/dist/es/standards-sdk.es45.js +5 -51
- package/dist/es/standards-sdk.es45.js.map +1 -1
- package/dist/es/standards-sdk.es46.js +4 -9
- package/dist/es/standards-sdk.es46.js.map +1 -1
- package/dist/es/standards-sdk.es47.js +205 -81
- package/dist/es/standards-sdk.es47.js.map +1 -1
- package/dist/es/standards-sdk.es48.js +58 -4
- package/dist/es/standards-sdk.es48.js.map +1 -1
- package/dist/es/standards-sdk.es49.js +69 -2
- package/dist/es/standards-sdk.es49.js.map +1 -1
- package/dist/es/standards-sdk.es5.js +70 -2
- package/dist/es/standards-sdk.es5.js.map +1 -1
- package/dist/es/standards-sdk.es50.js +3 -112
- package/dist/es/standards-sdk.es50.js.map +1 -1
- package/dist/es/standards-sdk.es51.js +3 -74
- package/dist/es/standards-sdk.es51.js.map +1 -1
- package/dist/es/standards-sdk.es52.js +163 -5
- package/dist/es/standards-sdk.es52.js.map +1 -1
- package/dist/es/standards-sdk.es53.js +31 -4
- package/dist/es/standards-sdk.es53.js.map +1 -1
- package/dist/es/standards-sdk.es54.js +54 -212
- package/dist/es/standards-sdk.es54.js.map +1 -1
- package/dist/es/standards-sdk.es55.js +47 -55
- package/dist/es/standards-sdk.es55.js.map +1 -1
- package/dist/es/standards-sdk.es56.js +10 -69
- package/dist/es/standards-sdk.es56.js.map +1 -1
- package/dist/es/standards-sdk.es57.js +65 -2
- package/dist/es/standards-sdk.es57.js.map +1 -1
- package/dist/es/standards-sdk.es58.js +5 -2281
- package/dist/es/standards-sdk.es58.js.map +1 -1
- package/dist/es/standards-sdk.es59.js +12 -161
- package/dist/es/standards-sdk.es59.js.map +1 -1
- package/dist/es/standards-sdk.es60.js +7 -32
- package/dist/es/standards-sdk.es60.js.map +1 -1
- package/dist/es/standards-sdk.es61.js +43 -61
- package/dist/es/standards-sdk.es61.js.map +1 -1
- package/dist/es/standards-sdk.es62.js +2 -50
- package/dist/es/standards-sdk.es62.js.map +1 -1
- package/dist/es/standards-sdk.es63.js +136 -10
- package/dist/es/standards-sdk.es63.js.map +1 -1
- package/dist/es/standards-sdk.es64.js +164 -57
- package/dist/es/standards-sdk.es64.js.map +1 -1
- package/dist/es/standards-sdk.es65.js +2 -6
- package/dist/es/standards-sdk.es65.js.map +1 -1
- package/dist/es/standards-sdk.es66.js +13 -15
- package/dist/es/standards-sdk.es66.js.map +1 -1
- package/dist/es/standards-sdk.es67.js +13 -7
- package/dist/es/standards-sdk.es67.js.map +1 -1
- package/dist/es/standards-sdk.es68.js +7136 -45
- package/dist/es/standards-sdk.es68.js.map +1 -1
- package/dist/es/standards-sdk.es69.js +32 -2
- package/dist/es/standards-sdk.es69.js.map +1 -1
- package/dist/es/standards-sdk.es7.js +2 -2
- package/dist/es/standards-sdk.es70.js +14 -135
- package/dist/es/standards-sdk.es70.js.map +1 -1
- package/dist/es/standards-sdk.es71.js +4 -172
- package/dist/es/standards-sdk.es71.js.map +1 -1
- package/dist/es/standards-sdk.es72.js +3 -83
- package/dist/es/standards-sdk.es72.js.map +1 -1
- package/dist/es/standards-sdk.es73.js +15 -22
- package/dist/es/standards-sdk.es73.js.map +1 -1
- package/dist/es/standards-sdk.es74.js +4 -147
- package/dist/es/standards-sdk.es74.js.map +1 -1
- package/dist/es/standards-sdk.es75.js +39 -91
- package/dist/es/standards-sdk.es75.js.map +1 -1
- package/dist/es/standards-sdk.es76.js +35 -190
- package/dist/es/standards-sdk.es76.js.map +1 -1
- package/dist/es/standards-sdk.es77.js +32 -433
- package/dist/es/standards-sdk.es77.js.map +1 -1
- package/dist/es/standards-sdk.es78.js +74 -21
- package/dist/es/standards-sdk.es78.js.map +1 -1
- package/dist/es/standards-sdk.es79.js +181 -125
- package/dist/es/standards-sdk.es79.js.map +1 -1
- package/dist/es/standards-sdk.es8.js +6 -6
- package/dist/es/standards-sdk.es8.js.map +1 -1
- package/dist/es/standards-sdk.es80.js +433 -13
- package/dist/es/standards-sdk.es80.js.map +1 -1
- package/dist/es/standards-sdk.es81.js +18 -22
- package/dist/es/standards-sdk.es81.js.map +1 -1
- package/dist/es/standards-sdk.es82.js +127 -17
- package/dist/es/standards-sdk.es82.js.map +1 -1
- package/dist/es/standards-sdk.es83.js +10 -13
- package/dist/es/standards-sdk.es83.js.map +1 -1
- package/dist/es/standards-sdk.es84.js +22 -37
- package/dist/es/standards-sdk.es84.js.map +1 -1
- package/dist/es/standards-sdk.es85.js +21 -10
- package/dist/es/standards-sdk.es85.js.map +1 -1
- package/dist/es/standards-sdk.es86.js +14 -54
- package/dist/es/standards-sdk.es86.js.map +1 -1
- package/dist/es/standards-sdk.es87.js +39 -1284
- package/dist/es/standards-sdk.es87.js.map +1 -1
- package/dist/es/standards-sdk.es88.js +15 -29
- package/dist/es/standards-sdk.es88.js.map +1 -1
- package/dist/es/standards-sdk.es89.js +60 -5
- 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 +1269 -139
- package/dist/es/standards-sdk.es90.js.map +1 -1
- package/dist/es/standards-sdk.es91.js +137 -782
- package/dist/es/standards-sdk.es91.js.map +1 -1
- package/dist/es/standards-sdk.es92.js +78 -130
- package/dist/es/standards-sdk.es92.js.map +1 -1
- package/dist/es/standards-sdk.es93.js +71 -161
- package/dist/es/standards-sdk.es93.js.map +1 -1
- package/dist/es/standards-sdk.es94.js +32 -13
- package/dist/es/standards-sdk.es94.js.map +1 -1
- package/dist/es/standards-sdk.es95.js +6 -13
- package/dist/es/standards-sdk.es95.js.map +1 -1
- package/dist/es/standards-sdk.es96.js +156 -29
- package/dist/es/standards-sdk.es96.js.map +1 -1
- package/dist/es/standards-sdk.es97.js +22 -14
- package/dist/es/standards-sdk.es97.js.map +1 -1
- package/dist/es/standards-sdk.es98.js +792 -3
- package/dist/es/standards-sdk.es98.js.map +1 -1
- package/dist/es/standards-sdk.es99.js +100 -3
- package/dist/es/standards-sdk.es99.js.map +1 -1
- package/dist/umd/hcs-10/base-client.d.ts +10 -0
- package/dist/umd/hcs-10/base-client.d.ts.map +1 -1
- package/dist/umd/hcs-10/browser.d.ts.map +1 -1
- package/dist/umd/standards-sdk.umd.js +1 -1
- package/dist/umd/standards-sdk.umd.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,151 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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 parseProtocol(url) {
|
|
2
|
+
const match = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url);
|
|
3
|
+
return match && match[1] || "";
|
|
142
4
|
}
|
|
143
5
|
export {
|
|
144
|
-
|
|
145
|
-
assertArgument,
|
|
146
|
-
assertArgumentCount,
|
|
147
|
-
assertPrivate,
|
|
148
|
-
isError,
|
|
149
|
-
makeError
|
|
6
|
+
parseProtocol as default
|
|
150
7
|
};
|
|
151
8
|
//# sourceMappingURL=standards-sdk.es74.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-sdk.es74.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//# sourceM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C7E;AAAA,IACA;AAAA,EACR,CAAK;AACD,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.es74.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,94 +1,42 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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);
|
|
73
|
-
} else {
|
|
74
|
-
result.set(bytes, 0);
|
|
75
|
-
}
|
|
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
|
-
}
|
|
1
|
+
import speedometer from "./standards-sdk.es108.js";
|
|
2
|
+
import throttle from "./standards-sdk.es109.js";
|
|
3
|
+
import utils from "./standards-sdk.es33.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));
|
|
84
37
|
export {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
getBytesCopy,
|
|
89
|
-
hexlify,
|
|
90
|
-
isHexString,
|
|
91
|
-
zeroPadBytes,
|
|
92
|
-
zeroPadValue
|
|
38
|
+
asyncDecorator,
|
|
39
|
+
progressEventDecorator,
|
|
40
|
+
progressEventReducer
|
|
93
41
|
};
|
|
94
42
|
//# sourceMappingURL=standards-sdk.es75.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-sdk.es75.js","sources":["../../node_modules/
|
|
1
|
+
{"version":3,"file":"standards-sdk.es75.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,198 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
PanicReasons.set(33, "ENUM_RANGE_ERROR");
|
|
28
|
-
PanicReasons.set(34, "BAD_STORAGE_DATA");
|
|
29
|
-
PanicReasons.set(49, "STACK_UNDERFLOW");
|
|
30
|
-
PanicReasons.set(50, "ARRAY_RANGE_ERROR");
|
|
31
|
-
PanicReasons.set(65, "OUT_OF_MEMORY");
|
|
32
|
-
PanicReasons.set(81, "UNINITIALIZED_FUNCTION_CALL");
|
|
33
|
-
const paramTypeBytes = new RegExp(/^bytes([0-9]*)$/);
|
|
34
|
-
const paramTypeNumber = new RegExp(/^(u?int)([0-9]*)$/);
|
|
35
|
-
let defaultCoder = null;
|
|
36
|
-
let defaultMaxInflation = 1024;
|
|
37
|
-
function getBuiltinCallException(action, tx, data, abiCoder) {
|
|
38
|
-
let message = "missing revert data";
|
|
39
|
-
let reason = null;
|
|
40
|
-
const invocation = null;
|
|
41
|
-
let revert = null;
|
|
42
|
-
if (data) {
|
|
43
|
-
message = "execution reverted";
|
|
44
|
-
const bytes = getBytes(data);
|
|
45
|
-
data = hexlify(data);
|
|
46
|
-
if (bytes.length === 0) {
|
|
47
|
-
message += " (no data present; likely require(false) occurred";
|
|
48
|
-
reason = "require(false)";
|
|
49
|
-
} else if (bytes.length % 32 !== 4) {
|
|
50
|
-
message += " (could not decode reason; invalid data length)";
|
|
51
|
-
} else if (hexlify(bytes.slice(0, 4)) === "0x08c379a0") {
|
|
52
|
-
try {
|
|
53
|
-
reason = abiCoder.decode(["string"], bytes.slice(4))[0];
|
|
54
|
-
revert = {
|
|
55
|
-
signature: "Error(string)",
|
|
56
|
-
name: "Error",
|
|
57
|
-
args: [reason]
|
|
58
|
-
};
|
|
59
|
-
message += `: ${JSON.stringify(reason)}`;
|
|
60
|
-
} catch (error) {
|
|
61
|
-
message += " (could not decode reason; invalid string data)";
|
|
62
|
-
}
|
|
63
|
-
} else if (hexlify(bytes.slice(0, 4)) === "0x4e487b71") {
|
|
64
|
-
try {
|
|
65
|
-
const code = Number(abiCoder.decode(["uint256"], bytes.slice(4))[0]);
|
|
66
|
-
revert = {
|
|
67
|
-
signature: "Panic(uint256)",
|
|
68
|
-
name: "Panic",
|
|
69
|
-
args: [code]
|
|
70
|
-
};
|
|
71
|
-
reason = `Panic due to ${PanicReasons.get(code) || "UNKNOWN"}(${code})`;
|
|
72
|
-
message += `: ${reason}`;
|
|
73
|
-
} catch (error) {
|
|
74
|
-
message += " (could not decode panic code)";
|
|
75
|
-
}
|
|
76
|
-
} else {
|
|
77
|
-
message += " (unknown custom error)";
|
|
1
|
+
import platform from "./standards-sdk.es60.js";
|
|
2
|
+
import utils from "./standards-sdk.es33.js";
|
|
3
|
+
import isURLSameOrigin from "./standards-sdk.es110.js";
|
|
4
|
+
import cookies from "./standards-sdk.es111.js";
|
|
5
|
+
import buildFullPath from "./standards-sdk.es56.js";
|
|
6
|
+
import mergeConfig from "./standards-sdk.es36.js";
|
|
7
|
+
import AxiosHeaders from "./standards-sdk.es47.js";
|
|
8
|
+
import buildURL from "./standards-sdk.es53.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("; "));
|
|
78
27
|
}
|
|
79
28
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
return makeError(message, "CALL_EXCEPTION", {
|
|
88
|
-
action,
|
|
89
|
-
data,
|
|
90
|
-
reason,
|
|
91
|
-
transaction,
|
|
92
|
-
invocation,
|
|
93
|
-
revert
|
|
94
|
-
});
|
|
95
|
-
}
|
|
96
|
-
const _AbiCoder = class _AbiCoder {
|
|
97
|
-
constructor() {
|
|
98
|
-
__privateAdd(this, _AbiCoder_instances);
|
|
99
|
-
}
|
|
100
|
-
/**
|
|
101
|
-
* Get the default values for the given %%types%%.
|
|
102
|
-
*
|
|
103
|
-
* For example, a ``uint`` is by default ``0`` and ``bool``
|
|
104
|
-
* is by default ``false``.
|
|
105
|
-
*/
|
|
106
|
-
getDefaultValue(types) {
|
|
107
|
-
const coders = types.map((type) => __privateMethod(this, _AbiCoder_instances, getCoder_fn).call(this, ParamType.from(type)));
|
|
108
|
-
const coder = new TupleCoder(coders, "_");
|
|
109
|
-
return coder.defaultValue();
|
|
110
|
-
}
|
|
111
|
-
/**
|
|
112
|
-
* Encode the %%values%% as the %%types%% into ABI data.
|
|
113
|
-
*
|
|
114
|
-
* @returns DataHexstring
|
|
115
|
-
*/
|
|
116
|
-
encode(types, values) {
|
|
117
|
-
assertArgumentCount(values.length, types.length, "types/values length mismatch");
|
|
118
|
-
const coders = types.map((type) => __privateMethod(this, _AbiCoder_instances, getCoder_fn).call(this, ParamType.from(type)));
|
|
119
|
-
const coder = new TupleCoder(coders, "_");
|
|
120
|
-
const writer = new Writer();
|
|
121
|
-
coder.encode(writer, values);
|
|
122
|
-
return writer.data;
|
|
123
|
-
}
|
|
124
|
-
/**
|
|
125
|
-
* Decode the ABI %%data%% as the %%types%% into values.
|
|
126
|
-
*
|
|
127
|
-
* If %%loose%% decoding is enabled, then strict padding is
|
|
128
|
-
* not enforced. Some older versions of Solidity incorrectly
|
|
129
|
-
* padded event data emitted from ``external`` functions.
|
|
130
|
-
*/
|
|
131
|
-
decode(types, data, loose) {
|
|
132
|
-
const coders = types.map((type) => __privateMethod(this, _AbiCoder_instances, getCoder_fn).call(this, ParamType.from(type)));
|
|
133
|
-
const coder = new TupleCoder(coders, "_");
|
|
134
|
-
return coder.decode(new Reader(data, loose, defaultMaxInflation));
|
|
135
|
-
}
|
|
136
|
-
static _setDefaultMaxInflation(value) {
|
|
137
|
-
assertArgument(typeof value === "number" && Number.isInteger(value), "invalid defaultMaxInflation factor", "value", value);
|
|
138
|
-
defaultMaxInflation = value;
|
|
139
|
-
}
|
|
140
|
-
/**
|
|
141
|
-
* Returns the shared singleton instance of a default [[AbiCoder]].
|
|
142
|
-
*
|
|
143
|
-
* On the first call, the instance is created internally.
|
|
144
|
-
*/
|
|
145
|
-
static defaultAbiCoder() {
|
|
146
|
-
if (defaultCoder == null) {
|
|
147
|
-
defaultCoder = new _AbiCoder();
|
|
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
|
+
}
|
|
148
36
|
}
|
|
149
|
-
return defaultCoder;
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* Returns an ethers-compatible [[CallExceptionError]] Error for the given
|
|
153
|
-
* result %%data%% for the [[CallExceptionAction]] %%action%% against
|
|
154
|
-
* the Transaction %%tx%%.
|
|
155
|
-
*/
|
|
156
|
-
static getBuiltinCallException(action, tx, data) {
|
|
157
|
-
return getBuiltinCallException(action, tx, data, _AbiCoder.defaultAbiCoder());
|
|
158
|
-
}
|
|
159
|
-
};
|
|
160
|
-
_AbiCoder_instances = new WeakSet();
|
|
161
|
-
getCoder_fn = function(param) {
|
|
162
|
-
if (param.isArray()) {
|
|
163
|
-
return new ArrayCoder(__privateMethod(this, _AbiCoder_instances, getCoder_fn).call(this, param.arrayChildren), param.arrayLength, param.name);
|
|
164
|
-
}
|
|
165
|
-
if (param.isTuple()) {
|
|
166
|
-
return new TupleCoder(param.components.map((c) => __privateMethod(this, _AbiCoder_instances, getCoder_fn).call(this, c)), param.name);
|
|
167
|
-
}
|
|
168
|
-
switch (param.baseType) {
|
|
169
|
-
case "address":
|
|
170
|
-
return new AddressCoder(param.name);
|
|
171
|
-
case "bool":
|
|
172
|
-
return new BooleanCoder(param.name);
|
|
173
|
-
case "string":
|
|
174
|
-
return new StringCoder(param.name);
|
|
175
|
-
case "bytes":
|
|
176
|
-
return new BytesCoder(param.name);
|
|
177
|
-
case "":
|
|
178
|
-
return new NullCoder(param.name);
|
|
179
|
-
}
|
|
180
|
-
let match = param.type.match(paramTypeNumber);
|
|
181
|
-
if (match) {
|
|
182
|
-
let size = parseInt(match[2] || "256");
|
|
183
|
-
assertArgument(size !== 0 && size <= 256 && size % 8 === 0, "invalid " + match[1] + " bit length", "param", param);
|
|
184
|
-
return new NumberCoder(size / 8, match[1] === "int", param.name);
|
|
185
|
-
}
|
|
186
|
-
match = param.type.match(paramTypeBytes);
|
|
187
|
-
if (match) {
|
|
188
|
-
let size = parseInt(match[1]);
|
|
189
|
-
assertArgument(size !== 0 && size <= 32, "invalid bytes length", "param", param);
|
|
190
|
-
return new FixedBytesCoder(size, param.name);
|
|
191
37
|
}
|
|
192
|
-
|
|
38
|
+
return newConfig;
|
|
193
39
|
};
|
|
194
|
-
let AbiCoder = _AbiCoder;
|
|
195
40
|
export {
|
|
196
|
-
|
|
41
|
+
resolveConfig as default
|
|
197
42
|
};
|
|
198
43
|
//# sourceMappingURL=standards-sdk.es76.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standards-sdk.es76.js","sources":["../../node_modules/ethers/lib.esm/abi/abi-coder.js"],"sourcesContent":["/**\n * When sending values to or receiving values from a [[Contract]], the\n * data is generally encoded using the [ABI standard](link-solc-abi).\n *\n * The AbiCoder provides a utility to encode values to ABI data and\n * decode values from ABI data.\n *\n * Most of the time, developers should favour the [[Contract]] class,\n * which further abstracts a lot of the finer details of ABI data.\n *\n * @_section api/abi/abi-coder:ABI Encoding\n */\n// See: https://github.com/ethereum/wiki/wiki/Ethereum-Contract-ABI\nimport { assertArgumentCount, assertArgument } from \"../utils/index.js\";\nimport { Reader, Writer } from \"./coders/abstract-coder.js\";\nimport { AddressCoder } from \"./coders/address.js\";\nimport { ArrayCoder } from \"./coders/array.js\";\nimport { BooleanCoder } from \"./coders/boolean.js\";\nimport { BytesCoder } from \"./coders/bytes.js\";\nimport { FixedBytesCoder } from \"./coders/fixed-bytes.js\";\nimport { NullCoder } from \"./coders/null.js\";\nimport { NumberCoder } from \"./coders/number.js\";\nimport { StringCoder } from \"./coders/string.js\";\nimport { TupleCoder } from \"./coders/tuple.js\";\nimport { ParamType } from \"./fragments.js\";\nimport { getAddress } from \"../address/index.js\";\nimport { getBytes, hexlify, makeError } from \"../utils/index.js\";\n// https://docs.soliditylang.org/en/v0.8.17/control-structures.html\nconst PanicReasons = new Map();\nPanicReasons.set(0x00, \"GENERIC_PANIC\");\nPanicReasons.set(0x01, \"ASSERT_FALSE\");\nPanicReasons.set(0x11, \"OVERFLOW\");\nPanicReasons.set(0x12, \"DIVIDE_BY_ZERO\");\nPanicReasons.set(0x21, \"ENUM_RANGE_ERROR\");\nPanicReasons.set(0x22, \"BAD_STORAGE_DATA\");\nPanicReasons.set(0x31, \"STACK_UNDERFLOW\");\nPanicReasons.set(0x32, \"ARRAY_RANGE_ERROR\");\nPanicReasons.set(0x41, \"OUT_OF_MEMORY\");\nPanicReasons.set(0x51, \"UNINITIALIZED_FUNCTION_CALL\");\nconst paramTypeBytes = new RegExp(/^bytes([0-9]*)$/);\nconst paramTypeNumber = new RegExp(/^(u?int)([0-9]*)$/);\nlet defaultCoder = null;\nlet defaultMaxInflation = 1024;\nfunction getBuiltinCallException(action, tx, data, abiCoder) {\n let message = \"missing revert data\";\n let reason = null;\n const invocation = null;\n let revert = null;\n if (data) {\n message = \"execution reverted\";\n const bytes = getBytes(data);\n data = hexlify(data);\n if (bytes.length === 0) {\n message += \" (no data present; likely require(false) occurred\";\n reason = \"require(false)\";\n }\n else if (bytes.length % 32 !== 4) {\n message += \" (could not decode reason; invalid data length)\";\n }\n else if (hexlify(bytes.slice(0, 4)) === \"0x08c379a0\") {\n // Error(string)\n try {\n reason = abiCoder.decode([\"string\"], bytes.slice(4))[0];\n revert = {\n signature: \"Error(string)\",\n name: \"Error\",\n args: [reason]\n };\n message += `: ${JSON.stringify(reason)}`;\n }\n catch (error) {\n message += \" (could not decode reason; invalid string data)\";\n }\n }\n else if (hexlify(bytes.slice(0, 4)) === \"0x4e487b71\") {\n // Panic(uint256)\n try {\n const code = Number(abiCoder.decode([\"uint256\"], bytes.slice(4))[0]);\n revert = {\n signature: \"Panic(uint256)\",\n name: \"Panic\",\n args: [code]\n };\n reason = `Panic due to ${PanicReasons.get(code) || \"UNKNOWN\"}(${code})`;\n message += `: ${reason}`;\n }\n catch (error) {\n message += \" (could not decode panic code)\";\n }\n }\n else {\n message += \" (unknown custom error)\";\n }\n }\n const transaction = {\n to: (tx.to ? getAddress(tx.to) : null),\n data: (tx.data || \"0x\")\n };\n if (tx.from) {\n transaction.from = getAddress(tx.from);\n }\n return makeError(message, \"CALL_EXCEPTION\", {\n action, data, reason, transaction, invocation, revert\n });\n}\n/**\n * The **AbiCoder** is a low-level class responsible for encoding JavaScript\n * values into binary data and decoding binary data into JavaScript values.\n */\nexport class AbiCoder {\n #getCoder(param) {\n if (param.isArray()) {\n return new ArrayCoder(this.#getCoder(param.arrayChildren), param.arrayLength, param.name);\n }\n if (param.isTuple()) {\n return new TupleCoder(param.components.map((c) => this.#getCoder(c)), param.name);\n }\n switch (param.baseType) {\n case \"address\":\n return new AddressCoder(param.name);\n case \"bool\":\n return new BooleanCoder(param.name);\n case \"string\":\n return new StringCoder(param.name);\n case \"bytes\":\n return new BytesCoder(param.name);\n case \"\":\n return new NullCoder(param.name);\n }\n // u?int[0-9]*\n let match = param.type.match(paramTypeNumber);\n if (match) {\n let size = parseInt(match[2] || \"256\");\n assertArgument(size !== 0 && size <= 256 && (size % 8) === 0, \"invalid \" + match[1] + \" bit length\", \"param\", param);\n return new NumberCoder(size / 8, (match[1] === \"int\"), param.name);\n }\n // bytes[0-9]+\n match = param.type.match(paramTypeBytes);\n if (match) {\n let size = parseInt(match[1]);\n assertArgument(size !== 0 && size <= 32, \"invalid bytes length\", \"param\", param);\n return new FixedBytesCoder(size, param.name);\n }\n assertArgument(false, \"invalid type\", \"type\", param.type);\n }\n /**\n * Get the default values for the given %%types%%.\n *\n * For example, a ``uint`` is by default ``0`` and ``bool``\n * is by default ``false``.\n */\n getDefaultValue(types) {\n const coders = types.map((type) => this.#getCoder(ParamType.from(type)));\n const coder = new TupleCoder(coders, \"_\");\n return coder.defaultValue();\n }\n /**\n * Encode the %%values%% as the %%types%% into ABI data.\n *\n * @returns DataHexstring\n */\n encode(types, values) {\n assertArgumentCount(values.length, types.length, \"types/values length mismatch\");\n const coders = types.map((type) => this.#getCoder(ParamType.from(type)));\n const coder = (new TupleCoder(coders, \"_\"));\n const writer = new Writer();\n coder.encode(writer, values);\n return writer.data;\n }\n /**\n * Decode the ABI %%data%% as the %%types%% into values.\n *\n * If %%loose%% decoding is enabled, then strict padding is\n * not enforced. Some older versions of Solidity incorrectly\n * padded event data emitted from ``external`` functions.\n */\n decode(types, data, loose) {\n const coders = types.map((type) => this.#getCoder(ParamType.from(type)));\n const coder = new TupleCoder(coders, \"_\");\n return coder.decode(new Reader(data, loose, defaultMaxInflation));\n }\n static _setDefaultMaxInflation(value) {\n assertArgument(typeof (value) === \"number\" && Number.isInteger(value), \"invalid defaultMaxInflation factor\", \"value\", value);\n defaultMaxInflation = value;\n }\n /**\n * Returns the shared singleton instance of a default [[AbiCoder]].\n *\n * On the first call, the instance is created internally.\n */\n static defaultAbiCoder() {\n if (defaultCoder == null) {\n defaultCoder = new AbiCoder();\n }\n return defaultCoder;\n }\n /**\n * Returns an ethers-compatible [[CallExceptionError]] Error for the given\n * result %%data%% for the [[CallExceptionAction]] %%action%% against\n * the Transaction %%tx%%.\n */\n static getBuiltinCallException(action, tx, data) {\n return getBuiltinCallException(action, tx, data, AbiCoder.defaultAbiCoder());\n }\n}\n//# sourceMappingURL=abi-coder.js.map"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AA4BA,MAAM,eAAe,oBAAI,IAAK;AAC9B,aAAa,IAAI,GAAM,eAAe;AACtC,aAAa,IAAI,GAAM,cAAc;AACrC,aAAa,IAAI,IAAM,UAAU;AACjC,aAAa,IAAI,IAAM,gBAAgB;AACvC,aAAa,IAAI,IAAM,kBAAkB;AACzC,aAAa,IAAI,IAAM,kBAAkB;AACzC,aAAa,IAAI,IAAM,iBAAiB;AACxC,aAAa,IAAI,IAAM,mBAAmB;AAC1C,aAAa,IAAI,IAAM,eAAe;AACtC,aAAa,IAAI,IAAM,6BAA6B;AACpD,MAAM,iBAAiB,IAAI,OAAO,iBAAiB;AACnD,MAAM,kBAAkB,IAAI,OAAO,mBAAmB;AACtD,IAAI,eAAe;AACnB,IAAI,sBAAsB;AAC1B,SAAS,wBAAwB,QAAQ,IAAI,MAAM,UAAU;AACzD,MAAI,UAAU;AACd,MAAI,SAAS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,SAAS,KAAK;AAC/E,WAAO,IAAI,gBAAgB,MAAM,MAAM,IAAI;AAAA,EACvD;AACQ,iBAAe,OAAO,gBAAgB,QAAQ,MAAM,IAAI;AAChE;AAnCO,IAAM,WAAN;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"standards-sdk.es76.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,MAAM,WAAW,IAAI,GAAG;AAC1B,QAAI,SAAS,yBAAyB,SAAS,gCAAgC;AAC7E,cAAQ,eAAe,MAAS;AAAA,IACjC,YAAW,cAAc,QAAQ,eAAc,OAAQ,OAAO;AAE7D,YAAM,CAAC,MAAM,GAAG,MAAM,IAAI,cAAc,YAAY,MAAM,GAAG,EAAE,IAAI,WAAS,MAAM,KAAI,CAAE,EAAE,OAAO,OAAO,IAAI,CAAE;AAC9G,cAAQ,eAAe,CAAC,QAAQ,uBAAuB,GAAG,MAAM,EAAE,KAAK,IAAI,CAAC;AAAA,IAClF;AAAA,EACA;AAME,MAAI,SAAS,uBAAuB;AAClC,qBAAiB,MAAM,WAAW,aAAa,MAAM,gBAAgB,cAAc,SAAS;AAE5F,QAAI,iBAAkB,kBAAkB,SAAS,gBAAgB,UAAU,GAAG,GAAI;AAEhF,YAAM,Y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