@hashgraphonline/standards-sdk 0.0.77 → 0.0.78
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.es100.js +14 -16
- package/dist/es/standards-sdk.es100.js.map +1 -1
- package/dist/es/standards-sdk.es101.js +4 -60
- package/dist/es/standards-sdk.es101.js.map +1 -1
- package/dist/es/standards-sdk.es102.js +37 -1287
- package/dist/es/standards-sdk.es102.js.map +1 -1
- package/dist/es/standards-sdk.es103.js +35 -143
- package/dist/es/standards-sdk.es103.js.map +1 -1
- package/dist/es/standards-sdk.es104.js +36 -90
- package/dist/es/standards-sdk.es104.js.map +1 -1
- package/dist/es/standards-sdk.es105.js +71 -77
- package/dist/es/standards-sdk.es105.js.map +1 -1
- package/dist/es/standards-sdk.es106.js +18 -29
- package/dist/es/standards-sdk.es106.js.map +1 -1
- package/dist/es/standards-sdk.es107.js +26 -5
- package/dist/es/standards-sdk.es107.js.map +1 -1
- package/dist/es/standards-sdk.es108.js +26 -159
- package/dist/es/standards-sdk.es108.js.map +1 -1
- package/dist/es/standards-sdk.es109.js +36 -21
- package/dist/es/standards-sdk.es109.js.map +1 -1
- package/dist/es/standards-sdk.es110.js +30 -789
- package/dist/es/standards-sdk.es110.js.map +1 -1
- package/dist/es/standards-sdk.es111.js +30 -171
- package/dist/es/standards-sdk.es111.js.map +1 -1
- package/dist/es/standards-sdk.es112.js +9 -143
- package/dist/es/standards-sdk.es112.js.map +1 -1
- package/dist/es/standards-sdk.es113.js +32 -19
- package/dist/es/standards-sdk.es113.js.map +1 -1
- package/dist/es/standards-sdk.es114.js +3 -27
- package/dist/es/standards-sdk.es114.js.map +1 -1
- package/dist/es/standards-sdk.es115.js +2 -26
- package/dist/es/standards-sdk.es115.js.map +1 -1
- package/dist/es/standards-sdk.es116.js +2 -38
- package/dist/es/standards-sdk.es116.js.map +1 -1
- package/dist/es/standards-sdk.es12.js +3 -3
- package/dist/es/standards-sdk.es12.js.map +1 -1
- package/dist/es/standards-sdk.es21.js +1 -1
- package/dist/es/standards-sdk.es23.js +1 -1
- package/dist/es/standards-sdk.es26.js +1041 -3
- package/dist/es/standards-sdk.es26.js.map +1 -1
- package/dist/es/standards-sdk.es27.js +3 -2
- package/dist/es/standards-sdk.es27.js.map +1 -1
- package/dist/es/standards-sdk.es28.js +4086 -960
- package/dist/es/standards-sdk.es28.js.map +1 -1
- package/dist/es/standards-sdk.es29.js +2 -4167
- package/dist/es/standards-sdk.es29.js.map +1 -1
- package/dist/es/standards-sdk.es33.js +1 -7133
- package/dist/es/standards-sdk.es33.js.map +1 -1
- package/dist/es/standards-sdk.es34.js +7133 -1
- package/dist/es/standards-sdk.es34.js.map +1 -1
- package/dist/es/standards-sdk.es38.js +1 -1
- package/dist/es/standards-sdk.es39.js +1 -1
- package/dist/es/standards-sdk.es4.js +1 -1
- package/dist/es/standards-sdk.es40.js +1 -1
- package/dist/es/standards-sdk.es42.js +5 -5
- package/dist/es/standards-sdk.es44.js +3 -3
- package/dist/es/standards-sdk.es54.js +1 -1
- package/dist/es/standards-sdk.es55.js +3 -3
- package/dist/es/standards-sdk.es57.js +2 -2282
- package/dist/es/standards-sdk.es57.js.map +1 -1
- package/dist/es/standards-sdk.es58.js +2281 -163
- package/dist/es/standards-sdk.es58.js.map +1 -1
- package/dist/es/standards-sdk.es59.js +159 -27
- package/dist/es/standards-sdk.es59.js.map +1 -1
- package/dist/es/standards-sdk.es60.js +25 -56
- package/dist/es/standards-sdk.es60.js.map +1 -1
- package/dist/es/standards-sdk.es61.js +58 -45
- package/dist/es/standards-sdk.es61.js.map +1 -1
- package/dist/es/standards-sdk.es62.js +48 -8
- package/dist/es/standards-sdk.es62.js.map +1 -1
- package/dist/es/standards-sdk.es63.js +8 -63
- package/dist/es/standards-sdk.es63.js.map +1 -1
- package/dist/es/standards-sdk.es64.js +64 -5
- package/dist/es/standards-sdk.es64.js.map +1 -1
- package/dist/es/standards-sdk.es65.js +6 -15
- package/dist/es/standards-sdk.es65.js.map +1 -1
- package/dist/es/standards-sdk.es66.js +15 -7
- package/dist/es/standards-sdk.es66.js.map +1 -1
- package/dist/es/standards-sdk.es67.js +6 -44
- package/dist/es/standards-sdk.es67.js.map +1 -1
- package/dist/es/standards-sdk.es68.js +45 -2
- package/dist/es/standards-sdk.es68.js.map +1 -1
- package/dist/es/standards-sdk.es69.js +2 -136
- package/dist/es/standards-sdk.es69.js.map +1 -1
- package/dist/es/standards-sdk.es7.js +1 -1
- package/dist/es/standards-sdk.es70.js +124 -160
- package/dist/es/standards-sdk.es70.js.map +1 -1
- package/dist/es/standards-sdk.es71.js +171 -12
- package/dist/es/standards-sdk.es71.js.map +1 -1
- package/dist/es/standards-sdk.es72.js +84 -13
- package/dist/es/standards-sdk.es72.js.map +1 -1
- package/dist/es/standards-sdk.es73.js +20 -29
- package/dist/es/standards-sdk.es73.js.map +1 -1
- package/dist/es/standards-sdk.es74.js +146 -13
- package/dist/es/standards-sdk.es74.js.map +1 -1
- package/dist/es/standards-sdk.es75.js +90 -3
- package/dist/es/standards-sdk.es75.js.map +1 -1
- package/dist/es/standards-sdk.es76.js +194 -3
- package/dist/es/standards-sdk.es76.js.map +1 -1
- package/dist/es/standards-sdk.es77.js +436 -14
- package/dist/es/standards-sdk.es77.js.map +1 -1
- package/dist/es/standards-sdk.es78.js +24 -4
- package/dist/es/standards-sdk.es78.js.map +1 -1
- package/dist/es/standards-sdk.es79.js +139 -39
- package/dist/es/standards-sdk.es79.js.map +1 -1
- package/dist/es/standards-sdk.es8.js +1 -1
- package/dist/es/standards-sdk.es80.js +15 -37
- package/dist/es/standards-sdk.es80.js.map +1 -1
- package/dist/es/standards-sdk.es81.js +28 -36
- package/dist/es/standards-sdk.es81.js.map +1 -1
- package/dist/es/standards-sdk.es82.js +25 -74
- package/dist/es/standards-sdk.es82.js.map +1 -1
- package/dist/es/standards-sdk.es83.js +21 -2
- package/dist/es/standards-sdk.es83.js.map +1 -1
- package/dist/es/standards-sdk.es84.js +44 -3
- package/dist/es/standards-sdk.es84.js.map +1 -1
- package/dist/es/standards-sdk.es85.js +18 -2
- package/dist/es/standards-sdk.es85.js.map +1 -1
- package/dist/es/standards-sdk.es86.js +61 -2
- package/dist/es/standards-sdk.es86.js.map +1 -1
- package/dist/es/standards-sdk.es87.js +1287 -32
- package/dist/es/standards-sdk.es87.js.map +1 -1
- package/dist/es/standards-sdk.es88.js +29 -30
- package/dist/es/standards-sdk.es88.js.map +1 -1
- package/dist/es/standards-sdk.es89.js +6 -9
- 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 +155 -30
- package/dist/es/standards-sdk.es90.js.map +1 -1
- package/dist/es/standards-sdk.es91.js +766 -168
- package/dist/es/standards-sdk.es91.js.map +1 -1
- package/dist/es/standards-sdk.es92.js +125 -420
- package/dist/es/standards-sdk.es92.js.map +1 -1
- package/dist/es/standards-sdk.es93.js +170 -21
- package/dist/es/standards-sdk.es93.js.map +1 -1
- package/dist/es/standards-sdk.es94.js +13 -139
- package/dist/es/standards-sdk.es94.js.map +1 -1
- package/dist/es/standards-sdk.es95.js +13 -18
- package/dist/es/standards-sdk.es95.js.map +1 -1
- package/dist/es/standards-sdk.es96.js +30 -27
- package/dist/es/standards-sdk.es96.js.map +1 -1
- package/dist/es/standards-sdk.es97.js +14 -28
- package/dist/es/standards-sdk.es97.js.map +1 -1
- package/dist/es/standards-sdk.es98.js +3 -20
- package/dist/es/standards-sdk.es98.js.map +1 -1
- package/dist/es/standards-sdk.es99.js +3 -43
- package/dist/es/standards-sdk.es99.js.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 +1 -1
|
@@ -1,198 +1,796 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
1
2
|
var __typeError = (msg) => {
|
|
2
3
|
throw TypeError(msg);
|
|
3
4
|
};
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
7
|
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
8
|
+
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
5
9
|
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
import { StringCoder } from "./standards-sdk.es100.js";
|
|
17
|
-
import { TupleCoder } from "./standards-sdk.es101.js";
|
|
18
|
-
import { ParamType } from "./standards-sdk.es102.js";
|
|
19
|
-
import { assertArgument, assertArgumentCount, makeError } from "./standards-sdk.es103.js";
|
|
20
|
-
import { getBytes, hexlify } from "./standards-sdk.es104.js";
|
|
21
|
-
import { getAddress } from "./standards-sdk.es105.js";
|
|
22
|
-
const PanicReasons = /* @__PURE__ */ new Map();
|
|
23
|
-
PanicReasons.set(0, "GENERIC_PANIC");
|
|
24
|
-
PanicReasons.set(1, "ASSERT_FALSE");
|
|
25
|
-
PanicReasons.set(17, "OVERFLOW");
|
|
26
|
-
PanicReasons.set(18, "DIVIDE_BY_ZERO");
|
|
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)";
|
|
78
|
-
}
|
|
10
|
+
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
11
|
+
var _options;
|
|
12
|
+
import { assertPrivate } from "./standards-sdk.es74.js";
|
|
13
|
+
import { defineProperties } from "./standards-sdk.es88.js";
|
|
14
|
+
const _gaurd = {};
|
|
15
|
+
function n(value, width) {
|
|
16
|
+
let signed = false;
|
|
17
|
+
if (width < 0) {
|
|
18
|
+
signed = true;
|
|
19
|
+
width *= -1;
|
|
79
20
|
}
|
|
80
|
-
|
|
81
|
-
to: tx.to ? getAddress(tx.to) : null,
|
|
82
|
-
data: tx.data || "0x"
|
|
83
|
-
};
|
|
84
|
-
if (tx.from) {
|
|
85
|
-
transaction.from = getAddress(tx.from);
|
|
86
|
-
}
|
|
87
|
-
return makeError(message, "CALL_EXCEPTION", {
|
|
88
|
-
action,
|
|
89
|
-
data,
|
|
90
|
-
reason,
|
|
91
|
-
transaction,
|
|
92
|
-
invocation,
|
|
93
|
-
revert
|
|
94
|
-
});
|
|
21
|
+
return new Typed(_gaurd, `${signed ? "" : "u"}int${width}`, value, { signed, width });
|
|
95
22
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
23
|
+
function b(value, size) {
|
|
24
|
+
return new Typed(_gaurd, `bytes${size ? size : ""}`, value, { size });
|
|
25
|
+
}
|
|
26
|
+
const _typedSymbol = Symbol.for("_ethers_typed");
|
|
27
|
+
const _Typed = class _Typed {
|
|
28
|
+
/**
|
|
29
|
+
* @_ignore:
|
|
30
|
+
*/
|
|
31
|
+
constructor(gaurd, type, value, options) {
|
|
32
|
+
/**
|
|
33
|
+
* The type, as a Solidity-compatible type.
|
|
34
|
+
*/
|
|
35
|
+
__publicField(this, "type");
|
|
36
|
+
/**
|
|
37
|
+
* The actual value.
|
|
38
|
+
*/
|
|
39
|
+
__publicField(this, "value");
|
|
40
|
+
__privateAdd(this, _options);
|
|
41
|
+
/**
|
|
42
|
+
* @_ignore:
|
|
43
|
+
*/
|
|
44
|
+
__publicField(this, "_typedSymbol");
|
|
45
|
+
if (options == null) {
|
|
46
|
+
options = null;
|
|
47
|
+
}
|
|
48
|
+
assertPrivate(_gaurd, gaurd, "Typed");
|
|
49
|
+
defineProperties(this, { _typedSymbol, type, value });
|
|
50
|
+
__privateSet(this, _options, options);
|
|
51
|
+
this.format();
|
|
99
52
|
}
|
|
100
53
|
/**
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
* For example, a ``uint`` is by default ``0`` and ``bool``
|
|
104
|
-
* is by default ``false``.
|
|
54
|
+
* Format the type as a Human-Readable type.
|
|
105
55
|
*/
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
56
|
+
format() {
|
|
57
|
+
if (this.type === "array") {
|
|
58
|
+
throw new Error("");
|
|
59
|
+
} else if (this.type === "dynamicArray") {
|
|
60
|
+
throw new Error("");
|
|
61
|
+
} else if (this.type === "tuple") {
|
|
62
|
+
return `tuple(${this.value.map((v) => v.format()).join(",")})`;
|
|
63
|
+
}
|
|
64
|
+
return this.type;
|
|
110
65
|
}
|
|
111
66
|
/**
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
* @returns DataHexstring
|
|
67
|
+
* The default value returned by this type.
|
|
115
68
|
*/
|
|
116
|
-
|
|
117
|
-
|
|
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;
|
|
69
|
+
defaultValue() {
|
|
70
|
+
return 0;
|
|
123
71
|
}
|
|
124
72
|
/**
|
|
125
|
-
*
|
|
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.
|
|
73
|
+
* The minimum value for numeric types.
|
|
130
74
|
*/
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
const coder = new TupleCoder(coders, "_");
|
|
134
|
-
return coder.decode(new Reader(data, loose, defaultMaxInflation));
|
|
75
|
+
minValue() {
|
|
76
|
+
return 0;
|
|
135
77
|
}
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
78
|
+
/**
|
|
79
|
+
* The maximum value for numeric types.
|
|
80
|
+
*/
|
|
81
|
+
maxValue() {
|
|
82
|
+
return 0;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Returns ``true`` and provides a type guard is this is a [[TypedBigInt]].
|
|
86
|
+
*/
|
|
87
|
+
isBigInt() {
|
|
88
|
+
return !!this.type.match(/^u?int[0-9]+$/);
|
|
139
89
|
}
|
|
140
90
|
/**
|
|
141
|
-
* Returns
|
|
91
|
+
* Returns ``true`` and provides a type guard is this is a [[TypedData]].
|
|
92
|
+
*/
|
|
93
|
+
isData() {
|
|
94
|
+
return this.type.startsWith("bytes");
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Returns ``true`` and provides a type guard is this is a [[TypedString]].
|
|
98
|
+
*/
|
|
99
|
+
isString() {
|
|
100
|
+
return this.type === "string";
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Returns the tuple name, if this is a tuple. Throws otherwise.
|
|
104
|
+
*/
|
|
105
|
+
get tupleName() {
|
|
106
|
+
if (this.type !== "tuple") {
|
|
107
|
+
throw TypeError("not a tuple");
|
|
108
|
+
}
|
|
109
|
+
return __privateGet(this, _options);
|
|
110
|
+
}
|
|
111
|
+
// Returns the length of this type as an array
|
|
112
|
+
// - `null` indicates the length is unforced, it could be dynamic
|
|
113
|
+
// - `-1` indicates the length is dynamic
|
|
114
|
+
// - any other value indicates it is a static array and is its length
|
|
115
|
+
/**
|
|
116
|
+
* Returns the length of the array type or ``-1`` if it is dynamic.
|
|
142
117
|
*
|
|
143
|
-
*
|
|
118
|
+
* Throws if the type is not an array.
|
|
144
119
|
*/
|
|
145
|
-
|
|
146
|
-
if (
|
|
147
|
-
|
|
120
|
+
get arrayLength() {
|
|
121
|
+
if (this.type !== "array") {
|
|
122
|
+
throw TypeError("not an array");
|
|
148
123
|
}
|
|
149
|
-
|
|
124
|
+
if (__privateGet(this, _options) === true) {
|
|
125
|
+
return -1;
|
|
126
|
+
}
|
|
127
|
+
if (__privateGet(this, _options) === false) {
|
|
128
|
+
return this.value.length;
|
|
129
|
+
}
|
|
130
|
+
return null;
|
|
150
131
|
}
|
|
151
132
|
/**
|
|
152
|
-
* Returns
|
|
153
|
-
* result %%data%% for the [[CallExceptionAction]] %%action%% against
|
|
154
|
-
* the Transaction %%tx%%.
|
|
133
|
+
* Returns a new **Typed** of %%type%% with the %%value%%.
|
|
155
134
|
*/
|
|
156
|
-
static
|
|
157
|
-
return
|
|
135
|
+
static from(type, value) {
|
|
136
|
+
return new _Typed(_gaurd, type, value);
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Return a new ``uint8`` type for %%v%%.
|
|
140
|
+
*/
|
|
141
|
+
static uint8(v) {
|
|
142
|
+
return n(v, 8);
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Return a new ``uint16`` type for %%v%%.
|
|
146
|
+
*/
|
|
147
|
+
static uint16(v) {
|
|
148
|
+
return n(v, 16);
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Return a new ``uint24`` type for %%v%%.
|
|
152
|
+
*/
|
|
153
|
+
static uint24(v) {
|
|
154
|
+
return n(v, 24);
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Return a new ``uint32`` type for %%v%%.
|
|
158
|
+
*/
|
|
159
|
+
static uint32(v) {
|
|
160
|
+
return n(v, 32);
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Return a new ``uint40`` type for %%v%%.
|
|
164
|
+
*/
|
|
165
|
+
static uint40(v) {
|
|
166
|
+
return n(v, 40);
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Return a new ``uint48`` type for %%v%%.
|
|
170
|
+
*/
|
|
171
|
+
static uint48(v) {
|
|
172
|
+
return n(v, 48);
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Return a new ``uint56`` type for %%v%%.
|
|
176
|
+
*/
|
|
177
|
+
static uint56(v) {
|
|
178
|
+
return n(v, 56);
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* Return a new ``uint64`` type for %%v%%.
|
|
182
|
+
*/
|
|
183
|
+
static uint64(v) {
|
|
184
|
+
return n(v, 64);
|
|
185
|
+
}
|
|
186
|
+
/**
|
|
187
|
+
* Return a new ``uint72`` type for %%v%%.
|
|
188
|
+
*/
|
|
189
|
+
static uint72(v) {
|
|
190
|
+
return n(v, 72);
|
|
191
|
+
}
|
|
192
|
+
/**
|
|
193
|
+
* Return a new ``uint80`` type for %%v%%.
|
|
194
|
+
*/
|
|
195
|
+
static uint80(v) {
|
|
196
|
+
return n(v, 80);
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Return a new ``uint88`` type for %%v%%.
|
|
200
|
+
*/
|
|
201
|
+
static uint88(v) {
|
|
202
|
+
return n(v, 88);
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Return a new ``uint96`` type for %%v%%.
|
|
206
|
+
*/
|
|
207
|
+
static uint96(v) {
|
|
208
|
+
return n(v, 96);
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Return a new ``uint104`` type for %%v%%.
|
|
212
|
+
*/
|
|
213
|
+
static uint104(v) {
|
|
214
|
+
return n(v, 104);
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Return a new ``uint112`` type for %%v%%.
|
|
218
|
+
*/
|
|
219
|
+
static uint112(v) {
|
|
220
|
+
return n(v, 112);
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Return a new ``uint120`` type for %%v%%.
|
|
224
|
+
*/
|
|
225
|
+
static uint120(v) {
|
|
226
|
+
return n(v, 120);
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Return a new ``uint128`` type for %%v%%.
|
|
230
|
+
*/
|
|
231
|
+
static uint128(v) {
|
|
232
|
+
return n(v, 128);
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Return a new ``uint136`` type for %%v%%.
|
|
236
|
+
*/
|
|
237
|
+
static uint136(v) {
|
|
238
|
+
return n(v, 136);
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* Return a new ``uint144`` type for %%v%%.
|
|
242
|
+
*/
|
|
243
|
+
static uint144(v) {
|
|
244
|
+
return n(v, 144);
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Return a new ``uint152`` type for %%v%%.
|
|
248
|
+
*/
|
|
249
|
+
static uint152(v) {
|
|
250
|
+
return n(v, 152);
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Return a new ``uint160`` type for %%v%%.
|
|
254
|
+
*/
|
|
255
|
+
static uint160(v) {
|
|
256
|
+
return n(v, 160);
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* Return a new ``uint168`` type for %%v%%.
|
|
260
|
+
*/
|
|
261
|
+
static uint168(v) {
|
|
262
|
+
return n(v, 168);
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* Return a new ``uint176`` type for %%v%%.
|
|
266
|
+
*/
|
|
267
|
+
static uint176(v) {
|
|
268
|
+
return n(v, 176);
|
|
269
|
+
}
|
|
270
|
+
/**
|
|
271
|
+
* Return a new ``uint184`` type for %%v%%.
|
|
272
|
+
*/
|
|
273
|
+
static uint184(v) {
|
|
274
|
+
return n(v, 184);
|
|
275
|
+
}
|
|
276
|
+
/**
|
|
277
|
+
* Return a new ``uint192`` type for %%v%%.
|
|
278
|
+
*/
|
|
279
|
+
static uint192(v) {
|
|
280
|
+
return n(v, 192);
|
|
281
|
+
}
|
|
282
|
+
/**
|
|
283
|
+
* Return a new ``uint200`` type for %%v%%.
|
|
284
|
+
*/
|
|
285
|
+
static uint200(v) {
|
|
286
|
+
return n(v, 200);
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Return a new ``uint208`` type for %%v%%.
|
|
290
|
+
*/
|
|
291
|
+
static uint208(v) {
|
|
292
|
+
return n(v, 208);
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Return a new ``uint216`` type for %%v%%.
|
|
296
|
+
*/
|
|
297
|
+
static uint216(v) {
|
|
298
|
+
return n(v, 216);
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Return a new ``uint224`` type for %%v%%.
|
|
302
|
+
*/
|
|
303
|
+
static uint224(v) {
|
|
304
|
+
return n(v, 224);
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Return a new ``uint232`` type for %%v%%.
|
|
308
|
+
*/
|
|
309
|
+
static uint232(v) {
|
|
310
|
+
return n(v, 232);
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Return a new ``uint240`` type for %%v%%.
|
|
314
|
+
*/
|
|
315
|
+
static uint240(v) {
|
|
316
|
+
return n(v, 240);
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Return a new ``uint248`` type for %%v%%.
|
|
320
|
+
*/
|
|
321
|
+
static uint248(v) {
|
|
322
|
+
return n(v, 248);
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* Return a new ``uint256`` type for %%v%%.
|
|
326
|
+
*/
|
|
327
|
+
static uint256(v) {
|
|
328
|
+
return n(v, 256);
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Return a new ``uint256`` type for %%v%%.
|
|
332
|
+
*/
|
|
333
|
+
static uint(v) {
|
|
334
|
+
return n(v, 256);
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Return a new ``int8`` type for %%v%%.
|
|
338
|
+
*/
|
|
339
|
+
static int8(v) {
|
|
340
|
+
return n(v, -8);
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Return a new ``int16`` type for %%v%%.
|
|
344
|
+
*/
|
|
345
|
+
static int16(v) {
|
|
346
|
+
return n(v, -16);
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Return a new ``int24`` type for %%v%%.
|
|
350
|
+
*/
|
|
351
|
+
static int24(v) {
|
|
352
|
+
return n(v, -24);
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Return a new ``int32`` type for %%v%%.
|
|
356
|
+
*/
|
|
357
|
+
static int32(v) {
|
|
358
|
+
return n(v, -32);
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* Return a new ``int40`` type for %%v%%.
|
|
362
|
+
*/
|
|
363
|
+
static int40(v) {
|
|
364
|
+
return n(v, -40);
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Return a new ``int48`` type for %%v%%.
|
|
368
|
+
*/
|
|
369
|
+
static int48(v) {
|
|
370
|
+
return n(v, -48);
|
|
371
|
+
}
|
|
372
|
+
/**
|
|
373
|
+
* Return a new ``int56`` type for %%v%%.
|
|
374
|
+
*/
|
|
375
|
+
static int56(v) {
|
|
376
|
+
return n(v, -56);
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* Return a new ``int64`` type for %%v%%.
|
|
380
|
+
*/
|
|
381
|
+
static int64(v) {
|
|
382
|
+
return n(v, -64);
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* Return a new ``int72`` type for %%v%%.
|
|
386
|
+
*/
|
|
387
|
+
static int72(v) {
|
|
388
|
+
return n(v, -72);
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* Return a new ``int80`` type for %%v%%.
|
|
392
|
+
*/
|
|
393
|
+
static int80(v) {
|
|
394
|
+
return n(v, -80);
|
|
395
|
+
}
|
|
396
|
+
/**
|
|
397
|
+
* Return a new ``int88`` type for %%v%%.
|
|
398
|
+
*/
|
|
399
|
+
static int88(v) {
|
|
400
|
+
return n(v, -88);
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Return a new ``int96`` type for %%v%%.
|
|
404
|
+
*/
|
|
405
|
+
static int96(v) {
|
|
406
|
+
return n(v, -96);
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* Return a new ``int104`` type for %%v%%.
|
|
410
|
+
*/
|
|
411
|
+
static int104(v) {
|
|
412
|
+
return n(v, -104);
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* Return a new ``int112`` type for %%v%%.
|
|
416
|
+
*/
|
|
417
|
+
static int112(v) {
|
|
418
|
+
return n(v, -112);
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* Return a new ``int120`` type for %%v%%.
|
|
422
|
+
*/
|
|
423
|
+
static int120(v) {
|
|
424
|
+
return n(v, -120);
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* Return a new ``int128`` type for %%v%%.
|
|
428
|
+
*/
|
|
429
|
+
static int128(v) {
|
|
430
|
+
return n(v, -128);
|
|
431
|
+
}
|
|
432
|
+
/**
|
|
433
|
+
* Return a new ``int136`` type for %%v%%.
|
|
434
|
+
*/
|
|
435
|
+
static int136(v) {
|
|
436
|
+
return n(v, -136);
|
|
437
|
+
}
|
|
438
|
+
/**
|
|
439
|
+
* Return a new ``int144`` type for %%v%%.
|
|
440
|
+
*/
|
|
441
|
+
static int144(v) {
|
|
442
|
+
return n(v, -144);
|
|
443
|
+
}
|
|
444
|
+
/**
|
|
445
|
+
* Return a new ``int52`` type for %%v%%.
|
|
446
|
+
*/
|
|
447
|
+
static int152(v) {
|
|
448
|
+
return n(v, -152);
|
|
449
|
+
}
|
|
450
|
+
/**
|
|
451
|
+
* Return a new ``int160`` type for %%v%%.
|
|
452
|
+
*/
|
|
453
|
+
static int160(v) {
|
|
454
|
+
return n(v, -160);
|
|
455
|
+
}
|
|
456
|
+
/**
|
|
457
|
+
* Return a new ``int168`` type for %%v%%.
|
|
458
|
+
*/
|
|
459
|
+
static int168(v) {
|
|
460
|
+
return n(v, -168);
|
|
461
|
+
}
|
|
462
|
+
/**
|
|
463
|
+
* Return a new ``int176`` type for %%v%%.
|
|
464
|
+
*/
|
|
465
|
+
static int176(v) {
|
|
466
|
+
return n(v, -176);
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* Return a new ``int184`` type for %%v%%.
|
|
470
|
+
*/
|
|
471
|
+
static int184(v) {
|
|
472
|
+
return n(v, -184);
|
|
473
|
+
}
|
|
474
|
+
/**
|
|
475
|
+
* Return a new ``int92`` type for %%v%%.
|
|
476
|
+
*/
|
|
477
|
+
static int192(v) {
|
|
478
|
+
return n(v, -192);
|
|
479
|
+
}
|
|
480
|
+
/**
|
|
481
|
+
* Return a new ``int200`` type for %%v%%.
|
|
482
|
+
*/
|
|
483
|
+
static int200(v) {
|
|
484
|
+
return n(v, -200);
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* Return a new ``int208`` type for %%v%%.
|
|
488
|
+
*/
|
|
489
|
+
static int208(v) {
|
|
490
|
+
return n(v, -208);
|
|
491
|
+
}
|
|
492
|
+
/**
|
|
493
|
+
* Return a new ``int216`` type for %%v%%.
|
|
494
|
+
*/
|
|
495
|
+
static int216(v) {
|
|
496
|
+
return n(v, -216);
|
|
497
|
+
}
|
|
498
|
+
/**
|
|
499
|
+
* Return a new ``int224`` type for %%v%%.
|
|
500
|
+
*/
|
|
501
|
+
static int224(v) {
|
|
502
|
+
return n(v, -224);
|
|
503
|
+
}
|
|
504
|
+
/**
|
|
505
|
+
* Return a new ``int232`` type for %%v%%.
|
|
506
|
+
*/
|
|
507
|
+
static int232(v) {
|
|
508
|
+
return n(v, -232);
|
|
509
|
+
}
|
|
510
|
+
/**
|
|
511
|
+
* Return a new ``int240`` type for %%v%%.
|
|
512
|
+
*/
|
|
513
|
+
static int240(v) {
|
|
514
|
+
return n(v, -240);
|
|
515
|
+
}
|
|
516
|
+
/**
|
|
517
|
+
* Return a new ``int248`` type for %%v%%.
|
|
518
|
+
*/
|
|
519
|
+
static int248(v) {
|
|
520
|
+
return n(v, -248);
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* Return a new ``int256`` type for %%v%%.
|
|
524
|
+
*/
|
|
525
|
+
static int256(v) {
|
|
526
|
+
return n(v, -256);
|
|
527
|
+
}
|
|
528
|
+
/**
|
|
529
|
+
* Return a new ``int256`` type for %%v%%.
|
|
530
|
+
*/
|
|
531
|
+
static int(v) {
|
|
532
|
+
return n(v, -256);
|
|
533
|
+
}
|
|
534
|
+
/**
|
|
535
|
+
* Return a new ``bytes1`` type for %%v%%.
|
|
536
|
+
*/
|
|
537
|
+
static bytes1(v) {
|
|
538
|
+
return b(v, 1);
|
|
539
|
+
}
|
|
540
|
+
/**
|
|
541
|
+
* Return a new ``bytes2`` type for %%v%%.
|
|
542
|
+
*/
|
|
543
|
+
static bytes2(v) {
|
|
544
|
+
return b(v, 2);
|
|
545
|
+
}
|
|
546
|
+
/**
|
|
547
|
+
* Return a new ``bytes3`` type for %%v%%.
|
|
548
|
+
*/
|
|
549
|
+
static bytes3(v) {
|
|
550
|
+
return b(v, 3);
|
|
551
|
+
}
|
|
552
|
+
/**
|
|
553
|
+
* Return a new ``bytes4`` type for %%v%%.
|
|
554
|
+
*/
|
|
555
|
+
static bytes4(v) {
|
|
556
|
+
return b(v, 4);
|
|
557
|
+
}
|
|
558
|
+
/**
|
|
559
|
+
* Return a new ``bytes5`` type for %%v%%.
|
|
560
|
+
*/
|
|
561
|
+
static bytes5(v) {
|
|
562
|
+
return b(v, 5);
|
|
563
|
+
}
|
|
564
|
+
/**
|
|
565
|
+
* Return a new ``bytes6`` type for %%v%%.
|
|
566
|
+
*/
|
|
567
|
+
static bytes6(v) {
|
|
568
|
+
return b(v, 6);
|
|
569
|
+
}
|
|
570
|
+
/**
|
|
571
|
+
* Return a new ``bytes7`` type for %%v%%.
|
|
572
|
+
*/
|
|
573
|
+
static bytes7(v) {
|
|
574
|
+
return b(v, 7);
|
|
575
|
+
}
|
|
576
|
+
/**
|
|
577
|
+
* Return a new ``bytes8`` type for %%v%%.
|
|
578
|
+
*/
|
|
579
|
+
static bytes8(v) {
|
|
580
|
+
return b(v, 8);
|
|
581
|
+
}
|
|
582
|
+
/**
|
|
583
|
+
* Return a new ``bytes9`` type for %%v%%.
|
|
584
|
+
*/
|
|
585
|
+
static bytes9(v) {
|
|
586
|
+
return b(v, 9);
|
|
587
|
+
}
|
|
588
|
+
/**
|
|
589
|
+
* Return a new ``bytes10`` type for %%v%%.
|
|
590
|
+
*/
|
|
591
|
+
static bytes10(v) {
|
|
592
|
+
return b(v, 10);
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* Return a new ``bytes11`` type for %%v%%.
|
|
596
|
+
*/
|
|
597
|
+
static bytes11(v) {
|
|
598
|
+
return b(v, 11);
|
|
599
|
+
}
|
|
600
|
+
/**
|
|
601
|
+
* Return a new ``bytes12`` type for %%v%%.
|
|
602
|
+
*/
|
|
603
|
+
static bytes12(v) {
|
|
604
|
+
return b(v, 12);
|
|
605
|
+
}
|
|
606
|
+
/**
|
|
607
|
+
* Return a new ``bytes13`` type for %%v%%.
|
|
608
|
+
*/
|
|
609
|
+
static bytes13(v) {
|
|
610
|
+
return b(v, 13);
|
|
611
|
+
}
|
|
612
|
+
/**
|
|
613
|
+
* Return a new ``bytes14`` type for %%v%%.
|
|
614
|
+
*/
|
|
615
|
+
static bytes14(v) {
|
|
616
|
+
return b(v, 14);
|
|
617
|
+
}
|
|
618
|
+
/**
|
|
619
|
+
* Return a new ``bytes15`` type for %%v%%.
|
|
620
|
+
*/
|
|
621
|
+
static bytes15(v) {
|
|
622
|
+
return b(v, 15);
|
|
623
|
+
}
|
|
624
|
+
/**
|
|
625
|
+
* Return a new ``bytes16`` type for %%v%%.
|
|
626
|
+
*/
|
|
627
|
+
static bytes16(v) {
|
|
628
|
+
return b(v, 16);
|
|
629
|
+
}
|
|
630
|
+
/**
|
|
631
|
+
* Return a new ``bytes17`` type for %%v%%.
|
|
632
|
+
*/
|
|
633
|
+
static bytes17(v) {
|
|
634
|
+
return b(v, 17);
|
|
635
|
+
}
|
|
636
|
+
/**
|
|
637
|
+
* Return a new ``bytes18`` type for %%v%%.
|
|
638
|
+
*/
|
|
639
|
+
static bytes18(v) {
|
|
640
|
+
return b(v, 18);
|
|
641
|
+
}
|
|
642
|
+
/**
|
|
643
|
+
* Return a new ``bytes19`` type for %%v%%.
|
|
644
|
+
*/
|
|
645
|
+
static bytes19(v) {
|
|
646
|
+
return b(v, 19);
|
|
647
|
+
}
|
|
648
|
+
/**
|
|
649
|
+
* Return a new ``bytes20`` type for %%v%%.
|
|
650
|
+
*/
|
|
651
|
+
static bytes20(v) {
|
|
652
|
+
return b(v, 20);
|
|
653
|
+
}
|
|
654
|
+
/**
|
|
655
|
+
* Return a new ``bytes21`` type for %%v%%.
|
|
656
|
+
*/
|
|
657
|
+
static bytes21(v) {
|
|
658
|
+
return b(v, 21);
|
|
659
|
+
}
|
|
660
|
+
/**
|
|
661
|
+
* Return a new ``bytes22`` type for %%v%%.
|
|
662
|
+
*/
|
|
663
|
+
static bytes22(v) {
|
|
664
|
+
return b(v, 22);
|
|
665
|
+
}
|
|
666
|
+
/**
|
|
667
|
+
* Return a new ``bytes23`` type for %%v%%.
|
|
668
|
+
*/
|
|
669
|
+
static bytes23(v) {
|
|
670
|
+
return b(v, 23);
|
|
671
|
+
}
|
|
672
|
+
/**
|
|
673
|
+
* Return a new ``bytes24`` type for %%v%%.
|
|
674
|
+
*/
|
|
675
|
+
static bytes24(v) {
|
|
676
|
+
return b(v, 24);
|
|
677
|
+
}
|
|
678
|
+
/**
|
|
679
|
+
* Return a new ``bytes25`` type for %%v%%.
|
|
680
|
+
*/
|
|
681
|
+
static bytes25(v) {
|
|
682
|
+
return b(v, 25);
|
|
683
|
+
}
|
|
684
|
+
/**
|
|
685
|
+
* Return a new ``bytes26`` type for %%v%%.
|
|
686
|
+
*/
|
|
687
|
+
static bytes26(v) {
|
|
688
|
+
return b(v, 26);
|
|
689
|
+
}
|
|
690
|
+
/**
|
|
691
|
+
* Return a new ``bytes27`` type for %%v%%.
|
|
692
|
+
*/
|
|
693
|
+
static bytes27(v) {
|
|
694
|
+
return b(v, 27);
|
|
695
|
+
}
|
|
696
|
+
/**
|
|
697
|
+
* Return a new ``bytes28`` type for %%v%%.
|
|
698
|
+
*/
|
|
699
|
+
static bytes28(v) {
|
|
700
|
+
return b(v, 28);
|
|
701
|
+
}
|
|
702
|
+
/**
|
|
703
|
+
* Return a new ``bytes29`` type for %%v%%.
|
|
704
|
+
*/
|
|
705
|
+
static bytes29(v) {
|
|
706
|
+
return b(v, 29);
|
|
707
|
+
}
|
|
708
|
+
/**
|
|
709
|
+
* Return a new ``bytes30`` type for %%v%%.
|
|
710
|
+
*/
|
|
711
|
+
static bytes30(v) {
|
|
712
|
+
return b(v, 30);
|
|
713
|
+
}
|
|
714
|
+
/**
|
|
715
|
+
* Return a new ``bytes31`` type for %%v%%.
|
|
716
|
+
*/
|
|
717
|
+
static bytes31(v) {
|
|
718
|
+
return b(v, 31);
|
|
719
|
+
}
|
|
720
|
+
/**
|
|
721
|
+
* Return a new ``bytes32`` type for %%v%%.
|
|
722
|
+
*/
|
|
723
|
+
static bytes32(v) {
|
|
724
|
+
return b(v, 32);
|
|
725
|
+
}
|
|
726
|
+
/**
|
|
727
|
+
* Return a new ``address`` type for %%v%%.
|
|
728
|
+
*/
|
|
729
|
+
static address(v) {
|
|
730
|
+
return new _Typed(_gaurd, "address", v);
|
|
731
|
+
}
|
|
732
|
+
/**
|
|
733
|
+
* Return a new ``bool`` type for %%v%%.
|
|
734
|
+
*/
|
|
735
|
+
static bool(v) {
|
|
736
|
+
return new _Typed(_gaurd, "bool", !!v);
|
|
737
|
+
}
|
|
738
|
+
/**
|
|
739
|
+
* Return a new ``bytes`` type for %%v%%.
|
|
740
|
+
*/
|
|
741
|
+
static bytes(v) {
|
|
742
|
+
return new _Typed(_gaurd, "bytes", v);
|
|
743
|
+
}
|
|
744
|
+
/**
|
|
745
|
+
* Return a new ``string`` type for %%v%%.
|
|
746
|
+
*/
|
|
747
|
+
static string(v) {
|
|
748
|
+
return new _Typed(_gaurd, "string", v);
|
|
749
|
+
}
|
|
750
|
+
/**
|
|
751
|
+
* Return a new ``array`` type for %%v%%, allowing %%dynamic%% length.
|
|
752
|
+
*/
|
|
753
|
+
static array(v, dynamic) {
|
|
754
|
+
throw new Error("not implemented yet");
|
|
755
|
+
}
|
|
756
|
+
/**
|
|
757
|
+
* Return a new ``tuple`` type for %%v%%, with the optional %%name%%.
|
|
758
|
+
*/
|
|
759
|
+
static tuple(v, name) {
|
|
760
|
+
throw new Error("not implemented yet");
|
|
761
|
+
}
|
|
762
|
+
/**
|
|
763
|
+
* Return a new ``uint8`` type for %%v%%.
|
|
764
|
+
*/
|
|
765
|
+
static overrides(v) {
|
|
766
|
+
return new _Typed(_gaurd, "overrides", Object.assign({}, v));
|
|
767
|
+
}
|
|
768
|
+
/**
|
|
769
|
+
* Returns true only if %%value%% is a [[Typed]] instance.
|
|
770
|
+
*/
|
|
771
|
+
static isTyped(value) {
|
|
772
|
+
return value && typeof value === "object" && "_typedSymbol" in value && value._typedSymbol === _typedSymbol;
|
|
773
|
+
}
|
|
774
|
+
/**
|
|
775
|
+
* If the value is a [[Typed]] instance, validates the underlying value
|
|
776
|
+
* and returns it, otherwise returns value directly.
|
|
777
|
+
*
|
|
778
|
+
* This is useful for functions that with to accept either a [[Typed]]
|
|
779
|
+
* object or values.
|
|
780
|
+
*/
|
|
781
|
+
static dereference(value, type) {
|
|
782
|
+
if (_Typed.isTyped(value)) {
|
|
783
|
+
if (value.type !== type) {
|
|
784
|
+
throw new Error(`invalid type: expecetd ${type}, got ${value.type}`);
|
|
785
|
+
}
|
|
786
|
+
return value.value;
|
|
787
|
+
}
|
|
788
|
+
return value;
|
|
158
789
|
}
|
|
159
790
|
};
|
|
160
|
-
|
|
161
|
-
|
|
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
|
-
}
|
|
192
|
-
assertArgument(false, "invalid type", "type", param.type);
|
|
193
|
-
};
|
|
194
|
-
let AbiCoder = _AbiCoder;
|
|
791
|
+
_options = new WeakMap();
|
|
792
|
+
let Typed = _Typed;
|
|
195
793
|
export {
|
|
196
|
-
|
|
794
|
+
Typed
|
|
197
795
|
};
|
|
198
796
|
//# sourceMappingURL=standards-sdk.es91.js.map
|