@atomicfinance/client 2.2.3
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/.nvmrc +1 -0
- package/LICENSE +674 -0
- package/README.md +11 -0
- package/dist/Cfd.d.ts +74 -0
- package/dist/Cfd.js +216 -0
- package/dist/Cfd.js.map +1 -0
- package/dist/Client.d.ts +20 -0
- package/dist/Client.js +36 -0
- package/dist/Client.js.map +1 -0
- package/dist/Dlc.d.ts +152 -0
- package/dist/Dlc.js +186 -0
- package/dist/Dlc.js.map +1 -0
- package/dist/Wallet.d.ts +14 -0
- package/dist/Wallet.js +33 -0
- package/dist/Wallet.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/lib/Cfd.ts +553 -0
- package/lib/Client.ts +45 -0
- package/lib/Dlc.ts +421 -0
- package/lib/Wallet.ts +72 -0
- package/lib/index.ts +2 -0
- package/package.json +35 -0
- package/tsconfig.json +7 -0
package/lib/Cfd.ts
ADDED
|
@@ -0,0 +1,553 @@
|
|
|
1
|
+
import {
|
|
2
|
+
AddMultisigSignRequest,
|
|
3
|
+
AddMultisigSignResponse,
|
|
4
|
+
AddPubkeyHashSignRequest,
|
|
5
|
+
AddPubkeyHashSignResponse,
|
|
6
|
+
AddRawTransactionRequest,
|
|
7
|
+
AddRawTransactionResponse,
|
|
8
|
+
AddScriptHashSignRequest,
|
|
9
|
+
AddScriptHashSignResponse,
|
|
10
|
+
AddSignRequest,
|
|
11
|
+
AddSignResponse,
|
|
12
|
+
AppendDescriptorChecksumRequest,
|
|
13
|
+
AppendDescriptorChecksumResponse,
|
|
14
|
+
BlindRawTransactionRequest,
|
|
15
|
+
BlindRawTransactionResponse,
|
|
16
|
+
CalculateEcSignatureRequest,
|
|
17
|
+
CalculateEcSignatureResponse,
|
|
18
|
+
ConvertAesRequest,
|
|
19
|
+
ConvertAesResponse,
|
|
20
|
+
ConvertEntropyToMnemonicRequest,
|
|
21
|
+
ConvertEntropyToMnemonicResponse,
|
|
22
|
+
ConvertMnemonicToSeedRequest,
|
|
23
|
+
ConvertMnemonicToSeedResponse,
|
|
24
|
+
CreateAddressRequest,
|
|
25
|
+
CreateAddressResponse,
|
|
26
|
+
CreateDescriptorRequest,
|
|
27
|
+
CreateDescriptorResponse,
|
|
28
|
+
CreateDestroyAmountRequest,
|
|
29
|
+
CreateDestroyAmountResponse,
|
|
30
|
+
CreateElementsSignatureHashRequest,
|
|
31
|
+
CreateElementsSignatureHashResponse,
|
|
32
|
+
CreateExtkeyFromParentKeyRequest,
|
|
33
|
+
CreateExtkeyFromParentKeyResponse,
|
|
34
|
+
CreateExtkeyFromParentPathRequest,
|
|
35
|
+
CreateExtkeyFromParentPathResponse,
|
|
36
|
+
CreateExtkeyFromParentRequest,
|
|
37
|
+
CreateExtkeyFromParentResponse,
|
|
38
|
+
CreateExtkeyFromSeedRequest,
|
|
39
|
+
CreateExtkeyFromSeedResponse,
|
|
40
|
+
CreateExtkeyRequest,
|
|
41
|
+
CreateExtkeyResponse,
|
|
42
|
+
CreateExtPubkeyRequest,
|
|
43
|
+
CreateExtPubkeyResponse,
|
|
44
|
+
CreateKeyPairRequest,
|
|
45
|
+
CreateKeyPairResponse,
|
|
46
|
+
CreateMultisigRequest,
|
|
47
|
+
CreateMultisigResponse,
|
|
48
|
+
CreateMultisigScriptSigRequest,
|
|
49
|
+
CreateMultisigScriptSigResponse,
|
|
50
|
+
CreatePegInAddressRequest,
|
|
51
|
+
CreatePegInAddressResponse,
|
|
52
|
+
CreateRawPeginRequest,
|
|
53
|
+
CreateRawPeginResponse,
|
|
54
|
+
CreateRawPegoutRequest,
|
|
55
|
+
CreateRawPegoutResponse,
|
|
56
|
+
CreateRawTransactionRequest,
|
|
57
|
+
CreateRawTransactionResponse,
|
|
58
|
+
CreateScriptRequest,
|
|
59
|
+
CreateScriptResponse,
|
|
60
|
+
CreateSignatureHashRequest,
|
|
61
|
+
CreateSignatureHashResponse,
|
|
62
|
+
DecodeBase58Request,
|
|
63
|
+
DecodeBase58Response,
|
|
64
|
+
DecodeDerSignatureToRawRequest,
|
|
65
|
+
DecodeDerSignatureToRawResponse,
|
|
66
|
+
DecodeRawTransactionRequest,
|
|
67
|
+
DecodeRawTransactionResponse,
|
|
68
|
+
ElementsAddRawTransactionRequest,
|
|
69
|
+
ElementsAddRawTransactionResponse,
|
|
70
|
+
ElementsCreateRawTransactionRequest,
|
|
71
|
+
ElementsCreateRawTransactionResponse,
|
|
72
|
+
ElementsDecodeRawTransactionRequest,
|
|
73
|
+
ElementsDecodeRawTransactionResponse,
|
|
74
|
+
EncodeBase58Request,
|
|
75
|
+
EncodeBase58Response,
|
|
76
|
+
EncodeSignatureByDerRequest,
|
|
77
|
+
EncodeSignatureByDerResponse,
|
|
78
|
+
EstimateFeeRequest,
|
|
79
|
+
EstimateFeeResponse,
|
|
80
|
+
FundRawTransactionRequest,
|
|
81
|
+
FundRawTransactionResponse,
|
|
82
|
+
GetAddressesFromMultisigRequest,
|
|
83
|
+
GetAddressesFromMultisigResponse,
|
|
84
|
+
GetAddressInfoRequest,
|
|
85
|
+
GetAddressInfoResponse,
|
|
86
|
+
GetCommitmentRequest,
|
|
87
|
+
GetCommitmentResponse,
|
|
88
|
+
GetCompressedPubkeyRequest,
|
|
89
|
+
GetCompressedPubkeyResponse,
|
|
90
|
+
GetConfidentialAddressRequest,
|
|
91
|
+
GetConfidentialAddressResponse,
|
|
92
|
+
GetDefaultBlindingKeyRequest,
|
|
93
|
+
GetDefaultBlindingKeyResponse,
|
|
94
|
+
GetExtkeyInfoRequest,
|
|
95
|
+
GetExtkeyInfoResponse,
|
|
96
|
+
GetIssuanceBlindingKeyRequest,
|
|
97
|
+
GetIssuanceBlindingKeyResponse,
|
|
98
|
+
GetMnemonicWordlistRequest,
|
|
99
|
+
GetMnemonicWordlistResponse,
|
|
100
|
+
GetPrivkeyFromExtkeyRequest,
|
|
101
|
+
GetPrivkeyFromExtkeyResponse,
|
|
102
|
+
GetPrivkeyFromWifRequest,
|
|
103
|
+
GetPrivkeyFromWifResponse,
|
|
104
|
+
GetPrivkeyWifRequest,
|
|
105
|
+
GetPrivkeyWifResponse,
|
|
106
|
+
GetPubkeyFromExtkeyRequest,
|
|
107
|
+
GetPubkeyFromExtkeyResponse,
|
|
108
|
+
GetPubkeyFromPrivkeyRequest,
|
|
109
|
+
GetPubkeyFromPrivkeyResponse,
|
|
110
|
+
GetSupportedFunctionResponse,
|
|
111
|
+
GetUnblindedAddressRequest,
|
|
112
|
+
GetUnblindedAddressResponse,
|
|
113
|
+
GetWitnessStackNumRequest,
|
|
114
|
+
GetWitnessStackNumResponse,
|
|
115
|
+
ParseDescriptorRequest,
|
|
116
|
+
ParseDescriptorResponse,
|
|
117
|
+
ParseScriptRequest,
|
|
118
|
+
ParseScriptResponse,
|
|
119
|
+
SelectUtxosRequest,
|
|
120
|
+
SelectUtxosResponse,
|
|
121
|
+
SerializeLedgerFormatRequest,
|
|
122
|
+
SerializeLedgerFormatResponse,
|
|
123
|
+
SetRawIssueAssetRequest,
|
|
124
|
+
SetRawIssueAssetResponse,
|
|
125
|
+
SetRawReissueAssetRequest,
|
|
126
|
+
SetRawReissueAssetResponse,
|
|
127
|
+
SignWithPrivkeyRequest,
|
|
128
|
+
SignWithPrivkeyResponse,
|
|
129
|
+
UnblindRawTransactionRequest,
|
|
130
|
+
UnblindRawTransactionResponse,
|
|
131
|
+
UpdateTxOutAmountRequest,
|
|
132
|
+
UpdateTxOutAmountResponse,
|
|
133
|
+
UpdateWitnessStackRequest,
|
|
134
|
+
UpdateWitnessStackResponse,
|
|
135
|
+
VerifySignatureRequest,
|
|
136
|
+
VerifySignatureResponse,
|
|
137
|
+
VerifySignRequest,
|
|
138
|
+
VerifySignResponse,
|
|
139
|
+
} from '@atomicfinance/types';
|
|
140
|
+
|
|
141
|
+
export default class Cfd {
|
|
142
|
+
client: any;
|
|
143
|
+
|
|
144
|
+
constructor(client: any) {
|
|
145
|
+
this.client = client;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
async AddMultisigSign(
|
|
149
|
+
jsonObject: AddMultisigSignRequest,
|
|
150
|
+
): Promise<AddMultisigSignResponse> {
|
|
151
|
+
return this.client.getMethod('AddMultisigSign')(jsonObject);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
async AddPubkeyHashSign(
|
|
155
|
+
jsonObject: AddPubkeyHashSignRequest,
|
|
156
|
+
): Promise<AddPubkeyHashSignResponse> {
|
|
157
|
+
return this.client.getMethod('AddPubkeyHashSign')(jsonObject);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
async AddRawTransaction(
|
|
161
|
+
jsonObject: AddRawTransactionRequest,
|
|
162
|
+
): Promise<AddRawTransactionResponse> {
|
|
163
|
+
return this.client.getMethod('AddRawTransaction')(jsonObject);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
async AddScriptHashSign(
|
|
167
|
+
jsonObject: AddScriptHashSignRequest,
|
|
168
|
+
): Promise<AddScriptHashSignResponse> {
|
|
169
|
+
return this.client.getMethod('AddScriptHashSign')(jsonObject);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
async AddSign(jsonObject: AddSignRequest): Promise<AddSignResponse> {
|
|
173
|
+
return this.client.getMethod('AddSign')(jsonObject);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
async AppendDescriptorChecksum(
|
|
177
|
+
jsonObject: AppendDescriptorChecksumRequest,
|
|
178
|
+
): Promise<AppendDescriptorChecksumResponse> {
|
|
179
|
+
return this.client.getMethod('AppendDescriptorChecksum')(jsonObject);
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
async BlindRawTransaction(
|
|
183
|
+
jsonObject: BlindRawTransactionRequest,
|
|
184
|
+
): Promise<BlindRawTransactionResponse> {
|
|
185
|
+
return this.client.getMethod('BlindRawTransaction')(jsonObject);
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
async CalculateEcSignature(
|
|
189
|
+
jsonObject: CalculateEcSignatureRequest,
|
|
190
|
+
): Promise<CalculateEcSignatureResponse> {
|
|
191
|
+
return this.client.getMethod('CalculateEcSignature')(jsonObject);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
async ConvertAes(jsonObject: ConvertAesRequest): Promise<ConvertAesResponse> {
|
|
195
|
+
return this.client.getMethod('ConvertAes')(jsonObject);
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
async ConvertEntropyToMnemonic(
|
|
199
|
+
jsonObject: ConvertEntropyToMnemonicRequest,
|
|
200
|
+
): Promise<ConvertEntropyToMnemonicResponse> {
|
|
201
|
+
return this.client.getMethod('ConvertEntropyToMnemonic')(jsonObject);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
async ConvertMnemonicToSeed(
|
|
205
|
+
jsonObject: ConvertMnemonicToSeedRequest,
|
|
206
|
+
): Promise<ConvertMnemonicToSeedResponse> {
|
|
207
|
+
return this.client.getMethod('ConvertMnemonicToSeed')(jsonObject);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
async CreateAddress(
|
|
211
|
+
jsonObject: CreateAddressRequest,
|
|
212
|
+
): Promise<CreateAddressResponse> {
|
|
213
|
+
return this.client.getMethod('CreateAddress')(jsonObject);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
async CreateDescriptor(
|
|
217
|
+
jsonObject: CreateDescriptorRequest,
|
|
218
|
+
): Promise<CreateDescriptorResponse> {
|
|
219
|
+
return this.client.getMethod('CreateDescriptor')(jsonObject);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
async CreateExtkey(
|
|
223
|
+
jsonObject: CreateExtkeyRequest,
|
|
224
|
+
): Promise<CreateExtkeyResponse> {
|
|
225
|
+
return this.client.getMethod('CreateExtkey')(jsonObject);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
async CreateExtkeyFromParent(
|
|
229
|
+
jsonObject: CreateExtkeyFromParentRequest,
|
|
230
|
+
): Promise<CreateExtkeyFromParentResponse> {
|
|
231
|
+
return this.client.getMethod('CreateExtkeyFromParent')(jsonObject);
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
async CreateExtkeyFromParentKey(
|
|
235
|
+
jsonObject: CreateExtkeyFromParentKeyRequest,
|
|
236
|
+
): Promise<CreateExtkeyFromParentKeyResponse> {
|
|
237
|
+
return this.client.getMethod('CreateExtkeyFromParentKey')(jsonObject);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
async CreateExtkeyFromParentPath(
|
|
241
|
+
jsonObject: CreateExtkeyFromParentPathRequest,
|
|
242
|
+
): Promise<CreateExtkeyFromParentPathResponse> {
|
|
243
|
+
return this.client.getMethod('CreateExtkeyFromParentPath')(jsonObject);
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
async CreateExtkeyFromSeed(
|
|
247
|
+
jsonObject: CreateExtkeyFromSeedRequest,
|
|
248
|
+
): Promise<CreateExtkeyFromSeedResponse> {
|
|
249
|
+
return this.client.getMethod('CreateExtkeyFromSeed')(jsonObject);
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
async CreateExtPubkey(
|
|
253
|
+
jsonObject: CreateExtPubkeyRequest,
|
|
254
|
+
): Promise<CreateExtPubkeyResponse> {
|
|
255
|
+
return this.client.getMethod('CreateExtPubkey')(jsonObject);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
async CreateKeyPair(
|
|
259
|
+
jsonObject: CreateKeyPairRequest,
|
|
260
|
+
): Promise<CreateKeyPairResponse> {
|
|
261
|
+
return this.client.getMethod('CreateKeyPair')(jsonObject);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
async CreateMultisigScriptSig(
|
|
265
|
+
jsonObject: CreateMultisigScriptSigRequest,
|
|
266
|
+
): Promise<CreateMultisigScriptSigResponse> {
|
|
267
|
+
return this.client.getMethod('CreateMultisigScriptSig')(jsonObject);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
async CreateScript(
|
|
271
|
+
jsonObject: CreateScriptRequest,
|
|
272
|
+
): Promise<CreateScriptResponse> {
|
|
273
|
+
return this.client.getMethod('CreateScript')(jsonObject);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
async DecodeBase58(
|
|
277
|
+
jsonObject: DecodeBase58Request,
|
|
278
|
+
): Promise<DecodeBase58Response> {
|
|
279
|
+
return this.client.getMethod('DecodeBase58')(jsonObject);
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
async DecodeDerSignatureToRaw(
|
|
283
|
+
jsonObject: DecodeDerSignatureToRawRequest,
|
|
284
|
+
): Promise<DecodeDerSignatureToRawResponse> {
|
|
285
|
+
return this.client.getMethod('DecodeDerSignatureToRaw')(jsonObject);
|
|
286
|
+
}
|
|
287
|
+
|
|
288
|
+
async DecodeRawTransaction(
|
|
289
|
+
jsonObject: DecodeRawTransactionRequest,
|
|
290
|
+
): Promise<DecodeRawTransactionResponse> {
|
|
291
|
+
return this.client.getMethod('DecodeRawTransaction')(jsonObject);
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
async ElementsAddRawTransaction(
|
|
295
|
+
jsonObject: ElementsAddRawTransactionRequest,
|
|
296
|
+
): Promise<ElementsAddRawTransactionResponse> {
|
|
297
|
+
return this.client.getMethod('ElementsAddRawTransaction')(jsonObject);
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
async CreateDestroyAmount(
|
|
301
|
+
jsonObject: CreateDestroyAmountRequest,
|
|
302
|
+
): Promise<CreateDestroyAmountResponse> {
|
|
303
|
+
return this.client.getMethod('CreateDestroyAmount')(jsonObject);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
async CreatePegInAddress(
|
|
307
|
+
jsonObject: CreatePegInAddressRequest,
|
|
308
|
+
): Promise<CreatePegInAddressResponse> {
|
|
309
|
+
return this.client.getMethod('CreatePegInAddress')(jsonObject);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
async CreateRawPegin(
|
|
313
|
+
jsonObject: CreateRawPeginRequest,
|
|
314
|
+
): Promise<CreateRawPeginResponse> {
|
|
315
|
+
return this.client.getMethod('CreateRawPegin')(jsonObject);
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
async CreateRawPegout(
|
|
319
|
+
jsonObject: CreateRawPegoutRequest,
|
|
320
|
+
): Promise<CreateRawPegoutResponse> {
|
|
321
|
+
return this.client.getMethod('CreateRawPegout')(jsonObject);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
async ElementsCreateRawTransaction(
|
|
325
|
+
jsonObject: ElementsCreateRawTransactionRequest,
|
|
326
|
+
): Promise<ElementsCreateRawTransactionResponse> {
|
|
327
|
+
return this.client.getMethod('ElementsCreateRawTransaction')(jsonObject);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
async ElementsDecodeRawTransaction(
|
|
331
|
+
jsonObject: ElementsDecodeRawTransactionRequest,
|
|
332
|
+
): Promise<ElementsDecodeRawTransactionResponse> {
|
|
333
|
+
return this.client.getMethod('ElementsDecodeRawTransaction')(jsonObject);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
async GetConfidentialAddress(
|
|
337
|
+
jsonObject: GetConfidentialAddressRequest,
|
|
338
|
+
): Promise<GetConfidentialAddressResponse> {
|
|
339
|
+
return this.client.getMethod('GetConfidentialAddress')(jsonObject);
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
async GetUnblindedAddress(
|
|
343
|
+
jsonObject: GetUnblindedAddressRequest,
|
|
344
|
+
): Promise<GetUnblindedAddressResponse> {
|
|
345
|
+
return this.client.getMethod('GetUnblindedAddress')(jsonObject);
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
async SetRawIssueAsset(
|
|
349
|
+
jsonObject: SetRawIssueAssetRequest,
|
|
350
|
+
): Promise<SetRawIssueAssetResponse> {
|
|
351
|
+
return this.client.getMethod('SetRawIssueAsset')(jsonObject);
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
async SetRawReissueAsset(
|
|
355
|
+
jsonObject: SetRawReissueAssetRequest,
|
|
356
|
+
): Promise<SetRawReissueAssetResponse> {
|
|
357
|
+
return this.client.getMethod('SetRawReissueAsset')(jsonObject);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
async UnblindRawTransaction(
|
|
361
|
+
jsonObject: UnblindRawTransactionRequest,
|
|
362
|
+
): Promise<UnblindRawTransactionResponse> {
|
|
363
|
+
return this.client.getMethod('UnblindRawTransaction')(jsonObject);
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
async EncodeBase58(
|
|
367
|
+
jsonObject: EncodeBase58Request,
|
|
368
|
+
): Promise<EncodeBase58Response> {
|
|
369
|
+
return this.client.getMethod('EncodeBase58')(jsonObject);
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
async EncodeSignatureByDer(
|
|
373
|
+
jsonObject: EncodeSignatureByDerRequest,
|
|
374
|
+
): Promise<EncodeSignatureByDerResponse> {
|
|
375
|
+
return this.client.getMethod('EncodeSignatureByDer')(jsonObject);
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
async EstimateFee(
|
|
379
|
+
jsonObject: EstimateFeeRequest,
|
|
380
|
+
): Promise<EstimateFeeResponse> {
|
|
381
|
+
return this.client.getMethod('EstimateFee')(jsonObject);
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
async FundRawTransaction(
|
|
385
|
+
jsonObject: FundRawTransactionRequest,
|
|
386
|
+
): Promise<FundRawTransactionResponse> {
|
|
387
|
+
return this.client.getMethod('FundRawTransaction')(jsonObject);
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
async GetAddressInfo(
|
|
391
|
+
jsonObject: GetAddressInfoRequest,
|
|
392
|
+
): Promise<GetAddressInfoResponse> {
|
|
393
|
+
return this.client.getMethod('GetAddressInfo')(jsonObject);
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
async GetAddressesFromMultisig(
|
|
397
|
+
jsonObject: GetAddressesFromMultisigRequest,
|
|
398
|
+
): Promise<GetAddressesFromMultisigResponse> {
|
|
399
|
+
return this.client.getMethod('GetAddressesFromMultisig')(jsonObject);
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
async GetCommitment(
|
|
403
|
+
jsonObject: GetCommitmentRequest,
|
|
404
|
+
): Promise<GetCommitmentResponse> {
|
|
405
|
+
return this.client.getMethod('GetCommitment')(jsonObject);
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
async GetCompressedPubkey(
|
|
409
|
+
jsonObject: GetCompressedPubkeyRequest,
|
|
410
|
+
): Promise<GetCompressedPubkeyResponse> {
|
|
411
|
+
return this.client.getMethod('GetCompressedPubkey')(jsonObject);
|
|
412
|
+
}
|
|
413
|
+
|
|
414
|
+
async GetDefaultBlindingKey(
|
|
415
|
+
jsonObject: GetDefaultBlindingKeyRequest,
|
|
416
|
+
): Promise<GetDefaultBlindingKeyResponse> {
|
|
417
|
+
return this.client.getMethod('GetDefaultBlindingKey')(jsonObject);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
async GetExtkeyInfo(
|
|
421
|
+
jsonObject: GetExtkeyInfoRequest,
|
|
422
|
+
): Promise<GetExtkeyInfoResponse> {
|
|
423
|
+
return this.client.getMethod('GetExtkeyInfo')(jsonObject);
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
async GetIssuanceBlindingKey(
|
|
427
|
+
jsonObject: GetIssuanceBlindingKeyRequest,
|
|
428
|
+
): Promise<GetIssuanceBlindingKeyResponse> {
|
|
429
|
+
return this.client.getMethod('GetIssuanceBlindingKey')(jsonObject);
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
async GetMnemonicWordlist(
|
|
433
|
+
jsonObject: GetMnemonicWordlistRequest,
|
|
434
|
+
): Promise<GetMnemonicWordlistResponse> {
|
|
435
|
+
return this.client.getMethod('GetMnemonicWordlist')(jsonObject);
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
async GetPrivkeyFromExtkey(
|
|
439
|
+
jsonObject: GetPrivkeyFromExtkeyRequest,
|
|
440
|
+
): Promise<GetPrivkeyFromExtkeyResponse> {
|
|
441
|
+
return this.client.getMethod('GetPrivkeyFromExtkey')(jsonObject);
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
async GetPrivkeyFromWif(
|
|
445
|
+
jsonObject: GetPrivkeyFromWifRequest,
|
|
446
|
+
): Promise<GetPrivkeyFromWifResponse> {
|
|
447
|
+
return this.client.getMethod('GetPrivkeyFromWif')(jsonObject);
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
async GetPrivkeyWif(
|
|
451
|
+
jsonObject: GetPrivkeyWifRequest,
|
|
452
|
+
): Promise<GetPrivkeyWifResponse> {
|
|
453
|
+
return this.client.getMethod('GetPrivkeyWif')(jsonObject);
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
async GetPubkeyFromExtkey(
|
|
457
|
+
jsonObject: GetPubkeyFromExtkeyRequest,
|
|
458
|
+
): Promise<GetPubkeyFromExtkeyResponse> {
|
|
459
|
+
return this.client.getMethod('GetPubkeyFromExtkey')(jsonObject);
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
async GetPubkeyFromPrivkey(
|
|
463
|
+
jsonObject: GetPubkeyFromPrivkeyRequest,
|
|
464
|
+
): Promise<GetPubkeyFromPrivkeyResponse> {
|
|
465
|
+
return this.client.getMethod('GetPubkeyFromPrivkey')(jsonObject);
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
async GetWitnessStackNum(
|
|
469
|
+
jsonObject: GetWitnessStackNumRequest,
|
|
470
|
+
): Promise<GetWitnessStackNumResponse> {
|
|
471
|
+
return this.client.getMethod('GetWitnessStackNum')(jsonObject);
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
async CreateMultisig(
|
|
475
|
+
jsonObject: CreateMultisigRequest,
|
|
476
|
+
): Promise<CreateMultisigResponse> {
|
|
477
|
+
return this.client.getMethod('CreateMultisig')(jsonObject);
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
async ParseDescriptor(
|
|
481
|
+
jsonObject: ParseDescriptorRequest,
|
|
482
|
+
): Promise<ParseDescriptorResponse> {
|
|
483
|
+
return this.client.getMethod('ParseDescriptor')(jsonObject);
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
async ParseScript(
|
|
487
|
+
jsonObject: ParseScriptRequest,
|
|
488
|
+
): Promise<ParseScriptResponse> {
|
|
489
|
+
return this.client.getMethod('ParseScript')(jsonObject);
|
|
490
|
+
}
|
|
491
|
+
|
|
492
|
+
async SelectUtxos(
|
|
493
|
+
jsonObject: SelectUtxosRequest,
|
|
494
|
+
): Promise<SelectUtxosResponse> {
|
|
495
|
+
return this.client.getMethod('SelectUtxos')(jsonObject);
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
async SerializeLedgerFormat(
|
|
499
|
+
jsonObject: SerializeLedgerFormatRequest,
|
|
500
|
+
): Promise<SerializeLedgerFormatResponse> {
|
|
501
|
+
return this.client.getMethod('SerializeLedgerFormat')(jsonObject);
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
async CreateSignatureHash(
|
|
505
|
+
jsonObject: CreateSignatureHashRequest,
|
|
506
|
+
): Promise<CreateSignatureHashResponse> {
|
|
507
|
+
return this.client.getMethod('CreateSignatureHash')(jsonObject);
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
async CreateElementsSignatureHash(
|
|
511
|
+
jsonObject: CreateElementsSignatureHashRequest,
|
|
512
|
+
): Promise<CreateElementsSignatureHashResponse> {
|
|
513
|
+
return this.client.getMethod('CreateElementsSignatureHash')(jsonObject);
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
async SignWithPrivkey(
|
|
517
|
+
jsonObject: SignWithPrivkeyRequest,
|
|
518
|
+
): Promise<SignWithPrivkeyResponse> {
|
|
519
|
+
return this.client.getMethod('SignWithPrivkey')(jsonObject);
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
async GetSupportedFunction(): Promise<GetSupportedFunctionResponse> {
|
|
523
|
+
return this.client.getMethod('GetSupportedFunction')();
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
async CreateRawTransaction(
|
|
527
|
+
jsonObject: CreateRawTransactionRequest,
|
|
528
|
+
): Promise<CreateRawTransactionResponse> {
|
|
529
|
+
return this.client.getMethod('CreateRawTransaction')(jsonObject);
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
async UpdateTxOutAmount(
|
|
533
|
+
jsonObject: UpdateTxOutAmountRequest,
|
|
534
|
+
): Promise<UpdateTxOutAmountResponse> {
|
|
535
|
+
return this.client.getMethod('UpdateTxOutAmount')(jsonObject);
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
async UpdateWitnessStack(
|
|
539
|
+
jsonObject: UpdateWitnessStackRequest,
|
|
540
|
+
): Promise<UpdateWitnessStackResponse> {
|
|
541
|
+
return this.client.getMethod('UpdateWitnessStack')(jsonObject);
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
async VerifySign(jsonObject: VerifySignRequest): Promise<VerifySignResponse> {
|
|
545
|
+
return this.client.getMethod('VerifySign')(jsonObject);
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
async VerifySignature(
|
|
549
|
+
jsonObject: VerifySignatureRequest,
|
|
550
|
+
): Promise<VerifySignatureResponse> {
|
|
551
|
+
return this.client.getMethod('VerifySignature')(jsonObject);
|
|
552
|
+
}
|
|
553
|
+
}
|
package/lib/Client.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import FinanceProvider from '@atomicfinance/provider';
|
|
2
|
+
import { Client } from '@liquality/client';
|
|
3
|
+
import { Provider } from '@liquality/provider';
|
|
4
|
+
|
|
5
|
+
import Cfd from './Cfd';
|
|
6
|
+
import Dlc from './Dlc';
|
|
7
|
+
import Wallet from './Wallet';
|
|
8
|
+
|
|
9
|
+
export default class FinanceClient extends Client {
|
|
10
|
+
version: string;
|
|
11
|
+
_dlc: Dlc;
|
|
12
|
+
_cfd: Cfd;
|
|
13
|
+
_financewallet: Wallet;
|
|
14
|
+
identifier: string;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Client
|
|
18
|
+
*/
|
|
19
|
+
constructor(provider?: Provider | FinanceProvider, version?: string) {
|
|
20
|
+
super(provider, version);
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @type {Array}
|
|
24
|
+
*/
|
|
25
|
+
this._providers = [];
|
|
26
|
+
|
|
27
|
+
this._dlc = new Dlc(this);
|
|
28
|
+
this._cfd = new Cfd(this);
|
|
29
|
+
this._financewallet = new Wallet(this);
|
|
30
|
+
|
|
31
|
+
this.identifier = 'Client';
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
get dlc() {
|
|
35
|
+
return this._dlc;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
get cfd() {
|
|
39
|
+
return this._cfd;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
get financewallet() {
|
|
43
|
+
return this._financewallet;
|
|
44
|
+
}
|
|
45
|
+
}
|