-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBitExplorerAPI.yaml
More file actions
3856 lines (3576 loc) · 158 KB
/
BitExplorerAPI.yaml
File metadata and controls
3856 lines (3576 loc) · 158 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.0
info:
version: '1.0.0'
title: 'Enecuum Node API'
description: |
# Introduction
Enecuum is a cryptocurrency project designed to involve both mobile and desktop devices into one blockchain network. Enecuum provides a payment platform with the use of a native token. Enecuum's native token, ENQ, can be bought on the exchange, by card, or mined on PCs and smartphones.
Below, you can read a short explanation of the basic terms and concepts related to Enecuum and cryptocurrency in general. The description will help you better understand the Enecuum API. **Be aware that the API and its documentation is a work in progress and is constantly updated.**
The methods' parameters and returned values are thoroughly explained in schemas, which you can access by clicking "Schema" next to the "Example Value".
# How Enecuum Works
When a user creates an account in the Enecuum network, a pair of public and private keys is generated.
**The public key** is a user's identification. It is used as a wallet address. The user can safely share the public key to receive payments.
**The private key** acts as a password. It is used to access the account. The user must never share the private key. The private key needs to be backed up. If a private key is lost, the account will never be recovered.
You can read more about the key pair generation in the according section down below.
Be aware that any wallet, including the one created for technical purposes, can receive referral rewards. This can happen if someone decides to use the wallet's referral address as their referral agent. These rewards are marked accordingly in the blockchain.
Enecuum has a native token, ENQ, which is used for payments in the Enecuum network, as well as a non-tradable token BIT designed for testing. Enecuum also allows the issue of custom tokens. Each token has two unique identifiers: ticker and hash. A **ticker** is a 1-6 letter name used for convenience. A **hash** is a 64-character sequence that acts as a technical identification. ENQ has an all-zero token hash (64 zeroes). Non-zero values mean that you deal with an asset other than Enecuum. Custom tokens have a random hexadecimal string as a token ID.
Each token token has a fixed number of **decimal places**. When using Enecuum API, the methods will return the token amount as an integer. Because of this, the returned amount is multiplied by 10^*d*, where *d* stands for the number of decimal places. For example, ENQ has 10 decimal places. The returned amount 250050000000 correlates with 25.005 ENQ.
The tokens are used to perform transactions. After making the request to perform a transaction, it is sent to the main node. Then, it is processed by miners. Finally, the transaction is recorded in the blockchain. **Rejected transactions are also recorded.**
<details>
<summary> **click to expand**
# Enecuum Account Generation
</summary>
Enecuum account is a keypair of private and public key. Public key is also used as a Enecuum address.
To create a key pair, we use the secp256k1 elliptic curve. First, a random 32-bytes number is generated, and a public key is generated from it by secp256k1 rules. The received public key in the format 04 + x_coord + y_coord (65 total bytes, 130 symbols in string format) is converted to a compressed public key 02/03 + x_coord (33 total bytes, 66 symbols in string format) depending on the sign of y_coord. Most cryptographic libraries convert a key pair into a standard certificate formats (PEM, PKCS, etc...), but we use a simplified raw private and public key representation.
So here is an example of Enecuum account:
```
{
"prvkey" : "5caf0e01227bc31771dd7ea804c022796da2355452d93396e7e3802f0099f276",
"pubkey" : "026f6be1bc2cba807b9e5f22f79df985ff021db77f853a36a200b8dd6a9bd0af9b"
}
```
You can create an Enecuum BIT network wallet at [bit-wallet.enecuum.com/login](https://bit-wallet.enecuum.com/login).
Here is a NodeJS example using standard crypto package:
```
const crypto = require('crypto');
function gen_keys(){
const user = crypto.createECDH('secp256k1');
user.generateKeys();
return {
prvkey : user.getPrivateKey().toString('hex'),
pubkey : crypto.ECDH.convertKey(user.getPublicKey().toString('hex'), 'secp256k1', 'hex', 'hex', 'compressed')
};
}
console.log(gen_keys());
```
Here is an NodeJS example using elliptic package. Note that you can set a private key by yourself, which can’t be achieved in crypto package by simple steps. You also can use Browserify to use it at client-side.
```
let EC = require('elliptic').ec;
function gen_keys(prvkey) {
let ec = new EC('secp256k1');
let key = ec.keyFromPrivate(prvkey, "hex");
let pubkey = key.getPublic(true, 'hex');
return {
prvkey : prvkey,
pubkey : pubkey
};
}
let prvkey = '75587f836841d72c7b8bf5b7e514bd4b83dcb9503ed89b0032e519e9a3eaa5f9';
console.log(gen_keys(prvkey));
```
</details>
servers:
# Added by API Auto Mocking Plugin
# - description: SwaggerHub API Auto Mocking
# url: https://virtserver.swaggerhub.com/enecuum/BitExplorerAPI/1.0.0
# Added by API Auto Mocking Plugin
# - description: SwaggerHub API Auto Mocking
# url: https://virtserver.swaggerhub.com/enecuum/BitExplorerAPI/1.0.0
# Added by API Auto Mocking Plugin
# Added by API Auto Mocking Plugin
- description: SwaggerHub API Auto Mocking
url: https://virtserver.swaggerhub.com/enecuum/BitExplorerAPI/1.0.0
- description: Enecuum BIT Network. New API is first deployed here.
url: http://bit.enecuum.com/api/v1/ #bit.enecuum.com/api/v1
- description: Enecuum Pulse Network (main network). Some API methods may be missing.
url: https://pulse.enecuum.com/api/v1
# Added3 by API Auto Mocking Plugin
# - description: SwaggerHub API Auto Mocking
# url: https://virtserver.swaggerhub.com/enecuum/EnecuumNodeAPI/1.0.0
# NETWORK METHODS
paths:
/network_info:
get:
tags:
- Network
summary: 'Retrieves network information'
description: 'Returns network info'
responses:
'200':
description: Successfully returned.
content:
application/json:
schema:
properties:
target_speed:
type: integer
description: desired interval between block release in seconds
example: 15
reward_ratio:
type: object
description: Shares of the native token block reward by node types (10,000 = 100%)
properties:
pos:
type: integer
description: Reward ratio for PoS nodes
example: 5500
poa:
type: integer
description: Reward ratio for PoA nodes
example: 3181
pow:
type: integer
description: Reward ratio for PoW nodes
example: 500
ref:
type: integer
description: Reward ratio for referrals
example: 819
transfer_lock:
type: integer
description: Minimal amount of blocks between undelegation and transfer so that the transfer is valid
example: 5
pos_min_stake:
type: integer
description: Minimal stake for a PoS node
example: 25000000000
native_token:
type: object
description: Native token properties
properties:
hash:
type: string
description: Native token hash
example: 0000000000000000000000000000000000000000000000000000000000000001
owner:
type: string
description: Address of the wallet that created the native token
example: 029dd222eeddd5c3340e8d46ae0a22e2c8e301bfee4903bcf8c899766c8ceb3a7d
fee_type:
type: integer
description: Fee type (see comment below, TO BE CLARIFIED - see comment below)
# 0 - flat fee for owner upon transaction in reward tokens, 1 - percent fee in reward tokens, 2 - native fee, fixed, charged in native tokens)
example: 0
fee_value:
type: integer
description: Fee value
example: 1000000000
ticker:
type: string
description: Native token ticker
example: BIT
decimals:
type: integer
description: Number of decimal places
example: 10
total_supply:
type: string
description: Total supply of native tokens
example: 2455559059822244864
caption:
type: string
description: Token name
example: Enecuum Testnet BIT
active:
type: integer
description: TO BE EXPLAINED
# has something to do with mining slots?
example: 1
reissuable:
type: integer
description: (1 stands for tokens that can be minted and burned?)
example: 0
minable:
type: integer
description: Whether a token can be mined or not
example: 1
max_supply:
type: integer
description: Maximum token supply
example: 3500000000000000000
block_reward:
type: integer
description: Reward for the mining of a block
example: 30460000000
min_stake:
type: integer
description: The minimal stake for a PoA node (applies to mineable tokens only? null for others)
example: 250000000000
referrer_stake:
type: integer
description: TO BE EXPLAINED
example: 10000000000000
ref_share:
type: integer
description: TO BE EXPLAINED
example: 2574
txs_count:
type: integer
description: (TO BE CLARIFIED) amount of transactions with this token
example: 6406044
cg_price_usd:
type: integer
description: CoinGecko price of the token in USDT? (TO BE CLARIFIED)
example: 0.03952753
dex_price_usd:
type: integer
description: Price of the token on pour DEX (ENEX? TO BE CLARIFIED)
example: 0.03952753
price_raw:
type: object
description: a different representation of cg_price_usd and dex_price_usd
properties:
cg_price:
type: integer
description: CoinGecko price, different representation
example: 395275300
dex_price:
type: integer
description: Our DEX price, different representation
example: 395275300
decimals:
type: integer
description: Number of decimal places
example: 10
origin:
type: object
description: TO BE EXPLAINED
properties:
publisher:
type: string
description: TO BE EXPLAINED
example: 029dd222eeddd5c3340e8d46ae0a22e2c8e301bfee4903bcf8c899766c8ceb3a7d
reward:
type: integer
description: TO BE EXPLAINED
example: 2449913938434801029
hash:
type: string
description: TO BE EXPLAINED
example: BITGENESIS
link:
type: string
description: TO BE EXPLAINED
example: BITGENESIS
sprout:
type: string
description: TO BE EXPLAINED
example: BITGENESIS
time:
type: integer
description: TO BE EXPLAINED
example: 0
fee_shares:
type: object
description: TO BE EXPLAINED
properties:
gen_share:
type: integer
description: TO BE EXPLAINED
example: 300
pow_share:
type: integer
description: TO BE EXPLAINED
example: 50
ldr_share:
type: integer
description: TO BE EXPLAINED
example: 50
pos_share:
type: integer
description: TO BE EXPLAINED
example: 9600
MPK:
type: object
description: TO BE EXPLAINED
properties:
x:
type: integer
description: TO BE EXPLAINED
example: 1 1887977886599394063028178950947279860127724050479032082036805996418912013153131127696715993837524647383570338355695255786360661495991220227612598684883028 3780267397673468252343519622281735554920859525529214838409547998448097213079684300112811104508239777017758612507356636174013439449215588949644233352733139
y:
type: integer
description: TO BE EXPLAINED
example: 1 607218419856648654813472028821287383397295365990787484847671131205048590195733091420684296247120974745720384180519261046258140424163987254801646299078125 3574484102938033217678888696334982695759754668992496989785966938244090853405896393856377280681069520660874902711918462986779665727013338716276831662950626
mblock_slots:
type: object
description: TO BE EXPLAINED
properties:
size:
type: integer
description: TO BE EXPLAINED
example: 2
count:
type: integer
description: TO BE EXPLAINED
example: 2
min_stake:
type: integer
description: TO BE EXPLAINED - minimal stake
example: 5000000000000000
dex:
type: object
description: TO BE EXPLAINED
properties:
DEX_COMMANDER_ADDRESS:
type: string
description: TO BE EXPLAINED
example: 033333333333333333333333333333333333333333333333333333333333333333
DEX_BURN_ADDRESS:
type: string
description: TO BE EXPLAINED
example: 02dead000000000000000000000000000000000000000000000000000000000000
DEX_ENX_TOKEN_HASH:
type: string
description: TO BE EXPLAINED
example: 824e7b171c01e971337c1b25a055023dd53c003d4aa5aa8b58a503d7c622651e
DEX_SPACE_STATION_ID:
type: string
description: TO BE EXPLAINED
example: 50789932e52d80ff65a56547274498d865ce1d85f14bbacdcd5b575191f87621
DEX_COMMANDER_FEE:
type: integer
description: TO BE EXPLAINED
example: 5
DEX_POOL_FEE:
type: integer
description: TO BE EXPLAINED
example: 30
DEX_TRUSTED_TOKENS:
type: string
description: TO BE EXPLAINED
example: 824e7b171c01e971337c1b25a055023dd53c003d4aa5aa8b58a503d7c622651e
/stats:
get:
tags:
- Network
summary: 'Returns network stats.'
description: 'Returns network stats. Check response schema for more details.'
responses:
'200':
description: Successfully returned network stats.
content:
application/json:
schema:
properties:
accounts:
type: integer
description: Number of accounts.
example: 2128
apkUrl:
type: integer
description: URL for the latest version Android Masternode App download.
example:
block_time_24h_avg:
type: integer
description: Average time in seconds between k-block generation in the last 24 hours.
example: 15
block_time_30d_avg:
type: integer
description: Average time in seconds between k-block generation in the last 30 days.
example: 13
block_time_target:
type: integer
description: Targeted time in seconds between k-block generation.
example: 15
calc_rois:
type: integer
description: The balance the PoA node will have after mining for 24 hours with a *calc_stakes* stake.
example: 250008797842
calc_stakes:
type: integer
description: The stake that is used to calculate *calc_rois*.
example: 250000000000
cashier_ptr:
type: integer
description: Block hash that is used for cashier calculation.
example: 6
cg_btc:
type: number
description: Current ENQ value in BTC based on [CoinGecko](https://www.coingecko.com/en/coins/enecuum).
example: 0.00000122
cg_eth:
type: number
description: Current ENQ value in ETH based on [CoinGecko](https://www.coingecko.com/en/coins/enecuum).
example: 0.00004273
cg_usd:
type: number
description: Current ENQ value in USD based on [CoinGecko](https://www.coingecko.com/en/coins/enecuum).
example: 0.01615963
csup:
type: integer
description: ENQ circulating supply, i.e., the total ENQ supply minus [team wallet](https://pulse.enecuum.com/#!/account/0270a88ea6f7c5ea2a2ec3878008d878a70fd5d4ca27d5866d0eec3594cab0b912/0) and [fund wallet](https://pulse.enecuum.com/#!/account/026df0aa41967d8d47082c36b29a164aa1c90cdd07cb02d373daaba90b8eca5301/0). The returned value is multiplied by 10^10.
example: 3407411488880000000
difficulty:
type: number
description: Mining difficulty.
example: 9.69
engaged_balance:
type: integer
description: Total stakes of PoA and PoS nodes. The returned value is multiplied by 10^10.
example: 3272847385977657300
full_count:
type: integer
description: Number of active Full nodes.
example: 2
height:
$ref: '#/components/schemas/Height'
indexer_ptr:
type: integer
description: Block hash that is used by the explorer.
example: 0
maxApkVersion:
type: integer
description: This is used for auto updating of Enecuum Masternode Android app.
example: 0
max_stake:
type: integer
description: PoA stake threshold. Having greater stake results in no additional rewards. The returned value is multiplied by 10^10.
example: 250000000000000
max_tps:
type: integer
description: Current maximum number of transactions per second. This is NOT the maximum possible TPS for Enecuum.
example: 17
minApkVersion:
type: integer
description: Minimum version of Enecuum Android App required for mining.
example: 0
min_stake:
$ref: '#/components/schemas/MinStake'
network_hashrate:
type: integer
description: Network hashrate in hashes per second.
example: 826
poa_capable_count:
type: integer
description: The number of PoA accounts capable of mining, i.e., with available balance of at least minimum stake.
example: 2109
poa_count:
type: integer
description: Number of active PoA nodes.
example: 648
pos_active_count:
type: integer
description: Number of PoS contracts that have received rewards in the last X blocks (the value may be different, currently X = 5760).
example: 1
pos_count:
type: integer
description: Number of active PoS nodes.
example: null
pos_total_count:
type: integer
description: Number of all PoS contracts.
example: 23
pow_count:
type: integer
description: Number of active PoW nodes.
example: 1
proposed_inflation:
type: integer
description: Proposed inflation calculated as yearly rewards divided by total supply.
example: 0
referrer_stake:
$ref: '#/components/schemas/ReferrerStake'
reward_poa:
type: integer
description: Rewards received by PoA nodes in the last 24 hours. The returned value is multiplied by 10^10.
example: 1016375584599730
reward_pos:
type: integer
description: Rewards received by PoS nodes in the last 24 hours. The returned value is multiplied by 10^10.
example: 291775352000000
reward_pow:
type: integer
description: Rewards received by PoW nodes in the last 24 hours. The returned value is multiplied by 10^10.
example: 26525032000000
total_daily_pos_stake:
type: integer
description: TODO.
example: 0
total_daily_stake:
type: integer
description: Total PoA nodes stake. The returned value is multiplied by 10^10.
example: 3272841444722907600
tps:
type: integer
description: Transactions per second.
example: 0
tsup:
type: integer
description: ENQ total supply. The returned value is multiplied by 10^10.
example: 1901936042160000000
txfee_daily_30d_avg:
type: integer
description: Average transaction fees in the last 30 days.
example: 28560
txfee_hourly_24h_avg:
type: integer
description: Average transaction fees in the last 24 hours.
example: 2071
/tps:
get:
tags:
- Network
summary: 'Returns TPS (transactions per second) value'
responses:
'200':
description: Successfully returned.
content:
application/json:
schema:
properties:
tps:
type: integer
description: 'Average rounded aount of transactions during the last 300 seconds'
example: 1
/get_tokens_count:
get:
tags:
- Network
summary: 'Returns the number of tokens deployed on the network and the breakdown of those tokens by type.'
responses:
'200':
description: 'The number of tokens and their breakdown by type.'
content:
application/json:
schema:
properties:
count:
type: integer
description: 'The total number of tokens deployed on the network.'
example: 1427
non_reissuable:
type: integer
description: 'The number of non-reissuable tokens.'
example: 873
reissuable:
type: integer
description: 'The number of reissuable tokens.'
example: 279
minable:
type: integer
description: 'The number of minable tokens.'
example: 275
/get_token_holder_count:
get:
tags:
- Network
summary: 'Returns the amount of accounts that hold the specified token. If no token is specified, it returns the amount of accounts that hold the native token (BIT)'
parameters:
- in: query
name: hash
required: false
description: 'Token hash.'
schema:
type: string
responses:
'200':
description: The amount of token holders.
content:
application/json:
schema:
properties:
count:
type: integer
description: 'The amount of token holding accounts'
example: 34676
/get_tickers_all:
get:
tags:
- Network
summary: 'Returns the list of all token tickers on the network, including token hashes and captions.'
responses:
'200':
description: 'The list of all token tickers on the network, including token hashes and captions.'
content:
application/json:
schema:
properties:
hash:
type: string
description: 'Token hash.'
example: 0000000000000000000000000000000000000000000000000000000000000001
ticker:
type: string
description: 'Token ticker.'
example: BIT
caption:
type: string
description: 'Token caption (long name).'
example: Enecuum testnet BIT
/get_transfer_lock:
get:
tags:
- Network
summary: 'Returns asset lock duration.'
description: 'Returns asset lock duration.' #TODO: elaborate
responses:
'200':
description: Successfully returned transfer lock.
content:
application/json:
schema:
properties:
transfer_lock:
type: integer
description: Transfer lock duration. #TODO: elaborate
example: 5
/peer_map:
get:
tags:
- Network
summary: 'Returns the map of peer nodes on the blockchain'
description: 'Returns a breakdown of peer nodes by location'
responses:
'200':
description: Peer node properties
content:
application/json:
schema:
type: array
description: Peer info by location
items:
type: object
properties:
type:
type: integer
description: 'Peer type.' # (to be expanded)
example: 2
city:
type: string
description: 'City where the peers are based'
example: 'Beverwijk'
lat:
type: number
description: 'Latitude of the city where the peers is based'
example: 52.4847
lon:
type: number
description: 'Longitude of the city where the peers are based'
example: 4.6543
count:
type: integer
description: 'Total count of nodes based in the city'
example: 10
/height:
get:
tags:
- Network
summary: 'Returns blockchain height.'
description: 'Returns the last block number, i.e., the total number of blocks in the blockchain. The block count starts with 0.'
responses:
'200':
description: Successfully returned block height.
content:
application/json:
schema:
properties:
height:
$ref: '#/components/schemas/Height'
/difficulty:
get:
tags:
- Network
summary: 'Returns block mining difficulty.'
description: 'Returns block mining difficulty.'
responses:
'200':
description: Successfully returns mining difficulty.
content:
application/json:
schema:
properties:
difficulty:
type: number
format: float
description: 'Block mining difficulty'
example: 0.00
/ext/plain/hashrate:
get:
tags:
- Network
summary: 'Returns blockchain hash rate.'
description: 'Returns blockchain hash rate.'
responses:
'200':
description: 'Successfully returns blockchain hash rate.'
content:
application/json:
schema:
properties:
hashrate:
type: number
description: 'Blockchain hash rate.'
example: 2.0139111001134378
### TOKEN METHODS
/native_token:
get:
tags:
- Token
summary: 'Returns token info about the native token of the network.'
responses:
'200':
description: Token info.
content:
application/json:
schema:
properties:
hash:
type: string
description: Token hash
example: '0000000000000000000000000000000000000000000000000000000000000001'
owner:
type: string
description: Address of the account that created the token
example: 029dd222eeddd5c3340e8d46ae0a22e2c8e301bfee4903bcf8c899766c8ceb3a7d
fee_type:
type: integer
description: Fee type (see comment below, TO BE CLARIFIED - see comment below)
# 0 - flat fee for owner upon transaction in reward tokens, 1 - percent fee in reward tokens, 2 - native fee, fixed, charged in native tokens)
example: 0
fee_value:
type: integer
description: Fee value
example: 1000000000
fee_min:
type: integer
description: Minimal fee
example: 1000000000
ticker:
type: string
description: Token ticker
example: BIT
decimals:
type: integer
description: Number of decimal places
example: 10
total_supply:
type: string
description: Total supply of the token
example: 2455559059822244864
caption:
type: string
description: Long token name
example: Enecuum Testnet BIT
active:
type: integer
description: TO BE EXPLAINED
# has something to do with mining slots?
example: 0
reissuable:
type: integer
description: Indicates whether the token is reissuable (can be minted and burned)
example: 0
minable:
type: integer
description: Indicates whether a token can be mined
example: 1
max_supply:
type: integer
description: Maximum token supply
example: 3500000000000000000
block_reward:
type: integer
description: Reward for the mining of a block
example: 30460000000
min_stake:
type: integer
description: Minimal stake for a PoS node
example: 250000000000
referrer_stake:
type: integer
description: TO BE EXPLAINED
example: 10000000000000
ref_share:
type: integer
description: TO BE EXPLAINED
example: 2574
txs_count:
type: integer
description: (TO BE CLARIFIED) Amount of transactions with this token
example: 6406044
cg_price_usd:
type: integer
description: CoinGecko price of the token in USD (TO BE CLARIFIED)
example: 0.03952753
dex_price_usd:
type: integer
description: Price of the token on pour DEX (ENEX? TO BE CLARIFIED)
example: 0.03952753
price_raw:
type: object
description: another ("raw", without decimal point) representation of cg_price_usd and dex_price_usd
properties:
cg_price:
type: integer
description: CoinGecko price, different representation
example: 395275300
dex_price:
type: integer
description: Our DEX price, different representation
example: 395275300
decimals:
type: integer
description: Number of decimal places
example: 10
/token_info:
get:
tags:
- Token
summary: 'Returns information about the token.'
description: 'Returns general information about the token. Multiple examples of possible responses can be chosen below. The description of the response can be found in the response schema.'
parameters:
- name: hash
in: query
required: true
description: 'Token hash.'
schema:
$ref: '#/components/schemas/Token'
responses:
'200':
description: Successfully returned token info.
content:
application/json:
schema:
type: array
items:
type: object
properties:
hash:
$ref: '#/components/schemas/Token'
owner:
$ref: '#/components/schemas/Owner'
fee_type:
type: integer
description: |
One of the following fee types is possible:
- 0 means flat fee;
- 1 means percent fee.
enum: [0,1]
example: 0
fee_value:
type: integer
description: For flat fee, the fee amount is multiplied by 10^*d*, where *d* stands for the number of decimal places. For percent fee, the fee amount is multiplied by 100.
example: 10000000000
fee_min:
type: integer
description: The minimum flat fee in case the token uses percent fee.
example: 10000000000
ticker:
$ref: '#/components/schemas/Ticker'
decimals:
$ref: '#/components/schemas/Decimals'
total_supply:
type: integer
description: The token emission. The amount is multiplied by 10^*d*, where *d* stands for the number of decimal places.
example: 5010637449999934464
caption:
type: string
description: A 0-40 character token description. Can be empty.
example: mining token 2
active:
type: integer
description: |
One of the following statuses is possible:
- 0 means inactive;
- 1 means active.
enum: [0,1]
example: 1
reissuable:
$ref: '#/components/schemas/Reissuable'
minable:
$ref: '#/components/schemas/Minable'
max_supply:
type: integer
description: A maximum token emission. Upon reaching this number, the token can no longer be mined.
example: 10000000000000000000
block_reward:
type: integer
description: A reward for each mined macroblock. This number includes the referral reward.
example: 50000000000
min_stake:
$ref: '#/components/schemas/MinStake'
referrer_stake:
$ref: '#/components/schemas/ReferrerStake'
ref_share:
type: integer
description: A share of the total block reward that determines the referral reward amount. The referral reward is distributed among the referral and their agent equally
example: 1000
txs_count:
type: integer
description: The number of transactions with this token (within which timeframe?)
example: 1
cg_price_usd:
type: integer
description: CoinGecko price of the token
example: null
dex_price_usd:
type: integer
description: Price of the token on pour DEX (ENEX? TO BE CLARIFIED)
example: 0.0361261927
price_raw:
type: object
description: another ("raw", without decimal point) representation of cg_price_usd and dex_price_usd
properties:
cg_price:
type: integer
description: CoinGecko price, different representation
example: null
dex_price:
type: integer
description: Our DEX price, different representation
example: 361261927
decimals:
type: integer
description: Number of decimal places
example: 10
examples:
reissuable:
description: Tokens with a flexible supply. After the token release, its supply can be changed by issuing or burning of coins.
value:
- hash: "0000000000000000000000000000000000000000000000000000000000000000"
owner: 029dd222eeddd5c3340e8d46ae0a22e2c8e301bfee4903bcf8c899766c8ceb3a7d
fee_type: 0
fee_value: 100000000
fee_min: 0
ticker: BIT
decimals: 10
total_supply: 3493999410335106560
caption: Enecuum testnet BIT
active: 0
reissuable: 1
minable: 0
max_supply: null
block_reward: null
min_stake: null
referrer_stake: null
ref_share: null
non-reissuable:
description: Tokens with a fixed supply. After the token release, extra token coins can not be emitted.
value:
- hash: "0000000000000000000000000000000000000000000000000000000000000000"
owner: 029dd222eeddd5c3340e8d46ae0a22e2c8e301bfee4903bcf8c899766c8ceb3a7d
fee_type: 0
fee_value: 100000000
fee_min: 0
ticker: BIT
decimals: 10
total_supply: 3493999410335106560
caption: Enecuum testnet BIT
active: 0
reissuable: 0
minable: 0
max_supply: null
block_reward: null
min_stake: null
referrer_stake: null
ref_share: null
mineable:
description: Tokens that can be mined. Some volume is selected for instant release (pre-mine), and the rest is mined by users.
value:
- hash: "0000000000000000000000000000000000000000000000000000000000000000"
owner: 029dd222eeddd5c3340e8d46ae0a22e2c8e301bfee4903bcf8c899766c8ceb3a7d
fee_type: 0
fee_value: 100000000
fee_min: 0
ticker: BIT