@neuraiproject/neurai-rpc 0.8.0 → 0.9.1
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/CHANGELOG.md +9 -0
- package/dist/index.cjs +890 -86
- package/dist/index.d.cts +27 -2
- package/dist/index.d.ts +27 -2
- package/dist/index.mjs +890 -86
- package/docs.json +57 -32
- package/docs.ts +1045 -91
- package/index.ts +1 -2
- package/neurai_methods.md +914 -85
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -164,9 +164,6 @@ var methods = {
|
|
|
164
164
|
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "backupwallet", "params": ["backup.dat"] }' -H 'content-type: text/plain;' http://127.0.0.1:19001/
|
|
165
165
|
**/
|
|
166
166
|
backupwallet: "backupwallet",
|
|
167
|
-
/** bumpfee has been deprecated on the XNA Wallet.
|
|
168
|
-
**/
|
|
169
|
-
bumpfee: "bumpfee",
|
|
170
167
|
/** cancelsnapshotrequest "asset_name" block_height
|
|
171
168
|
|
|
172
169
|
Cancels the specified snapshot request.
|
|
@@ -299,6 +296,28 @@ var methods = {
|
|
|
299
296
|
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "clearmessages", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:19001/
|
|
300
297
|
**/
|
|
301
298
|
clearmessages: "clearmessages",
|
|
299
|
+
/** closedepin "asset_name" ("change_address")
|
|
300
|
+
|
|
301
|
+
THIS COMMAND IS NOT YET ACTIVE!
|
|
302
|
+
https://github.com/NeuraiProject/rips/blob/master/rip-0002.mediawiki
|
|
303
|
+
|
|
304
|
+
Close transfers of a DEPIN asset (owner only): the asset becomes soulbound
|
|
305
|
+
again and only the owner can move it. Valid from the open state; takes effect
|
|
306
|
+
from the block after the one that confirms it. Pending holder transfers are
|
|
307
|
+
dropped from the mempool when the close confirms.
|
|
308
|
+
|
|
309
|
+
Arguments:
|
|
310
|
+
1. "asset_name" (string, required) The DEPIN asset name (must start with &)
|
|
311
|
+
2. "change_address" (string, optional) The change address for the owner token
|
|
312
|
+
|
|
313
|
+
Result:
|
|
314
|
+
"txid" (string) The transaction id
|
|
315
|
+
|
|
316
|
+
Examples:
|
|
317
|
+
> neurai-cli closedepin "&FRANCE"
|
|
318
|
+
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "closedepin", "params": ["&FRANCE"] }' -H 'content-type: text/plain;' http://127.0.0.1:19001/
|
|
319
|
+
**/
|
|
320
|
+
closedepin: "closedepin",
|
|
302
321
|
/** combinerawtransaction ["hexstring",...]
|
|
303
322
|
|
|
304
323
|
Combine multiple partially signed transactions into one transaction.
|
|
@@ -318,6 +337,57 @@ var methods = {
|
|
|
318
337
|
> neurai-cli combinerawtransaction ["myhex1", "myhex2", "myhex3"]
|
|
319
338
|
**/
|
|
320
339
|
combinerawtransaction: "combinerawtransaction",
|
|
340
|
+
/** createdistributionbatch "plan_hash" {plan} batch_index ( {options} )
|
|
341
|
+
|
|
342
|
+
Builds, funds and signs one batch of a distribution plan from this wallet (NIP-048), and locks the inputs it
|
|
343
|
+
spends. It does NOT broadcast: store the result in your batch records first, then send it with
|
|
344
|
+
sendrawtransaction. The plan must still hash to plan_hash, so a payment is always bound to the plan the
|
|
345
|
+
operator approved.
|
|
346
|
+
To replace a version that left the mempool, build a new one with the same anchor: every version of a batch
|
|
347
|
+
spends the anchor, so at most one of them can confirm.
|
|
348
|
+
|
|
349
|
+
Arguments:
|
|
350
|
+
1. "plan_hash" (string, required) The approved plan hash, from getdistributionplan
|
|
351
|
+
2. plan (object, required) The plan parameters
|
|
352
|
+
{
|
|
353
|
+
"asset_name": "name", (string, required) as in getdistributionplan
|
|
354
|
+
"snapshot_height": n, (number, required)
|
|
355
|
+
"distribution_asset_name": "name", (string, required)
|
|
356
|
+
"amount": x.xxx, (numeric, required) gross_distribution_amount
|
|
357
|
+
"exception_addresses": "a,b", (string, optional)
|
|
358
|
+
"remainder": "payer"|"largest", (string, optional, default "payer")
|
|
359
|
+
"allow_legacy_snapshot": bool, (boolean, optional, default false)
|
|
360
|
+
"announcement": {"txid": "hex", "block_hash": "hex"} (object, optional) as in getdistributionplan
|
|
361
|
+
"qualifier": "#TAG", (string, optional) as in getdistributionplan
|
|
362
|
+
"weights": {"address": n, ...}, (object, optional) as in getdistributionplan
|
|
363
|
+
"report": {"txid": "hex", "block_hash": "hex"} (object, optional) as in getdistributionplan
|
|
364
|
+
"allocation": "holdings"|"equal", (string, optional, default "holdings") as in getdistributionplan
|
|
365
|
+
"min_held": x.xxx, (numeric, optional) as in getdistributionplan
|
|
366
|
+
}
|
|
367
|
+
3. batch_index (number, required) The batch to build, from getdistributionbatches
|
|
368
|
+
4. options (object, optional)
|
|
369
|
+
{
|
|
370
|
+
"max_outputs": n, (number, default 500) batch size, as in getdistributionbatches
|
|
371
|
+
"anchor": {"txid": "hex", "vout": n}, (object, optional) the anchor of earlier versions of this batch
|
|
372
|
+
"max_fee": x.xxx (numeric, optional) refuse a fee above this amount of XNA
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
Result:
|
|
376
|
+
{
|
|
377
|
+
"plan_hash": "hex",
|
|
378
|
+
"batch_index": n,
|
|
379
|
+
"batch_id": "hex",
|
|
380
|
+
"txid": "hex",
|
|
381
|
+
"hex": "hex", (string) the signed transaction, not broadcast
|
|
382
|
+
"fee": x.xxx,
|
|
383
|
+
"anchor": {"txid": "hex", "vout": n}, (object) the XNA input every later version must spend
|
|
384
|
+
"inputs": [ {"txid": "hex", "vout": n}, ... ] (array) inputs, now locked in this wallet
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
Examples:
|
|
388
|
+
> neurai-cli createdistributionbatch "planhash" '{"asset_name":"TRONCO","snapshot_height":12345,"distribution_asset_name":"XNA","amount":1000}' 0
|
|
389
|
+
**/
|
|
390
|
+
createdistributionbatch: "createdistributionbatch",
|
|
321
391
|
/** createmultisig nrequired ["key",...]
|
|
322
392
|
|
|
323
393
|
Creates a multi-signature address with n signature of m keys required.
|
|
@@ -376,6 +446,9 @@ var methods = {
|
|
|
376
446
|
unfreeze_addresses 0
|
|
377
447
|
freeze_asset 0
|
|
378
448
|
unfreeze_asset 0
|
|
449
|
+
open_depin 0
|
|
450
|
+
close_depin 0
|
|
451
|
+
seal_depin 0
|
|
379
452
|
|
|
380
453
|
Assets For Authorization:
|
|
381
454
|
These operations require a specific asset input for authorization:
|
|
@@ -388,6 +461,10 @@ var methods = {
|
|
|
388
461
|
unfreeze_addresses
|
|
389
462
|
freeze_asset
|
|
390
463
|
unfreeze_asset
|
|
464
|
+
DEPIN Owner Token (&NAME!):
|
|
465
|
+
open_depin
|
|
466
|
+
close_depin
|
|
467
|
+
seal_depin
|
|
391
468
|
Root Qualifier Token:
|
|
392
469
|
issue_qualifier (when issuing subqualifier)
|
|
393
470
|
Qualifier Token:
|
|
@@ -407,7 +484,9 @@ var methods = {
|
|
|
407
484
|
{
|
|
408
485
|
"txid":"id", (string, required) The transaction id
|
|
409
486
|
"vout":n, (number, required) The output number
|
|
410
|
-
"sequence":n (number, optional) The sequence number
|
|
487
|
+
"sequence":n (number, optional) The sequence number. Once the no-RBF sequence rule
|
|
488
|
+
applies to the next block it must be 4294967295, 4294967294 or, in a
|
|
489
|
+
version 2 or 3 transaction, a BIP 68 relative lock (bit 31 clear)
|
|
411
490
|
}
|
|
412
491
|
,...
|
|
413
492
|
]
|
|
@@ -421,7 +500,7 @@ var methods = {
|
|
|
421
500
|
"transfer":
|
|
422
501
|
{
|
|
423
502
|
"asset-name": (string, required) asset name
|
|
424
|
-
asset-quantity (number, required) the number of raw units to transfer
|
|
503
|
+
asset-quantity (number or string, required) the number of raw units to transfer
|
|
425
504
|
,...
|
|
426
505
|
}
|
|
427
506
|
}
|
|
@@ -431,7 +510,7 @@ var methods = {
|
|
|
431
510
|
"transferwithmessage":
|
|
432
511
|
{
|
|
433
512
|
"asset-name": (string, required) asset name
|
|
434
|
-
asset-quantity, (number, required) the number of raw units to transfer
|
|
513
|
+
asset-quantity, (number or string, required) the number of raw units to transfer
|
|
435
514
|
"message":"hash", (string, required) ipfs hash or a txid hash
|
|
436
515
|
"expire_time": n (number, required) utc time in seconds to expire the message
|
|
437
516
|
}
|
|
@@ -441,7 +520,7 @@ var methods = {
|
|
|
441
520
|
"issue":
|
|
442
521
|
{
|
|
443
522
|
"asset_name":"asset-name", (string, required) new asset name
|
|
444
|
-
"asset_quantity":n, (number, required) the number of raw units to issue
|
|
523
|
+
"asset_quantity":n, (number or string, required) the number of raw units to issue
|
|
445
524
|
"units":[1-8], (number, required) display units, between 1 (integral) to 8 (max precision)
|
|
446
525
|
"reissuable":[0-1], (number, required) 1=reissuable asset
|
|
447
526
|
"has_ipfs":[0-1], (number, required) 1=passing ipfs_hash
|
|
@@ -464,8 +543,9 @@ var methods = {
|
|
|
464
543
|
"reissue":
|
|
465
544
|
{
|
|
466
545
|
"asset_name":"asset-name", (string, required) name of asset to be reissued
|
|
467
|
-
"asset_quantity":n, (number, required) the number of raw units to issue
|
|
546
|
+
"asset_quantity":n, (number or string, required) the number of raw units to issue
|
|
468
547
|
"reissuable":[0-1], (number, optional) default is 1, 1=reissuable asset
|
|
548
|
+
"units":[-1-8], (number, optional) default is -1: keep the current units; 0-8 sets new units (never fewer than now)
|
|
469
549
|
"ipfs_hash":"hash", (string, optional) An ipfs hash for discovering asset metadata,
|
|
470
550
|
Overrides the current ipfs hash if given
|
|
471
551
|
"owner_change_address" (string, optional) the address where the owner token will be sent to.
|
|
@@ -477,7 +557,7 @@ var methods = {
|
|
|
477
557
|
"issue_restricted":
|
|
478
558
|
{
|
|
479
559
|
"asset_name":"asset-name",(string, required) new asset name
|
|
480
|
-
"asset_quantity":n, (number, required) the number of raw units to issue
|
|
560
|
+
"asset_quantity":n, (number or string, required) the number of raw units to issue
|
|
481
561
|
"verifier_string":"text", (string, required) the verifier string to be used for a restricted
|
|
482
562
|
asset transfer verification
|
|
483
563
|
"units":[0-8], (number, required) display units, between 0 (integral) and 8 (max precision)
|
|
@@ -493,8 +573,9 @@ var methods = {
|
|
|
493
573
|
"reissue_restricted":
|
|
494
574
|
{
|
|
495
575
|
"asset_name":"asset-name", (string, required) name of asset to be reissued
|
|
496
|
-
"asset_quantity":n, (number, required) the number of raw units to issue
|
|
576
|
+
"asset_quantity":n, (number or string, required) the number of raw units to issue
|
|
497
577
|
"reissuable":[0-1], (number, optional) default is 1, 1=reissuable asset
|
|
578
|
+
"units":[-1-8], (number, optional) default is -1: keep the current units; 0-8 sets new units (never fewer than now)
|
|
498
579
|
"verifier_string":"text", (string, optional) the verifier string to be used for a restricted asset
|
|
499
580
|
transfer verification
|
|
500
581
|
"ipfs_hash":"hash", (string, optional) An ipfs hash for discovering asset metadata,
|
|
@@ -508,7 +589,7 @@ var methods = {
|
|
|
508
589
|
"issue_qualifier":
|
|
509
590
|
{
|
|
510
591
|
"asset_name":"asset_name", (string, required) a qualifier name (starts with '#')
|
|
511
|
-
"asset_quantity":n, (
|
|
592
|
+
"asset_quantity":n, (number or string, optional, default=1) the number of units to be issued (1 to 10)
|
|
512
593
|
"has_ipfs":[0-1], (boolean, optional, default=false), whether ifps hash is going
|
|
513
594
|
to be added to the asset
|
|
514
595
|
"ipfs_hash":"hash", (string, optional but required if has_ipfs = 1), an ipfs hash or a
|
|
@@ -516,7 +597,7 @@ var methods = {
|
|
|
516
597
|
"root_change_address" (string, optional) Only applies when issuing subqualifiers.
|
|
517
598
|
The address where the root qualifier will be sent.
|
|
518
599
|
If not specified, it will be sent to the output address.
|
|
519
|
-
"change_quantity":"qty" (
|
|
600
|
+
"change_quantity":"qty" (number or string, optional) the asset change amount (defaults to 1)
|
|
520
601
|
}
|
|
521
602
|
}
|
|
522
603
|
or
|
|
@@ -526,7 +607,7 @@ var methods = {
|
|
|
526
607
|
{
|
|
527
608
|
"qualifier":"qualifier", (string, required) a qualifier name (starts with '#')
|
|
528
609
|
"addresses":["addr", ...], (array, required) the addresses to be tagged (up to 10)
|
|
529
|
-
"change_quantity":"qty", (
|
|
610
|
+
"change_quantity":"qty", (number or string, optional) the asset change amount (defaults to 1)
|
|
530
611
|
}
|
|
531
612
|
}
|
|
532
613
|
or
|
|
@@ -536,7 +617,7 @@ var methods = {
|
|
|
536
617
|
{
|
|
537
618
|
"qualifier":"qualifier", (string, required) a qualifier name (starts with '#')
|
|
538
619
|
"addresses":["addr", ...], (array, required) the addresses to be untagged (up to 10)
|
|
539
|
-
"change_quantity":"qty", (
|
|
620
|
+
"change_quantity":"qty", (number or string, optional) the asset change amount (defaults to 1)
|
|
540
621
|
}
|
|
541
622
|
}
|
|
542
623
|
or
|
|
@@ -574,6 +655,14 @@ var methods = {
|
|
|
574
655
|
}
|
|
575
656
|
}
|
|
576
657
|
or
|
|
658
|
+
{ (object) A json object describing a DEPIN transfer state operation.
|
|
659
|
+
The address in the key will be used as the owner token change address.
|
|
660
|
+
"open_depin" | "close_depin" | "seal_depin":
|
|
661
|
+
{
|
|
662
|
+
"asset_name":"asset_name", (string, required) a DEPIN asset name (starts with '&')
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
or
|
|
577
666
|
"data": "hex" (string, required) The key is "data", the value is hex encoded data
|
|
578
667
|
,...
|
|
579
668
|
}
|
|
@@ -735,6 +824,24 @@ var methods = {
|
|
|
735
824
|
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "decodescript", "params": ["hexstring"] }' -H 'content-type: text/plain;' http://127.0.0.1:19001/
|
|
736
825
|
**/
|
|
737
826
|
decodescript: "decodescript",
|
|
827
|
+
/** decodesilentpaymentcode "code"
|
|
828
|
+
|
|
829
|
+
Validates a silent payment code for this network and returns its keys.
|
|
830
|
+
|
|
831
|
+
Arguments:
|
|
832
|
+
1. "code" (string, required) payment code
|
|
833
|
+
|
|
834
|
+
Result:
|
|
835
|
+
{
|
|
836
|
+
"isvalid": true|false, (boolean)
|
|
837
|
+
"error": "str", (string) reason when invalid
|
|
838
|
+
"network", "scan_pubkey", "spend_pubkey" when valid
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
Examples:
|
|
842
|
+
> neurai-cli decodesilentpaymentcode "tnsp1q..."
|
|
843
|
+
**/
|
|
844
|
+
decodesilentpaymentcode: "decodesilentpaymentcode",
|
|
738
845
|
/**
|
|
739
846
|
* depinchallenge request
|
|
740
847
|
*
|
|
@@ -863,41 +970,10 @@ var methods = {
|
|
|
863
970
|
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "disconnectnode", "params": ["", 1] }' -H 'content-type: text/plain;' http://127.0.0.1:19001/
|
|
864
971
|
**/
|
|
865
972
|
disconnectnode: "disconnectnode",
|
|
866
|
-
/** distributereward "asset_name" snapshot_height "distribution_asset_name" gross_distribution_amount ( "exception_addresses" ) ("change_address"
|
|
867
|
-
|
|
868
|
-
Splits the specified amount of the distribution asset to all owners of asset_name that are not in the optional exclusion_addresses
|
|
869
|
-
|
|
870
|
-
Arguments:
|
|
871
|
-
1. "asset_name" (string, required) The reward will be distributed all owners of this asset
|
|
872
|
-
2. "snapshot_height" (number, required) The block height of the ownership snapshot
|
|
873
|
-
3. "distribution_asset_name" (string, required) The name of the asset that will be distributed, or XNA
|
|
874
|
-
4. "gross_distribution_amount" (number, required) The amount of the distribution asset that will be split amongst all owners
|
|
875
|
-
5. "exception_addresses" (string, optional) Ownership addresses that should be excluded
|
|
876
|
-
6. "change_address" (string, optional) If the rewards can't be fully distributed. The change will be sent to this address
|
|
877
|
-
|
|
878
|
-
Result:
|
|
879
|
-
{
|
|
880
|
-
error_txn_gen_failed: (string),
|
|
881
|
-
error_nsf: (string),
|
|
882
|
-
error_rejects: (string),
|
|
883
|
-
error_db_update: (string),
|
|
884
|
-
batch_results: [
|
|
885
|
-
{
|
|
886
|
-
transaction_id: (string),
|
|
887
|
-
error_txn_rejected: (string),
|
|
888
|
-
total_amount: (number),
|
|
889
|
-
fee: (number),
|
|
890
|
-
expected_count: (number),
|
|
891
|
-
actual_count: (number),
|
|
892
|
-
}
|
|
893
|
-
]
|
|
894
|
-
}
|
|
973
|
+
/** distributereward "asset_name" snapshot_height "distribution_asset_name" gross_distribution_amount ( "exception_addresses" ) ( "change_address" )
|
|
895
974
|
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
> neurai-cli distributereward "PHATSTACKS" 12345 "DIVIDENDS" 1000 "mwN7xC3yomYdvJuVXkVC7ymY9wNBjWNduD,n4Rf18edydDaRBh7t6gHUbuByLbWEoWUTg"
|
|
899
|
-
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "distributereward", "params": ["TRONCO" 34987 "DIVIDENDS" 100000] }' -H 'content-type: text/plain;' http://127.0.0.1:19001/
|
|
900
|
-
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "distributereward", "params": ["PHATSTACKS" 34987 "XNA" 100000 "mwN7xC3yomYdvJuVXkVC7ymY9wNBjWNduD,n4Rf18edydDaRBh7t6gHUbuByLbWEoWUTg"] }' -H 'content-type: text/plain;' http://127.0.0.1:19001/
|
|
975
|
+
Retired (NIP-048): the node no longer sends reward payments.
|
|
976
|
+
Use getdistributionplan to compute the payments, then send them from your wallet.
|
|
901
977
|
**/
|
|
902
978
|
distributereward: "distributereward",
|
|
903
979
|
/** dumpextkeypq
|
|
@@ -1034,6 +1110,25 @@ var methods = {
|
|
|
1034
1110
|
> neurai-cli estimatesmartfee 6
|
|
1035
1111
|
**/
|
|
1036
1112
|
estimatesmartfee: "estimatesmartfee",
|
|
1113
|
+
/** exportsilentpaymentviewkey "acknowledge"
|
|
1114
|
+
|
|
1115
|
+
Returns the view key (b_scan and B_spend) of this wallet's silent payment code.
|
|
1116
|
+
Whoever holds it can find and link every payment to the code, but cannot spend them.
|
|
1117
|
+
Never combine it with an exported payment private key: together they reveal the spend key.
|
|
1118
|
+
The result is a secret: from a shell, prefer a terminal that is not recorded or logged.
|
|
1119
|
+
|
|
1120
|
+
Arguments:
|
|
1121
|
+
1. "acknowledge" (string, required) must be "reveal view key"
|
|
1122
|
+
|
|
1123
|
+
Result:
|
|
1124
|
+
{
|
|
1125
|
+
"scan_private_key": "hex", "spend_pubkey": "hex", "network": "str"
|
|
1126
|
+
}
|
|
1127
|
+
|
|
1128
|
+
Examples:
|
|
1129
|
+
> neurai-cli exportsilentpaymentviewkey "reveal view key"
|
|
1130
|
+
**/
|
|
1131
|
+
exportsilentpaymentviewkey: "exportsilentpaymentviewkey",
|
|
1037
1132
|
/** exportxpqpub count ( chain offset )
|
|
1038
1133
|
|
|
1039
1134
|
Generates a batch of count ML-DSA-44 public keys and returns the xpqpub blob.
|
|
@@ -1148,7 +1243,6 @@ var methods = {
|
|
|
1148
1243
|
Those recipients will receive less neurais than you enter in their corresponding amount field.
|
|
1149
1244
|
If no outputs are specified here, the sender pays the fee.
|
|
1150
1245
|
[vout_index,...]
|
|
1151
|
-
Allows this transaction to be replaced by a transaction with higher fees
|
|
1152
1246
|
"conf_target" (numeric, optional) Confirmation target (in blocks)
|
|
1153
1247
|
"estimate_mode" (string, optional, default=UNSET) The fee estimate mode, must be one of:
|
|
1154
1248
|
"UNSET"
|
|
@@ -1483,6 +1577,7 @@ var methods = {
|
|
|
1483
1577
|
ipfs_hash: (hash), (only if has_ipfs = 1 and that data is a ipfs hash)
|
|
1484
1578
|
txid_hash: (hash), (only if has_ipfs = 1 and that data is a txid hash)
|
|
1485
1579
|
verifier_string: (string)
|
|
1580
|
+
transfer_state: (string) "closed" | "open" | "sealed" (only for DEPIN assets, names starting with &)
|
|
1486
1581
|
}
|
|
1487
1582
|
|
|
1488
1583
|
Examples:
|
|
@@ -1545,10 +1640,12 @@ var methods = {
|
|
|
1545
1640
|
If verbosity is 0, returns a string that is serialized, hex-encoded data for block 'hash'.
|
|
1546
1641
|
If verbosity is 1, returns an Object with information about block <hash>.
|
|
1547
1642
|
If verbosity is 2, returns an Object with information about block <hash> and information about each transaction.
|
|
1643
|
+
If verbosity is 3, returns the same as verbosity 2 plus a "prevout" object in each input with the spent output
|
|
1644
|
+
(generated, height, value, scriptPubKey), read from the block undo data. This works without -txindex.
|
|
1548
1645
|
|
|
1549
1646
|
Arguments:
|
|
1550
1647
|
1. "blockhash" (string, required) The block hash
|
|
1551
|
-
2. verbosity (numeric, optional, default=1) 0 for hex encoded data, 1 for a json object, and
|
|
1648
|
+
2. verbosity (numeric, optional, default=1) 0 for hex encoded data, 1 for a json object, 2 for json object with transaction data, and 3 for json object with transaction data and spent outputs
|
|
1552
1649
|
|
|
1553
1650
|
Result (for verbosity = 0):
|
|
1554
1651
|
"data" (string) A string that is serialized, hex-encoded data for block 'hash'.
|
|
@@ -1599,6 +1696,7 @@ var methods = {
|
|
|
1599
1696
|
{
|
|
1600
1697
|
"chain": "xxxx", (string) current network name as defined in BIP70 (main, test, regtest)
|
|
1601
1698
|
"blocks": xxxxxx, (numeric) the current number of blocks processed in the server
|
|
1699
|
+
"asset_marker": "xxxx", (string) marker required for new asset outputs in the next block ("rvn" or "xna")
|
|
1602
1700
|
"headers": xxxxxx, (numeric) the current number of headers we have validated
|
|
1603
1701
|
"bestblockhash": "...", (string) the hash of the currently best block
|
|
1604
1702
|
"difficulty": xxxxxx, (numeric) the current difficulty
|
|
@@ -1607,6 +1705,11 @@ var methods = {
|
|
|
1607
1705
|
"chainwork": "xxxx" (string) total amount of work in active chain, in hexadecimal
|
|
1608
1706
|
"size_on_disk": xxxxxx, (numeric) the estimated size of the block and undo files on disk
|
|
1609
1707
|
"pruned": xx, (boolean) if the blocks are subject to pruning
|
|
1708
|
+
"zk_public_tree": { (object) profile-2 public-transition activation
|
|
1709
|
+
"activation_height": n, (numeric or null) scheduled height, null when unscheduled
|
|
1710
|
+
"active_at_tip": b, (boolean) whether the current block uses profile 2
|
|
1711
|
+
"active_for_next_block": b (boolean) whether a candidate block uses profile 2
|
|
1712
|
+
},
|
|
1610
1713
|
"pruneheight": xxxxxx, (numeric) lowest-height complete block stored (only present if pruning is enabled)
|
|
1611
1714
|
"automatic_pruning": xx, (boolean) whether automatic pruning is enabled (only present if pruning is enabled)
|
|
1612
1715
|
"prune_target_size": xxxxxx, (numeric) the target size used by pruning (only present if automatic pruning is enabled)
|
|
@@ -1635,6 +1738,17 @@ var methods = {
|
|
|
1635
1738
|
}
|
|
1636
1739
|
}
|
|
1637
1740
|
}
|
|
1741
|
+
"asset_services": { (object) legacy asset modules (NIP-048)
|
|
1742
|
+
"messages": {
|
|
1743
|
+
"active": xx, (boolean) legacy asset messaging stores are open
|
|
1744
|
+
"store_on_disk": xx (boolean) the data directory has a messages store
|
|
1745
|
+
},
|
|
1746
|
+
"rewards": {
|
|
1747
|
+
"active": xx, (boolean) reward snapshot stores are open
|
|
1748
|
+
"store_on_disk": xx, (boolean) the data directory has a rewards store
|
|
1749
|
+
"assetindex": xx (boolean) -assetindex, which the reward RPCs require
|
|
1750
|
+
}
|
|
1751
|
+
},
|
|
1638
1752
|
"warnings" : "...", (string) any network and blockchain warnings.
|
|
1639
1753
|
}
|
|
1640
1754
|
|
|
@@ -1887,6 +2001,58 @@ var methods = {
|
|
|
1887
2001
|
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getchaintxstats", "params": [2016] }' -H 'content-type: text/plain;' http://127.0.0.1:19001/
|
|
1888
2002
|
**/
|
|
1889
2003
|
getchaintxstats: "getchaintxstats",
|
|
2004
|
+
/** getchannelmessages "channel" ( {options} )
|
|
2005
|
+
|
|
2006
|
+
Returns the messages of an asset channel from the chain-wide index (-channelmessageindex, NIP-048): every
|
|
2007
|
+
message an owner token (NAME!) or message channel token (NAME~CHANNEL) carried back to the address it came
|
|
2008
|
+
from, whatever the wallet. Expiry is decided at query time against reference_time, so nodes with the same
|
|
2009
|
+
chain answer alike.
|
|
2010
|
+
|
|
2011
|
+
Arguments:
|
|
2012
|
+
1. "channel" (string, required) The owner token or message channel
|
|
2013
|
+
2. options (object, optional)
|
|
2014
|
+
{
|
|
2015
|
+
"from_height": n, (number, default 0)
|
|
2016
|
+
"to_height": n, (number, default the tip)
|
|
2017
|
+
"include_expired": bool, (boolean, default false)
|
|
2018
|
+
"reference_time": n, (number, default the median time past of the tip) expiry reference
|
|
2019
|
+
"message": "hash", (string, optional) only messages with this payload
|
|
2020
|
+
"include_tx": bool, (boolean, default false) add the raw transaction
|
|
2021
|
+
"include_proof": bool, (boolean, default false) add a gettxoutproof-style proof
|
|
2022
|
+
"limit": n (number, default 1000, max 10000) messages per call;
|
|
2023
|
+
a block is never split, so the last block may go past it
|
|
2024
|
+
}
|
|
2025
|
+
|
|
2026
|
+
Result:
|
|
2027
|
+
{
|
|
2028
|
+
"channel": "name",
|
|
2029
|
+
"synced_height": n,
|
|
2030
|
+
"reference_time": n,
|
|
2031
|
+
"messages": [ (array) in chain order
|
|
2032
|
+
{
|
|
2033
|
+
"channel": "name",
|
|
2034
|
+
"authority": "owner"|"channel", (string) the token that carried the message
|
|
2035
|
+
"txid": "hex", "vout": n,
|
|
2036
|
+
"height": n, "block_hash": "hash", "block_time": n,
|
|
2037
|
+
"expire_time": n, (number) 0: never expires
|
|
2038
|
+
"expired": true|false,
|
|
2039
|
+
"message": "hash", (string) IPFS hash or 64-hex hash
|
|
2040
|
+
"address": "address", (string) the address that sent it to itself
|
|
2041
|
+
"op_return": "hex", (string, optional) data of the transaction's OP_RETURN output
|
|
2042
|
+
"op_return_matches": bool, (boolean, with op_return) the message is the SHA-256 of that data, so
|
|
2043
|
+
the data is content the token holder published in full (NIP-048 D1)
|
|
2044
|
+
"tx": "hex", (string, optional)
|
|
2045
|
+
"proof": "hex" (string, optional) checked with verifytxoutproof
|
|
2046
|
+
}, ...
|
|
2047
|
+
],
|
|
2048
|
+
"next_from_height": n|null (number) the limit stopped here: pass it as from_height for the next page
|
|
2049
|
+
}
|
|
2050
|
+
|
|
2051
|
+
Examples:
|
|
2052
|
+
> neurai-cli getchannelmessages "ASSET!"
|
|
2053
|
+
> neurai-cli getchannelmessages "ASSET~NEWS" '{"from_height":1000,"include_expired":true}'
|
|
2054
|
+
**/
|
|
2055
|
+
getchannelmessages: "getchannelmessages",
|
|
1890
2056
|
/** getconnectioncount
|
|
1891
2057
|
|
|
1892
2058
|
Returns the number of connections to other nodes.
|
|
@@ -1929,6 +2095,179 @@ var methods = {
|
|
|
1929
2095
|
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getdistributestatus", "params": ["PHATSTACKS" 34987 "XNA" 100000 "mwN7xC3yomYdvJuVXkVC7ymY9wNBjWNduD,n4Rf18edydDaRBh7t6gHUbuByLbWEoWUTg"] }' -H 'content-type: text/plain;' http://127.0.0.1:19001/
|
|
1930
2096
|
**/
|
|
1931
2097
|
getdistributestatus: "getdistributestatus",
|
|
2098
|
+
/** getdistributionbatches {plan} ( {options} )
|
|
2099
|
+
|
|
2100
|
+
Splits the payments of a distribution plan into batches of at most max_outputs recipients, in plan order
|
|
2101
|
+
(NIP-048). Each batch pays all its recipients in one transaction. Nothing is spent or locked.
|
|
2102
|
+
|
|
2103
|
+
Arguments:
|
|
2104
|
+
1. plan (object, required) The plan parameters
|
|
2105
|
+
{
|
|
2106
|
+
"asset_name": "name", (string, required) as in getdistributionplan
|
|
2107
|
+
"snapshot_height": n, (number, required)
|
|
2108
|
+
"distribution_asset_name": "name", (string, required)
|
|
2109
|
+
"amount": x.xxx, (numeric, required) gross_distribution_amount
|
|
2110
|
+
"exception_addresses": "a,b", (string, optional)
|
|
2111
|
+
"remainder": "payer"|"largest", (string, optional, default "payer")
|
|
2112
|
+
"allow_legacy_snapshot": bool, (boolean, optional, default false)
|
|
2113
|
+
"announcement": {"txid": "hex", "block_hash": "hex"} (object, optional) as in getdistributionplan
|
|
2114
|
+
"qualifier": "#TAG", (string, optional) as in getdistributionplan
|
|
2115
|
+
"weights": {"address": n, ...}, (object, optional) as in getdistributionplan
|
|
2116
|
+
"report": {"txid": "hex", "block_hash": "hex"} (object, optional) as in getdistributionplan
|
|
2117
|
+
"allocation": "holdings"|"equal", (string, optional, default "holdings") as in getdistributionplan
|
|
2118
|
+
"min_held": x.xxx, (numeric, optional) as in getdistributionplan
|
|
2119
|
+
}
|
|
2120
|
+
2. options (object, optional)
|
|
2121
|
+
{
|
|
2122
|
+
"max_outputs": n (number, default 500, max 1000) recipients per batch
|
|
2123
|
+
}
|
|
2124
|
+
|
|
2125
|
+
Result:
|
|
2126
|
+
{
|
|
2127
|
+
"plan_hash": "hex",
|
|
2128
|
+
"max_outputs": n,
|
|
2129
|
+
"batches": [
|
|
2130
|
+
{
|
|
2131
|
+
"index": n,
|
|
2132
|
+
"batch_id": "hex", (string) SHA-256 of 0x04 || plan hash || max_outputs || index
|
|
2133
|
+
"first_recipient": n,
|
|
2134
|
+
"recipient_count": n,
|
|
2135
|
+
"amount": x.xxx, (numeric) total paid by the batch
|
|
2136
|
+
"outputs": { ... } (object) the payments in createrawtransaction format
|
|
2137
|
+
}, ...
|
|
2138
|
+
]
|
|
2139
|
+
}
|
|
2140
|
+
|
|
2141
|
+
Examples:
|
|
2142
|
+
> neurai-cli getdistributionbatches '{"asset_name":"TRONCO","snapshot_height":12345,"distribution_asset_name":"XNA","amount":1000}'
|
|
2143
|
+
**/
|
|
2144
|
+
getdistributionbatches: "getdistributionbatches",
|
|
2145
|
+
/** getdistributionplan "asset_name" snapshot_height "distribution_asset_name" gross_distribution_amount ( "exception_addresses" {options} )
|
|
2146
|
+
|
|
2147
|
+
Computes, without spending anything, how gross_distribution_amount of the distribution asset is split among the
|
|
2148
|
+
holders of asset_name in its snapshot at snapshot_height (NIP-048). Each holder gets floor(amount * held / total)
|
|
2149
|
+
in whole units of the distribution asset, or floor(amount / holders) with equal allocation. The plan hash commits
|
|
2150
|
+
to the snapshot, the parameters and every payment;
|
|
2151
|
+
pay the recipients from any wallet, for instance with getdistributionbatches and createdistributionbatch.
|
|
2152
|
+
|
|
2153
|
+
Arguments:
|
|
2154
|
+
1. "asset_name" (string, required) The asset whose holders receive the distribution
|
|
2155
|
+
2. "snapshot_height" (number, required) The height of a snapshot taken with requestsnapshot
|
|
2156
|
+
3. "distribution_asset_name" (string, required) The asset to distribute, or XNA
|
|
2157
|
+
4. "gross_distribution_amount" (number, required) The amount to split, a multiple of the distribution asset's smallest unit
|
|
2158
|
+
5. "exception_addresses" (string, optional) Comma-separated holder addresses to exclude
|
|
2159
|
+
6. options (object, optional)
|
|
2160
|
+
{
|
|
2161
|
+
"remainder": "payer"|"largest", (string, default "payer") Where the undivided remainder goes: it stays with the
|
|
2162
|
+
payer, or one unit each to the largest fractional parts (ties by script)
|
|
2163
|
+
"allow_legacy_snapshot": bool, (boolean, default false) Accept a snapshot captured before NIP-048, which has no block identity
|
|
2164
|
+
"announcement": { (object, optional) The transaction that announced snapshot_height in advance
|
|
2165
|
+
"txid": "hex", (see getsnapshotannouncement); the plan then commits to it (format version 2)
|
|
2166
|
+
"block_hash": "hex" (optional) Its block, for nodes without -txindex
|
|
2167
|
+
},
|
|
2168
|
+
"qualifier": "#TAG", (string, optional) Only holders tagged with this qualifier at the height
|
|
2169
|
+
"weights": {"address": n, ...}, (object, optional) Weights of a work report, positive integers; they replace
|
|
2170
|
+
the holdings, and holders without a weight are excluded
|
|
2171
|
+
"report": {"txid": "hex", "block_hash": "hex"} (object, optional) The owner token transfer that anchored
|
|
2172
|
+
the report hash (SHA-256 of 0x07 || weights)
|
|
2173
|
+
"allocation": "holdings"|"equal", (string, default "holdings") Split in proportion to the holdings (or the
|
|
2174
|
+
report weights), or in equal shares among the eligible holders, whatever
|
|
2175
|
+
they hold; equal cannot be combined with weights
|
|
2176
|
+
"min_held": x.xxx, (numeric, optional) Only holders with at least this amount of asset_name
|
|
2177
|
+
}
|
|
2178
|
+
|
|
2179
|
+
A snapshot taken since NIP-048 D3 records, per holder, freezes, DEPIN self-revocations and qualifier tags; such
|
|
2180
|
+
holders are excluded. With a qualifier, report weights or both, the plan hash commits to them (format version 3);
|
|
2181
|
+
with equal allocation or a minimum holding, it commits to those too (format version 4).
|
|
2182
|
+
|
|
2183
|
+
Result:
|
|
2184
|
+
{
|
|
2185
|
+
"plan_hash": "hex", (string) SHA-256 commitment to the header and the Merkle root
|
|
2186
|
+
"merkle_root": "hex", (string) RFC 6962 root over the recipients, in order
|
|
2187
|
+
"version": n, (number) plan format version
|
|
2188
|
+
"network": "name", (string) network the plan belongs to
|
|
2189
|
+
"snapshot": {
|
|
2190
|
+
"asset_name": "name",
|
|
2191
|
+
"height": n,
|
|
2192
|
+
"block_hash": "hash", (string) block the snapshot was captured on; empty for a legacy snapshot
|
|
2193
|
+
"snapshot_hash": "hex", (string) commitment to the snapshot content
|
|
2194
|
+
"legacy": true|false,
|
|
2195
|
+
"confirmations": n
|
|
2196
|
+
},
|
|
2197
|
+
"distribution_asset_name": "name",
|
|
2198
|
+
"amount": x.xxx, (numeric) gross_distribution_amount
|
|
2199
|
+
"remainder_policy": "payer"|"largest",
|
|
2200
|
+
"allocation": "holdings"|"equal",
|
|
2201
|
+
"min_held": x.xxx, (numeric) minimum holding to be eligible, 0 if none
|
|
2202
|
+
"exception_addresses": [ "address", ... ], (array) sorted, as committed in the plan hash
|
|
2203
|
+
"total_held": x.xxx, (numeric) holdings of the eligible holders
|
|
2204
|
+
"distributed": x.xxx, (numeric) sum of the payments: the funds the payer needs, before fees
|
|
2205
|
+
"remainder": x.xxx, (numeric) amount left undistributed
|
|
2206
|
+
"recipients": [ (array) payments, ordered by output script
|
|
2207
|
+
{ "address": "address", "script": "hex", "held": x.xxx, "amount": x.xxx }, ...
|
|
2208
|
+
],
|
|
2209
|
+
"zero_amount": [ { "address": "address", "held": x.xxx }, ... ], (array) holders whose share rounds to zero
|
|
2210
|
+
"excluded": [ { "address": "address", "held": x.xxx, "reason": "..." }, ... ], (array) reason: exception, burn,
|
|
2211
|
+
globally_frozen, frozen, self_revoked, missing_qualifier, below_minimum or no_weight
|
|
2212
|
+
"announcement": { (object or null) The announcement, when given
|
|
2213
|
+
"txid": "hex", "height": n, "notice": n, "minimum_notice": n (notice: blocks between announcement and snapshot)
|
|
2214
|
+
},
|
|
2215
|
+
"verifiability": "announced"|"late_announcement"|"unannounced" (string) Whether other nodes could capture the
|
|
2216
|
+
same snapshot: without an announcement made with the minimum notice (-minsnapshotnotice),
|
|
2217
|
+
recipients rely on the issuer's snapshot or on replaysnapshot
|
|
2218
|
+
"qualifier": "#TAG"|null,
|
|
2219
|
+
"report": {"hash": "hex", "txid": "hex", "height": n}|null (recipients then also show their "weight")
|
|
2220
|
+
}
|
|
2221
|
+
|
|
2222
|
+
Examples:
|
|
2223
|
+
> neurai-cli getdistributionplan "TRONCO" 12345 "XNA" 1000
|
|
2224
|
+
> neurai-cli getdistributionplan "PHATSTACKS" 12345 "DIVIDENDS" 1000 "" '{"remainder":"largest"}'
|
|
2225
|
+
> neurai-cli getdistributionplan "&GRID" 12345 "XNA" 1000 "" '{"allocation":"equal","min_held":1}'
|
|
2226
|
+
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getdistributionplan", "params": ["TRONCO", 34987, "DIVIDENDS", 100000] }' -H 'content-type: text/plain;' http://127.0.0.1:19001/
|
|
2227
|
+
**/
|
|
2228
|
+
getdistributionplan: "getdistributionplan",
|
|
2229
|
+
/** getdistributionproof {plan} "address"
|
|
2230
|
+
|
|
2231
|
+
Returns the RFC 6962 inclusion proof of one recipient of a distribution plan (NIP-048). With the plan's
|
|
2232
|
+
merkle_root it shows that the payment is part of the plan; it does not show that the amount is right or that
|
|
2233
|
+
no recipient is missing (recompute the plan for that).
|
|
2234
|
+
|
|
2235
|
+
Arguments:
|
|
2236
|
+
1. plan (object, required) The plan parameters
|
|
2237
|
+
{
|
|
2238
|
+
"asset_name": "name", (string, required) as in getdistributionplan
|
|
2239
|
+
"snapshot_height": n, (number, required)
|
|
2240
|
+
"distribution_asset_name": "name", (string, required)
|
|
2241
|
+
"amount": x.xxx, (numeric, required) gross_distribution_amount
|
|
2242
|
+
"exception_addresses": "a,b", (string, optional)
|
|
2243
|
+
"remainder": "payer"|"largest", (string, optional, default "payer")
|
|
2244
|
+
"allow_legacy_snapshot": bool, (boolean, optional, default false)
|
|
2245
|
+
"announcement": {"txid": "hex", "block_hash": "hex"} (object, optional) as in getdistributionplan
|
|
2246
|
+
"qualifier": "#TAG", (string, optional) as in getdistributionplan
|
|
2247
|
+
"weights": {"address": n, ...}, (object, optional) as in getdistributionplan
|
|
2248
|
+
"report": {"txid": "hex", "block_hash": "hex"} (object, optional) as in getdistributionplan
|
|
2249
|
+
"allocation": "holdings"|"equal", (string, optional, default "holdings") as in getdistributionplan
|
|
2250
|
+
"min_held": x.xxx, (numeric, optional) as in getdistributionplan
|
|
2251
|
+
}
|
|
2252
|
+
2. "address" (string, required) A recipient of the plan
|
|
2253
|
+
|
|
2254
|
+
Result:
|
|
2255
|
+
{
|
|
2256
|
+
"plan_hash": "hex",
|
|
2257
|
+
"merkle_root": "hex",
|
|
2258
|
+
"leaf_count": n,
|
|
2259
|
+
"index": n, (number) position of the recipient in the plan
|
|
2260
|
+
"address": "address",
|
|
2261
|
+
"script": "hex",
|
|
2262
|
+
"amount": x.xxx,
|
|
2263
|
+
"leaf_hash": "hex", (string) SHA-256 of 0x00 || script || amount
|
|
2264
|
+
"path": [ "hex", ... ] (array) sibling hashes, deepest first
|
|
2265
|
+
}
|
|
2266
|
+
|
|
2267
|
+
Examples:
|
|
2268
|
+
> neurai-cli getdistributionproof '{"asset_name":"TRONCO","snapshot_height":12345,"distribution_asset_name":"XNA","amount":1000}' "address"
|
|
2269
|
+
**/
|
|
2270
|
+
getdistributionproof: "getdistributionproof",
|
|
1932
2271
|
/** getgenerate
|
|
1933
2272
|
|
|
1934
2273
|
Return if the server is set to generate coins or not. The default is false.
|
|
@@ -1944,24 +2283,23 @@ var methods = {
|
|
|
1944
2283
|
**/
|
|
1945
2284
|
getgenerate: "getgenerate",
|
|
1946
2285
|
/** getibdstatus
|
|
1947
|
-
|
|
1948
2286
|
Returns header synchronization timing collected since process start.
|
|
2287
|
+
request_to_response_us includes peer response and local queueing time.
|
|
1949
2288
|
|
|
1950
2289
|
Result:
|
|
1951
2290
|
{
|
|
1952
|
-
"blocks": n,
|
|
1953
|
-
"headers": n,
|
|
1954
|
-
"header_batches": n,
|
|
1955
|
-
"headers_in_batches": n,
|
|
1956
|
-
"
|
|
1957
|
-
"
|
|
1958
|
-
"
|
|
1959
|
-
"peers": [...]
|
|
2291
|
+
"blocks": n, (numeric) current active-chain height
|
|
2292
|
+
"headers": n, (numeric) best validated header height
|
|
2293
|
+
"header_batches": n, (numeric) requested header batches received
|
|
2294
|
+
"headers_in_batches": n, (numeric) headers in those batches
|
|
2295
|
+
"average_request_to_response_us": n, (numeric) average request-to-response time
|
|
2296
|
+
"average_validation_us": n, (numeric) average local processing time
|
|
2297
|
+
"peers": [ ... ] (array) per-peer timing counters
|
|
1960
2298
|
}
|
|
1961
2299
|
|
|
1962
2300
|
Examples:
|
|
1963
2301
|
> neurai-cli getibdstatus
|
|
1964
|
-
> curl --user myusername --data-binary '{"jsonrpc":"
|
|
2302
|
+
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getibdstatus", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:19001/
|
|
1965
2303
|
**/
|
|
1966
2304
|
getibdstatus: "getibdstatus",
|
|
1967
2305
|
/** getinfo
|
|
@@ -1999,11 +2337,11 @@ var methods = {
|
|
|
1999
2337
|
Get the kawpow hash for a block given its block data
|
|
2000
2338
|
|
|
2001
2339
|
Arguments
|
|
2002
|
-
1. "header_hash" (string, required) the
|
|
2003
|
-
2. "mix_hash" (string, required) the mix hash
|
|
2004
|
-
3. "nonce" (string, required)
|
|
2340
|
+
1. "header_hash" (string, required) the header hash given to the GPU miner (exactly 64 hex digits)
|
|
2341
|
+
2. "mix_hash" (string, required) the mix hash mined by the GPU miner (exactly 64 hex digits)
|
|
2342
|
+
3. "nonce" (string, required) 1 to 16 hex digits, optionally prefixed with 0x
|
|
2005
2343
|
4. "height" (number, required) the height of the block data that is being hashed
|
|
2006
|
-
5. "target" (string, optional) the target
|
|
2344
|
+
5. "target" (string, optional) the target to meet (exactly 64 hex digits)
|
|
2007
2345
|
|
|
2008
2346
|
Result:
|
|
2009
2347
|
|
|
@@ -2020,6 +2358,8 @@ var methods = {
|
|
|
2020
2358
|
{ (json object)
|
|
2021
2359
|
"bip32_root_private" : (string) extended master private key,
|
|
2022
2360
|
"bip32_root_public" : (string) extended master public key,
|
|
2361
|
+
"address_type" : (string) the wallet address type (-addresstype): legacy, pq or ecdsa
|
|
2362
|
+
"strict_ecdsa_derivation_path" : (string, ecdsa wallets) account path of its witness v3 keys
|
|
2023
2363
|
"account_derivation_path" : (string) The derivation path to the account public/private keys
|
|
2024
2364
|
"external_derivation_path" : (string) The derivation path prefix for receiving addresses
|
|
2025
2365
|
"internal_derivation_path" : (string) The derivation path prefix for change addresses
|
|
@@ -2087,6 +2427,7 @@ var methods = {
|
|
|
2087
2427
|
"ancestorcount" : n, (numeric) number of in-mempool ancestor transactions (including this one)
|
|
2088
2428
|
"ancestorsize" : n, (numeric) virtual transaction size of in-mempool ancestors (including this one)
|
|
2089
2429
|
"ancestorfees" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one)
|
|
2430
|
+
"poseidonwork" : n, (numeric) reserved Poseidon permutations for this transaction
|
|
2090
2431
|
"wtxid" : hash, (string) hash of serialized transaction, including witness data
|
|
2091
2432
|
"depends" : [ (array) unconfirmed transactions used as inputs for this transaction
|
|
2092
2433
|
"transactionid", (string) parent transaction id
|
|
@@ -2127,6 +2468,7 @@ var methods = {
|
|
|
2127
2468
|
"ancestorcount" : n, (numeric) number of in-mempool ancestor transactions (including this one)
|
|
2128
2469
|
"ancestorsize" : n, (numeric) virtual transaction size of in-mempool ancestors (including this one)
|
|
2129
2470
|
"ancestorfees" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one)
|
|
2471
|
+
"poseidonwork" : n, (numeric) reserved Poseidon permutations for this transaction
|
|
2130
2472
|
"wtxid" : hash, (string) hash of serialized transaction, including witness data
|
|
2131
2473
|
"depends" : [ (array) unconfirmed transactions used as inputs for this transaction
|
|
2132
2474
|
"transactionid", (string) parent transaction id
|
|
@@ -2159,6 +2501,7 @@ var methods = {
|
|
|
2159
2501
|
"ancestorcount" : n, (numeric) number of in-mempool ancestor transactions (including this one)
|
|
2160
2502
|
"ancestorsize" : n, (numeric) virtual transaction size of in-mempool ancestors (including this one)
|
|
2161
2503
|
"ancestorfees" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one)
|
|
2504
|
+
"poseidonwork" : n, (numeric) reserved Poseidon permutations for this transaction
|
|
2162
2505
|
"wtxid" : hash, (string) hash of serialized transaction, including witness data
|
|
2163
2506
|
"depends" : [ (array) unconfirmed transactions used as inputs for this transaction
|
|
2164
2507
|
"transactionid", (string) parent transaction id
|
|
@@ -2317,7 +2660,7 @@ var methods = {
|
|
|
2317
2660
|
|
|
2318
2661
|
Arguments:
|
|
2319
2662
|
1. "account" (string, optional) DEPRECATED. The account name for the address to be linked to. If not provided, the default account "" is used. It can also be set to the empty string "" to represent the default account. The account does not need to exist, it will be created if there is no account by the given name.
|
|
2320
|
-
2. "address_type" (string, optional) The address family: "legacy" (Base58, secp256k1), "pq" (strict post-quantum, witness v2, pq1.../tpq1...) or "ecdsa" (strict ECDSA, witness v3, nq1r.../tnq1r...). If omitted, the wallet's
|
|
2663
|
+
2. "address_type" (string, optional) The address family: "legacy" (Base58, secp256k1), "pq" (strict post-quantum, witness v2, pq1.../tpq1...) or "ecdsa" (strict ECDSA, witness v3, nq1r.../tnq1r...). If omitted, the wallet's address type (-addresstype when it was created, see getwalletinfo) is used. "pq" needs a pq wallet; an ecdsa wallet refuses "legacy". Strict addresses are handed out before the network activates them, but payments to them are refused until then. Generic AuthScript v1 (nc1p.../tnc1p...) is a contract family and is never handed out by the wallet.
|
|
2321
2664
|
|
|
2322
2665
|
Result:
|
|
2323
2666
|
"address" (string) The new neurai address
|
|
@@ -2380,9 +2723,30 @@ var methods = {
|
|
|
2380
2723
|
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getpeerinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:19001/
|
|
2381
2724
|
**/
|
|
2382
2725
|
getpeerinfo: "getpeerinfo",
|
|
2726
|
+
/** getprivacypoolinfo pool ( limit )
|
|
2727
|
+
|
|
2728
|
+
Read public state-thread identity and confirmed state, without registering a pool.
|
|
2729
|
+
Requires -spentindex and -txindex and readable historical transactions.
|
|
2730
|
+
pool: {"txid": birth_txid, "vout": birth_output}
|
|
2731
|
+
limit: maximum transitions to follow (default 100, maximum 1000).
|
|
2732
|
+
history_complete=false means current_state is unknown; continue with next_cursor.
|
|
2733
|
+
The reported profile describes the transport, not an audited privacy circuit.
|
|
2734
|
+
**/
|
|
2735
|
+
getprivacypoolinfo: "getprivacypoolinfo",
|
|
2736
|
+
/** getprivacypoolupdates pool ( cursor limit )
|
|
2737
|
+
|
|
2738
|
+
Return confirmed public pool transactions, including complete witnesses, in state-thread order.
|
|
2739
|
+
pool: {"txid": birth_txid, "vout": birth_output}; no registry or viewing key.
|
|
2740
|
+
cursor: null for birth, otherwise the unchanged next_cursor from a previous query.
|
|
2741
|
+
limit: maximum updates (default 100, maximum 1000); pages also have a 1 MiB raw-byte limit.
|
|
2742
|
+
Pages pin one chain snapshot; a completed cursor refreshes to the current tip.
|
|
2743
|
+
A reorganized snapshot or foreign/tampered cursor is rejected. Mempool spends are excluded.
|
|
2744
|
+
No matching successor ends this transport; it does not prove the contract is closed.
|
|
2745
|
+
**/
|
|
2746
|
+
getprivacypoolupdates: "getprivacypoolupdates",
|
|
2383
2747
|
/** getpubkey "address"
|
|
2384
2748
|
|
|
2385
|
-
Returns the public key for
|
|
2749
|
+
Returns the public key for a Legacy, AuthScript v1 or strict ECDSA address that has revealed it by spending (requires pubkeyindex to be enabled).
|
|
2386
2750
|
|
|
2387
2751
|
Arguments:
|
|
2388
2752
|
1. "address" (string, required) The Neurai address
|
|
@@ -2407,7 +2771,7 @@ var methods = {
|
|
|
2407
2771
|
This is for use with raw transactions, NOT normal use.
|
|
2408
2772
|
|
|
2409
2773
|
Arguments:
|
|
2410
|
-
1. "address_type" (string, optional) "legacy", "pq" (strict witness v2) or "ecdsa" (strict witness v3). Default: the wallet's
|
|
2774
|
+
1. "address_type" (string, optional) "legacy", "pq" (strict witness v2) or "ecdsa" (strict witness v3). Default: the wallet's address type (-addresstype when it was created).
|
|
2411
2775
|
|
|
2412
2776
|
Result:
|
|
2413
2777
|
"address" (string) The address
|
|
@@ -2446,6 +2810,7 @@ var methods = {
|
|
|
2446
2810
|
"ancestorcount" : n, (numeric) number of in-mempool ancestor transactions (including this one)
|
|
2447
2811
|
"ancestorsize" : n, (numeric) virtual transaction size of in-mempool ancestors (including this one)
|
|
2448
2812
|
"ancestorfees" : n, (numeric) modified fees (see above) of in-mempool ancestors (including this one)
|
|
2813
|
+
"poseidonwork" : n, (numeric) reserved Poseidon permutations for this transaction
|
|
2449
2814
|
"wtxid" : hash, (string) hash of serialized transaction, including witness data
|
|
2450
2815
|
"depends" : [ (array) unconfirmed transactions used as inputs for this transaction
|
|
2451
2816
|
"transactionid", (string) parent transaction id
|
|
@@ -2596,6 +2961,148 @@ var methods = {
|
|
|
2596
2961
|
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getrpcinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:19001/
|
|
2597
2962
|
**/
|
|
2598
2963
|
getrpcinfo: "getrpcinfo",
|
|
2964
|
+
/** getsilentpaymentcode
|
|
2965
|
+
|
|
2966
|
+
Returns the reusable silent payment code of this wallet (NIP-047).
|
|
2967
|
+
Every payment to the code lands on a new strict ECDSA (witness v3) output
|
|
2968
|
+
that only this wallet can link to the code.
|
|
2969
|
+
|
|
2970
|
+
Result:
|
|
2971
|
+
{
|
|
2972
|
+
"code": "str", (string) payment code (nsp1... / tnsp1...)
|
|
2973
|
+
"network": "str", (string) main, test or regtest
|
|
2974
|
+
"scan_pubkey": "hex", (string) B_scan
|
|
2975
|
+
"spend_pubkey": "hex", (string) B_spend
|
|
2976
|
+
"view_only": true|false (boolean) imported view key: payments are detected, not spendable
|
|
2977
|
+
"verified": true (boolean) checked against the wallet seed in this session. An encrypted
|
|
2978
|
+
wallet shows its code only after one unlock in the session
|
|
2979
|
+
}
|
|
2980
|
+
|
|
2981
|
+
Examples:
|
|
2982
|
+
> neurai-cli getsilentpaymentcode
|
|
2983
|
+
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getsilentpaymentcode", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:19001/
|
|
2984
|
+
**/
|
|
2985
|
+
getsilentpaymentcode: "getsilentpaymentcode",
|
|
2986
|
+
/** getsilentpaymentindexinfo
|
|
2987
|
+
|
|
2988
|
+
State of the NIP-047 silent payment index (-silentpaymentindex).
|
|
2989
|
+
|
|
2990
|
+
Result:
|
|
2991
|
+
{
|
|
2992
|
+
"enabled" : true|false, (boolean) whether the node maintains the index
|
|
2993
|
+
"state" : "str", (string) disabled, ready or incomplete (records missing and their blocks pruned)
|
|
2994
|
+
"schema" : n, (numeric) storage schema of the records
|
|
2995
|
+
"formats" : [n,...], (array) public formats served
|
|
2996
|
+
"context" : "hex", (string) NIP-047 context N: network id, genesis, profile and family
|
|
2997
|
+
"start_height" : n, (numeric) first indexed height: max(1, strict AuthScript activation)
|
|
2998
|
+
"synced_height" : n, (numeric) every active block from start_height to this height has a record
|
|
2999
|
+
"synced_hash" : "hash", (string) hash of the block at synced_height
|
|
3000
|
+
"complete" : true|false, (boolean) ready and synced up to the tip
|
|
3001
|
+
"missing" : [[n,n],...], (array) height ranges without a record or block data to rebuild it
|
|
3002
|
+
"pruned" : true|false (boolean) whether the node has deleted block files
|
|
3003
|
+
}
|
|
3004
|
+
|
|
3005
|
+
Examples:
|
|
3006
|
+
> neurai-cli getsilentpaymentindexinfo
|
|
3007
|
+
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getsilentpaymentindexinfo", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:19001/
|
|
3008
|
+
**/
|
|
3009
|
+
getsilentpaymentindexinfo: "getsilentpaymentindexinfo",
|
|
3010
|
+
/** getsilentpaymentinfo
|
|
3011
|
+
|
|
3012
|
+
Returns the silent payment scanning state of this wallet.
|
|
3013
|
+
|
|
3014
|
+
Result:
|
|
3015
|
+
{
|
|
3016
|
+
"enabled": true|false, (boolean) the wallet has an identity (own or view key)
|
|
3017
|
+
"view_only": true|false,
|
|
3018
|
+
"code": "str", (string) once checked against the seed in this session and while
|
|
3019
|
+
the identity is sound
|
|
3020
|
+
"code_verified": true|false,(boolean) code checked against the seed in this session
|
|
3021
|
+
"identity_error": "str", (string) damaged identity: the code must not be used
|
|
3022
|
+
"paused": true|false, (boolean) locked wallet: scanning waits for walletpassphrase
|
|
3023
|
+
"scanned_height": n, (numeric) last block really scanned (-1: none)
|
|
3024
|
+
"scanned_hash": "hex",
|
|
3025
|
+
"tip_height": n,
|
|
3026
|
+
"blocks_behind": n,
|
|
3027
|
+
"error": "str", (string) why scanning stopped (missing block or undo data)
|
|
3028
|
+
"payments": n
|
|
3029
|
+
}
|
|
3030
|
+
|
|
3031
|
+
Examples:
|
|
3032
|
+
> neurai-cli getsilentpaymentinfo
|
|
3033
|
+
**/
|
|
3034
|
+
getsilentpaymentinfo: "getsilentpaymentinfo",
|
|
3035
|
+
/** getsilentpaymenttweaks "blockhash" ( "encoding" )
|
|
3036
|
+
|
|
3037
|
+
NIP-047 light client data of one block: every eligible transaction with a native v3 output,
|
|
3038
|
+
its public tweak T = h*A and all its native v3 outputs, plus every native v3 output the block spends.
|
|
3039
|
+
A receiver computes b_scan*T for each entry; the node learns nothing about it.
|
|
3040
|
+
Requires -silentpaymentindex.
|
|
3041
|
+
|
|
3042
|
+
Arguments:
|
|
3043
|
+
1. "blockhash" (string, required) the block hash
|
|
3044
|
+
2. "encoding" (string, optional, default=json) json, or hex for the binary message of type 1
|
|
3045
|
+
|
|
3046
|
+
Result (json):
|
|
3047
|
+
{
|
|
3048
|
+
"format" : 1,
|
|
3049
|
+
"context" : "hex", (string) NIP-047 context N
|
|
3050
|
+
"block" : { (object) immutable for this block hash
|
|
3051
|
+
"height" : n,
|
|
3052
|
+
"hash" : "hash",
|
|
3053
|
+
"prev" : "hash",
|
|
3054
|
+
"entries" : [
|
|
3055
|
+
{
|
|
3056
|
+
"txid" : "hex",
|
|
3057
|
+
"tweak" : "hex", (string) 33-byte compressed point T
|
|
3058
|
+
"outputs" : [{ "vout" : n, "commitment" : "hex", "value_sat" : "n" },...]
|
|
3059
|
+
},...
|
|
3060
|
+
],
|
|
3061
|
+
"spent" : [{ "txid" : "hex", "vout" : n },...],
|
|
3062
|
+
"digest" : "hex" (string) tagged hash of the canonical block bytes
|
|
3063
|
+
},
|
|
3064
|
+
"in_active_chain" : true|false
|
|
3065
|
+
}
|
|
3066
|
+
|
|
3067
|
+
Result (hex):
|
|
3068
|
+
"hex" (string) binary message of type 1
|
|
3069
|
+
|
|
3070
|
+
Examples:
|
|
3071
|
+
> neurai-cli getsilentpaymenttweaks "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"
|
|
3072
|
+
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getsilentpaymenttweaks", "params": ["00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"] }' -H 'content-type: text/plain;' http://127.0.0.1:19001/
|
|
3073
|
+
**/
|
|
3074
|
+
getsilentpaymenttweaks: "getsilentpaymenttweaks",
|
|
3075
|
+
/** getsilentpaymenttweaksrange start_height count ( "anchor_hash" "encoding" )
|
|
3076
|
+
|
|
3077
|
+
NIP-047 light client data of consecutive blocks of the active chain, as getsilentpaymenttweaks.
|
|
3078
|
+
The blocks come from one snapshot of the active chain. Whole blocks only: at least one, up to
|
|
3079
|
+
1000 blocks and 4 MB. Requires -silentpaymentindex.
|
|
3080
|
+
|
|
3081
|
+
Arguments:
|
|
3082
|
+
1. start_height (numeric, required) first height, from start_height of getsilentpaymentindexinfo
|
|
3083
|
+
up to the tip + 1 (an empty answer with status "tip")
|
|
3084
|
+
2. count (numeric, required) number of blocks wanted
|
|
3085
|
+
3. "anchor_hash" (string, optional) hash the client has at start_height - 1. If it left the active
|
|
3086
|
+
chain the answer is {"reorg": true, "fork_height": n}: continue from fork_height + 1
|
|
3087
|
+
4. "encoding" (string, optional, default=json) json, or hex for the binary message of type 2
|
|
3088
|
+
|
|
3089
|
+
Result (json):
|
|
3090
|
+
{
|
|
3091
|
+
"format" : 1,
|
|
3092
|
+
"context" : "hex",
|
|
3093
|
+
"snapshot" : { "height" : n, "hash" : "hash" }, (object) tip when the request was served
|
|
3094
|
+
"synced_height" : n,
|
|
3095
|
+
"blocks" : [ {...},... ], (array) as "block" in getsilentpaymenttweaks
|
|
3096
|
+
"next_height" : n, (numeric) height after the last block returned
|
|
3097
|
+
"status" : "str" (string) more: ask again now; tip: wait for a new block;
|
|
3098
|
+
incomplete: the index lacks data from next_height
|
|
3099
|
+
}
|
|
3100
|
+
|
|
3101
|
+
Examples:
|
|
3102
|
+
> neurai-cli getsilentpaymenttweaksrange 1000 100
|
|
3103
|
+
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getsilentpaymenttweaksrange", "params": [1000, 100, "00000000c937983704a73af28acdec37b049d214adbda81d7e2a3dd146f6ed09"] }' -H 'content-type: text/plain;' http://127.0.0.1:19001/
|
|
3104
|
+
**/
|
|
3105
|
+
getsilentpaymenttweaksrange: "getsilentpaymenttweaksrange",
|
|
2599
3106
|
/** getsnapshot "asset_name" block_height
|
|
2600
3107
|
|
|
2601
3108
|
THIS COMMAND IS NOT YET ACTIVE!
|
|
@@ -2611,10 +3118,17 @@ var methods = {
|
|
|
2611
3118
|
{
|
|
2612
3119
|
name: (string),
|
|
2613
3120
|
height: (number),
|
|
3121
|
+
block_hash: (string) the block the snapshot was captured on; empty for a legacy snapshot
|
|
3122
|
+
snapshot_hash: (string) commitment to the snapshot content (NIP-048); empty for a legacy snapshot
|
|
3123
|
+
format: (number) 0 legacy, 1 bound to its block, 2 also with holder state (NIP-048 D3)
|
|
3124
|
+
global_frozen: (bool, format 2) the asset was globally frozen
|
|
2614
3125
|
owners: [
|
|
2615
3126
|
{
|
|
2616
3127
|
address: (string),
|
|
2617
3128
|
amount_owned: (number),
|
|
3129
|
+
frozen: (bool, format 2) frozen for the asset (restricted asset or DEPIN owner freeze)
|
|
3130
|
+
self_revoked: (bool, format 2) a DEPIN holder that revoked itself
|
|
3131
|
+
tags: [ (string), ... ] (format 2) qualifier tags of the address
|
|
2618
3132
|
}
|
|
2619
3133
|
}
|
|
2620
3134
|
|
|
@@ -2622,6 +3136,64 @@ var methods = {
|
|
|
2622
3136
|
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getsnapshot", "params": ["ASSET_NAME" 28546] }' -H 'content-type: text/plain;' http://127.0.0.1:19001/
|
|
2623
3137
|
**/
|
|
2624
3138
|
getsnapshot: "getsnapshot",
|
|
3139
|
+
/** getsnapshotannouncement "asset_name" snapshot_height
|
|
3140
|
+
|
|
3141
|
+
Returns the message that announces a snapshot height before the chain reaches it (NIP-048). The holder of the
|
|
3142
|
+
owner token sends it to itself with that message, for instance:
|
|
3143
|
+
transfer "ASSET!" 1 "owner_token_address" "message"
|
|
3144
|
+
Other nodes that see the announcement request the same snapshot and can check the plan independently.
|
|
3145
|
+
A plan names the announcement with its "announcement" option.
|
|
3146
|
+
|
|
3147
|
+
Arguments:
|
|
3148
|
+
1. "asset_name" (string, required) The asset whose holders will be snapshotted
|
|
3149
|
+
2. snapshot_height (number, required) The future snapshot height
|
|
3150
|
+
|
|
3151
|
+
Result:
|
|
3152
|
+
{
|
|
3153
|
+
"asset_name": "name",
|
|
3154
|
+
"snapshot_height": n,
|
|
3155
|
+
"owner_token": "name", (string) the token that must carry the message
|
|
3156
|
+
"message": "hex", (string) SHA-256 of 0x05 || network || asset || height
|
|
3157
|
+
"minimum_notice": n, (number) blocks the announcement must precede the height (-minsnapshotnotice)
|
|
3158
|
+
"notice_if_mined_next": n (number) the notice if the announcement is mined in the next block
|
|
3159
|
+
}
|
|
3160
|
+
|
|
3161
|
+
Examples:
|
|
3162
|
+
> neurai-cli getsnapshotannouncement "TRONCO" 12345
|
|
3163
|
+
**/
|
|
3164
|
+
getsnapshotannouncement: "getsnapshotannouncement",
|
|
3165
|
+
/** getsnapshotrecipients "asset_name" snapshot_height
|
|
3166
|
+
|
|
3167
|
+
The holders in a snapshot with what an encrypted bulletin to them needs (NIP-048 D5). Encryption follows DePIN
|
|
3168
|
+
messaging: a holder is ready when its address is P2PKH or strict ECDSA and its public key is in -pubkeyindex.
|
|
3169
|
+
The others are listed too, so no holder is skipped silently. Needs -pubkeyindex.
|
|
3170
|
+
|
|
3171
|
+
Arguments:
|
|
3172
|
+
1. "asset_name" (string, required) The asset of the snapshot
|
|
3173
|
+
2. snapshot_height (number, required) The snapshot height
|
|
3174
|
+
|
|
3175
|
+
Result:
|
|
3176
|
+
{
|
|
3177
|
+
"asset_name": "name",
|
|
3178
|
+
"height": n,
|
|
3179
|
+
"block_hash": "hash",
|
|
3180
|
+
"snapshot_hash": "hex",
|
|
3181
|
+
"ready": n, "key_not_revealed": n, "unsupported_type": n,
|
|
3182
|
+
"holders": [
|
|
3183
|
+
{
|
|
3184
|
+
"address": "address",
|
|
3185
|
+
"held": x.xxx,
|
|
3186
|
+
"state": "ready"|"key_not_revealed"|"unsupported_type",
|
|
3187
|
+
"pubkey": "hex", (string, when ready)
|
|
3188
|
+
"frozen": bool, "self_revoked": bool (snapshots with holder state)
|
|
3189
|
+
}, ...
|
|
3190
|
+
]
|
|
3191
|
+
}
|
|
3192
|
+
|
|
3193
|
+
Examples:
|
|
3194
|
+
> neurai-cli getsnapshotrecipients "&TOKEN" 12345
|
|
3195
|
+
**/
|
|
3196
|
+
getsnapshotrecipients: "getsnapshotrecipients",
|
|
2625
3197
|
/** getsnapshotrequest "asset_name" block_height
|
|
2626
3198
|
|
|
2627
3199
|
Retrieves the specified snapshot request details.
|
|
@@ -2683,8 +3255,6 @@ var methods = {
|
|
|
2683
3255
|
"txid" : "transactionid", (string) The transaction id.
|
|
2684
3256
|
"time" : ttt, (numeric) The transaction time in seconds since epoch (1 Jan 1970 GMT)
|
|
2685
3257
|
"timereceived" : ttt, (numeric) The time received in seconds since epoch (1 Jan 1970 GMT)
|
|
2686
|
-
"bip125-replaceable": "yes|no|unknown", (string) Whether this transaction could be replaced due to BIP125 (replace-by-fee);
|
|
2687
|
-
may be unknown for unconfirmed transactions not in the mempool
|
|
2688
3258
|
"details" : [
|
|
2689
3259
|
{
|
|
2690
3260
|
"account" : "accountname", (string) DEPRECATED. The account name involved in the transaction, can be "" for the default account.
|
|
@@ -2831,6 +3401,7 @@ var methods = {
|
|
|
2831
3401
|
{
|
|
2832
3402
|
"walletname": xxxxx, (string) the wallet name
|
|
2833
3403
|
"walletversion": xxxxx, (numeric) the wallet version
|
|
3404
|
+
"addresstype": "type", (string) the address type fixed when the wallet was created (-addresstype): legacy, pq or ecdsa
|
|
2834
3405
|
"balance": xxxxxxx, (numeric) the total confirmed balance of the wallet in XNA
|
|
2835
3406
|
"unconfirmed_balance": xxx, (numeric) the total unconfirmed balance of the wallet in XNA
|
|
2836
3407
|
"immature_balance": xxxxxx, (numeric) the total immature balance of the wallet in XNA
|
|
@@ -2869,6 +3440,7 @@ var methods = {
|
|
|
2869
3440
|
2. "label" (string, optional, default="") An optional label
|
|
2870
3441
|
3. rescan (boolean, optional, default=true) Rescan the wallet for transactions
|
|
2871
3442
|
4. p2sh (boolean, optional, default=false) Add the P2SH version of the script as well
|
|
3443
|
+
If the wallet already has the keys, registering the redeem script can make its P2SH output spendable.
|
|
2872
3444
|
|
|
2873
3445
|
Note: This call can take minutes to complete if rescan is true.
|
|
2874
3446
|
If you have the full public key, you should call importpubkey instead of this.
|
|
@@ -2986,6 +3558,28 @@ var methods = {
|
|
|
2986
3558
|
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "importpubkey", "params": ["mypubkey", "testing", false] }' -H 'content-type: text/plain;' http://127.0.0.1:19001/
|
|
2987
3559
|
**/
|
|
2988
3560
|
importpubkey: "importpubkey",
|
|
3561
|
+
/** importsilentpaymentviewkey "scan_private_key" "spend_pubkey" ( start_height )
|
|
3562
|
+
|
|
3563
|
+
Turns this wallet into a watch wallet of a silent payment code: payments are
|
|
3564
|
+
detected and shown as watch-only, never spendable. Only for an unencrypted wallet
|
|
3565
|
+
without its own silent payment identity (or whose stored view key is damaged); the wallet
|
|
3566
|
+
can no longer be encrypted. Pass the secret with "neurai-cli -stdin importsilentpaymentviewkey"
|
|
3567
|
+
(one argument per line) so it stays out of the shell history and the process list.
|
|
3568
|
+
|
|
3569
|
+
Arguments:
|
|
3570
|
+
1. "scan_private_key" (string, required) hex b_scan
|
|
3571
|
+
2. "spend_pubkey" (string, required) hex B_spend
|
|
3572
|
+
3. start_height (numeric, optional, default=0) first block to scan
|
|
3573
|
+
|
|
3574
|
+
Result:
|
|
3575
|
+
{
|
|
3576
|
+
"code": "str", "scanned_height": n, "found": n
|
|
3577
|
+
}
|
|
3578
|
+
|
|
3579
|
+
Examples:
|
|
3580
|
+
> neurai-cli importsilentpaymentviewkey "<hex>" "<hex>" 0
|
|
3581
|
+
**/
|
|
3582
|
+
importsilentpaymentviewkey: "importsilentpaymentviewkey",
|
|
2989
3583
|
/** importwallet "filename"
|
|
2990
3584
|
|
|
2991
3585
|
Imports keys from a wallet dump file (see dumpwallet).
|
|
@@ -3370,6 +3964,7 @@ var methods = {
|
|
|
3370
3964
|
{
|
|
3371
3965
|
"address": "address", (string) The Neurai address
|
|
3372
3966
|
"pubkey": "pubkey_hex" (string) The public key in hex format
|
|
3967
|
+
"valid": 1|0 (numeric) 1 = active/valid, 0 = blocked/revoked (only meaningful for DEPIN assets; always 1 for regular assets)
|
|
3373
3968
|
},
|
|
3374
3969
|
...
|
|
3375
3970
|
]
|
|
@@ -3507,7 +4102,7 @@ var methods = {
|
|
|
3507
4102
|
|
|
3508
4103
|
Result:
|
|
3509
4104
|
[ (json array of strings)
|
|
3510
|
-
"address" (string) A
|
|
4105
|
+
"address" (string) A strict post-quantum (witness v2) address of a PQ key (pq1.../tpq1...)
|
|
3511
4106
|
...
|
|
3512
4107
|
]
|
|
3513
4108
|
|
|
@@ -3575,6 +4170,24 @@ var methods = {
|
|
|
3575
4170
|
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "listreceivedbyaddress", "params": [6, true, true] }' -H 'content-type: text/plain;' http://127.0.0.1:19001/
|
|
3576
4171
|
**/
|
|
3577
4172
|
listreceivedbyaddress: "listreceivedbyaddress",
|
|
4173
|
+
/** listsilentpayments ( include_spent )
|
|
4174
|
+
|
|
4175
|
+
Lists the silent payments received by this wallet.
|
|
4176
|
+
|
|
4177
|
+
Arguments:
|
|
4178
|
+
1. include_spent (boolean, optional, default=true)
|
|
4179
|
+
|
|
4180
|
+
Result:
|
|
4181
|
+
[{
|
|
4182
|
+
"txid": "hex", "vout": n, "k": n, "amount": x.xxx, "address": "str",
|
|
4183
|
+
"status": "pending|unconfirmed|confirmed|spent|conflicted|abandoned|other_chain|unknown",
|
|
4184
|
+
"confirmations": n, "blockhash": "hex", "height": n, "view_only": true|false
|
|
4185
|
+
}, ...]
|
|
4186
|
+
|
|
4187
|
+
Examples:
|
|
4188
|
+
> neurai-cli listsilentpayments
|
|
4189
|
+
**/
|
|
4190
|
+
listsilentpayments: "listsilentpayments",
|
|
3578
4191
|
/** listsinceblock ( "blockhash" target_confirmations include_watchonly include_removed )
|
|
3579
4192
|
|
|
3580
4193
|
Get all transactions in blocks since block [blockhash], or all transactions if omitted.
|
|
@@ -3606,8 +4219,6 @@ var methods = {
|
|
|
3606
4219
|
"txid": "transactionid", (string) The transaction id. Available for 'send' and 'receive' category of transactions.
|
|
3607
4220
|
"time": xxx, (numeric) The transaction time in seconds since epoch (Jan 1 1970 GMT).
|
|
3608
4221
|
"timereceived": xxx, (numeric) The time received in seconds since epoch (Jan 1 1970 GMT). Available for 'send' and 'receive' category of transactions.
|
|
3609
|
-
"bip125-replaceable": "yes|no|unknown", (string) Whether this transaction could be replaced due to BIP125 (replace-by-fee);
|
|
3610
|
-
may be unknown for unconfirmed transactions not in the mempool
|
|
3611
4222
|
"abandoned": xxx, (bool) 'true' if the transaction has been abandoned (inputs are respendable). Only available for the 'send' category of transactions.
|
|
3612
4223
|
"comment": "...", (string) If a comment is associated with the transaction.
|
|
3613
4224
|
"label" : "label" (string) A comment for the address/transaction, if any
|
|
@@ -3712,8 +4323,6 @@ var methods = {
|
|
|
3712
4323
|
"otheraccount": "accountname", (string) DEPRECATED. For the 'move' category of transactions, the account the funds came
|
|
3713
4324
|
from (for receiving funds, positive amounts), or went to (for sending funds,
|
|
3714
4325
|
negative amounts).
|
|
3715
|
-
"bip125-replaceable": "yes|no|unknown", (string) Whether this transaction could be replaced due to BIP125 (replace-by-fee);
|
|
3716
|
-
may be unknown for unconfirmed transactions not in the mempool
|
|
3717
4326
|
"abandoned": xxx (bool) 'true' if the transaction has been abandoned (inputs are respendable). Only available for the
|
|
3718
4327
|
'send' category of transactions.
|
|
3719
4328
|
}
|
|
@@ -3866,6 +4475,28 @@ var methods = {
|
|
|
3866
4475
|
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "move", "params": ["timotei", "akiko", 0.01, 6, "happy birthday!"] }' -H 'content-type: text/plain;' http://127.0.0.1:19001/
|
|
3867
4476
|
**/
|
|
3868
4477
|
move: "move",
|
|
4478
|
+
/** opendepin "asset_name" ("change_address")
|
|
4479
|
+
|
|
4480
|
+
THIS COMMAND IS NOT YET ACTIVE!
|
|
4481
|
+
https://github.com/NeuraiProject/rips/blob/master/rip-0002.mediawiki
|
|
4482
|
+
|
|
4483
|
+
Open transfers of a DEPIN asset (owner only): while open, holders can move
|
|
4484
|
+
the asset like a regular asset without the owner token. Transfers from addresses
|
|
4485
|
+
frozen by the owner or self-revoked stay rejected. Valid from the closed state;
|
|
4486
|
+
takes effect from the block after the one that confirms it.
|
|
4487
|
+
|
|
4488
|
+
Arguments:
|
|
4489
|
+
1. "asset_name" (string, required) The DEPIN asset name (must start with &)
|
|
4490
|
+
2. "change_address" (string, optional) The change address for the owner token
|
|
4491
|
+
|
|
4492
|
+
Result:
|
|
4493
|
+
"txid" (string) The transaction id
|
|
4494
|
+
|
|
4495
|
+
Examples:
|
|
4496
|
+
> neurai-cli opendepin "&FRANCE"
|
|
4497
|
+
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "opendepin", "params": ["&FRANCE"] }' -H 'content-type: text/plain;' http://127.0.0.1:19001/
|
|
4498
|
+
**/
|
|
4499
|
+
opendepin: "opendepin",
|
|
3869
4500
|
/** ping
|
|
3870
4501
|
|
|
3871
4502
|
Requests that a ping be sent to all other nodes, to measure ping time.
|
|
@@ -3882,15 +4513,15 @@ var methods = {
|
|
|
3882
4513
|
Attempts to submit new block to network mined by kawpow gpu miner via rpc.
|
|
3883
4514
|
|
|
3884
4515
|
Arguments
|
|
3885
|
-
1. "header_hash" (string, required) the
|
|
3886
|
-
2. "mix_hash" (string, required) the mix hash
|
|
3887
|
-
3. "nonce" (string, required)
|
|
4516
|
+
1. "header_hash" (string, required) the header hash given to the GPU miner (exactly 64 hex digits)
|
|
4517
|
+
2. "mix_hash" (string, required) the mix hash mined by the GPU miner (exactly 64 hex digits)
|
|
4518
|
+
3. "nonce" (string, required) 1 to 16 hex digits, optionally prefixed with 0x
|
|
3888
4519
|
|
|
3889
4520
|
Result:
|
|
3890
4521
|
|
|
3891
4522
|
Examples:
|
|
3892
|
-
> neurai-cli pprpcsb "header_hash" "mix_hash"
|
|
3893
|
-
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "pprpcsb", "params": ["header_hash" "mix_hash"
|
|
4523
|
+
> neurai-cli pprpcsb "header_hash" "mix_hash" "0x100000"
|
|
4524
|
+
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "pprpcsb", "params": ["header_hash" "mix_hash" "0x100000"] }' -H 'content-type: text/plain;' http://127.0.0.1:19001/
|
|
3894
4525
|
**/
|
|
3895
4526
|
pprpcsb: "pprpcsb",
|
|
3896
4527
|
/** preciousblock "blockhash"
|
|
@@ -4058,9 +4689,54 @@ var methods = {
|
|
|
4058
4689
|
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "removetagfromaddress", "params": ["#TAG" "to_address" "change_address"] }' -H 'content-type: text/plain;' http://127.0.0.1:19001/
|
|
4059
4690
|
**/
|
|
4060
4691
|
removetagfromaddress: "removetagfromaddress",
|
|
4692
|
+
/** repairsilentpaymentidentity
|
|
4693
|
+
|
|
4694
|
+
Rewrites the silent payment code of this wallet from its seed after an identity failure
|
|
4695
|
+
("stored silent payment code does not match the wallet seed"). Payments sent to the
|
|
4696
|
+
replaced code did not reach this wallet: check your backups before repairing.
|
|
4697
|
+
|
|
4698
|
+
Result:
|
|
4699
|
+
{
|
|
4700
|
+
"previous_code": "str", (string) the code that was stored (do not use it)
|
|
4701
|
+
"code": "str" (string) the code derived from the seed
|
|
4702
|
+
}
|
|
4703
|
+
|
|
4704
|
+
Examples:
|
|
4705
|
+
> neurai-cli repairsilentpaymentidentity
|
|
4706
|
+
**/
|
|
4707
|
+
repairsilentpaymentidentity: "repairsilentpaymentidentity",
|
|
4708
|
+
/** replaysnapshot "asset_name" snapshot_height ( "expected_snapshot_hash" )
|
|
4709
|
+
|
|
4710
|
+
Rebuilds the holders of an asset at a height from the blocks and their undo data, without using any snapshot,
|
|
4711
|
+
and returns the snapshot hash they give (NIP-048). A node that did not capture the snapshot can so check a
|
|
4712
|
+
plan's snapshot_hash. It reads every block from asset activation to the height: it is slow, and a pruned node
|
|
4713
|
+
cannot do it.
|
|
4714
|
+
|
|
4715
|
+
Arguments:
|
|
4716
|
+
1. "asset_name" (string, required) The asset
|
|
4717
|
+
2. snapshot_height (number, required) The height to rebuild
|
|
4718
|
+
3. "expected_snapshot_hash" (string, optional) A snapshot_hash to compare with, for instance from a plan
|
|
4719
|
+
|
|
4720
|
+
Result:
|
|
4721
|
+
{
|
|
4722
|
+
"asset_name": "name",
|
|
4723
|
+
"height": n,
|
|
4724
|
+
"block_hash": "hash",
|
|
4725
|
+
"snapshot_hash": "hex", (string) as in getsnapshot and getdistributionplan
|
|
4726
|
+
"holders": n,
|
|
4727
|
+
"scanned_blocks": n,
|
|
4728
|
+
"matches_stored": true|false|null, (null: this node holds no snapshot at that height)
|
|
4729
|
+
"matches_expected": true|false|null (null: no expected hash given)
|
|
4730
|
+
}
|
|
4731
|
+
|
|
4732
|
+
Examples:
|
|
4733
|
+
> neurai-cli replaysnapshot "TRONCO" 12345
|
|
4734
|
+
**/
|
|
4735
|
+
replaysnapshot: "replaysnapshot",
|
|
4061
4736
|
/** requestsnapshot "asset_name" block_height
|
|
4062
4737
|
|
|
4063
|
-
Schedules a snapshot of the specified asset at the specified block height.
|
|
4738
|
+
Schedules a snapshot of the specified asset at the specified block height. The node captures it while it
|
|
4739
|
+
connects that block, so at most -maxsnapshotrequests different assets are accepted at one height.
|
|
4064
4740
|
|
|
4065
4741
|
Arguments:
|
|
4066
4742
|
1. "asset_name" (string, required) The asset name for which the snapshot will be taken
|
|
@@ -4095,6 +4771,24 @@ var methods = {
|
|
|
4095
4771
|
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "rescanblockchain", "params": [100000, 120000] }' -H 'content-type: text/plain;' http://127.0.0.1:19001/
|
|
4096
4772
|
**/
|
|
4097
4773
|
rescanblockchain: "rescanblockchain",
|
|
4774
|
+
/** rescansilentpayments ( start_height )
|
|
4775
|
+
|
|
4776
|
+
Scans the active chain again for silent payments, from start_height to the tip.
|
|
4777
|
+
Reads blocks and their undo data; -txindex is not needed. Scanning stops, without
|
|
4778
|
+
advancing past it, at the first block whose data is not available (pruned node).
|
|
4779
|
+
|
|
4780
|
+
Arguments:
|
|
4781
|
+
1. start_height (numeric, optional, default=0)
|
|
4782
|
+
|
|
4783
|
+
Result:
|
|
4784
|
+
{
|
|
4785
|
+
"start_height": n, "scanned_height": n, "found": n
|
|
4786
|
+
}
|
|
4787
|
+
|
|
4788
|
+
Examples:
|
|
4789
|
+
> neurai-cli rescansilentpayments 100
|
|
4790
|
+
**/
|
|
4791
|
+
rescansilentpayments: "rescansilentpayments",
|
|
4098
4792
|
/** savemempool
|
|
4099
4793
|
|
|
4100
4794
|
Dumps the mempool to disk.
|
|
@@ -4104,6 +4798,28 @@ var methods = {
|
|
|
4104
4798
|
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "savemempool", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:19001/
|
|
4105
4799
|
**/
|
|
4106
4800
|
savemempool: "savemempool",
|
|
4801
|
+
/** sealdepin "asset_name" ("change_address")
|
|
4802
|
+
|
|
4803
|
+
THIS COMMAND IS NOT YET ACTIVE!
|
|
4804
|
+
https://github.com/NeuraiProject/rips/blob/master/rip-0002.mediawiki
|
|
4805
|
+
|
|
4806
|
+
Seal a DEPIN asset (owner only). WARNING: THIS IS IRREVERSIBLE.
|
|
4807
|
+
A sealed asset is soulbound like a closed one, but no transfer state operation
|
|
4808
|
+
(open, close or seal) is ever accepted for it again. Only valid from the closed
|
|
4809
|
+
state: an open asset must be closed first.
|
|
4810
|
+
|
|
4811
|
+
Arguments:
|
|
4812
|
+
1. "asset_name" (string, required) The DEPIN asset name (must start with &)
|
|
4813
|
+
2. "change_address" (string, optional) The change address for the owner token
|
|
4814
|
+
|
|
4815
|
+
Result:
|
|
4816
|
+
"txid" (string) The transaction id
|
|
4817
|
+
|
|
4818
|
+
Examples:
|
|
4819
|
+
> neurai-cli sealdepin "&FRANCE"
|
|
4820
|
+
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "sealdepin", "params": ["&FRANCE"] }' -H 'content-type: text/plain;' http://127.0.0.1:19001/
|
|
4821
|
+
**/
|
|
4822
|
+
sealdepin: "sealdepin",
|
|
4107
4823
|
/** selfrevokedepin "asset_name"
|
|
4108
4824
|
|
|
4109
4825
|
THIS COMMAND IS NOT YET ACTIVE!
|
|
@@ -4171,7 +4887,7 @@ var methods = {
|
|
|
4171
4887
|
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "sendfrom", "params": ["tabby", "1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd", 0.01, 6, "donation", "seans outpost"] }' -H 'content-type: text/plain;' http://127.0.0.1:19001/
|
|
4172
4888
|
**/
|
|
4173
4889
|
sendfrom: "sendfrom",
|
|
4174
|
-
/** sendfromaddress "from_address" "to_address" amount ( "comment" "comment_to" subtractfeefromamount
|
|
4890
|
+
/** sendfromaddress "from_address" "to_address" amount ( "comment" "comment_to" subtractfeefromamount conf_target "estimate_mode")
|
|
4175
4891
|
|
|
4176
4892
|
Send an amount from a specific address to a given address. All xna change will get sent back to the from_address
|
|
4177
4893
|
|
|
@@ -4202,7 +4918,7 @@ var methods = {
|
|
|
4202
4918
|
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "sendfromaddress", "params": ["1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd" "1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd", 0.1, "donation", "seans outpost"] }' -H 'content-type: text/plain;' http://127.0.0.1:19001/
|
|
4203
4919
|
**/
|
|
4204
4920
|
sendfromaddress: "sendfromaddress",
|
|
4205
|
-
/** sendmany "fromaccount" {"address":amount,...} ( minconf "comment" ["address",...]
|
|
4921
|
+
/** sendmany "fromaccount" {"address":amount,...} ( minconf "comment" ["address",...] conf_target "estimate_mode")
|
|
4206
4922
|
|
|
4207
4923
|
Send multiple times. Amounts are double-precision floating point numbers.
|
|
4208
4924
|
|
|
@@ -4295,7 +5011,29 @@ var methods = {
|
|
|
4295
5011
|
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "sendrawtransaction", "params": ["signedhex"] }' -H 'content-type: text/plain;' http://127.0.0.1:19001/
|
|
4296
5012
|
**/
|
|
4297
5013
|
sendrawtransaction: "sendrawtransaction",
|
|
4298
|
-
/**
|
|
5014
|
+
/** sendsilentpayments [{"code":"str","amount":x},...] ( conf_target "estimate_mode" )
|
|
5015
|
+
|
|
5016
|
+
Pays one or more silent payment codes from strict ECDSA (v3) coins only.
|
|
5017
|
+
Several payments to the same code are allowed (up to 16 per code); the change
|
|
5018
|
+
returns to a new internal v3 address.
|
|
5019
|
+
|
|
5020
|
+
Arguments:
|
|
5021
|
+
1. payments (array, required) [{"code": payment code, "amount": amount in XNA}, ...]
|
|
5022
|
+
2. conf_target (numeric, optional) Confirmation target (in blocks)
|
|
5023
|
+
3. "estimate_mode" (string, optional, default=UNSET) UNSET, ECONOMICAL or CONSERVATIVE
|
|
5024
|
+
|
|
5025
|
+
Result:
|
|
5026
|
+
{
|
|
5027
|
+
"txid": "hex",
|
|
5028
|
+
"fee": x.xxx,
|
|
5029
|
+
"payments": [{"code": "str", "amount": x.xxx, "vout": n, "k": n}, ...]
|
|
5030
|
+
}
|
|
5031
|
+
|
|
5032
|
+
Examples:
|
|
5033
|
+
> neurai-cli sendsilentpayments '[{"code":"tnsp1q...","amount":1.5}]'
|
|
5034
|
+
**/
|
|
5035
|
+
sendsilentpayments: "sendsilentpayments",
|
|
5036
|
+
/** sendtoaddress "address" amount ( "comment" "comment_to" subtractfeefromamount conf_target "estimate_mode")
|
|
4299
5037
|
|
|
4300
5038
|
Send an amount to a given address.
|
|
4301
5039
|
|
|
@@ -4509,8 +5247,7 @@ var methods = {
|
|
|
4509
5247
|
signrawtransaction: "signrawtransaction",
|
|
4510
5248
|
/** stop
|
|
4511
5249
|
|
|
4512
|
-
Stop Neurai server
|
|
4513
|
-
**/
|
|
5250
|
+
Stop Neurai server.**/
|
|
4514
5251
|
stop: "stop",
|
|
4515
5252
|
/** submitblock "hexdata" ( "dummy" )
|
|
4516
5253
|
|
|
@@ -4841,6 +5578,73 @@ var methods = {
|
|
|
4841
5578
|
> curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "verifychain", "params": [] }' -H 'content-type: text/plain;' http://127.0.0.1:19001/
|
|
4842
5579
|
**/
|
|
4843
5580
|
verifychain: "verifychain",
|
|
5581
|
+
/** verifydistribution {plan} [batches] ( {options} )
|
|
5582
|
+
|
|
5583
|
+
Classifies the batches of a distribution plan from the operator's batch records (NIP-048): every signed
|
|
5584
|
+
version of each batch. Nothing is broadcast, rebuilt or spent.
|
|
5585
|
+
confirmed a version that pays the batch has the required confirmations
|
|
5586
|
+
confirming a version is in the active chain with fewer confirmations; its recipients stay reserved
|
|
5587
|
+
pending a version is in the mempool, or is signed and all its inputs are unspent; rebroadcast it
|
|
5588
|
+
conflicting every version has an input spent by another transaction (needs -txindex to tell apart
|
|
5589
|
+
from a confirmed version whose outputs were all spent)
|
|
5590
|
+
unknown no recorded version, or the node cannot tell; review before building anything
|
|
5591
|
+
|
|
5592
|
+
Arguments:
|
|
5593
|
+
1. plan (object, required) The plan parameters
|
|
5594
|
+
{
|
|
5595
|
+
"asset_name": "name", (string, required) as in getdistributionplan
|
|
5596
|
+
"snapshot_height": n, (number, required)
|
|
5597
|
+
"distribution_asset_name": "name", (string, required)
|
|
5598
|
+
"amount": x.xxx, (numeric, required) gross_distribution_amount
|
|
5599
|
+
"exception_addresses": "a,b", (string, optional)
|
|
5600
|
+
"remainder": "payer"|"largest", (string, optional, default "payer")
|
|
5601
|
+
"allow_legacy_snapshot": bool, (boolean, optional, default false)
|
|
5602
|
+
"announcement": {"txid": "hex", "block_hash": "hex"} (object, optional) as in getdistributionplan
|
|
5603
|
+
"qualifier": "#TAG", (string, optional) as in getdistributionplan
|
|
5604
|
+
"weights": {"address": n, ...}, (object, optional) as in getdistributionplan
|
|
5605
|
+
"report": {"txid": "hex", "block_hash": "hex"} (object, optional) as in getdistributionplan
|
|
5606
|
+
"allocation": "holdings"|"equal", (string, optional, default "holdings") as in getdistributionplan
|
|
5607
|
+
"min_held": x.xxx, (numeric, optional) as in getdistributionplan
|
|
5608
|
+
}
|
|
5609
|
+
2. batches (array, required) The operator's batch records
|
|
5610
|
+
[
|
|
5611
|
+
{
|
|
5612
|
+
"index": n, (number, required) batch index
|
|
5613
|
+
"versions": [ (array, required) every signed version, as hex or as
|
|
5614
|
+
"hex" | { "hex": "hex", "block_hash": "hash" }, ... an object with the block it was seen in
|
|
5615
|
+
]
|
|
5616
|
+
}, ...
|
|
5617
|
+
]
|
|
5618
|
+
3. options (object, optional)
|
|
5619
|
+
{
|
|
5620
|
+
"max_outputs": n, (number, default 500) batch size used to build the batches
|
|
5621
|
+
"confirmations": n (number, default 6) confirmations a batch needs to count as paid
|
|
5622
|
+
}
|
|
5623
|
+
|
|
5624
|
+
Result:
|
|
5625
|
+
{
|
|
5626
|
+
"plan_hash": "hex",
|
|
5627
|
+
"complete": true|false, (boolean) every batch is confirmed
|
|
5628
|
+
"paid": x.xxx, (numeric) amount in confirmed batches
|
|
5629
|
+
"reserved": x.xxx, (numeric) amount in confirming and pending batches
|
|
5630
|
+
"unpaid": x.xxx, (numeric) amount in conflicting and unknown batches
|
|
5631
|
+
"batches": [
|
|
5632
|
+
{
|
|
5633
|
+
"index": n,
|
|
5634
|
+
"batch_id": "hex",
|
|
5635
|
+
"state": "confirmed"|"confirming"|"pending"|"conflicting"|"unknown",
|
|
5636
|
+
"txid": "hex", (string, optional) the version that decides the state
|
|
5637
|
+
"confirmations": n, (number, optional)
|
|
5638
|
+
"amount": x.xxx,
|
|
5639
|
+
"issues": [ "text", ... ]
|
|
5640
|
+
}, ...
|
|
5641
|
+
]
|
|
5642
|
+
}
|
|
5643
|
+
|
|
5644
|
+
Examples:
|
|
5645
|
+
> neurai-cli verifydistribution '{"asset_name":"TRONCO","snapshot_height":12345,"distribution_asset_name":"XNA","amount":1000}' '[{"index":0,"versions":["0200..."]}]'
|
|
5646
|
+
**/
|
|
5647
|
+
verifydistribution: "verifydistribution",
|
|
4844
5648
|
/** verifymessage "address" "signature" "message"
|
|
4845
5649
|
|
|
4846
5650
|
Verify a signed message
|
|
@@ -5060,7 +5864,7 @@ function assertNoDuplicateJsonKeys(text) {
|
|
|
5060
5864
|
|
|
5061
5865
|
// index.ts
|
|
5062
5866
|
var MAINNET_GENESIS_HASH = "00000044d33c0c0ba019be5c0249730424a69cb4c222153322f68c6104484806";
|
|
5063
|
-
var TESTNET_GENESIS_HASH = "
|
|
5867
|
+
var TESTNET_GENESIS_HASH = "000000c710413a4265a996d30c86043aedef6a563900f1bc43fea61d5b2dc77d";
|
|
5064
5868
|
async function assertRpcGenesis(rpc, expectedGenesisHash) {
|
|
5065
5869
|
const actual = await rpc("getblockhash", [0]);
|
|
5066
5870
|
if (typeof actual !== "string" || actual.toLowerCase() !== expectedGenesisHash.toLowerCase()) {
|