-
Notifications
You must be signed in to change notification settings - Fork 8
/
wallet.go
712 lines (591 loc) · 20.4 KB
/
wallet.go
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
package rpc
import (
"net/http"
"github.com/samber/mo"
"github.com/chia-network/go-chia-libs/pkg/rpcinterface"
"github.com/chia-network/go-chia-libs/pkg/types"
)
// WalletService encapsulates wallet RPC methods
type WalletService struct {
client *Client
}
// NewRequest returns a new request specific to the wallet service
func (s *WalletService) NewRequest(rpcEndpoint rpcinterface.Endpoint, opt interface{}) (*rpcinterface.Request, error) {
return s.client.NewRequest(rpcinterface.ServiceWallet, rpcEndpoint, opt)
}
// Do is just a shortcut to the client's Do method
func (s *WalletService) Do(req *rpcinterface.Request, v interface{}) (*http.Response, error) {
return s.client.Do(req, v)
}
// GetConnections returns connections
func (s *WalletService) GetConnections(opts *GetConnectionsOptions) (*GetConnectionsResponse, *http.Response, error) {
request, err := s.NewRequest("get_connections", opts)
if err != nil {
return nil, nil, err
}
c := &GetConnectionsResponse{}
resp, err := s.Do(request, c)
if err != nil {
return nil, resp, err
}
return c, resp, nil
}
// GetNetworkInfo wallet rpc -> get_network_info
func (s *WalletService) GetNetworkInfo(opts *GetNetworkInfoOptions) (*GetNetworkInfoResponse, *http.Response, error) {
request, err := s.NewRequest("get_network_info", nil)
if err != nil {
return nil, nil, err
}
r := &GetNetworkInfoResponse{}
resp, err := s.Do(request, r)
if err != nil {
return nil, resp, err
}
return r, resp, nil
}
// GetPublicKeysResponse response from get_public_keys
type GetPublicKeysResponse struct {
Response
PublicKeyFingerprints mo.Option[[]int] `json:"public_key_fingerprints"`
}
// GetPublicKeys endpoint
func (s *WalletService) GetPublicKeys() (*GetPublicKeysResponse, *http.Response, error) {
request, err := s.NewRequest("get_public_keys", nil)
if err != nil {
return nil, nil, err
}
r := &GetPublicKeysResponse{}
resp, err := s.Do(request, r)
if err != nil {
return nil, resp, err
}
return r, resp, nil
}
// GenerateMnemonicResponse Random new 24 words response
type GenerateMnemonicResponse struct {
Response
Mnemonic mo.Option[[]string] `json:"mnemonic"`
}
// GenerateMnemonic Endpoint for generating a new random 24 words
func (s *WalletService) GenerateMnemonic() (*GenerateMnemonicResponse, *http.Response, error) {
request, err := s.NewRequest("generate_mnemonic", nil)
if err != nil {
return nil, nil, err
}
r := &GenerateMnemonicResponse{}
resp, err := s.Do(request, r)
if err != nil {
return nil, resp, err
}
return r, resp, nil
}
// AddKeyOptions options for the add_key endpoint
type AddKeyOptions struct {
Mnemonic []string `json:"mnemonic"`
}
// AddKeyResponse response from the add_key endpoint
type AddKeyResponse struct {
Response
Word mo.Option[string] `json:"word,omitempty"` // This is part of a unique error response
Fingerprint mo.Option[int] `json:"fingerprint,omitempty"`
}
// AddKey Adds a new key from 24 words to the keychain
func (s *WalletService) AddKey(options *AddKeyOptions) (*AddKeyResponse, *http.Response, error) {
request, err := s.NewRequest("add_key", options)
if err != nil {
return nil, nil, err
}
r := &AddKeyResponse{}
resp, err := s.Do(request, r)
if err != nil {
return nil, resp, err
}
return r, resp, nil
}
// DeleteAllKeysResponse Delete keys response
type DeleteAllKeysResponse struct {
Response
}
// DeleteAllKeys deletes all keys from the keychain
func (s *WalletService) DeleteAllKeys() (*DeleteAllKeysResponse, *http.Response, error) {
request, err := s.NewRequest("delete_all_keys", nil)
if err != nil {
return nil, nil, err
}
r := &DeleteAllKeysResponse{}
resp, err := s.Do(request, r)
if err != nil {
return nil, resp, err
}
return r, resp, nil
}
// GetNextAddressOptions options for get_next_address endpoint
type GetNextAddressOptions struct {
NewAddress bool `json:"new_address"`
WalletID uint32 `json:"wallet_id"`
}
// GetNextAddressResponse response from get next address
type GetNextAddressResponse struct {
Response
WalletID mo.Option[uint32] `json:"wallet_id"`
Address mo.Option[string] `json:"address"`
}
// GetNextAddress returns the current address for the wallet. If NewAddress is true, it moves to the next address before responding
func (s *WalletService) GetNextAddress(options *GetNextAddressOptions) (*GetNextAddressResponse, *http.Response, error) {
request, err := s.NewRequest("get_next_address", options)
if err != nil {
return nil, nil, err
}
r := &GetNextAddressResponse{}
resp, err := s.Do(request, r)
if err != nil {
return nil, resp, err
}
return r, resp, nil
}
// GetWalletSyncStatusResponse Response for get_sync_status on wallet
type GetWalletSyncStatusResponse struct {
Response
GenesisInitialized mo.Option[bool] `json:"genesis_initialized"`
Synced mo.Option[bool] `json:"synced"`
Syncing mo.Option[bool] `json:"syncing"`
}
// GetSyncStatus wallet rpc -> get_sync_status
func (s *WalletService) GetSyncStatus() (*GetWalletSyncStatusResponse, *http.Response, error) {
request, err := s.NewRequest("get_sync_status", nil)
if err != nil {
return nil, nil, err
}
r := &GetWalletSyncStatusResponse{}
resp, err := s.Do(request, r)
if err != nil {
return nil, resp, err
}
return r, resp, nil
}
// GetWalletHeightInfoResponse response for get_height_info on wallet
type GetWalletHeightInfoResponse struct {
Response
Height mo.Option[uint32] `json:"height"`
}
// GetHeightInfo wallet rpc -> get_height_info
func (s *WalletService) GetHeightInfo() (*GetWalletHeightInfoResponse, *http.Response, error) {
request, err := s.NewRequest("get_height_info", nil)
if err != nil {
return nil, nil, err
}
r := &GetWalletHeightInfoResponse{}
resp, err := s.Do(request, r)
if err != nil {
return nil, resp, err
}
return r, resp, nil
}
// GetWalletsOptions wallet rpc -> get_wallets
type GetWalletsOptions struct {
Type types.WalletType `json:"type"`
}
// GetWalletsResponse wallet rpc -> get_wallets
type GetWalletsResponse struct {
Response
Fingerprint mo.Option[int] `json:"fingerprint"`
Wallets mo.Option[[]types.WalletInfo] `json:"wallets"`
}
// GetWallets wallet rpc -> get_wallets
func (s *WalletService) GetWallets(opts *GetWalletsOptions) (*GetWalletsResponse, *http.Response, error) {
request, err := s.NewRequest("get_wallets", opts)
if err != nil {
return nil, nil, err
}
r := &GetWalletsResponse{}
resp, err := s.Do(request, r)
if err != nil {
return nil, resp, err
}
return r, resp, nil
}
// GetWalletBalanceOptions request options for get_wallet_balance
type GetWalletBalanceOptions struct {
WalletID uint32 `json:"wallet_id"`
}
// GetWalletBalanceResponse is the wallet balance RPC response
type GetWalletBalanceResponse struct {
Response
Balance mo.Option[types.WalletBalance] `json:"wallet_balance"`
}
// GetWalletBalance returns wallet balance
func (s *WalletService) GetWalletBalance(opts *GetWalletBalanceOptions) (*GetWalletBalanceResponse, *http.Response, error) {
request, err := s.NewRequest("get_wallet_balance", opts)
if err != nil {
return nil, nil, err
}
r := &GetWalletBalanceResponse{}
resp, err := s.Do(request, r)
if err != nil {
return nil, resp, err
}
return r, resp, nil
}
// GetWalletTransactionCountOptions options for get transaction count
type GetWalletTransactionCountOptions struct {
WalletID uint32 `json:"wallet_id"`
}
// GetWalletTransactionCountResponse response for get_transaction_count
type GetWalletTransactionCountResponse struct {
Response
WalletID mo.Option[uint32] `json:"wallet_id"`
Count mo.Option[int] `json:"count"`
}
// GetTransactionCount returns the total count of transactions for the specific wallet ID
func (s *WalletService) GetTransactionCount(opts *GetWalletTransactionCountOptions) (*GetWalletTransactionCountResponse, *http.Response, error) {
request, err := s.NewRequest("get_transaction_count", opts)
if err != nil {
return nil, nil, err
}
r := &GetWalletTransactionCountResponse{}
resp, err := s.Do(request, r)
if err != nil {
return nil, resp, err
}
return r, resp, nil
}
// GetWalletTransactionsOptions options for get wallet transactions
type GetWalletTransactionsOptions struct {
WalletID uint32 `json:"wallet_id"`
Start *int `json:"start,omitempty"`
End *int `json:"end,omitempty"`
ToAddress string `json:"to_address,omitempty"`
}
// GetWalletTransactionsResponse response for get_wallet_transactions
type GetWalletTransactionsResponse struct {
Response
WalletID mo.Option[uint32] `json:"wallet_id"`
Transactions mo.Option[[]types.TransactionRecord] `json:"transactions"`
}
// GetTransactions wallet rpc -> get_transactions
func (s *WalletService) GetTransactions(opts *GetWalletTransactionsOptions) (*GetWalletTransactionsResponse, *http.Response, error) {
request, err := s.NewRequest("get_transactions", opts)
if err != nil {
return nil, nil, err
}
r := &GetWalletTransactionsResponse{}
resp, err := s.Do(request, r)
if err != nil {
return nil, resp, err
}
return r, resp, nil
}
// GetWalletTransactionOptions options for getting a single wallet transaction
type GetWalletTransactionOptions struct {
WalletID uint32 `json:"wallet_id"`
TransactionID string `json:"transaction_id"`
}
// GetWalletTransactionResponse response for get_wallet_transactions
type GetWalletTransactionResponse struct {
Response
Transaction mo.Option[types.TransactionRecord] `json:"transaction"`
TransactionID mo.Option[string] `json:"transaction_id"`
}
// GetTransaction returns a single transaction record
func (s *WalletService) GetTransaction(opts *GetWalletTransactionOptions) (*GetWalletTransactionResponse, *http.Response, error) {
request, err := s.NewRequest("get_transaction", opts)
if err != nil {
return nil, nil, err
}
r := &GetWalletTransactionResponse{}
resp, err := s.Do(request, r)
if err != nil {
return nil, resp, err
}
return r, resp, nil
}
// SendTransactionOptions represents the options for send_transaction
type SendTransactionOptions struct {
WalletID uint32 `json:"wallet_id"`
Amount uint64 `json:"amount"`
Address string `json:"address"`
Memos []types.Bytes `json:"memos,omitempty"`
Fee uint64 `json:"fee"`
Coins []types.Coin `json:"coins,omitempty"`
}
// SendTransactionResponse represents the response from send_transaction
type SendTransactionResponse struct {
Response
TransactionID mo.Option[string] `json:"transaction_id"`
Transaction mo.Option[types.TransactionRecord] `json:"transaction"`
}
// SendTransaction sends a transaction
func (s *WalletService) SendTransaction(opts *SendTransactionOptions) (*SendTransactionResponse, *http.Response, error) {
request, err := s.NewRequest("send_transaction", opts)
if err != nil {
return nil, nil, err
}
r := &SendTransactionResponse{}
resp, err := s.Do(request, r)
if err != nil {
return nil, resp, err
}
return r, resp, nil
}
// CatSpendOptions represents the options for cat_spend
type CatSpendOptions struct {
WalletID uint32 `json:"wallet_id"`
Amount uint64 `json:"amount"`
Address string `json:"inner_address"`
Fee uint64 `json:"fee"`
}
// CatSpendResponse represents the response from cat_spend
type CatSpendResponse struct {
Response
TransactionID mo.Option[string] `json:"transaction_id"`
Transaction mo.Option[types.TransactionRecord] `json:"transaction"`
}
// CatSpend sends a transaction
func (s *WalletService) CatSpend(opts *CatSpendOptions) (*CatSpendResponse, *http.Response, error) {
request, err := s.NewRequest("cat_spend", opts)
if err != nil {
return nil, nil, err
}
r := &CatSpendResponse{}
resp, err := s.Do(request, r)
if err != nil {
return nil, resp, err
}
return r, resp, nil
}
// MintNFTOptions represents the options for nft_get_info
type MintNFTOptions struct {
DidID string `json:"did_id"` // not required
EditionNumber uint32 `json:"edition_number"` // not required
EditionCount uint32 `json:"edition_count"` // not required
Fee uint64 `json:"fee"` // not required
LicenseHash string `json:"license_hash"` //not required
LicenseURIs []string `json:"license_uris"` // not required
MetaHash string `json:"meta_hash"` // not required
MetaURIs []string `json:"meta_uris"` // not required
RoyaltyAddress string `json:"royalty_address"` // not required
RoyaltyPercentage uint32 `json:"royalty_percentage"` // not required
TargetAddress string `json:"target_address"` // not required
Hash string `json:"hash"`
URIs []string `json:"uris"`
WalletID uint32 `json:"wallet_id"`
}
// MintNFTResponse represents the response from nft_get_info
type MintNFTResponse struct {
Response
SpendBundle mo.Option[types.SpendBundle] `json:"spend_bundle"`
WalletID mo.Option[uint32] `json:"wallet_id"`
}
// MintNFT Mint a new NFT
func (s *WalletService) MintNFT(opts *MintNFTOptions) (*MintNFTResponse, *http.Response, error) {
request, err := s.NewRequest("nft_mint_nft", opts)
if err != nil {
return nil, nil, err
}
r := &MintNFTResponse{}
resp, err := s.Do(request, r)
if err != nil {
return nil, resp, err
}
return r, resp, nil
}
// GetNFTsOptions represents the options for nft_get_nfts
type GetNFTsOptions struct {
WalletID uint32 `json:"wallet_id"`
StartIndex mo.Option[int] `json:"start_index"`
Num mo.Option[int] `json:"num"`
}
// GetNFTsResponse represents the response from nft_get_nfts
type GetNFTsResponse struct {
Response
WalletID mo.Option[uint32] `json:"wallet_id"`
NFTList mo.Option[[]types.NFTInfo] `json:"nft_list"`
}
// GetNFTs Show all NFTs in a given wallet
func (s *WalletService) GetNFTs(opts *GetNFTsOptions) (*GetNFTsResponse, *http.Response, error) {
request, err := s.NewRequest("nft_get_nfts", opts)
if err != nil {
return nil, nil, err
}
r := &GetNFTsResponse{}
resp, err := s.Do(request, r)
if err != nil {
return nil, resp, err
}
return r, resp, nil
}
// TransferNFTOptions represents the options for nft_get_info
type TransferNFTOptions struct {
Fee uint64 `json:"fee"` // not required
NFTCoinID string `json:"nft_coin_id"`
TargetAddress string `json:"target_address"`
WalletID uint32 `json:"wallet_id"`
}
// TransferNFTResponse represents the response from nft_get_info
type TransferNFTResponse struct {
Response
SpendBundle mo.Option[types.SpendBundle] `json:"spend_bundle"`
WalletID mo.Option[uint32] `json:"wallet_id"`
}
// TransferNFT Get info about an NFT
func (s *WalletService) TransferNFT(opts *TransferNFTOptions) (*TransferNFTResponse, *http.Response, error) {
request, err := s.NewRequest("nft_transfer_nft", opts)
if err != nil {
return nil, nil, err
}
r := &TransferNFTResponse{}
resp, err := s.Do(request, r)
if err != nil {
return nil, resp, err
}
return r, resp, nil
}
// GetNFTInfoOptions represents the options for nft_get_info
type GetNFTInfoOptions struct {
CoinID string `json:"coin_id"`
WalletID uint32 `json:"wallet_id"`
}
// GetNFTInfoResponse represents the response from nft_get_info
type GetNFTInfoResponse struct {
Response
NFTInfo mo.Option[types.NFTInfo] `json:"nft_info"`
}
// GetNFTInfo Get info about an NFT
func (s *WalletService) GetNFTInfo(opts *GetNFTInfoOptions) (*GetNFTInfoResponse, *http.Response, error) {
request, err := s.NewRequest("nft_get_info", opts)
if err != nil {
return nil, nil, err
}
r := &GetNFTInfoResponse{}
resp, err := s.Do(request, r)
if err != nil {
return nil, resp, err
}
return r, resp, nil
}
// NFTAddURIOptions represents the options for nft_add_uri
type NFTAddURIOptions struct {
Fee uint64 `json:"fee"` // not required
Key string `json:"key"`
NFTCoinID string `json:"nft_coin_id"`
URI string `json:"uri"`
WalletID uint32 `json:"wallet_id"`
}
// NFTAddURIResponse represents the response from nft_add_uri
type NFTAddURIResponse struct {
Response
SpendBundle mo.Option[types.SpendBundle] `json:"spend_bundle"`
WalletID mo.Option[uint32] `json:"wallet_id"`
}
// NFTAddURI Get info about an NFT
func (s *WalletService) NFTAddURI(opts *NFTAddURIOptions) (*NFTAddURIResponse, *http.Response, error) {
request, err := s.NewRequest("nft_add_uri", opts)
if err != nil {
return nil, nil, err
}
r := &NFTAddURIResponse{}
resp, err := s.Do(request, r)
if err != nil {
return nil, resp, err
}
return r, resp, nil
}
// NFTGetByDidOptions represents the options for nft_get_by_did
type NFTGetByDidOptions struct {
DidID types.Bytes32 `json:"did_id,omitempty"`
}
// NFTGetByDidResponse represents the response from nft_get_by_did
type NFTGetByDidResponse struct {
Response
WalletID mo.Option[uint32] `json:"wallet_id"`
}
// NFTGetByDid Get wallet ID by DID
func (s *WalletService) NFTGetByDid(opts *NFTGetByDidOptions) (*NFTGetByDidResponse, *http.Response, error) {
request, err := s.NewRequest("nft_get_by_did", opts)
if err != nil {
return nil, nil, err
}
r := &NFTGetByDidResponse{}
resp, err := s.Do(request, r)
if err != nil {
return nil, resp, err
}
return r, resp, nil
}
// GetSpendableCoinsOptions Options for get_spendable_coins
type GetSpendableCoinsOptions struct {
WalletID uint32 `json:"wallet_id"`
MinCoinAmount *uint64 `json:"min_coin_amount,omitempty"`
MaxCoinAmount *uint64 `json:"max_coin_amount,omitempty"`
ExcludedCoinAmounts []uint64 `json:"excluded_coin_amounts,omitempty"`
}
// GetSpendableCoinsResponse response from get_spendable_coins
type GetSpendableCoinsResponse struct {
Response
ConfirmedRecords mo.Option[[]types.CoinRecord] `json:"confirmed_records"`
UnconfirmedRemovals mo.Option[[]types.CoinRecord] `json:"unconfirmed_removals"`
UnconfirmedAdditions mo.Option[[]types.CoinRecord] `json:"unconfirmed_additions"`
}
// GetSpendableCoins returns information about the coins in the wallet
func (s *WalletService) GetSpendableCoins(opts *GetSpendableCoinsOptions) (*GetSpendableCoinsResponse, *http.Response, error) {
request, err := s.NewRequest("get_spendable_coins", opts)
if err != nil {
return nil, nil, err
}
r := &GetSpendableCoinsResponse{}
resp, err := s.Do(request, r)
if err != nil {
return nil, resp, err
}
return r, resp, nil
}
// CreateSignedTransactionOptions Options for create_signed_transaction endpoint
type CreateSignedTransactionOptions struct {
WalletID *uint32 `json:"wallet_id,omitempty"`
Additions []types.Addition `json:"additions"`
Fee *uint64 `json:"fee,omitempty"`
MinCoinAmount *uint64 `json:"min_coin_amount,omitempty"`
MaxCoinAmount *uint64 `json:"max_coin_amount,omitempty"`
ExcludeCoinAmounts []*uint64 `json:"exclude_coin_amounts,omitempty"`
Coins []types.Coin `json:"Coins,omitempty"`
ExcludeCoins []types.Coin `json:"exclude_coins,omitempty"`
}
// CreateSignedTransactionResponse Response from create_signed_transaction
type CreateSignedTransactionResponse struct {
Response
SignedTXs mo.Option[[]types.TransactionRecord] `json:"signed_txs"`
SignedTX mo.Option[types.TransactionRecord] `json:"signed_tx"`
}
// CreateSignedTransaction generates a signed transaction based on the specified options
func (s *WalletService) CreateSignedTransaction(opts *CreateSignedTransactionOptions) (*CreateSignedTransactionResponse, *http.Response, error) {
request, err := s.NewRequest("create_signed_transaction", opts)
if err != nil {
return nil, nil, err
}
r := &CreateSignedTransactionResponse{}
resp, err := s.Do(request, r)
if err != nil {
return nil, resp, err
}
return r, resp, nil
}
// SendTransactionMultiResponse Response from send_transaction_multi
type SendTransactionMultiResponse struct {
Response
Transaction mo.Option[types.TransactionRecord] `json:"transaction"`
TransactionID mo.Option[string] `json:"transaction_id"`
}
// SendTransactionMulti allows sending a more detailed transaction with multiple inputs/outputs.
// Options are the same as create signed transaction since this is ultimately just a wrapper around that in Chia
func (s *WalletService) SendTransactionMulti(opts *CreateSignedTransactionOptions) (*SendTransactionMultiResponse, *http.Response, error) {
request, err := s.NewRequest("send_transaction_multi", opts)
if err != nil {
return nil, nil, err
}
r := &SendTransactionMultiResponse{}
resp, err := s.Do(request, r)
if err != nil {
return nil, resp, err
}
return r, resp, nil
}