@eosrio/node-abieos 2.1.1 → 2.2.0

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.
Files changed (99) hide show
  1. package/README.md +4 -1
  2. package/dist/abieos.node +0 -0
  3. package/lib/abieos.d.ts +19 -0
  4. package/lib/abieos.d.ts.map +1 -0
  5. package/lib/abieos.js +100 -0
  6. package/lib/abieos.ts +107 -0
  7. package/package.json +13 -8
  8. package/.idea/modules.xml +0 -8
  9. package/.idea/node-abieos.iml +0 -12
  10. package/.idea/vcs.xml +0 -9
  11. package/.idea/workspace.xml +0 -66
  12. package/CMakeLists.txt +0 -35
  13. package/abieos.d.ts +0 -21
  14. package/abieos.js +0 -59
  15. package/eosio.json +0 -1596
  16. package/include/.clang-format +0 -76
  17. package/include/eosio/abi.hpp +0 -393
  18. package/include/eosio/asset.hpp +0 -458
  19. package/include/eosio/bytes.hpp +0 -27
  20. package/include/eosio/chain_conversions.hpp +0 -450
  21. package/include/eosio/chain_types.hpp +0 -14
  22. package/include/eosio/check.hpp +0 -178
  23. package/include/eosio/convert.hpp +0 -95
  24. package/include/eosio/crypto.hpp +0 -148
  25. package/include/eosio/eosio_outcome.hpp +0 -41
  26. package/include/eosio/fixed_bytes.hpp +0 -250
  27. package/include/eosio/float.hpp +0 -35
  28. package/include/eosio/for_each_field.hpp +0 -48
  29. package/include/eosio/fpconv.c +0 -336
  30. package/include/eosio/fpconv.h +0 -41
  31. package/include/eosio/fpconv.license +0 -23
  32. package/include/eosio/from_bin.hpp +0 -272
  33. package/include/eosio/from_json.hpp +0 -749
  34. package/include/eosio/from_string.hpp +0 -28
  35. package/include/eosio/map_macro.h +0 -64
  36. package/include/eosio/murmur.hpp +0 -55
  37. package/include/eosio/name.hpp +0 -178
  38. package/include/eosio/opaque.hpp +0 -184
  39. package/include/eosio/operators.hpp +0 -71
  40. package/include/eosio/powers.h +0 -76
  41. package/include/eosio/reflection.hpp +0 -61
  42. package/include/eosio/ship_protocol.hpp +0 -971
  43. package/include/eosio/stream.hpp +0 -235
  44. package/include/eosio/symbol.hpp +0 -300
  45. package/include/eosio/time.hpp +0 -264
  46. package/include/eosio/to_bin.hpp +0 -189
  47. package/include/eosio/to_json.hpp +0 -334
  48. package/include/eosio/to_key.hpp +0 -305
  49. package/include/eosio/types.hpp +0 -103
  50. package/include/eosio/varint.hpp +0 -452
  51. package/include/outcome-basic.hpp +0 -6836
  52. package/include/rapidjson/allocators.h +0 -284
  53. package/include/rapidjson/cursorstreamwrapper.h +0 -78
  54. package/include/rapidjson/document.h +0 -2646
  55. package/include/rapidjson/encodedstream.h +0 -299
  56. package/include/rapidjson/encodings.h +0 -716
  57. package/include/rapidjson/error/en.h +0 -74
  58. package/include/rapidjson/error/error.h +0 -161
  59. package/include/rapidjson/filereadstream.h +0 -99
  60. package/include/rapidjson/filewritestream.h +0 -104
  61. package/include/rapidjson/fwd.h +0 -151
  62. package/include/rapidjson/internal/biginteger.h +0 -290
  63. package/include/rapidjson/internal/diyfp.h +0 -271
  64. package/include/rapidjson/internal/dtoa.h +0 -245
  65. package/include/rapidjson/internal/ieee754.h +0 -78
  66. package/include/rapidjson/internal/itoa.h +0 -308
  67. package/include/rapidjson/internal/meta.h +0 -186
  68. package/include/rapidjson/internal/pow10.h +0 -55
  69. package/include/rapidjson/internal/regex.h +0 -732
  70. package/include/rapidjson/internal/stack.h +0 -231
  71. package/include/rapidjson/internal/strfunc.h +0 -69
  72. package/include/rapidjson/internal/strtod.h +0 -290
  73. package/include/rapidjson/internal/swap.h +0 -46
  74. package/include/rapidjson/istreamwrapper.h +0 -113
  75. package/include/rapidjson/memorybuffer.h +0 -70
  76. package/include/rapidjson/memorystream.h +0 -71
  77. package/include/rapidjson/msinttypes/inttypes.h +0 -316
  78. package/include/rapidjson/msinttypes/stdint.h +0 -300
  79. package/include/rapidjson/ostreamwrapper.h +0 -81
  80. package/include/rapidjson/pointer.h +0 -1357
  81. package/include/rapidjson/prettywriter.h +0 -277
  82. package/include/rapidjson/rapidjson.h +0 -654
  83. package/include/rapidjson/reader.h +0 -2230
  84. package/include/rapidjson/schema.h +0 -2494
  85. package/include/rapidjson/stream.h +0 -223
  86. package/include/rapidjson/stringbuffer.h +0 -121
  87. package/include/rapidjson/writer.h +0 -710
  88. package/src/abi.cpp +0 -274
  89. package/src/abieos.cpp +0 -334
  90. package/src/abieos.h +0 -91
  91. package/src/abieos.hpp +0 -1011
  92. package/src/abieos_exception.hpp +0 -89
  93. package/src/abieos_numeric.hpp +0 -94
  94. package/src/abieos_ripemd160.hpp +0 -417
  95. package/src/crypto.cpp +0 -215
  96. package/src/main.cpp +0 -242
  97. package/src/ship.abi.cpp +0 -695
  98. package/tools/CMakeLists.txt +0 -9
  99. package/tools/name.cpp +0 -86
@@ -1,277 +0,0 @@
1
- // Tencent is pleased to support the open source community by making RapidJSON available.
2
- //
3
- // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. All rights reserved.
4
- //
5
- // Licensed under the MIT License (the "License"); you may not use this file except
6
- // in compliance with the License. You may obtain a copy of the License at
7
- //
8
- // http://opensource.org/licenses/MIT
9
- //
10
- // Unless required by applicable law or agreed to in writing, software distributed
11
- // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
12
- // CONDITIONS OF ANY KIND, either express or implied. See the License for the
13
- // specific language governing permissions and limitations under the License.
14
-
15
- #ifndef RAPIDJSON_PRETTYWRITER_H_
16
- #define RAPIDJSON_PRETTYWRITER_H_
17
-
18
- #include "writer.h"
19
-
20
- #ifdef __GNUC__
21
- RAPIDJSON_DIAG_PUSH
22
- RAPIDJSON_DIAG_OFF(effc++)
23
- #endif
24
-
25
- #if defined(__clang__)
26
- RAPIDJSON_DIAG_PUSH
27
- RAPIDJSON_DIAG_OFF(c++98-compat)
28
- #endif
29
-
30
- RAPIDJSON_NAMESPACE_BEGIN
31
-
32
- //! Combination of PrettyWriter format flags.
33
- /*! \see PrettyWriter::SetFormatOptions
34
- */
35
- enum PrettyFormatOptions {
36
- kFormatDefault = 0, //!< Default pretty formatting.
37
- kFormatSingleLineArray = 1 //!< Format arrays on a single line.
38
- };
39
-
40
- //! Writer with indentation and spacing.
41
- /*!
42
- \tparam OutputStream Type of output os.
43
- \tparam SourceEncoding Encoding of source string.
44
- \tparam TargetEncoding Encoding of output stream.
45
- \tparam StackAllocator Type of allocator for allocating memory of stack.
46
- */
47
- template<typename OutputStream, typename SourceEncoding = UTF8<>, typename TargetEncoding = UTF8<>, typename StackAllocator = CrtAllocator, unsigned writeFlags = kWriteDefaultFlags>
48
- class PrettyWriter : public Writer<OutputStream, SourceEncoding, TargetEncoding, StackAllocator, writeFlags> {
49
- public:
50
- typedef Writer<OutputStream, SourceEncoding, TargetEncoding, StackAllocator, writeFlags> Base;
51
- typedef typename Base::Ch Ch;
52
-
53
- //! Constructor
54
- /*! \param os Output stream.
55
- \param allocator User supplied allocator. If it is null, it will create a private one.
56
- \param levelDepth Initial capacity of stack.
57
- */
58
- explicit PrettyWriter(OutputStream& os, StackAllocator* allocator = 0, size_t levelDepth = Base::kDefaultLevelDepth) :
59
- Base(os, allocator, levelDepth), indentChar_(' '), indentCharCount_(4), formatOptions_(kFormatDefault) {}
60
-
61
-
62
- explicit PrettyWriter(StackAllocator* allocator = 0, size_t levelDepth = Base::kDefaultLevelDepth) :
63
- Base(allocator, levelDepth), indentChar_(' '), indentCharCount_(4) {}
64
-
65
- #if RAPIDJSON_HAS_CXX11_RVALUE_REFS
66
- PrettyWriter(PrettyWriter&& rhs) :
67
- Base(std::forward<PrettyWriter>(rhs)), indentChar_(rhs.indentChar_), indentCharCount_(rhs.indentCharCount_), formatOptions_(rhs.formatOptions_) {}
68
- #endif
69
-
70
- //! Set custom indentation.
71
- /*! \param indentChar Character for indentation. Must be whitespace character (' ', '\\t', '\\n', '\\r').
72
- \param indentCharCount Number of indent characters for each indentation level.
73
- \note The default indentation is 4 spaces.
74
- */
75
- PrettyWriter& SetIndent(Ch indentChar, unsigned indentCharCount) {
76
- RAPIDJSON_ASSERT(indentChar == ' ' || indentChar == '\t' || indentChar == '\n' || indentChar == '\r');
77
- indentChar_ = indentChar;
78
- indentCharCount_ = indentCharCount;
79
- return *this;
80
- }
81
-
82
- //! Set pretty writer formatting options.
83
- /*! \param options Formatting options.
84
- */
85
- PrettyWriter& SetFormatOptions(PrettyFormatOptions options) {
86
- formatOptions_ = options;
87
- return *this;
88
- }
89
-
90
- /*! @name Implementation of Handler
91
- \see Handler
92
- */
93
- //@{
94
-
95
- bool Null() { PrettyPrefix(kNullType); return Base::EndValue(Base::WriteNull()); }
96
- bool Bool(bool b) { PrettyPrefix(b ? kTrueType : kFalseType); return Base::EndValue(Base::WriteBool(b)); }
97
- bool Int(int i) { PrettyPrefix(kNumberType); return Base::EndValue(Base::WriteInt(i)); }
98
- bool Uint(unsigned u) { PrettyPrefix(kNumberType); return Base::EndValue(Base::WriteUint(u)); }
99
- bool Int64(int64_t i64) { PrettyPrefix(kNumberType); return Base::EndValue(Base::WriteInt64(i64)); }
100
- bool Uint64(uint64_t u64) { PrettyPrefix(kNumberType); return Base::EndValue(Base::WriteUint64(u64)); }
101
- bool Double(double d) { PrettyPrefix(kNumberType); return Base::EndValue(Base::WriteDouble(d)); }
102
-
103
- bool RawNumber(const Ch* str, SizeType length, bool copy = false) {
104
- RAPIDJSON_ASSERT(str != 0);
105
- (void)copy;
106
- PrettyPrefix(kNumberType);
107
- return Base::EndValue(Base::WriteString(str, length));
108
- }
109
-
110
- bool String(const Ch* str, SizeType length, bool copy = false) {
111
- RAPIDJSON_ASSERT(str != 0);
112
- (void)copy;
113
- PrettyPrefix(kStringType);
114
- return Base::EndValue(Base::WriteString(str, length));
115
- }
116
-
117
- #if RAPIDJSON_HAS_STDSTRING
118
- bool String(const std::basic_string<Ch>& str) {
119
- return String(str.data(), SizeType(str.size()));
120
- }
121
- #endif
122
-
123
- bool StartObject() {
124
- PrettyPrefix(kObjectType);
125
- new (Base::level_stack_.template Push<typename Base::Level>()) typename Base::Level(false);
126
- return Base::WriteStartObject();
127
- }
128
-
129
- bool Key(const Ch* str, SizeType length, bool copy = false) { return String(str, length, copy); }
130
-
131
- #if RAPIDJSON_HAS_STDSTRING
132
- bool Key(const std::basic_string<Ch>& str) {
133
- return Key(str.data(), SizeType(str.size()));
134
- }
135
- #endif
136
-
137
- bool EndObject(SizeType memberCount = 0) {
138
- (void)memberCount;
139
- RAPIDJSON_ASSERT(Base::level_stack_.GetSize() >= sizeof(typename Base::Level)); // not inside an Object
140
- RAPIDJSON_ASSERT(!Base::level_stack_.template Top<typename Base::Level>()->inArray); // currently inside an Array, not Object
141
- RAPIDJSON_ASSERT(0 == Base::level_stack_.template Top<typename Base::Level>()->valueCount % 2); // Object has a Key without a Value
142
-
143
- bool empty = Base::level_stack_.template Pop<typename Base::Level>(1)->valueCount == 0;
144
-
145
- if (!empty) {
146
- Base::os_->Put('\n');
147
- WriteIndent();
148
- }
149
- bool ret = Base::EndValue(Base::WriteEndObject());
150
- (void)ret;
151
- RAPIDJSON_ASSERT(ret == true);
152
- if (Base::level_stack_.Empty()) // end of json text
153
- Base::Flush();
154
- return true;
155
- }
156
-
157
- bool StartArray() {
158
- PrettyPrefix(kArrayType);
159
- new (Base::level_stack_.template Push<typename Base::Level>()) typename Base::Level(true);
160
- return Base::WriteStartArray();
161
- }
162
-
163
- bool EndArray(SizeType memberCount = 0) {
164
- (void)memberCount;
165
- RAPIDJSON_ASSERT(Base::level_stack_.GetSize() >= sizeof(typename Base::Level));
166
- RAPIDJSON_ASSERT(Base::level_stack_.template Top<typename Base::Level>()->inArray);
167
- bool empty = Base::level_stack_.template Pop<typename Base::Level>(1)->valueCount == 0;
168
-
169
- if (!empty && !(formatOptions_ & kFormatSingleLineArray)) {
170
- Base::os_->Put('\n');
171
- WriteIndent();
172
- }
173
- bool ret = Base::EndValue(Base::WriteEndArray());
174
- (void)ret;
175
- RAPIDJSON_ASSERT(ret == true);
176
- if (Base::level_stack_.Empty()) // end of json text
177
- Base::Flush();
178
- return true;
179
- }
180
-
181
- //@}
182
-
183
- /*! @name Convenience extensions */
184
- //@{
185
-
186
- //! Simpler but slower overload.
187
- bool String(const Ch* str) { return String(str, internal::StrLen(str)); }
188
- bool Key(const Ch* str) { return Key(str, internal::StrLen(str)); }
189
-
190
- //@}
191
-
192
- //! Write a raw JSON value.
193
- /*!
194
- For user to write a stringified JSON as a value.
195
-
196
- \param json A well-formed JSON value. It should not contain null character within [0, length - 1] range.
197
- \param length Length of the json.
198
- \param type Type of the root of json.
199
- \note When using PrettyWriter::RawValue(), the result json may not be indented correctly.
200
- */
201
- bool RawValue(const Ch* json, size_t length, Type type) {
202
- RAPIDJSON_ASSERT(json != 0);
203
- PrettyPrefix(type);
204
- return Base::EndValue(Base::WriteRawValue(json, length));
205
- }
206
-
207
- protected:
208
- void PrettyPrefix(Type type) {
209
- (void)type;
210
- if (Base::level_stack_.GetSize() != 0) { // this value is not at root
211
- typename Base::Level* level = Base::level_stack_.template Top<typename Base::Level>();
212
-
213
- if (level->inArray) {
214
- if (level->valueCount > 0) {
215
- Base::os_->Put(','); // add comma if it is not the first element in array
216
- if (formatOptions_ & kFormatSingleLineArray)
217
- Base::os_->Put(' ');
218
- }
219
-
220
- if (!(formatOptions_ & kFormatSingleLineArray)) {
221
- Base::os_->Put('\n');
222
- WriteIndent();
223
- }
224
- }
225
- else { // in object
226
- if (level->valueCount > 0) {
227
- if (level->valueCount % 2 == 0) {
228
- Base::os_->Put(',');
229
- Base::os_->Put('\n');
230
- }
231
- else {
232
- Base::os_->Put(':');
233
- Base::os_->Put(' ');
234
- }
235
- }
236
- else
237
- Base::os_->Put('\n');
238
-
239
- if (level->valueCount % 2 == 0)
240
- WriteIndent();
241
- }
242
- if (!level->inArray && level->valueCount % 2 == 0)
243
- RAPIDJSON_ASSERT(type == kStringType); // if it's in object, then even number should be a name
244
- level->valueCount++;
245
- }
246
- else {
247
- RAPIDJSON_ASSERT(!Base::hasRoot_); // Should only has one and only one root.
248
- Base::hasRoot_ = true;
249
- }
250
- }
251
-
252
- void WriteIndent() {
253
- size_t count = (Base::level_stack_.GetSize() / sizeof(typename Base::Level)) * indentCharCount_;
254
- PutN(*Base::os_, static_cast<typename OutputStream::Ch>(indentChar_), count);
255
- }
256
-
257
- Ch indentChar_;
258
- unsigned indentCharCount_;
259
- PrettyFormatOptions formatOptions_;
260
-
261
- private:
262
- // Prohibit copy constructor & assignment operator.
263
- PrettyWriter(const PrettyWriter&);
264
- PrettyWriter& operator=(const PrettyWriter&);
265
- };
266
-
267
- RAPIDJSON_NAMESPACE_END
268
-
269
- #if defined(__clang__)
270
- RAPIDJSON_DIAG_POP
271
- #endif
272
-
273
- #ifdef __GNUC__
274
- RAPIDJSON_DIAG_POP
275
- #endif
276
-
277
- #endif // RAPIDJSON_RAPIDJSON_H_