-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.d.ts
4384 lines (4119 loc) · 144 KB
/
index.d.ts
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
/* eslint-disable max-len */
/* eslint-disable indent */
/**
* Request for adapt signature on ecdsa adaptor.
* @property {string} adaptorSignature - adaptor signature hex.
* @property {string} secret - secret data
*/
export interface AdaptEcdsaAdaptorRequest {
adaptorSignature: string;
secret: string;
}
/**
* Multisig input data to add to tx.
* @property {boolean} isElements? - elements transaction flag.
* @property {string} tx - transaction hex
* @property {AddMultisigSignTxInRequest} txin - transaction input data
*/
export interface AddMultisigSignRequest {
isElements?: boolean;
tx: string;
txin: AddMultisigSignTxInRequest;
}
/**
* Multisig signature input data.
* @property {string} txid - utxo txid.
* @property {number} vout - utxo vout.
* @property {PubkeySignData[]} signParams - pubkey signature data.
* @property {string} redeemScript? - (required for P2SH or P2SH-P2WSH) redeem script for unlocking script
* @property {string} witnessScript? - (required for P2WSH or P2SH-P2WSH) witness script for witness stack
* @property {string} hashType - hash type. (p2sh, p2wsh or p2sh-p2wsh)
* @property {boolean} clearStack? - Clear the stack before addSign. If txinType is p2sh, clearStack is forced to be true.
*/
export interface AddMultisigSignTxInRequest {
txid: string;
vout: number;
signParams: PubkeySignData[];
redeemScript?: string;
witnessScript?: string;
hashType: string;
clearStack?: boolean;
}
/**
* request for add psbt data.
* @property {string} psbt - psbt data (hex or base64)
* @property {PsbtAddInputRequest[]} inputs? - request for add psbt input.
* @property {PsbtAddOutputRequest[]} outputs? - request for add psbt output.
*/
export interface AddPsbtDataRequest {
psbt: string;
inputs?: PsbtAddInputRequest[];
outputs?: PsbtAddOutputRequest[];
}
/**
* pubkey hash input data to add to tx.
* @property {boolean} isElements? - elements transaction flag.
* @property {string} tx - transaction hex
* @property {AddPubkeyHashSignTxInRequest} txin - transaction input data
*/
export interface AddPubkeyHashSignRequest {
isElements?: boolean;
tx: string;
txin: AddPubkeyHashSignTxInRequest;
}
/**
* pubkey hash input data
* @property {string} txid - utxo txid.
* @property {number} vout - utxo vout.
* @property {PubkeySignData} signParam - sign parameter.
* @property {string} pubkey - public key.
* @property {string} hashType - hash type. (p2pkh, p2wpkh or p2sh-p2wpkh)
*/
export interface AddPubkeyHashSignTxInRequest {
txid: string;
vout: number;
signParam: PubkeySignData;
pubkey: string;
hashType: string;
}
/**
* The data added to the transaction.
* @property {string} tx - transaction hex
* @property {TxInRequest[]} txins? - The data added to the transaction input.
* @property {TxOutRequest[]} txouts? - The data added to the transaction output.
*/
export interface AddRawTransactionRequest {
tx: string;
txins?: TxInRequest[];
txouts?: TxOutRequest[];
}
/**
* script hash input data to add to tx.
* @property {boolean} isElements? - elements transaction flag.
* @property {string} tx - transaction hex
* @property {AddScriptHashSignTxInRequest} txin - transaction input data
*/
export interface AddScriptHashSignRequest {
isElements?: boolean;
tx: string;
txin: AddScriptHashSignTxInRequest;
}
/**
* script hash input data
* @property {string} txid - utxo txid.
* @property {number} vout - utxo vout.
* @property {SignData[]} signParams - The sign data.
* @property {SignData[]} signParam? - The sign data.
* @property {string} redeemScript - redeem script.
* @property {string} hashType - hash type. (p2sh, p2wsh or p2sh-p2wsh)
*/
export interface AddScriptHashSignTxInRequest {
txid: string;
vout: number;
signParams: SignData[];
signParam?: SignData[];
redeemScript: string;
hashType: string;
}
/**
* Sign input data to add to tx.
* @property {boolean} isElements? - elements transaction flag.
* @property {string} tx - transaction hex
* @property {AddSignTxInRequest} txin - transaction input data
*/
export interface AddSignRequest {
isElements?: boolean;
tx: string;
txin: AddSignTxInRequest;
}
/**
* Sign input data.
* @property {string} txid - utxo txid.
* @property {number} vout - utxo vout.
* @property {boolean} isWitness? - use witness stack flag.
* @property {SignData[]} signParams - The sign data.
* @property {SignData[]} signParam? - The sign data.
* @property {boolean} clearStack? - Clear the stack before addSign. If isWitness is false, clearStack is forced to be true.
*/
export interface AddSignTxInRequest {
txid: string;
vout: number;
isWitness?: boolean;
signParams: SignData[];
signParam?: SignData[];
clearStack?: boolean;
}
/**
* taproot input data to add to tx.
* @property {boolean} isElements? - elements transaction flag.
* @property {string} tx - transaction hex
* @property {AddTaprootSchnorrSignTxInRequest} txin - transaction input data
*/
export interface AddTaprootSchnorrSignRequest {
isElements?: boolean;
tx: string;
txin: AddTaprootSchnorrSignTxInRequest;
}
/**
* taprootinput data
* @property {string} txid - utxo txid.
* @property {number} vout - utxo vout.
* @property {string} signature - sign hex.
* @property {string} sighashType? - signature hash type. (default, all, none or single)
* @property {boolean} sighashAnyoneCanPay? - sighashType anyone can pay flag.
* @property {boolean} sighashRangeproof? - (for Elements) sighash rangeproof
* @property {string} annex? - taproot annex bytes.
*/
export interface AddTaprootSchnorrSignTxInRequest {
txid: string;
vout: number;
signature: string;
sighashType?: string;
sighashAnyoneCanPay?: boolean;
sighashRangeproof?: boolean;
annex?: string;
}
/**
* tapscript input data to add to tx.
* @property {boolean} isElements? - elements transaction flag.
* @property {string} tx - transaction hex
* @property {AddTapscriptSignTxInRequest} txin - transaction input data
*/
export interface AddTapscriptSignRequest {
isElements?: boolean;
tx: string;
txin: AddTapscriptSignTxInRequest;
}
/**
* tapscript input data
* @property {string} txid - utxo txid.
* @property {number} vout - utxo vout.
* @property {TapScriptSignData[]} signParams - tapscript sign data.
* @property {string} tapscript - tapscript.
* @property {string} controlBlock - tapscript control block.
* @property {string} annex? - taproot annex bytes.
*/
export interface AddTapscriptSignTxInRequest {
txid: string;
vout: number;
signParams: TapScriptSignData[];
tapscript: string;
controlBlock: string;
annex?: string;
}
/**
* TapScript tree information
* @property {TapScriptTreeItem[]} branches - TapScript tree item
*/
export interface AnalyzeTapScriptTreeInfo {
branches: TapScriptTreeItem[];
}
/**
* Request for get TapBranch info.
* @property {string} treeString - tree serialize string. (cfd format)
*/
export interface AnalyzeTapScriptTreeRequest {
treeString: string;
}
/**
* The output descriptor request data.
* @property {string} descriptor - output descriptor.
* @property {boolean} isElements? - elements transaction flag.
*/
export interface AppendDescriptorChecksumRequest {
descriptor: string;
isElements?: boolean;
}
/**
* base64 data
* @property {string} base64 - base64 data
*/
export interface Base64Data {
base64: string;
}
/**
* Response of blinding key.
* @property {string} blindingKey - blinding key
*/
export interface BlindingKeyResponse {
blindingKey: string;
}
/**
* Tx input issuance data for blinding.
* @property {string} txid - utxo txid.
* @property {number} vout - utxo vout.
* @property {string} assetBlindingKey - asset blinding key.
* @property {string} tokenBlindingKey? - token blinding key. Used when issue transaction.
*/
export interface BlindIssuanceRequest {
txid: string;
vout: number;
assetBlindingKey: string;
tokenBlindingKey?: string;
}
/**
* Request blind the transaction.
* @property {string} tx - transaction hex
* @property {BlindTxInRequest[]} txins - Tx input data for blinding.
* @property {BlindTxOutRequest[]} txouts? - Tx output data for blinding.
* @property {string[]} txoutConfidentialAddresses? - Confidential address list. Use instead of txouts.
* @property {BlindIssuanceRequest[]} issuances? - Tx input issuance data for blinding.
* @property {bigint | number} minimumRangeValue? - rangeproof minimum value.
* @property {number} exponent? - An exponential value that guarantees a range of rangeproof.
* @property {number} minimumBits? - minimum bits of rangeproof.
* @property {boolean} collectBlinder? - collect blinder data. (blinders and issuanceBlinders)
*/
export interface BlindRawTransactionRequest {
tx: string;
txins: BlindTxInRequest[];
txouts?: BlindTxOutRequest[];
txoutConfidentialAddresses?: string[];
issuances?: BlindIssuanceRequest[];
minimumRangeValue?: bigint | number;
exponent?: number;
minimumBits?: number;
collectBlinder?: boolean;
}
/**
* The output blind transaction data.
* @property {string} hex - transaction hex.
* @property {UnblindOutput[]} blinders? - unblind txout
* @property {UnblindIssuanceOutput[]} issuanceBlinders? - unblind issuance data
*/
export interface BlindTransactionResponse {
hex: string;
blinders?: UnblindOutput[];
issuanceBlinders?: UnblindIssuanceOutput[];
}
/**
* Tx input data for blinding.
* @property {string} txid - utxo txid.
* @property {number} vout - utxo vout.
* @property {string} asset - asset hex.
* @property {string} blindFactor? - amount blinder.
* @property {string} assetBlindFactor? - asset blinder.
* @property {bigint | number} amount - satoshi amount.
*/
export interface BlindTxInRequest {
txid: string;
vout: number;
asset: string;
blindFactor?: string;
assetBlindFactor?: string;
amount: bigint | number;
}
/**
* Tx output data for blinding.
* @property {number} index - target txout index.
* @property {string} confidentialKey - confidential key.
* @property {string} blindPubkey? - (deprecated field)
*/
export interface BlindTxOutRequest {
index: number;
confidentialKey: string;
blindPubkey?: string;
}
/**
* block data.
* @property {boolean} isElements? - elements transaction flag.
* @property {string} block - block hex
*/
export interface BlockData {
isElements?: boolean;
block: string;
}
/**
* The output block information.
* @property {string} blockHash - block hash.
* @property {string[]} tx - txid list.
* @property {number} version - version.
* @property {string} versionHex - version hex.
* @property {string} previousblockhash - previous block hash.
* @property {string} merkleroot - merkleroot.
* @property {number} time - block time.
* @property {number} bits - bits.
* @property {number} nonce - nonce.
*/
export interface BlockInformation {
blockHash: string;
tx: string[];
version: number;
versionHex: string;
previousblockhash: string;
merkleroot: string;
time: number;
bits: number;
nonce: number;
}
/**
* The output block transaction data.
* @property {string} tx - tx hex.
* @property {string} txoutproof - txout proof.
*/
export interface BlockTxData {
tx: string;
txoutproof: string;
}
/**
* Request by block and txid.
* @property {boolean} isElements? - elements transaction flag.
* @property {string} block - block hex
* @property {string} txid - txid
*/
export interface BlockTxRequest {
isElements?: boolean;
block: string;
txid: string;
}
/**
* request ec signature data.
* @property {string} sighash - signature hash.
* @property {PrivkeyData} privkeyData? - private key data.
* @property {boolean} isGrindR? - Grind-R flag
*/
export interface CalculateEcSignatureRequest {
sighash: string;
privkeyData?: PrivkeyData;
isGrindR?: boolean;
}
/**
* tweak pubkey data
* @property {string} pubkey - tweaked schnorr public key
* @property {boolean} parity - y-parity flag
* @property {string} basePubkey - tweak based schnorr public key
* @property {string} tweak - 32-byte tweak data
*/
export interface CheckTweakedSchnorrPubkeyRequest {
pubkey: string;
parity: boolean;
basePubkey: string;
tweak: string;
}
/**
* fee information.
* @property {bigint | number} txFeeAmount? - Tx fee amount excluding txin.
* @property {number} feeRate? - network fee rate
* @property {number} longTermFeeRate? - network long-term fee rate
* @property {number} knapsackMinChange? - knapsack minimum change amount. (knapsack logic's threshold. Recommended value is 1.)
* @property {string} feeAsset? - fee asset (This field is available only elements.)
* @property {number} exponent? - blind exponent (This field is available only elements.)
* @property {number} minimumBits? - blind minimum bits (This field is available only elements.)
*/
export interface CoinSelectionFeeInformationField {
txFeeAmount?: bigint | number;
feeRate?: number;
longTermFeeRate?: number;
knapsackMinChange?: number;
feeAsset?: string;
exponent?: number;
minimumBits?: number;
}
/**
* Request for compute sigpoint on schnorr
* @property {string} message - message data. (32-byte hash, or text message.)
* @property {boolean} isHashed? - is 32-byte hashed message.
* @property {string} nonce - 32-byte nonce data.
* @property {string} schnorrPubkey - xonly public key.
*/
export interface ComputeSigPointRequest {
message: string;
isHashed?: boolean;
nonce: string;
schnorrPubkey: string;
}
/**
* Request AES data.
* @property {boolean} isEncrypt - aes encrypt flag. true is encrypt, false is decrypt
* @property {string} mode? - AES mode. (for feature) (cbc only)
* @property {string} key - key data (32 byte: 64 char hex)
* @property {string} iv? - initial vector (16 byte: 32 char hex) (using by cbc mode only.)
* @property {string} data - crypto target data
*/
export interface ConvertAesRequest {
isEncrypt: boolean;
mode?: string;
key: string;
iv?: string;
data: string;
}
/**
* The data converted by AES.
* @property {string} hex - encrypted or decrypted data
*/
export interface ConvertAesResponse {
hex: string;
}
/**
* Request's data for converting entropy to mnemonic.
* @property {string} entropy - entropy hex
* @property {string} language? - mnemonic's language. (support [en es fr it jp zhs zht])
*/
export interface ConvertEntropyToMnemonicRequest {
entropy: string;
language?: string;
}
/**
* Response data of converting entropy to mnemonic.
* @property {string[]} mnemonic - mnemonic word list.
*/
export interface ConvertEntropyToMnemonicResponse {
mnemonic: string[];
}
/**
* Request's data for converting mnemonic to seed.
* @property {string[]} mnemonic - mnemonic words
* @property {string} passphrase - passphrase
* @property {boolean} strictCheck? - Check mnemonic words strictly
* @property {string} language? - mnemonic language (support [en es fr it jp zhs zht])
* @property {boolean} useIdeographicSpace? - Currently, this flag is valid only the language is set "jp".
*/
export interface ConvertMnemonicToSeedRequest {
mnemonic: string[];
passphrase: string;
strictCheck?: boolean;
language?: string;
useIdeographicSpace?: boolean;
}
/**
* Response data of converting mnemonic to seed.
* @property {string} seed - mnemonic word list
* @property {string} entropy? - mnemonic's entropy. This field is only set if "language" is set in the request
*/
export interface ConvertMnemonicToSeedResponse {
seed: string;
entropy?: string;
}
/**
* Request for ConvertToPsbt.
* @property {string} tx - transaction hex
* @property {boolean} permitSigData? - If true, any signatures in the input will be discarded and conversion will continue. If false, this function will fail if any signatures are present.
*/
export interface ConvertToPsbtRequest {
tx: string;
permitSigData?: boolean;
}
/**
* Request data for creating address.
* @property {boolean} isElements? - elements transaction flag.
* @property {HashKeyData} keyData? - address's base data.
* @property {string} network - network type. (bitcoin:'mainnet, testnet, regtest'. elements:'liquidv1, regtest')
* @property {string} hashType - hash type. (p2wpkh, p2wsh, p2pkh, p2sh, p2sh-p2wpkh, p2sh-p2wsh, taproot)
*/
export interface CreateAddressRequest {
isElements?: boolean;
keyData?: HashKeyData;
network: string;
hashType: string;
}
/**
* Response data of creating address.
* @property {string} address - address string.
* @property {string} lockingScript - (redeem script or pubkey) locking script
* @property {string} redeemScript? - (required for P2SH-P2WPKH or P2SH-P2WSH) redeem script for unlocking script
*/
export interface CreateAddressResponse {
address: string;
lockingScript: string;
redeemScript?: string;
}
/**
* descriptor's key data.
* @property {string} key - pubkey or extpubkey.
* @property {string} parentExtkey? - parent extpubkey.
* @property {string} keyPathFromParent? - bip32 path from parent key.
*/
export interface CreateDescriptorKeyRequest {
key: string;
parentExtkey?: string;
keyPathFromParent?: string;
}
/**
* Request data for creating descriptor.
* @property {string} scriptType - Script types are joined by '-'. (ex. p2sh-p2wsh-multi)
* @property {CreateDescriptorKeyRequest[]} keyInfoList? - descriptor's key data.
* @property {number} requireNum? - multisig require num.
*/
export interface CreateDescriptorRequest {
scriptType: string;
keyInfoList?: CreateDescriptorKeyRequest[];
requireNum?: number;
}
/**
* Request for create destroy amount transaction
* @property {number} version? - transaction version
* @property {number} locktime? - locktime
* @property {TxInRequest[]} txins? - The data added to the transaction input.
* @property {ElementsTxOut[]} txouts? - adding txout data
* @property {ElementsDestroyAmount} destroy - destroy amount txout
* @property {ElementsTxOutFee} fee? - Transaction fee data.
*/
export interface CreateDestroyAmountRequest {
version?: number;
locktime?: number;
txins?: TxInRequest[];
txouts?: ElementsTxOut[];
destroy: ElementsDestroyAmount;
fee?: ElementsTxOutFee;
}
/**
* Request for create signature hash.
* @property {string} tx - transaction hex
* @property {CreateElementsSignatureHashTxIn} txin - txin data
*/
export interface CreateElementsSignatureHashRequest {
tx: string;
txin: CreateElementsSignatureHashTxIn;
}
/**
* txin data
* @property {string} txid - utxo txid
* @property {number} vout - utxo vout
* @property {HashKeyData} keyData - key data
* @property {bigint | number} amount? - satoshi amount (need either amount or confidentialValueCommitment)
* @property {string} confidentialValueCommitment? - value commitment (need either amount or confidentialValueCommitment)
* @property {string} hashType - hash type (p2wpkh, p2wsh, p2pkh, p2sh, p2sh-p2wpkh, p2sh-p2wsh)
* @property {string} sighashType? - signature hash type. (all, none, single)
* @property {boolean} sighashAnyoneCanPay? - sighashType anyone can pay flag.
* @property {boolean} sighashRangeproof? - (for Elements) sighash rangeproof
*/
export interface CreateElementsSignatureHashTxIn {
txid: string;
vout: number;
keyData: HashKeyData;
amount?: bigint | number;
confidentialValueCommitment?: string;
hashType: string;
sighashType?: string;
sighashAnyoneCanPay?: boolean;
sighashRangeproof?: boolean;
}
/**
* Request data for creating extkey from parent's key.
* @property {string} network - network type (mainnet, testnet or regtest)
* @property {string} extkeyType? - extkey type (extPrivkey or extPubkey)
* @property {string} parentKey - parent key (pubkey or privkey)
* @property {number} parentDepth - parent depth
* @property {string} parentChainCode - parent chain code
* @property {number} childNumber - bip32 child number.
* @property {boolean} hardened? - hardened flag. (true is extPrivkey only.)
*/
export interface CreateExtkeyFromParentKeyRequest {
network: string;
extkeyType?: string;
parentKey: string;
parentDepth: number;
parentChainCode: string;
childNumber: number;
hardened?: boolean;
}
/**
* Request data for creating extkey from parent.
* @property {string} extkey - parent extkey
* @property {string} network - network type (mainnet, testnet or regtest)
* @property {string} extkeyType - extkey type (extPrivkey or extPubkey)
* @property {number[]} childNumberArray? - bip32 child number array. (hardened is logical sum 0x80000000)
* @property {string} path? - bip32 path. (child number string. if exist path, disable childNumberArray. ex) 44'/0h/2.)
*/
export interface CreateExtkeyFromParentPathRequest {
extkey: string;
network: string;
extkeyType: string;
childNumberArray?: number[];
path?: string;
}
/**
* Request data for creating extkey from parent.
* @property {string} extkey - parent extkey
* @property {string} network - network type (mainnet, testnet or regtest)
* @property {string} extkeyType - extkey type (extPrivkey or extPubkey)
* @property {number} childNumber - bip32 child number.
* @property {boolean} hardened? - hardened flag. (true is extPrivkey only.)
*/
export interface CreateExtkeyFromParentRequest {
extkey: string;
network: string;
extkeyType: string;
childNumber: number;
hardened?: boolean;
}
/**
* Request data for creating extkey from seed.
* @property {string} seed - seed hex data
* @property {string} network - network type (mainnet, testnet or regtest)
* @property {string} extkeyType? - extkey type (extPrivkey or extPubkey)
*/
export interface CreateExtkeyFromSeedRequest {
seed: string;
network: string;
extkeyType?: string;
}
/**
* Request data for creating extkey.
* @property {string} network - network type (mainnet, testnet or regtest)
* @property {string} extkeyType? - extkey type (extPrivkey or extPubkey)
* @property {string} parentKey? - parent key
* @property {string} parentFingerprint? - parent key's fingerprint.
* @property {string} key - key hex. (pubkey or privkey)
* @property {number} depth - depth
* @property {string} chainCode - chain code
* @property {number} childNumber - bip32 child number.
* @property {boolean} hardened? - hardened flag. (true is extPrivkey only.)
*/
export interface CreateExtkeyRequest {
network: string;
extkeyType?: string;
parentKey?: string;
parentFingerprint?: string;
key: string;
depth: number;
chainCode: string;
childNumber: number;
hardened?: boolean;
}
/**
* Response of creating extkey.
* @property {string} extkey - extkey
*/
export interface CreateExtkeyResponse {
extkey: string;
}
/**
* Request data for creating extpubkey from extprivkey.
* @property {string} extkey - extkey
* @property {string} network - network type (mainnet, testnet or regtest)
*/
export interface CreateExtPubkeyRequest {
extkey: string;
network: string;
}
/**
* Request data for creating keypair.
* @property {boolean} wif - Set the privkey format to wif.
* @property {string} network? - network type (mainnet, testnet or regtest)
* @property {boolean} isCompressed? - pubkey compressed flag
*/
export interface CreateKeyPairRequest {
wif: boolean;
network?: string;
isCompressed?: boolean;
}
/**
* Response data of creating keypair.
* @property {string} privkey - privkey
* @property {string} pubkey - pubkey
*/
export interface CreateKeyPairResponse {
privkey: string;
pubkey: string;
}
/**
* Request for create multisig address and script
* @property {number} nrequired - require signature num.
* @property {string[]} keys - pubkey list
* @property {boolean} isElements? - elements mode flag.
* @property {string} network - network type (bitcoin:'mainnet, testnet, regtest'. elements:'liquidv1, regtest')
* @property {string} hashType - hash type (p2sh, p2wsh, p2sh-p2wsh)
*/
export interface CreateMultisigRequest {
nrequired: number;
keys: string[];
isElements?: boolean;
network: string;
hashType: string;
}
/**
* Response of create multisig address and script
* @property {string} address - address
* @property {string} redeemScript? - (required for P2SH or P2SH-P2WSH) redeem script for unlocking script
* @property {string} witnessScript? - (required for P2WSH or P2SH-P2WSH) witness script for witness stack
*/
export interface CreateMultisigResponse {
address: string;
redeemScript?: string;
witnessScript?: string;
}
/**
* Request for creating multisig's scriptsig.
* @property {PubkeySignData[]} signParams? - pubkey signature data.
* @property {string} redeemScript - multisig script
*/
export interface CreateMultisigScriptSigRequest {
signParams?: PubkeySignData[];
redeemScript: string;
}
/**
* Request data. If unlock pegin tx, sign to p2wpkh or p2wsh format.
* @property {string} fedpegscript - fedpeg script (fedpegscript comes from 'getsidechaininfo' rpc command.)
* @property {string} pubkey - pubkey related to unlocking peg-in utxo. (This field is only available when lockingScript is empty.)
* @property {string} redeemScript? - default is empty. set claim script to direct.
* @property {string} network? - network type. (mainnet, testnet or regtest)
* @property {string} hashType? - hash type (p2wsh, p2sh-p2wsh, p2sh)
*/
export interface CreatePegInAddressRequest {
fedpegscript: string;
pubkey: string;
redeemScript?: string;
network?: string;
hashType?: string;
}
/**
* Response data of creating pegin address.
* @property {string} mainchainAddress - mainchain address
* @property {string} claimScript - claim script.
* @property {string} tweakFedpegscript - tweaked fedpeg script
*/
export interface CreatePegInAddressResponse {
mainchainAddress: string;
claimScript: string;
tweakFedpegscript: string;
}
/**
* Request for CreatePegoutAddress.
* @property {string} network? - mainchain network type. (mainnet, testnet or regtest)
* @property {string} elementsNetwork? - elements network type. (liquidv1, elementsregtest)
* @property {string} descriptor - output descriptor or xpub
* @property {bigint | number} bip32Counter? - bip32 derive counter. (0 to 2147483647.)
* @property {string} hashType? - pubkey hash type (p2pkh, p2sh-p2pkh, p2wpkh)
*/
export interface CreatePegoutAddressRequest {
network?: string;
elementsNetwork?: string;
descriptor: string;
bip32Counter?: bigint | number;
hashType?: string;
}
/**
* Response data of creating pegout address.
* @property {string} mainchainAddress - mainchain address
* @property {string} baseDescriptor - base output descriptor
*/
export interface CreatePegoutAddressResponse {
mainchainAddress: string;
baseDescriptor: string;
}
/**
* Request for create pegin transaction
* @property {number} version? - transaction version
* @property {number} locktime? - locktime
* @property {ElementsPeginTxIn[]} txins - Pegin's txin data
* @property {ElementsTxOut[]} txouts? - adding txout data
* @property {ElementsTxOutFee} fee? - Transaction fee data.
* @property {boolean} isRandomSortTxOut? - txout random sort after adding transaction
*/
export interface CreateRawPeginRequest {
version?: number;
locktime?: number;
txins: ElementsPeginTxIn[];
txouts?: ElementsTxOut[];
fee?: ElementsTxOutFee;
isRandomSortTxOut?: boolean;
}
/**
* Request for create pegout transaction
* @property {number} version? - transaction version
* @property {number} locktime? - locktime
* @property {TxInRequest[]} txins? - The data added to the transaction input.
* @property {ElementsTxOut[]} txouts? - adding txout data
* @property {ElementsPegoutTxOut} pegout - pegout txout
* @property {ElementsTxOutFee} fee? - fee data
*/
export interface CreateRawPegoutRequest {
version?: number;
locktime?: number;
txins?: TxInRequest[];
txouts?: ElementsTxOut[];
pegout: ElementsPegoutTxOut;
fee?: ElementsTxOutFee;
}
/**
* Response of create pegout transaction.
* @property {string} hex - transaction hex
*/
export interface CreateRawPegoutResponse {
hex: string;
btcAddress?: string;
}
/**
* Request for create transaction
* @property {number} version? - transaction version
* @property {number} locktime? - locktime
* @property {TxInRequest[]} txins? - The data added to the transaction input.
* @property {TxOutRequest[]} txouts? - The data added to the transaction output.
*/
export interface CreateRawTransactionRequest {
version?: number;
locktime?: number;
txins?: TxInRequest[];
txouts?: TxOutRequest[];
}
/**
* Request for creating script.
* @property {string[]} items - item array accepts string of op_code, binary hex or number
*/
export interface CreateScriptRequest {
items: string[];
}
/**
* Request for create signature hash.
* @property {string} tx - transaction hex
* @property {CreateSignatureHashTxInRequest} txin - txin data
*/
export interface CreateSignatureHashRequest {
tx: string;
txin: CreateSignatureHashTxInRequest;
}
/**
* Response of create signature hash.
* @property {string} sighash - sighash
*/
export interface CreateSignatureHashResponse {
sighash: string;
}
/**
* txin data
* @property {string} txid - utxo txid
* @property {number} vout - utxo vout
* @property {HashKeyData} keyData - key data
* @property {bigint | number} amount - satoshi amount
* @property {string} hashType - hash type (p2wpkh, p2wsh, p2pkh, p2sh, p2sh-p2wpkh, p2sh-p2wsh)
* @property {string} sighashType? - signature hash type. (all, none, single)
* @property {boolean} sighashAnyoneCanPay? - sighashType anyone can pay flag.
*/
export interface CreateSignatureHashTxInRequest {
txid: string;
vout: number;
keyData: HashKeyData;
amount: bigint | number;
hashType: string;
sighashType?: string;
sighashAnyoneCanPay?: boolean;
}
/**
* Request for decode base58
* @property {string} data - base58 data
* @property {boolean} hasChecksum? - use checksum mode.
*/
export interface DecodeBase58Request {
data: string;
hasChecksum?: boolean;
}
/**
* Response of decode base58
* @property {string} hex - decoded data byte hex
*/
export interface DecodeBase58Response {
hex: string;
}
/**
* Request for decode signature.
* @property {string} signature - der signature
*/
export interface DecodeDerSignatureToRawRequest {
signature: string;
}
/**
* locking script data
* @property {string} asm? - script asm string
* @property {string} hex? - script hex
* @property {number} reqSigs? - require signature num
* @property {string} type? - script type
* @property {string[]} addresses? - address list
*/
export interface DecodeLockingScript {
asm?: string;
hex?: string;
reqSigs?: number;
type?: string;