@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,284 +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_ALLOCATORS_H_
16
- #define RAPIDJSON_ALLOCATORS_H_
17
-
18
- #include "rapidjson.h"
19
-
20
- RAPIDJSON_NAMESPACE_BEGIN
21
-
22
- ///////////////////////////////////////////////////////////////////////////////
23
- // Allocator
24
-
25
- /*! \class rapidjson::Allocator
26
- \brief Concept for allocating, resizing and freeing memory block.
27
-
28
- Note that Malloc() and Realloc() are non-static but Free() is static.
29
-
30
- So if an allocator need to support Free(), it needs to put its pointer in
31
- the header of memory block.
32
-
33
- \code
34
- concept Allocator {
35
- static const bool kNeedFree; //!< Whether this allocator needs to call Free().
36
-
37
- // Allocate a memory block.
38
- // \param size of the memory block in bytes.
39
- // \returns pointer to the memory block.
40
- void* Malloc(size_t size);
41
-
42
- // Resize a memory block.
43
- // \param originalPtr The pointer to current memory block. Null pointer is permitted.
44
- // \param originalSize The current size in bytes. (Design issue: since some allocator may not book-keep this, explicitly pass to it can save memory.)
45
- // \param newSize the new size in bytes.
46
- void* Realloc(void* originalPtr, size_t originalSize, size_t newSize);
47
-
48
- // Free a memory block.
49
- // \param pointer to the memory block. Null pointer is permitted.
50
- static void Free(void *ptr);
51
- };
52
- \endcode
53
- */
54
-
55
-
56
- /*! \def RAPIDJSON_ALLOCATOR_DEFUALT_CHUNK_CAPACITY
57
- \ingroup RAPIDJSON_CONFIG
58
- \brief User-defined kDefaultChunkCapacity definition.
59
-
60
- User can define this as any \c size that is a power of 2.
61
- */
62
-
63
- #ifndef RAPIDJSON_ALLOCATOR_DEFAULT_CHUNK_CAPACITY
64
- #define RAPIDJSON_ALLOCATOR_DEFAULT_CHUNK_CAPACITY (64 * 1024)
65
- #endif
66
-
67
-
68
- ///////////////////////////////////////////////////////////////////////////////
69
- // CrtAllocator
70
-
71
- //! C-runtime library allocator.
72
- /*! This class is just wrapper for standard C library memory routines.
73
- \note implements Allocator concept
74
- */
75
- class CrtAllocator {
76
- public:
77
- static const bool kNeedFree = true;
78
- void* Malloc(size_t size) {
79
- if (size) // behavior of malloc(0) is implementation defined.
80
- return std::malloc(size);
81
- else
82
- return NULL; // standardize to returning NULL.
83
- }
84
- void* Realloc(void* originalPtr, size_t originalSize, size_t newSize) {
85
- (void)originalSize;
86
- if (newSize == 0) {
87
- std::free(originalPtr);
88
- return NULL;
89
- }
90
- return std::realloc(originalPtr, newSize);
91
- }
92
- static void Free(void *ptr) { std::free(ptr); }
93
- };
94
-
95
- ///////////////////////////////////////////////////////////////////////////////
96
- // MemoryPoolAllocator
97
-
98
- //! Default memory allocator used by the parser and DOM.
99
- /*! This allocator allocate memory blocks from pre-allocated memory chunks.
100
-
101
- It does not free memory blocks. And Realloc() only allocate new memory.
102
-
103
- The memory chunks are allocated by BaseAllocator, which is CrtAllocator by default.
104
-
105
- User may also supply a buffer as the first chunk.
106
-
107
- If the user-buffer is full then additional chunks are allocated by BaseAllocator.
108
-
109
- The user-buffer is not deallocated by this allocator.
110
-
111
- \tparam BaseAllocator the allocator type for allocating memory chunks. Default is CrtAllocator.
112
- \note implements Allocator concept
113
- */
114
- template <typename BaseAllocator = CrtAllocator>
115
- class MemoryPoolAllocator {
116
- public:
117
- static const bool kNeedFree = false; //!< Tell users that no need to call Free() with this allocator. (concept Allocator)
118
-
119
- //! Constructor with chunkSize.
120
- /*! \param chunkSize The size of memory chunk. The default is kDefaultChunkSize.
121
- \param baseAllocator The allocator for allocating memory chunks.
122
- */
123
- MemoryPoolAllocator(size_t chunkSize = kDefaultChunkCapacity, BaseAllocator* baseAllocator = 0) :
124
- chunkHead_(0), chunk_capacity_(chunkSize), userBuffer_(0), baseAllocator_(baseAllocator), ownBaseAllocator_(0)
125
- {
126
- }
127
-
128
- //! Constructor with user-supplied buffer.
129
- /*! The user buffer will be used firstly. When it is full, memory pool allocates new chunk with chunk size.
130
-
131
- The user buffer will not be deallocated when this allocator is destructed.
132
-
133
- \param buffer User supplied buffer.
134
- \param size Size of the buffer in bytes. It must at least larger than sizeof(ChunkHeader).
135
- \param chunkSize The size of memory chunk. The default is kDefaultChunkSize.
136
- \param baseAllocator The allocator for allocating memory chunks.
137
- */
138
- MemoryPoolAllocator(void *buffer, size_t size, size_t chunkSize = kDefaultChunkCapacity, BaseAllocator* baseAllocator = 0) :
139
- chunkHead_(0), chunk_capacity_(chunkSize), userBuffer_(buffer), baseAllocator_(baseAllocator), ownBaseAllocator_(0)
140
- {
141
- RAPIDJSON_ASSERT(buffer != 0);
142
- RAPIDJSON_ASSERT(size > sizeof(ChunkHeader));
143
- chunkHead_ = reinterpret_cast<ChunkHeader*>(buffer);
144
- chunkHead_->capacity = size - sizeof(ChunkHeader);
145
- chunkHead_->size = 0;
146
- chunkHead_->next = 0;
147
- }
148
-
149
- //! Destructor.
150
- /*! This deallocates all memory chunks, excluding the user-supplied buffer.
151
- */
152
- ~MemoryPoolAllocator() {
153
- Clear();
154
- RAPIDJSON_DELETE(ownBaseAllocator_);
155
- }
156
-
157
- //! Deallocates all memory chunks, excluding the user-supplied buffer.
158
- void Clear() {
159
- while (chunkHead_ && chunkHead_ != userBuffer_) {
160
- ChunkHeader* next = chunkHead_->next;
161
- baseAllocator_->Free(chunkHead_);
162
- chunkHead_ = next;
163
- }
164
- if (chunkHead_ && chunkHead_ == userBuffer_)
165
- chunkHead_->size = 0; // Clear user buffer
166
- }
167
-
168
- //! Computes the total capacity of allocated memory chunks.
169
- /*! \return total capacity in bytes.
170
- */
171
- size_t Capacity() const {
172
- size_t capacity = 0;
173
- for (ChunkHeader* c = chunkHead_; c != 0; c = c->next)
174
- capacity += c->capacity;
175
- return capacity;
176
- }
177
-
178
- //! Computes the memory blocks allocated.
179
- /*! \return total used bytes.
180
- */
181
- size_t Size() const {
182
- size_t size = 0;
183
- for (ChunkHeader* c = chunkHead_; c != 0; c = c->next)
184
- size += c->size;
185
- return size;
186
- }
187
-
188
- //! Allocates a memory block. (concept Allocator)
189
- void* Malloc(size_t size) {
190
- if (!size)
191
- return NULL;
192
-
193
- size = RAPIDJSON_ALIGN(size);
194
- if (chunkHead_ == 0 || chunkHead_->size + size > chunkHead_->capacity)
195
- if (!AddChunk(chunk_capacity_ > size ? chunk_capacity_ : size))
196
- return NULL;
197
-
198
- void *buffer = reinterpret_cast<char *>(chunkHead_) + RAPIDJSON_ALIGN(sizeof(ChunkHeader)) + chunkHead_->size;
199
- chunkHead_->size += size;
200
- return buffer;
201
- }
202
-
203
- //! Resizes a memory block (concept Allocator)
204
- void* Realloc(void* originalPtr, size_t originalSize, size_t newSize) {
205
- if (originalPtr == 0)
206
- return Malloc(newSize);
207
-
208
- if (newSize == 0)
209
- return NULL;
210
-
211
- originalSize = RAPIDJSON_ALIGN(originalSize);
212
- newSize = RAPIDJSON_ALIGN(newSize);
213
-
214
- // Do not shrink if new size is smaller than original
215
- if (originalSize >= newSize)
216
- return originalPtr;
217
-
218
- // Simply expand it if it is the last allocation and there is sufficient space
219
- if (originalPtr == reinterpret_cast<char *>(chunkHead_) + RAPIDJSON_ALIGN(sizeof(ChunkHeader)) + chunkHead_->size - originalSize) {
220
- size_t increment = static_cast<size_t>(newSize - originalSize);
221
- if (chunkHead_->size + increment <= chunkHead_->capacity) {
222
- chunkHead_->size += increment;
223
- return originalPtr;
224
- }
225
- }
226
-
227
- // Realloc process: allocate and copy memory, do not free original buffer.
228
- if (void* newBuffer = Malloc(newSize)) {
229
- if (originalSize)
230
- std::memcpy(newBuffer, originalPtr, originalSize);
231
- return newBuffer;
232
- }
233
- else
234
- return NULL;
235
- }
236
-
237
- //! Frees a memory block (concept Allocator)
238
- static void Free(void *ptr) { (void)ptr; } // Do nothing
239
-
240
- private:
241
- //! Copy constructor is not permitted.
242
- MemoryPoolAllocator(const MemoryPoolAllocator& rhs) /* = delete */;
243
- //! Copy assignment operator is not permitted.
244
- MemoryPoolAllocator& operator=(const MemoryPoolAllocator& rhs) /* = delete */;
245
-
246
- //! Creates a new chunk.
247
- /*! \param capacity Capacity of the chunk in bytes.
248
- \return true if success.
249
- */
250
- bool AddChunk(size_t capacity) {
251
- if (!baseAllocator_)
252
- ownBaseAllocator_ = baseAllocator_ = RAPIDJSON_NEW(BaseAllocator)();
253
- if (ChunkHeader* chunk = reinterpret_cast<ChunkHeader*>(baseAllocator_->Malloc(RAPIDJSON_ALIGN(sizeof(ChunkHeader)) + capacity))) {
254
- chunk->capacity = capacity;
255
- chunk->size = 0;
256
- chunk->next = chunkHead_;
257
- chunkHead_ = chunk;
258
- return true;
259
- }
260
- else
261
- return false;
262
- }
263
-
264
- static const int kDefaultChunkCapacity = RAPIDJSON_ALLOCATOR_DEFAULT_CHUNK_CAPACITY; //!< Default chunk capacity.
265
-
266
- //! Chunk header for perpending to each chunk.
267
- /*! Chunks are stored as a singly linked list.
268
- */
269
- struct ChunkHeader {
270
- size_t capacity; //!< Capacity of the chunk in bytes (excluding the header itself).
271
- size_t size; //!< Current size of allocated memory in bytes.
272
- ChunkHeader *next; //!< Next chunk in the linked list.
273
- };
274
-
275
- ChunkHeader *chunkHead_; //!< Head of the chunk linked-list. Only the head chunk serves allocation.
276
- size_t chunk_capacity_; //!< The minimum capacity of chunk when they are allocated.
277
- void *userBuffer_; //!< User supplied buffer.
278
- BaseAllocator* baseAllocator_; //!< base allocator for allocating memory chunks.
279
- BaseAllocator* ownBaseAllocator_; //!< base allocator created by this object.
280
- };
281
-
282
- RAPIDJSON_NAMESPACE_END
283
-
284
- #endif // RAPIDJSON_ENCODINGS_H_
@@ -1,78 +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_CURSORSTREAMWRAPPER_H_
16
- #define RAPIDJSON_CURSORSTREAMWRAPPER_H_
17
-
18
- #include "stream.h"
19
-
20
- #if defined(__GNUC__)
21
- RAPIDJSON_DIAG_PUSH
22
- RAPIDJSON_DIAG_OFF(effc++)
23
- #endif
24
-
25
- #if defined(_MSC_VER) && _MSC_VER <= 1800
26
- RAPIDJSON_DIAG_PUSH
27
- RAPIDJSON_DIAG_OFF(4702) // unreachable code
28
- RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated
29
- #endif
30
-
31
- RAPIDJSON_NAMESPACE_BEGIN
32
-
33
-
34
- //! Cursor stream wrapper for counting line and column number if error exists.
35
- /*!
36
- \tparam InputStream Any stream that implements Stream Concept
37
- */
38
- template <typename InputStream, typename Encoding = UTF8<> >
39
- class CursorStreamWrapper : public GenericStreamWrapper<InputStream, Encoding> {
40
- public:
41
- typedef typename Encoding::Ch Ch;
42
-
43
- CursorStreamWrapper(InputStream& is):
44
- GenericStreamWrapper<InputStream, Encoding>(is), line_(1), col_(0) {}
45
-
46
- // counting line and column number
47
- Ch Take() {
48
- Ch ch = this->is_.Take();
49
- if(ch == '\n') {
50
- line_ ++;
51
- col_ = 0;
52
- } else {
53
- col_ ++;
54
- }
55
- return ch;
56
- }
57
-
58
- //! Get the error line number, if error exists.
59
- size_t GetLine() const { return line_; }
60
- //! Get the error column number, if error exists.
61
- size_t GetColumn() const { return col_; }
62
-
63
- private:
64
- size_t line_; //!< Current Line
65
- size_t col_; //!< Current Column
66
- };
67
-
68
- #if defined(_MSC_VER) && _MSC_VER <= 1800
69
- RAPIDJSON_DIAG_POP
70
- #endif
71
-
72
- #if defined(__GNUC__)
73
- RAPIDJSON_DIAG_POP
74
- #endif
75
-
76
- RAPIDJSON_NAMESPACE_END
77
-
78
- #endif // RAPIDJSON_CURSORSTREAMWRAPPER_H_