viz-js-lib 0.11.0 → 0.12.4
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/.qoder/docs/spec/viz-dns-nameserver-spec.md +982 -0
- package/.qoder/docs/viz-cpp-node-docs/data-types.md +322 -0
- package/.qoder/docs/viz-cpp-node-docs/index.md +160 -0
- package/.qoder/docs/viz-cpp-node-docs/op-account-market.md +236 -0
- package/.qoder/docs/viz-cpp-node-docs/op-account.md +199 -0
- package/.qoder/docs/viz-cpp-node-docs/op-award.md +162 -0
- package/.qoder/docs/viz-cpp-node-docs/op-committee.md +193 -0
- package/.qoder/docs/viz-cpp-node-docs/op-content.md +157 -0
- package/.qoder/docs/viz-cpp-node-docs/op-escrow.md +224 -0
- package/.qoder/docs/viz-cpp-node-docs/op-invite.md +219 -0
- package/.qoder/docs/viz-cpp-node-docs/op-proposal.md +229 -0
- package/.qoder/docs/viz-cpp-node-docs/op-recovery.md +188 -0
- package/.qoder/docs/viz-cpp-node-docs/op-subscription.md +146 -0
- package/.qoder/docs/viz-cpp-node-docs/op-transfer-vesting.md +224 -0
- package/.qoder/docs/viz-cpp-node-docs/op-witness.md +252 -0
- package/.qoder/docs/viz-cpp-node-docs/plugins.md +887 -0
- package/.qoder/docs/viz-cpp-node-docs/virtual-operations.md +513 -0
- package/.qoder/repowiki/en/content/API Reference/API Reference.md +724 -0
- package/.qoder/repowiki/en/content/API Reference/Configuration Options.md +410 -0
- package/.qoder/repowiki/en/content/API Reference/Core API Methods.md +547 -0
- package/.qoder/repowiki/en/content/API Reference/Streaming APIs.md +380 -0
- package/.qoder/repowiki/en/content/API Reference/Transport Layer.md +341 -0
- package/.qoder/repowiki/en/content/API Reference/VIZ Blockchain Operations Coverage Status.md +427 -0
- package/.qoder/repowiki/en/content/Authentication & Cryptography/Authentication & Cryptography.md +430 -0
- package/.qoder/repowiki/en/content/Authentication & Cryptography/Digital Signatures.md +462 -0
- package/.qoder/repowiki/en/content/Authentication & Cryptography/Key Management.md +456 -0
- package/.qoder/repowiki/en/content/Authentication & Cryptography/Memo Encryption.md +331 -0
- package/.qoder/repowiki/en/content/Authentication & Cryptography/Security Practices.md +488 -0
- package/.qoder/repowiki/en/content/Broadcast Transactions/Broadcast Transactions.md +432 -0
- package/.qoder/repowiki/en/content/Broadcast Transactions/Network Broadcasting.md +418 -0
- package/.qoder/repowiki/en/content/Broadcast Transactions/Operation Construction.md +352 -0
- package/.qoder/repowiki/en/content/Broadcast Transactions/Transaction Preparation.md +353 -0
- package/.qoder/repowiki/en/content/Broadcast Transactions/Transaction Signing.md +404 -0
- package/.qoder/repowiki/en/content/Data Serialization/Data Serialization.md +540 -0
- package/.qoder/repowiki/en/content/Data Serialization/Encoding & Decoding.md +463 -0
- package/.qoder/repowiki/en/content/Data Serialization/Object Templates.md +413 -0
- package/.qoder/repowiki/en/content/Data Serialization/Type System.md +514 -0
- package/.qoder/repowiki/en/content/Data Serialization/Validation Rules.md +439 -0
- package/.qoder/repowiki/en/content/Examples & Tutorials.md +485 -0
- package/.qoder/repowiki/en/content/Getting Started.md +345 -0
- package/.qoder/repowiki/en/content/Testing & Development.md +637 -0
- package/.qoder/repowiki/en/content/Utilities & Helpers.md +557 -0
- package/.qoder/repowiki/en/meta/repowiki-metadata.json +1 -0
- package/VIZ-JS-LIB-COVERAGE-STATUS.md +356 -0
- package/config.json +3 -1
- package/dist/statistics.html +1 -1
- package/dist/viz-tests.min.js +32 -42
- package/dist/viz-tests.min.js.gz +0 -0
- package/dist/viz.min.js +8 -18
- package/dist/viz.min.js.gz +0 -0
- package/lib/api/methods.js +24 -0
- package/lib/auth/serializer/src/ChainTypes.js +2 -1
- package/lib/auth/serializer/src/operations.js +35 -2
- package/lib/broadcast/index.js +29 -15
- package/lib/broadcast/operations.js +4 -0
- package/lib/dns.js +658 -0
- package/lib/index.js +3 -1
- package/package.json +3 -2
- package/test/dns.test.js +395 -0
- package/webpack/makeConfig.js +3 -0
|
@@ -0,0 +1,322 @@
|
|
|
1
|
+
# VIZ Blockchain — Common Data Types
|
|
2
|
+
|
|
3
|
+
This document describes all shared data types used across VIZ protocol operations and virtual operations. These types appear as field types throughout operation structures.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Primitive Types
|
|
8
|
+
|
|
9
|
+
| C++ type | JSON representation | Description |
|
|
10
|
+
|---|---|---|
|
|
11
|
+
| `string` | `string` | UTF-8 string |
|
|
12
|
+
| `bool` | `boolean` | true / false |
|
|
13
|
+
| `uint8_t` | `integer` | Unsigned 8-bit integer |
|
|
14
|
+
| `uint16_t` | `integer` | Unsigned 16-bit integer (0–65535) |
|
|
15
|
+
| `int16_t` | `integer` | Signed 16-bit integer (-32768–32767) |
|
|
16
|
+
| `uint32_t` | `integer` | Unsigned 32-bit integer |
|
|
17
|
+
| `int32_t` | `integer` | Signed 32-bit integer |
|
|
18
|
+
| `uint64_t` | `string` or `integer` | Unsigned 64-bit integer (use string in JS to avoid overflow) |
|
|
19
|
+
| `int64_t` | `string` or `integer` | Signed 64-bit integer |
|
|
20
|
+
| `share_type` | `integer` | Alias for `safe<int64_t>` — token satoshi amount |
|
|
21
|
+
| `time_point_sec` | `string` | ISO 8601 UTC datetime: `"2024-01-15T12:00:00"` |
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
## `account_name_type`
|
|
26
|
+
|
|
27
|
+
Fixed-length string (max 32 bytes). Must comply with domain-name rules:
|
|
28
|
+
- Dot-separated labels, each label 3+ characters
|
|
29
|
+
- Begins with a letter, ends with letter or digit
|
|
30
|
+
- Only lowercase letters, digits, hyphens
|
|
31
|
+
- Min length: `CHAIN_MIN_ACCOUNT_NAME_LENGTH` (2)
|
|
32
|
+
- Max length: `CHAIN_MAX_ACCOUNT_NAME_LENGTH` (16)
|
|
33
|
+
|
|
34
|
+
**JSON:** plain string, e.g. `"alice"`, `"alice.bob"`
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## `public_key_type`
|
|
39
|
+
|
|
40
|
+
A secp256k1 compressed public key encoded in base58check with `VIZ` prefix.
|
|
41
|
+
|
|
42
|
+
**JSON:** string, e.g. `"VIZ5hqSa4NkEZGAMUpoH5EaEr64mBJuMcPpGjvk8qb7hcPFTbXSQ9"`
|
|
43
|
+
|
|
44
|
+
### Checklist
|
|
45
|
+
- [ ] Prefix must be `VIZ` (not `STM`, `GLS`, etc.)
|
|
46
|
+
- [ ] 33-byte compressed public key + 4-byte checksum = 37 bytes base58-encoded
|
|
47
|
+
- [ ] Validate checksum on deserialization
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## `asset`
|
|
52
|
+
|
|
53
|
+
Represents a token amount with its symbol.
|
|
54
|
+
|
|
55
|
+
```
|
|
56
|
+
{
|
|
57
|
+
"amount": integer, // satoshi value (int64)
|
|
58
|
+
"symbol": integer // asset_symbol_type (uint64)
|
|
59
|
+
}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
**However**, in JSON API the asset is typically serialized as a string:
|
|
63
|
+
```
|
|
64
|
+
"10.000 VIZ"
|
|
65
|
+
"5.000000 SHARES"
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
### Asset Symbols
|
|
69
|
+
|
|
70
|
+
| Symbol name | String | Decimals | Description |
|
|
71
|
+
|---|---|---|---|
|
|
72
|
+
| `TOKEN_SYMBOL` | `VIZ` | 3 | Main liquid token |
|
|
73
|
+
| `SHARES_SYMBOL` | `SHARES` | 6 | Vesting shares (staked VIZ) |
|
|
74
|
+
|
|
75
|
+
### Checklist
|
|
76
|
+
- [ ] Parse/format amount with correct decimal places (VIZ=3, SHARES=6)
|
|
77
|
+
- [ ] When constructing `asset` for operations, use the string format: `"10.000 VIZ"`
|
|
78
|
+
- [ ] Validate symbol matches expected token type per operation field
|
|
79
|
+
|
|
80
|
+
---
|
|
81
|
+
|
|
82
|
+
## `authority`
|
|
83
|
+
|
|
84
|
+
Multi-signature authority structure controlling an account's permission level.
|
|
85
|
+
|
|
86
|
+
```json
|
|
87
|
+
{
|
|
88
|
+
"weight_threshold": 1,
|
|
89
|
+
"account_auths": [
|
|
90
|
+
["alice", 1]
|
|
91
|
+
],
|
|
92
|
+
"key_auths": [
|
|
93
|
+
["VIZ5hqSa4NkEZGAMUpoH5EaEr64mBJuMcPpGjvk8qb7hcPFTbXSQ9", 1]
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Fields
|
|
99
|
+
|
|
100
|
+
| Field | Type | Description |
|
|
101
|
+
|---|---|---|
|
|
102
|
+
| `weight_threshold` | `uint32_t` | Minimum total weight required to satisfy authority |
|
|
103
|
+
| `account_auths` | `[[account_name, weight], ...]` | Account-based signers |
|
|
104
|
+
| `key_auths` | `[[public_key, weight], ...]` | Key-based signers |
|
|
105
|
+
|
|
106
|
+
### Authority Levels
|
|
107
|
+
|
|
108
|
+
| Level | Used for |
|
|
109
|
+
|---|---|
|
|
110
|
+
| `master` | Highest security — changing keys, account recovery |
|
|
111
|
+
| `active` | Token operations — transfer, vesting, witness voting |
|
|
112
|
+
| `regular` | Social operations — content, awards, committee voting |
|
|
113
|
+
|
|
114
|
+
### Checklist
|
|
115
|
+
- [ ] Sum of weights for satisfied keys/accounts must be >= `weight_threshold`
|
|
116
|
+
- [ ] `account_auths` entries are `[string, uint16]` pairs
|
|
117
|
+
- [ ] `key_auths` entries are `[string, uint16]` pairs (public key as VIZ-prefixed base58)
|
|
118
|
+
- [ ] Empty authority = `{ "weight_threshold": 0, "account_auths": [], "key_auths": [] }`
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## `beneficiary_route_type`
|
|
123
|
+
|
|
124
|
+
Specifies a beneficiary account and their share weight for content rewards.
|
|
125
|
+
|
|
126
|
+
```json
|
|
127
|
+
{
|
|
128
|
+
"account": "alice",
|
|
129
|
+
"weight": 2500
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
| Field | Type | Description |
|
|
134
|
+
|---|---|---|
|
|
135
|
+
| `account` | `account_name_type` | Beneficiary account name |
|
|
136
|
+
| `weight` | `uint16_t` | Weight in basis points (100% = 10000) |
|
|
137
|
+
|
|
138
|
+
### Checklist
|
|
139
|
+
- [ ] Sum of all beneficiary weights must not exceed 10000 (100%)
|
|
140
|
+
- [ ] Beneficiaries array must be sorted by account name (ascending)
|
|
141
|
+
- [ ] Each beneficiary account must exist on-chain
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
## `extensions_type`
|
|
146
|
+
|
|
147
|
+
Currently unused — always an empty array `[]`.
|
|
148
|
+
|
|
149
|
+
```json
|
|
150
|
+
"extensions": []
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## `versioned_chain_properties`
|
|
156
|
+
|
|
157
|
+
A static variant holding one of the chain property versions. The variant is serialized as a 2-element array `[type_index, object]`.
|
|
158
|
+
|
|
159
|
+
| Index | Type |
|
|
160
|
+
|---|---|
|
|
161
|
+
| 0 | `chain_properties_init` |
|
|
162
|
+
| 1 | `chain_properties_hf4` |
|
|
163
|
+
| 2 | `chain_properties_hf6` |
|
|
164
|
+
| 3 | `chain_properties_hf9` |
|
|
165
|
+
|
|
166
|
+
Example (hf9 = index 3):
|
|
167
|
+
```json
|
|
168
|
+
[3, {
|
|
169
|
+
"account_creation_fee": "1.000 VIZ",
|
|
170
|
+
"maximum_block_size": 65536,
|
|
171
|
+
"create_account_delegation_ratio": 10,
|
|
172
|
+
"create_account_delegation_time": 2592000,
|
|
173
|
+
"min_delegation": "1.000 VIZ",
|
|
174
|
+
"min_curation_percent": 0,
|
|
175
|
+
"max_curation_percent": 10000,
|
|
176
|
+
"bandwidth_reserve_percent": 1000,
|
|
177
|
+
"bandwidth_reserve_below": "1.000000 SHARES",
|
|
178
|
+
"flag_energy_additional_cost": 1000,
|
|
179
|
+
"vote_accounting_min_rshares": 0,
|
|
180
|
+
"committee_request_approve_min_percent": 1000,
|
|
181
|
+
"inflation_witness_percent": 2000,
|
|
182
|
+
"inflation_ratio_committee_vs_reward_fund": 1000,
|
|
183
|
+
"inflation_recalc_period": 28800,
|
|
184
|
+
"data_operations_cost_additional_bandwidth": 0,
|
|
185
|
+
"witness_miss_penalty_percent": 100,
|
|
186
|
+
"witness_miss_penalty_duration": 86400,
|
|
187
|
+
"create_invite_min_balance": "1.000 VIZ",
|
|
188
|
+
"committee_create_request_fee": "1.000 VIZ",
|
|
189
|
+
"create_paid_subscription_fee": "1.000 VIZ",
|
|
190
|
+
"account_on_sale_fee": "10.000 VIZ",
|
|
191
|
+
"subaccount_on_sale_fee": "1.000 VIZ",
|
|
192
|
+
"witness_declaration_fee": "1.000 VIZ",
|
|
193
|
+
"withdraw_intervals": 28
|
|
194
|
+
}]
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## `chain_properties_init` Fields
|
|
200
|
+
|
|
201
|
+
| Field | Type | Default | Description |
|
|
202
|
+
|---|---|---|---|
|
|
203
|
+
| `account_creation_fee` | `asset` (VIZ) | `1.000 VIZ` | Fee to create a new account |
|
|
204
|
+
| `maximum_block_size` | `uint32_t` | 131072 | Max block size in bytes |
|
|
205
|
+
| `create_account_delegation_ratio` | `uint32_t` | 10 | Ratio of delegated SHARES on account creation |
|
|
206
|
+
| `create_account_delegation_time` | `uint32_t` | 2592000 | Minimum delegation time (seconds) |
|
|
207
|
+
| `min_delegation` | `asset` (VIZ) | `1.000 VIZ` | Minimum delegation amount |
|
|
208
|
+
| `min_curation_percent` | `int16_t` | 0 | Min curation reward percent (basis points) |
|
|
209
|
+
| `max_curation_percent` | `int16_t` | 10000 | Max curation reward percent (basis points) |
|
|
210
|
+
| `bandwidth_reserve_percent` | `int16_t` | 1000 | % of bandwidth reserved for low-stake accounts |
|
|
211
|
+
| `bandwidth_reserve_below` | `asset` (SHARES) | `1.000000 SHARES` | Threshold for bandwidth reserve |
|
|
212
|
+
| `flag_energy_additional_cost` | `int16_t` | 1000 | Extra energy cost for flag/downvote |
|
|
213
|
+
| `vote_accounting_min_rshares` | `uint32_t` | 0 | Min rshares for payout accounting |
|
|
214
|
+
| `committee_request_approve_min_percent` | `int16_t` | 1000 | Min approval % for committee requests |
|
|
215
|
+
|
|
216
|
+
## Additional fields in `chain_properties_hf4`
|
|
217
|
+
|
|
218
|
+
| Field | Type | Description |
|
|
219
|
+
|---|---|---|
|
|
220
|
+
| `inflation_witness_percent` | `int16_t` | Witness reward % from block inflation |
|
|
221
|
+
| `inflation_ratio_committee_vs_reward_fund` | `int16_t` | Ratio committee/reward fund |
|
|
222
|
+
| `inflation_recalc_period` | `uint32_t` | Blocks per inflation recalc |
|
|
223
|
+
|
|
224
|
+
## Additional fields in `chain_properties_hf6`
|
|
225
|
+
|
|
226
|
+
| Field | Type | Description |
|
|
227
|
+
|---|---|---|
|
|
228
|
+
| `data_operations_cost_additional_bandwidth` | `uint32_t` | Extra bandwidth % for data operations |
|
|
229
|
+
| `witness_miss_penalty_percent` | `int16_t` | Vote penalty % for missed block |
|
|
230
|
+
| `witness_miss_penalty_duration` | `uint32_t` | Duration of miss penalty (seconds) |
|
|
231
|
+
|
|
232
|
+
## Additional fields in `chain_properties_hf9`
|
|
233
|
+
|
|
234
|
+
| Field | Type | Description |
|
|
235
|
+
|---|---|---|
|
|
236
|
+
| `create_invite_min_balance` | `asset` (VIZ) | Min balance to create invite |
|
|
237
|
+
| `committee_create_request_fee` | `asset` (VIZ) | Fee to create committee request |
|
|
238
|
+
| `create_paid_subscription_fee` | `asset` (VIZ) | Fee to create paid subscription |
|
|
239
|
+
| `account_on_sale_fee` | `asset` (VIZ) | Fee to list account for sale |
|
|
240
|
+
| `subaccount_on_sale_fee` | `asset` (VIZ) | Fee to list subaccounts for sale |
|
|
241
|
+
| `witness_declaration_fee` | `asset` (VIZ) | Fee to declare as witness |
|
|
242
|
+
| `withdraw_intervals` | `uint16_t` | Number of withdraw intervals |
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
## Operation Type Indices
|
|
247
|
+
|
|
248
|
+
The `operation` is a `static_variant`. When serialized, it is a 2-element array: `[type_id, operation_object]`.
|
|
249
|
+
|
|
250
|
+
### Regular Operations
|
|
251
|
+
|
|
252
|
+
| ID | Operation Name |
|
|
253
|
+
|---|---|
|
|
254
|
+
| 0 | `vote_operation` *(deprecated)* |
|
|
255
|
+
| 1 | `content_operation` *(deprecated)* |
|
|
256
|
+
| 2 | `transfer_operation` |
|
|
257
|
+
| 3 | `transfer_to_vesting_operation` |
|
|
258
|
+
| 4 | `withdraw_vesting_operation` |
|
|
259
|
+
| 5 | `account_update_operation` |
|
|
260
|
+
| 6 | `witness_update_operation` |
|
|
261
|
+
| 7 | `account_witness_vote_operation` |
|
|
262
|
+
| 8 | `account_witness_proxy_operation` |
|
|
263
|
+
| 9 | `delete_content_operation` *(deprecated)* |
|
|
264
|
+
| 10 | `custom_operation` |
|
|
265
|
+
| 11 | `set_withdraw_vesting_route_operation` |
|
|
266
|
+
| 12 | `request_account_recovery_operation` |
|
|
267
|
+
| 13 | `recover_account_operation` |
|
|
268
|
+
| 14 | `change_recovery_account_operation` |
|
|
269
|
+
| 15 | `escrow_transfer_operation` |
|
|
270
|
+
| 16 | `escrow_dispute_operation` |
|
|
271
|
+
| 17 | `escrow_release_operation` |
|
|
272
|
+
| 18 | `escrow_approve_operation` |
|
|
273
|
+
| 19 | `delegate_vesting_shares_operation` |
|
|
274
|
+
| 20 | `account_create_operation` |
|
|
275
|
+
| 21 | `account_metadata_operation` |
|
|
276
|
+
| 22 | `proposal_create_operation` |
|
|
277
|
+
| 23 | `proposal_update_operation` |
|
|
278
|
+
| 24 | `proposal_delete_operation` |
|
|
279
|
+
| 25 | `chain_properties_update_operation` |
|
|
280
|
+
|
|
281
|
+
### Virtual Operations
|
|
282
|
+
|
|
283
|
+
| ID | Operation Name |
|
|
284
|
+
|---|---|
|
|
285
|
+
| 26 | `author_reward_operation` |
|
|
286
|
+
| 27 | `curation_reward_operation` |
|
|
287
|
+
| 28 | `content_reward_operation` |
|
|
288
|
+
| 29 | `fill_vesting_withdraw_operation` |
|
|
289
|
+
| 30 | `shutdown_witness_operation` |
|
|
290
|
+
| 31 | `hardfork_operation` |
|
|
291
|
+
| 32 | `content_payout_update_operation` |
|
|
292
|
+
| 33 | `content_benefactor_reward_operation` |
|
|
293
|
+
| 34 | `return_vesting_delegation_operation` |
|
|
294
|
+
| 35 | `committee_worker_create_request_operation` |
|
|
295
|
+
| 36 | `committee_worker_cancel_request_operation` |
|
|
296
|
+
| 37 | `committee_vote_request_operation` |
|
|
297
|
+
| 38 | `committee_cancel_request_operation` *(virtual)* |
|
|
298
|
+
| 39 | `committee_approve_request_operation` *(virtual)* |
|
|
299
|
+
| 40 | `committee_payout_request_operation` *(virtual)* |
|
|
300
|
+
| 41 | `committee_pay_request_operation` *(virtual)* |
|
|
301
|
+
| 42 | `witness_reward_operation` *(virtual)* |
|
|
302
|
+
| 43 | `create_invite_operation` |
|
|
303
|
+
| 44 | `claim_invite_balance_operation` |
|
|
304
|
+
| 45 | `invite_registration_operation` |
|
|
305
|
+
| 46 | `versioned_chain_properties_update_operation` |
|
|
306
|
+
| 47 | `award_operation` |
|
|
307
|
+
| 48 | `receive_award_operation` *(virtual)* |
|
|
308
|
+
| 49 | `benefactor_award_operation` *(virtual)* |
|
|
309
|
+
| 50 | `set_paid_subscription_operation` |
|
|
310
|
+
| 51 | `paid_subscribe_operation` |
|
|
311
|
+
| 52 | `paid_subscription_action_operation` *(virtual)* |
|
|
312
|
+
| 53 | `cancel_paid_subscription_operation` *(virtual)* |
|
|
313
|
+
| 54 | `set_account_price_operation` |
|
|
314
|
+
| 55 | `set_subaccount_price_operation` |
|
|
315
|
+
| 56 | `buy_account_operation` |
|
|
316
|
+
| 57 | `account_sale_operation` *(virtual)* |
|
|
317
|
+
| 58 | `use_invite_balance_operation` |
|
|
318
|
+
| 59 | `expire_escrow_ratification_operation` *(virtual)* |
|
|
319
|
+
| 60 | `fixed_award_operation` |
|
|
320
|
+
| 61 | `target_account_sale_operation` |
|
|
321
|
+
| 62 | `bid_operation` *(virtual)* |
|
|
322
|
+
| 63 | `outbid_operation` *(virtual)* |
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
# VIZ Blockchain — Operations & Structures Spec
|
|
2
|
+
|
|
3
|
+
Full specification and implementation checklist for building VIZ blockchain client libraries in PHP, Node.js, and other languages.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Files in This Directory
|
|
8
|
+
|
|
9
|
+
| File | Contents |
|
|
10
|
+
|---|---|
|
|
11
|
+
| [data-types.md](data-types.md) | Primitive types, `asset`, `authority`, `public_key_type`, operation type index |
|
|
12
|
+
| [plugins.md](plugins.md) | All node plugins, dependencies, status, JSON-RPC method tables |
|
|
13
|
+
| [op-account.md](op-account.md) | Account create, update, metadata operations |
|
|
14
|
+
| [op-transfer-vesting.md](op-transfer-vesting.md) | Transfer, transfer_to_vesting, withdraw_vesting, set route, delegate |
|
|
15
|
+
| [op-witness.md](op-witness.md) | Witness update, vote, proxy, chain properties |
|
|
16
|
+
| [op-content.md](op-content.md) | Content, vote, delete_content (deprecated), custom |
|
|
17
|
+
| [op-recovery.md](op-recovery.md) | Request/recover account, change recovery account |
|
|
18
|
+
| [op-escrow.md](op-escrow.md) | Escrow transfer, approve, dispute, release |
|
|
19
|
+
| [op-committee.md](op-committee.md) | Committee worker create/cancel request, vote |
|
|
20
|
+
| [op-invite.md](op-invite.md) | Create invite, claim balance, register, use balance |
|
|
21
|
+
| [op-award.md](op-award.md) | Award, fixed_award operations |
|
|
22
|
+
| [op-subscription.md](op-subscription.md) | Set paid subscription, paid subscribe |
|
|
23
|
+
| [op-account-market.md](op-account-market.md) | Set account/subaccount price, buy account, target sale |
|
|
24
|
+
| [op-proposal.md](op-proposal.md) | Proposal create, update, delete (multi-sig) |
|
|
25
|
+
| [virtual-operations.md](virtual-operations.md) | All virtual operations (read-only, blockchain-generated) |
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## Quick Reference: All Operations
|
|
30
|
+
|
|
31
|
+
### Regular Operations (user-broadcast)
|
|
32
|
+
|
|
33
|
+
| ID | Name | Auth | Key File |
|
|
34
|
+
|---|---|---|---|
|
|
35
|
+
| 0 | `vote_operation` *(deprecated)* | regular | op-content.md |
|
|
36
|
+
| 1 | `content_operation` *(deprecated)* | regular | op-content.md |
|
|
37
|
+
| 2 | `transfer_operation` | active (VIZ) / master (SHARES) | op-transfer-vesting.md |
|
|
38
|
+
| 3 | `transfer_to_vesting_operation` | active | op-transfer-vesting.md |
|
|
39
|
+
| 4 | `withdraw_vesting_operation` | active | op-transfer-vesting.md |
|
|
40
|
+
| 5 | `account_update_operation` | master/active | op-account.md |
|
|
41
|
+
| 6 | `witness_update_operation` | active | op-witness.md |
|
|
42
|
+
| 7 | `account_witness_vote_operation` | active | op-witness.md |
|
|
43
|
+
| 8 | `account_witness_proxy_operation` | active | op-witness.md |
|
|
44
|
+
| 9 | `delete_content_operation` *(deprecated)* | regular | op-content.md |
|
|
45
|
+
| 10 | `custom_operation` | active/regular | op-content.md |
|
|
46
|
+
| 11 | `set_withdraw_vesting_route_operation` | active | op-transfer-vesting.md |
|
|
47
|
+
| 12 | `request_account_recovery_operation` | active | op-recovery.md |
|
|
48
|
+
| 13 | `recover_account_operation` | master (×2) | op-recovery.md |
|
|
49
|
+
| 14 | `change_recovery_account_operation` | master | op-recovery.md |
|
|
50
|
+
| 15 | `escrow_transfer_operation` | active | op-escrow.md |
|
|
51
|
+
| 16 | `escrow_dispute_operation` | active | op-escrow.md |
|
|
52
|
+
| 17 | `escrow_release_operation` | active | op-escrow.md |
|
|
53
|
+
| 18 | `escrow_approve_operation` | active | op-escrow.md |
|
|
54
|
+
| 19 | `delegate_vesting_shares_operation` | active | op-transfer-vesting.md |
|
|
55
|
+
| 20 | `account_create_operation` | active | op-account.md |
|
|
56
|
+
| 21 | `account_metadata_operation` | regular | op-account.md |
|
|
57
|
+
| 22 | `proposal_create_operation` | active | op-proposal.md |
|
|
58
|
+
| 23 | `proposal_update_operation` | varies | op-proposal.md |
|
|
59
|
+
| 24 | `proposal_delete_operation` | active | op-proposal.md |
|
|
60
|
+
| 25 | `chain_properties_update_operation` | active | op-witness.md |
|
|
61
|
+
| 35 | `committee_worker_create_request_operation` | regular | op-committee.md |
|
|
62
|
+
| 36 | `committee_worker_cancel_request_operation` | regular | op-committee.md |
|
|
63
|
+
| 37 | `committee_vote_request_operation` | regular | op-committee.md |
|
|
64
|
+
| 43 | `create_invite_operation` | active | op-invite.md |
|
|
65
|
+
| 44 | `claim_invite_balance_operation` | active | op-invite.md |
|
|
66
|
+
| 45 | `invite_registration_operation` | active | op-invite.md |
|
|
67
|
+
| 46 | `versioned_chain_properties_update_operation` | active | op-witness.md |
|
|
68
|
+
| 47 | `award_operation` | regular | op-award.md |
|
|
69
|
+
| 50 | `set_paid_subscription_operation` | active | op-subscription.md |
|
|
70
|
+
| 51 | `paid_subscribe_operation` | active | op-subscription.md |
|
|
71
|
+
| 54 | `set_account_price_operation` | master | op-account-market.md |
|
|
72
|
+
| 55 | `set_subaccount_price_operation` | master | op-account-market.md |
|
|
73
|
+
| 56 | `buy_account_operation` | active | op-account-market.md |
|
|
74
|
+
| 58 | `use_invite_balance_operation` | active | op-invite.md |
|
|
75
|
+
| 60 | `fixed_award_operation` | regular | op-award.md |
|
|
76
|
+
| 61 | `target_account_sale_operation` | master | op-account-market.md |
|
|
77
|
+
|
|
78
|
+
### Virtual Operations (read-only, not broadcastable)
|
|
79
|
+
|
|
80
|
+
| ID | Name | Trigger | Key File |
|
|
81
|
+
|---|---|---|---|
|
|
82
|
+
| 26 | `author_reward_operation` | Content payout | virtual-operations.md |
|
|
83
|
+
| 27 | `curation_reward_operation` | Content payout | virtual-operations.md |
|
|
84
|
+
| 28 | `content_reward_operation` | Content payout | virtual-operations.md |
|
|
85
|
+
| 29 | `fill_vesting_withdraw_operation` | Withdrawal interval | virtual-operations.md |
|
|
86
|
+
| 30 | `shutdown_witness_operation` | Witness deactivated | virtual-operations.md |
|
|
87
|
+
| 31 | `hardfork_operation` | Hardfork activation | virtual-operations.md |
|
|
88
|
+
| 32 | `content_payout_update_operation` | Content payout update | virtual-operations.md |
|
|
89
|
+
| 33 | `content_benefactor_reward_operation` | Content payout | virtual-operations.md |
|
|
90
|
+
| 34 | `return_vesting_delegation_operation` | Delegation limbo ends | virtual-operations.md |
|
|
91
|
+
| 38 | `committee_cancel_request_operation` | Request expires | virtual-operations.md |
|
|
92
|
+
| 39 | `committee_approve_request_operation` | Request approved | virtual-operations.md |
|
|
93
|
+
| 40 | `committee_payout_request_operation` | Payout processed | virtual-operations.md |
|
|
94
|
+
| 41 | `committee_pay_request_operation` | Worker paid | virtual-operations.md |
|
|
95
|
+
| 42 | `witness_reward_operation` | Block produced | virtual-operations.md |
|
|
96
|
+
| 48 | `receive_award_operation` | Award given | virtual-operations.md |
|
|
97
|
+
| 49 | `benefactor_award_operation` | Award with beneficiary | virtual-operations.md |
|
|
98
|
+
| 52 | `paid_subscription_action_operation` | Subscription payment | virtual-operations.md |
|
|
99
|
+
| 53 | `cancel_paid_subscription_operation` | Subscription ends | virtual-operations.md |
|
|
100
|
+
| 57 | `account_sale_operation` | Account sold | virtual-operations.md |
|
|
101
|
+
| 59 | `expire_escrow_ratification_operation` | Escrow deadline missed | virtual-operations.md |
|
|
102
|
+
| 62 | `bid_operation` | Bid placed (HF11) | virtual-operations.md |
|
|
103
|
+
| 63 | `outbid_operation` | Outbid (HF11) | virtual-operations.md |
|
|
104
|
+
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
## Library Implementation Master Checklist
|
|
108
|
+
|
|
109
|
+
### Serialization
|
|
110
|
+
- [ ] Operations serialized as `[type_id, object]` (2-element array)
|
|
111
|
+
- [ ] `asset` values as string `"10.000 VIZ"` or as `{"amount": int, "symbol": int}` depending on API
|
|
112
|
+
- [ ] `authority` serialized with `weight_threshold`, `account_auths`, `key_auths`
|
|
113
|
+
- [ ] `public_key_type` as VIZ-prefixed base58check string
|
|
114
|
+
- [ ] `time_point_sec` as ISO 8601 UTC string `"2024-01-15T12:00:00"` (no timezone suffix)
|
|
115
|
+
- [ ] `optional<T>` as `null` when absent, or the value when present
|
|
116
|
+
- [ ] `extensions_type` always `[]`
|
|
117
|
+
- [ ] `flat_set` and `vector` as JSON arrays
|
|
118
|
+
- [ ] `flat_map` as JSON array of `[key, value]` pairs
|
|
119
|
+
|
|
120
|
+
### Transaction Construction
|
|
121
|
+
- [ ] Fetch current block header for `ref_block_num` and `ref_block_prefix`
|
|
122
|
+
- [ ] Set `expiration` = current time + desired TTL (max 60 seconds recommended)
|
|
123
|
+
- [ ] Sign transaction with required keys (see each operation's authority requirements)
|
|
124
|
+
- [ ] `ref_block_num` = `head_block_number & 0xFFFF`
|
|
125
|
+
- [ ] `ref_block_prefix` = first 4 bytes (little-endian uint32) of `block_id` starting at byte 4
|
|
126
|
+
- [ ] Chain ID must match target network (mainnet vs testnet)
|
|
127
|
+
|
|
128
|
+
### Key Management
|
|
129
|
+
- [ ] Private keys in WIF format (Base58Check with version byte 0x80)
|
|
130
|
+
- [ ] Public keys in VIZ-prefixed compressed base58 format
|
|
131
|
+
- [ ] Derive public key from private key using secp256k1
|
|
132
|
+
- [ ] Sign: sha256d(chain_id + serialized_tx) → compact ECDSA signature
|
|
133
|
+
|
|
134
|
+
### Energy System
|
|
135
|
+
- [ ] Energy is in basis points (0–10000 = 0%–100%)
|
|
136
|
+
- [ ] Energy regenerates at 100% per day (`CHAIN_ENERGY_REGENERATION_SECONDS = 86400`)
|
|
137
|
+
- [ ] Formula: `current_energy = min(10000, last_energy + elapsed_seconds / REGEN_RATE)`
|
|
138
|
+
- [ ] Spending 1000 energy (10%) costs proportional share of reward pool
|
|
139
|
+
|
|
140
|
+
### Asset Formatting
|
|
141
|
+
- [ ] VIZ: 3 decimal places, e.g. `"10.000 VIZ"`
|
|
142
|
+
- [ ] SHARES: 6 decimal places, e.g. `"10.000000 SHARES"`
|
|
143
|
+
- [ ] Parse: split on space, parse amount with decimal, check symbol
|
|
144
|
+
|
|
145
|
+
### Account Name Validation
|
|
146
|
+
- [ ] Length: 3–16 characters
|
|
147
|
+
- [ ] Only lowercase letters, digits, hyphens, dots
|
|
148
|
+
- [ ] Each segment (dot-separated) starts with letter, ends with letter/digit
|
|
149
|
+
- [ ] Each segment >= 3 characters
|
|
150
|
+
|
|
151
|
+
### Authority Validation
|
|
152
|
+
- [ ] `weight_threshold` must be satisfiable (sum of weights >= threshold)
|
|
153
|
+
- [ ] `key_auths` entries: `[public_key_string, uint16]`
|
|
154
|
+
- [ ] `account_auths` entries: `[account_name_string, uint16]`
|
|
155
|
+
|
|
156
|
+
### Bandwidth & Fees
|
|
157
|
+
- [ ] Operations consume bandwidth proportional to their serialized byte size
|
|
158
|
+
- [ ] Data operations (`custom_operation.json` etc.) have additional bandwidth cost
|
|
159
|
+
- [ ] Account creation requires `fee` >= chain `account_creation_fee`
|
|
160
|
+
- [ ] Committee/invite/subscription operations charge network fees from chain properties
|