@@ -55,25 +55,27 @@ For a smooth and quick integration:
55
55
* [ Parameters] ( #parameters-8 )
56
56
* [ getTrustedInputBIP143] ( #gettrustedinputbip143 )
57
57
* [ Parameters] ( #parameters-9 )
58
+ * [ signWithdrawal] ( #signwithdrawal )
59
+ * [ Parameters] ( #parameters-10 )
58
60
* [ AcreBtcNew] ( #acrebtcnew )
59
61
* [ getWalletXpub] ( #getwalletxpub-1 )
60
- * [ Parameters] ( #parameters-10 )
61
- * [ getWalletPublicKey] ( #getwalletpublickey-1 )
62
62
* [ Parameters] ( #parameters-11 )
63
- * [ createPaymentTransaction ] ( #createpaymenttransaction -1 )
63
+ * [ getWalletPublicKey ] ( #getwalletpublickey -1 )
64
64
* [ Parameters] ( #parameters-12 )
65
- * [ signMessage ] ( #signmessage -1 )
65
+ * [ createPaymentTransaction ] ( #createpaymenttransaction -1 )
66
66
* [ Parameters] ( #parameters-13 )
67
- * [ signWithdrawal ] ( #signwithdrawal -1 )
67
+ * [ signMessage ] ( #signmessage -1 )
68
68
* [ Parameters] ( #parameters-14 )
69
+ * [ signWithdrawal] ( #signwithdrawal-1 )
70
+ * [ Parameters] ( #parameters-15 )
69
71
* [ descrTemplFrom] ( #descrtemplfrom )
70
- * [ Parameters] ( #parameters-15 )
72
+ * [ Parameters] ( #parameters-16 )
71
73
* [ AcreBtcOld] ( #acrebtcold )
72
74
* [ getWalletPublicKey] ( #getwalletpublickey-2 )
73
- * [ Parameters] ( #parameters-16 )
75
+ * [ Parameters] ( #parameters-17 )
74
76
* [ Examples] ( #examples-7 )
75
77
* [ createPaymentTransaction] ( #createpaymenttransaction-2 )
76
- * [ Parameters] ( #parameters-17 )
78
+ * [ Parameters] ( #parameters-18 )
77
79
* [ Examples] ( #examples-8 )
78
80
* [ CreateTransactionArg] ( #createtransactionarg )
79
81
* [ Properties] ( #properties )
@@ -82,38 +84,38 @@ For a smooth and quick integration:
82
84
* [ Properties] ( #properties-1 )
83
85
* [ AccountType] ( #accounttype )
84
86
* [ spendingCondition] ( #spendingcondition )
85
- * [ Parameters] ( #parameters-18 )
86
- * [ setInput] ( #setinput )
87
87
* [ Parameters] ( #parameters-19 )
88
- * [ setOwnOutput ] ( #setownoutput )
88
+ * [ setInput ] ( #setinput )
89
89
* [ Parameters] ( #parameters-20 )
90
+ * [ setOwnOutput] ( #setownoutput )
91
+ * [ Parameters] ( #parameters-21 )
90
92
* [ getDescriptorTemplate] ( #getdescriptortemplate )
91
93
* [ SingleKeyAccount] ( #singlekeyaccount )
92
94
* [ getTaprootOutputKey] ( #gettaprootoutputkey )
93
- * [ Parameters] ( #parameters-21 )
94
- * [ AppClient] ( #appclient )
95
95
* [ Parameters] ( #parameters-22 )
96
- * [ ClientCommandInterpreter ] ( #clientcommandinterpreter )
96
+ * [ AppClient ] ( #appclient )
97
97
* [ Parameters] ( #parameters-23 )
98
- * [ MerkelizedPsbt ] ( #merkelizedpsbt )
98
+ * [ ClientCommandInterpreter ] ( #clientcommandinterpreter )
99
99
* [ Parameters] ( #parameters-24 )
100
- * [ Merkle ] ( #merkle )
100
+ * [ MerkelizedPsbt ] ( #merkelizedpsbt )
101
101
* [ Parameters] ( #parameters-25 )
102
- * [ MerkleMap ] ( #merklemap )
102
+ * [ Merkle ] ( #merkle )
103
103
* [ Parameters] ( #parameters-26 )
104
- * [ WalletPolicy ] ( #walletpolicy )
104
+ * [ MerkleMap ] ( #merklemap )
105
105
* [ Parameters] ( #parameters-27 )
106
- * [ extract ] ( #extract )
106
+ * [ WalletPolicy ] ( #walletpolicy )
107
107
* [ Parameters] ( #parameters-28 )
108
- * [ finalize ] ( #finalize )
108
+ * [ extract ] ( #extract )
109
109
* [ Parameters] ( #parameters-29 )
110
- * [ clearFinalizedInput ] ( #clearfinalizedinput )
110
+ * [ finalize ] ( #finalize )
111
111
* [ Parameters] ( #parameters-30 )
112
- * [ writePush ] ( #writepush )
112
+ * [ clearFinalizedInput ] ( #clearfinalizedinput )
113
113
* [ Parameters] ( #parameters-31 )
114
+ * [ writePush] ( #writepush )
115
+ * [ Parameters] ( #parameters-32 )
114
116
* [ PsbtV2] ( #psbtv2 )
115
117
* [ serializeTransactionOutputs] ( #serializetransactionoutputs-1 )
116
- * [ Parameters] ( #parameters-32 )
118
+ * [ Parameters] ( #parameters-33 )
117
119
* [ Examples] ( #examples-9 )
118
120
* [ SignP2SHTransactionArg] ( #signp2shtransactionarg )
119
121
* [ Properties] ( #properties-2 )
@@ -338,6 +340,46 @@ Trusted input is the hash of a UTXO that needs to be signed. BIP143 is used for
338
340
339
341
Returns ** [ string] ( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String ) **   ;
340
342
343
+ #### signWithdrawal
344
+
345
+ Signs an Acre Withdrawal message with the private key at
346
+ the provided derivation path according to the Bitcoin Signature format
347
+ and returns v, r, s.
348
+
349
+ ##### Parameters
350
+
351
+ * ` $0 ` ** {path: [ string] ( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String ) , withdrawalData: [ AcreWithdrawalData] ( #acrewithdrawaldata ) }**
352
+
353
+ * ` $0.path `   ;
354
+ * ` $0.withdrawalData `   ;
355
+
356
+ Returns ** [ Promise] ( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise ) <{v: [ number] ( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number ) , r: [ string] ( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String ) , s: [ string] ( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String ) }>**   ;
357
+
358
+ ##### Examples
359
+
360
+ ``` javascript
361
+ var withdrawalData = {
362
+ to: " 0xc14972DC5a4443E4f5e89E3655BE48Ee95A795aB" ,
363
+ value: " 0x0" ,
364
+ data: " 0xcae9ca510000000000000000000000000e781e9d538895ee99bd6e9bf28664942beff32f00000000000000000000000000000000000000000000000000470de4df820000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001000000000000000000000000006083Bde64CCBF08470a1a0dAa9a0281B4951be7C4b5e4623765ec95cfa6e261406d5c446012eff9300000000000000000000000008dcc842b8ed75efe1f222ebdc22d1b06ef35efff6469f708057266816f0595200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000587f579c500000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000001a1976a914c8e9edf5e915c0482b1b236fc917011a4b943e6e88ac000000000000" ,
365
+ operation: " 0" ,
366
+ safeTxGas: " 0x0" ,
367
+ baseGas: " 0x0" ,
368
+ gasPrice: " 0x0" ,
369
+ gasToken: " 0x0000000000000000000000000000000000000000" ,
370
+ refundReceiver: " 0x0000000000000000000000000000000000000000" ,
371
+ nonce: " 0xC" ,
372
+ };
373
+ acre .signWithdrawal ({" m/44'/0'/0'/0/0" , withdrawalData}).then (function (result ) {
374
+ var v = result[' v' ] + 27 + 4 ;
375
+ var signature = Buffer .from (v .toString (16 ) + result[' r' ] + result[' s' ], ' hex' ).toString (' base64' );
376
+ console .log (" Signature : " + signature);
377
+ }).catch (function (ex ) {console .log (ex);});
378
+ ```
379
+
380
+ Returns ** [ Promise] ( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise ) <{v: [ number] ( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number ) , r: [ string] ( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String ) , s: [ string] ( https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String ) }>**   ;
381
+
382
+
341
383
### AcreBtcNew
342
384
343
385
This class implements the same interface as AcreBtcOld (formerly
0 commit comments