-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdodsettlement.go
716 lines (639 loc) · 23.1 KB
/
dodsettlement.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
713
714
715
716
package qlcchain
import (
"github.com/qlcchain/qlc-go-sdk/pkg/types"
_ "github.com/qlcchain/qlc-go-sdk/pkg/util"
)
type DoDSettlementAPI struct {
client *QLCClient
}
func NewDoDSettlementAPI(c *QLCClient) *DoDSettlementAPI {
return &DoDSettlementAPI{
client: c,
}
}
type DoDSettleUser struct {
Address types.Address `json:"address" msg:"a,extension"`
Name string `json:"name" msg:"n"`
}
//go:generate go-enum -f=$GOFILE --marshal --names
/*
ENUM(
null
request
confirmed
rejected
)
*/
type DoDSettleContractState int
//go:generate go-enum -f=$GOFILE --marshal --names
/*
ENUM(
null
success
complete
fail
)
*/
type DoDSettleOrderState int
//go:generate go-enum -f=$GOFILE --marshal --names
/*
ENUM(
null
invoice
stableCoin
)
*/
type DoDSettlePaymentType int
//go:generate go-enum -f=$GOFILE --marshal --names
/*
ENUM(
null
PAYG
DOD
)
*/
type DoDSettleBillingType int
//go:generate go-enum -f=$GOFILE --marshal --names
/*
ENUM(
null
year
month
week
day
hour
minute
second
)
*/
type DoDSettleBillingUnit int
//go:generate go-enum -f=$GOFILE --marshal --names
/*
ENUM(
null
gold
silver
bronze
)
*/
type DoDSettleServiceClass int
//go:generate go-enum -f=$GOFILE --marshal --names
/*
ENUM(
null
confirm
reject
)
*/
type DoDSettleResponseAction int
//go:generate go-enum -f=$GOFILE --marshal --names
/*
ENUM(
null
create
change
terminate
)
*/
type DoDSettleOrderType int
type DoDSettleConnectionParam struct {
DoDSettleConnectionStaticParam
DoDSettleConnectionDynamicParam
}
type DoDSettleConnectionStaticParam struct {
BuyerProductId string `json:"buyerProductId,omitempty" msg:"bp"`
ProductOfferingId string `json:"productOfferingId,omitempty" msg:"po"`
ProductId string `json:"productId,omitempty" msg:"pi"`
SrcCompanyName string `json:"srcCompanyName,omitempty" msg:"scn"`
SrcRegion string `json:"srcRegion,omitempty" msg:"sr"`
SrcCity string `json:"srcCity,omitempty" msg:"sc"`
SrcDataCenter string `json:"srcDataCenter,omitempty" msg:"sdc"`
SrcPort string `json:"srcPort,omitempty" msg:"sp"`
DstCompanyName string `json:"dstCompanyName,omitempty" msg:"dcn"`
DstRegion string `json:"dstRegion,omitempty" msg:"dr"`
DstCity string `json:"dstCity,omitempty" msg:"dc"`
DstDataCenter string `json:"dstDataCenter,omitempty" msg:"ddc"`
DstPort string `json:"dstPort,omitempty" msg:"dp"`
}
type DoDSettleConnectionDynamicParam struct {
OrderId string `json:"orderId,omitempty" msg:"oi"`
InternalId string `json:"internalId,omitempty" msg:"-"`
ItemId string `json:"itemId,omitempty" msg:"ii"`
OrderItemId string `json:"orderItemId,omitempty" msg:"oii"`
QuoteId string `json:"quoteId,omitempty" msg:"q"`
QuoteItemId string `json:"quoteItemId,omitempty" msg:"qi"`
ConnectionName string `json:"connectionName,omitempty" msg:"cn"`
PaymentType DoDSettlePaymentType `json:"paymentType,omitempty" msg:"pt"`
BillingType DoDSettleBillingType `json:"billingType,omitempty" msg:"bt"`
Currency string `json:"currency,omitempty" msg:"cr"`
ServiceClass DoDSettleServiceClass `json:"serviceClass,omitempty" msg:"scs"`
Bandwidth string `json:"bandwidth,omitempty" msg:"bw"`
BillingUnit DoDSettleBillingUnit `json:"billingUnit,omitempty" msg:"bu"`
Price float64 `json:"price,omitempty" msg:"p"`
Addition float64 `json:"addition" msg:"ad"`
StartTime int64 `json:"startTime" msg:"st"`
StartTimeStr string `json:"startTimeStr,omitempty" msg:"-"`
EndTime int64 `json:"endTime" msg:"et"`
EndTimeStr string `json:"endTimeStr,omitempty" msg:"-"`
}
type ContractPrivacyParam struct {
PrivateFrom string `json:"privateFrom"`
PrivateFor []string `json:"privateFor"`
PrivateGroupID string `json:"privateGroupID"`
}
type DoDSettleCreateOrderParam struct {
ContractPrivacyParam
Buyer *DoDSettleUser `json:"buyer" msg:"b"`
Seller *DoDSettleUser `json:"seller" msg:"s"`
Connections []*DoDSettleConnectionParam `json:"connections,omitempty" msg:"c"`
}
type DoDSettleResponseParam struct {
ContractPrivacyParam
RequestHash types.Hash `json:"requestHash" msg:"-"`
Action DoDSettleResponseAction `json:"action" msg:"c"`
}
type DoDSettleChangeConnectionParam struct {
ProductId string `json:"productId" msg:"p"`
DoDSettleConnectionDynamicParam
}
type DoDSettleTerminateOrderParam struct {
ContractPrivacyParam
Buyer *DoDSettleUser `json:"buyer" msg:"b"`
Seller *DoDSettleUser `json:"seller" msg:"s"`
Connections []*DoDSettleChangeConnectionParam `json:"connections" msg:"c"`
}
type DoDSettleChangeOrderParam struct {
ContractPrivacyParam
Buyer *DoDSettleUser `json:"buyer" msg:"b"`
Seller *DoDSettleUser `json:"seller" msg:"s"`
Connections []*DoDSettleChangeConnectionParam `json:"connections" msg:"c"`
}
type DoDSettleProductInfo struct {
OrderItemId string `json:"orderItemId" msg:"oii"`
ProductId string `json:"productId" msg:"pi"`
Active bool `json:"active" msg:"a"`
}
type DoDSettleUpdateProductInfoParam struct {
ContractPrivacyParam
Address types.Address `json:"address" msg:"-"`
OrderId string `json:"orderId" msg:"oi"`
ProductInfo []*DoDSettleProductInfo `json:"productInfo" msg:"p"`
}
type DoDSettleOrderItem struct {
ItemId string `json:"itemId" msg:"i"`
OrderItemId string `json:"orderItemId" msg:"o"`
}
type DoDSettleUpdateOrderInfoParam struct {
ContractPrivacyParam
Buyer types.Address `json:"buyer" msg:"-"`
InternalId types.Hash `json:"internalId,omitempty" msg:"i,extension"`
OrderId string `json:"orderId,omitempty" msg:"oi"`
OrderItemId []*DoDSettleOrderItem `json:"orderItemId" msg:"oii"`
Status DoDSettleOrderState `json:"status,omitempty" msg:"s"`
FailReason string `json:"failReason,omitempty" msg:"fr"`
}
func (s *DoDSettlementAPI) GetCreateOrderBlock(param *DoDSettleCreateOrderParam, sign Signature) (*types.StateBlock, error) {
var blk types.StateBlock
err := s.client.getClient().Call(&blk, "DoDSettlement_getCreateOrderBlock", param)
if err != nil {
return nil, err
}
if sign != nil {
blk.Signature, err = sign(blk.GetHash())
if err != nil {
return nil, err
}
}
return &blk, nil
}
func (s *DoDSettlementAPI) GetCreateOrderRewardBlock(param *DoDSettleResponseParam, sign Signature) (*types.StateBlock, error) {
var blk types.StateBlock
err := s.client.getClient().Call(&blk, "DoDSettlement_getCreateOrderRewardBlock", param)
if err != nil {
return nil, err
}
if sign != nil {
blk.Signature, err = sign(blk.GetHash())
if err != nil {
return nil, err
}
}
return &blk, nil
}
func (s *DoDSettlementAPI) GetUpdateOrderInfoBlock(param *DoDSettleUpdateOrderInfoParam, sign Signature) (*types.StateBlock, error) {
var blk types.StateBlock
err := s.client.getClient().Call(&blk, "DoDSettlement_getUpdateOrderInfoBlock", param)
if err != nil {
return nil, err
}
if sign != nil {
blk.Signature, err = sign(blk.GetHash())
if err != nil {
return nil, err
}
}
return &blk, nil
}
func (s *DoDSettlementAPI) GetUpdateOrderInfoRewardBlock(param *DoDSettleResponseParam, sign Signature) (*types.StateBlock, error) {
var blk types.StateBlock
err := s.client.getClient().Call(&blk, "DoDSettlement_getUpdateOrderInfoRewardBlock", param)
if err != nil {
return nil, err
}
if sign != nil {
blk.Signature, err = sign(blk.GetHash())
if err != nil {
return nil, err
}
}
return &blk, nil
}
func (s *DoDSettlementAPI) GetChangeOrderBlock(param *DoDSettleChangeOrderParam, sign Signature) (*types.StateBlock, error) {
var blk types.StateBlock
err := s.client.getClient().Call(&blk, "DoDSettlement_getChangeOrderBlock", param)
if err != nil {
return nil, err
}
if sign != nil {
blk.Signature, err = sign(blk.GetHash())
if err != nil {
return nil, err
}
}
return &blk, nil
}
func (s *DoDSettlementAPI) GetChangeOrderRewardBlock(param *DoDSettleResponseParam, sign Signature) (*types.StateBlock, error) {
var blk types.StateBlock
err := s.client.getClient().Call(&blk, "DoDSettlement_getChangeOrderRewardBlock", param)
if err != nil {
return nil, err
}
if sign != nil {
blk.Signature, err = sign(blk.GetHash())
if err != nil {
return nil, err
}
}
return &blk, nil
}
func (s *DoDSettlementAPI) GetTerminateOrderBlock(param *DoDSettleTerminateOrderParam, sign Signature) (*types.StateBlock, error) {
var blk types.StateBlock
err := s.client.getClient().Call(&blk, "DoDSettlement_getTerminateOrderBlock", param)
if err != nil {
return nil, err
}
if sign != nil {
blk.Signature, err = sign(blk.GetHash())
if err != nil {
return nil, err
}
}
return &blk, nil
}
func (s *DoDSettlementAPI) GetTerminateOrderRewardBlock(param *DoDSettleResponseParam, sign Signature) (*types.StateBlock, error) {
var blk types.StateBlock
err := s.client.getClient().Call(&blk, "DoDSettlement_getTerminateOrderRewardBlock", param)
if err != nil {
return nil, err
}
if sign != nil {
blk.Signature, err = sign(blk.GetHash())
if err != nil {
return nil, err
}
}
return &blk, nil
}
func (s *DoDSettlementAPI) GetUpdateProductInfoBlock(param *DoDSettleUpdateProductInfoParam, sign Signature) (*types.StateBlock, error) {
var blk types.StateBlock
err := s.client.getClient().Call(&blk, "DoDSettlement_getUpdateProductInfoBlock", param)
if err != nil {
return nil, err
}
if sign != nil {
blk.Signature, err = sign(blk.GetHash())
if err != nil {
return nil, err
}
}
return &blk, nil
}
func (s *DoDSettlementAPI) GetUpdateProductInfoRewardBlock(param *DoDSettleResponseParam, sign Signature) (*types.StateBlock, error) {
var blk types.StateBlock
err := s.client.getClient().Call(&blk, "DoDSettlement_getUpdateProductInfoRewardBlock", param)
if err != nil {
return nil, err
}
if sign != nil {
blk.Signature, err = sign(blk.GetHash())
if err != nil {
return nil, err
}
}
return &blk, nil
}
type DoDSettleOrderLifeTrack struct {
ContractState DoDSettleContractState `json:"contractState" msg:"cs"`
OrderState DoDSettleOrderState `json:"orderState" msg:"os"`
Reason string `json:"reason,omitempty" msg:"r"`
Time int64 `json:"time" msg:"t"`
Hash types.Hash `json:"hash" msg:"h,extension"`
}
type DoDSettleOrderInfo struct {
Buyer *DoDSettleUser `json:"buyer" msg:"b"`
Seller *DoDSettleUser `json:"seller" msg:"s"`
OrderId string `json:"orderId,omitempty" msg:"oi"`
InternalId string `json:"internalId,omitempty" msg:"i"`
OrderType DoDSettleOrderType `json:"orderType,omitempty" msg:"ot"`
OrderState DoDSettleOrderState `json:"orderState" msg:"os"`
ContractState DoDSettleContractState `json:"contractState" msg:"cs"`
Connections []*DoDSettleConnectionParam `json:"connections" msg:"c"`
Track []*DoDSettleOrderLifeTrack `json:"track" msg:"t"`
}
type DoDSettleDisconnectInfo struct {
OrderId string `json:"orderId,omitempty" msg:"oi"`
OrderItemId string `json:"orderItemId,omitempty" msg:"oii"`
QuoteId string `json:"quoteId,omitempty" msg:"q"`
QuoteItemId string `json:"quoteItemId,omitempty" msg:"qi"`
Price float64 `json:"price,omitempty" msg:"p"`
Currency string `json:"currency,omitempty" msg:"cr"`
DisconnectAt int64 `json:"disconnectAt,omitempty" msg:"d"`
}
type DoDSettleConnectionLifeTrack struct {
OrderType DoDSettleOrderType `json:"orderType,omitempty" msg:"ot"`
OrderId string `json:"orderId,omitempty" msg:"oi"`
Time int64 `json:"time,omitempty" msg:"t"`
Changed *DoDSettleConnectionDynamicParam `json:"changed,omitempty" msg:"c"`
}
type DoDSettleConnectionInfo struct {
DoDSettleConnectionStaticParam
Active *DoDSettleConnectionDynamicParam `json:"active" msg:"ac"`
Done []*DoDSettleConnectionDynamicParam `json:"done" msg:"do"`
Disconnect *DoDSettleDisconnectInfo `json:"disconnect" msg:"dis"`
Track []*DoDSettleConnectionLifeTrack `json:"track" msg:"t"`
}
type DoDPendingRequestRsp struct {
Hash types.Hash `json:"hash"`
Order *DoDSettleOrderInfo `json:"order"`
}
type DoDSettleProductWithActiveInfo struct {
ProductId string `json:"productId"`
Active bool `json:"active"`
}
type DoDPendingResourceCheckInfo struct {
SendHash types.Hash `json:"sendHash"`
OrderId string `json:"orderId"`
InternalId types.Hash `json:"internalId"`
Products []*DoDSettleProductInfo `json:"products"`
}
type DoDPlacingOrderInfo struct {
InternalId types.Hash `json:"internalId"`
OrderInfo *DoDSettleOrderInfo `json:"orderInfo"`
}
type DoDPlacingOrderResp struct {
TotalOrders int `json:"totalOrders"`
OrderList []*DoDPlacingOrderInfo `json:"orderList"`
}
type DoDSettleInvoiceConnDynamic struct {
DoDSettleConnectionDynamicParam
InvoiceStartTime int64 `json:"invoiceStartTime,omitempty"`
InvoiceStartTimeStr string `json:"invoiceStartTimeStr,omitempty"`
InvoiceEndTime int64 `json:"invoiceEndTime,omitempty"`
InvoiceEndTimeStr string `json:"invoiceEndTimeStr,omitempty"`
InvoiceUnitCount int `json:"invoiceUnitCount,omitempty"`
OrderType DoDSettleOrderType `json:"orderType,omitempty"`
Amount float64 `json:"amount"`
}
type DoDSettleInvoiceConnDetail struct {
ConnectionAmount float64 `json:"connectionAmount"`
DoDSettleConnectionStaticParam
Usage []*DoDSettleInvoiceConnDynamic `json:"usage"`
}
type DoDSettleInvoiceOrderDetail struct {
OrderId string `json:"orderId"`
ConnectionCount int `json:"connectionCount"`
OrderAmount float64 `json:"orderAmount"`
Connections []*DoDSettleInvoiceConnDetail `json:"connections"`
}
type DoDSettleOrderInvoice struct {
TotalConnectionCount int `json:"totalConnectionCount"`
TotalAmount float64 `json:"totalAmount"`
Currency string `json:"currency"`
StartTime int64 `json:"startTime"`
EndTime int64 `json:"endTime"`
Buyer *DoDSettleUser `json:"buyer"`
Seller *DoDSettleUser `json:"seller"`
Order *DoDSettleInvoiceOrderDetail `json:"order"`
}
type DoDSettleBuyerInvoice struct {
OrderCount int `json:"orderCount"`
TotalConnectionCount int `json:"totalConnectionCount"`
TotalAmount float64 `json:"totalAmount"`
Currency string `json:"currency"`
StartTime int64 `json:"startTime"`
EndTime int64 `json:"endTime"`
Buyer *DoDSettleUser `json:"buyer"`
Seller *DoDSettleUser `json:"seller"`
Orders []*DoDSettleInvoiceOrderDetail `json:"orders"`
}
type DoDSettleProductInvoice struct {
TotalAmount float64 `json:"totalAmount"`
Currency string `json:"currency"`
StartTime int64 `json:"startTime"`
EndTime int64 `json:"endTime"`
Buyer *DoDSettleUser `json:"buyer"`
Seller *DoDSettleUser `json:"seller"`
Connection *DoDSettleInvoiceConnDetail `json:"connection"`
}
type DoDSettleProduct struct {
Seller types.Address `json:"seller" msg:"s,extension"`
ProductId string `json:"productId,omitempty" msg:"p"`
}
type DoDSettleOrder struct {
Seller types.Address `json:"seller" msg:"s,extension"`
OrderId string `json:"orderId,omitempty" msg:"o"`
}
type DoDSettlementOrderInfoResp struct {
OrderInfo []*DoDSettleOrderInfo `json:"orderInfo"`
TotalOrders int `json:"totalOrders"`
}
type DoDSettlementProductInfoResp struct {
ProductInfo []*DoDSettleConnectionInfo `json:"productInfo"`
TotalProducts int `json:"totalProducts"`
}
func (s *DoDSettlementAPI) GetOrderInfoBySellerAndOrderId(seller types.Address, orderId string) (*DoDSettleOrderInfo, error) {
var r DoDSettleOrderInfo
err := s.client.getClient().Call(&r, "DoDSettlement_getOrderInfoBySellerAndOrderId", seller, orderId)
if err != nil {
return nil, err
}
return &r, nil
}
func (s *DoDSettlementAPI) GetOrderInfoByInternalId(internalId string) (*DoDSettleOrderInfo, error) {
var r DoDSettleOrderInfo
err := s.client.getClient().Call(&r, "DoDSettlement_getOrderInfoByInternalId", internalId)
if err != nil {
return nil, err
}
return &r, nil
}
func (s *DoDSettlementAPI) GetProductInfoBySellerAndProductId(seller types.Address, productId string) (*DoDSettleConnectionInfo, error) {
var r DoDSettleConnectionInfo
err := s.client.getClient().Call(&r, "DoDSettlement_getProductInfoBySellerAndProductId", seller, productId)
if err != nil {
return nil, err
}
return &r, nil
}
func (s *DoDSettlementAPI) GetPendingRequest(address types.Address) ([]*DoDPendingRequestRsp, error) {
var r []*DoDPendingRequestRsp
err := s.client.getClient().Call(&r, "DoDSettlement_getPendingRequest", address)
if err != nil {
return nil, err
}
return r, nil
}
func (s *DoDSettlementAPI) GetPendingResourceCheck(address types.Address) ([]*DoDPendingResourceCheckInfo, error) {
var r []*DoDPendingResourceCheckInfo
err := s.client.getClient().Call(&r, "DoDSettlement_getPendingResourceCheck", address)
if err != nil {
return nil, err
}
return r, nil
}
func (s *DoDSettlementAPI) GetPlacingOrder(buyer, seller types.Address, count, offset int) (*DoDPlacingOrderResp, error) {
var r DoDPlacingOrderResp
err := s.client.getClient().Call(&r, "DoDSettlement_getPlacingOrder", buyer, seller, count, offset)
if err != nil {
return nil, err
}
return &r, nil
}
func (s *DoDSettlementAPI) GetProductIdListByAddress(address types.Address) ([]*DoDSettleProduct, error) {
var r []*DoDSettleProduct
err := s.client.getClient().Call(&r, "DoDSettlement_getProductIdListByAddress", address)
if err != nil {
return nil, err
}
return r, nil
}
func (s *DoDSettlementAPI) GetOrderIdListByAddress(address types.Address) ([]*DoDSettleOrder, error) {
var r []*DoDSettleOrder
err := s.client.getClient().Call(&r, "DoDSettlement_getOrderIdListByAddress", address)
if err != nil {
return nil, err
}
return r, nil
}
func (s *DoDSettlementAPI) GetProductIdListByAddressAndSeller(address, seller types.Address) ([]*DoDSettleOrder, error) {
var r []*DoDSettleOrder
err := s.client.getClient().Call(&r, "DoDSettlement_getProductIdListByAddressAndSeller", address, seller)
if err != nil {
return nil, err
}
return r, nil
}
func (s *DoDSettlementAPI) GetOrderIdListByAddressAndSeller(address, seller types.Address) ([]*DoDSettleOrder, error) {
var r []*DoDSettleOrder
err := s.client.getClient().Call(&r, "DoDSettlement_getOrderIdListByAddressAndSeller", address, seller)
if err != nil {
return nil, err
}
return r, nil
}
func (s *DoDSettlementAPI) GenerateInvoiceByOrderId(seller types.Address, orderId string, start, end int64, flight, split bool) (*DoDSettleOrderInvoice, error) {
var r DoDSettleOrderInvoice
err := s.client.getClient().Call(&r, "DoDSettlement_generateInvoiceByOrderId", seller, orderId, start, end, flight, split)
if err != nil {
return nil, err
}
return &r, nil
}
func (s *DoDSettlementAPI) GenerateInvoiceByBuyer(seller, buyer types.Address, start, end int64, flight, split bool) (*DoDSettleBuyerInvoice, error) {
var r DoDSettleBuyerInvoice
err := s.client.getClient().Call(&r, "DoDSettlement_generateInvoiceByBuyer", seller, buyer, start, end, flight, split)
if err != nil {
return nil, err
}
return &r, nil
}
func (s *DoDSettlementAPI) GenerateInvoiceByProductId(seller types.Address, productId string, start, end int64, flight, split bool) (*DoDSettleProductInvoice, error) {
var r DoDSettleProductInvoice
err := s.client.getClient().Call(&r, "DoDSettlement_generateInvoiceByProductId", seller, productId, start, end, flight, split)
if err != nil {
return nil, err
}
return &r, nil
}
func (s *DoDSettlementAPI) GetOrderCountByAddress(address types.Address) int {
var length int
err := s.client.getClient().Call(&length, "DoDSettlement_getOrderCountByAddress", address)
if err != nil {
return 0
}
return length
}
func (s *DoDSettlementAPI) GetOrderInfoByAddress(address types.Address, count, offset int) (*DoDSettlementOrderInfoResp, error) {
var r DoDSettlementOrderInfoResp
err := s.client.getClient().Call(&r, "DoDSettlement_getOrderInfoByAddress", address, count, offset)
if err != nil {
return nil, err
}
return &r, nil
}
func (s *DoDSettlementAPI) GetOrderCountByAddressAndSeller(address, seller types.Address) int {
var length int
err := s.client.getClient().Call(&length, "DoDSettlement_getOrderCountByAddressAndSeller", address, seller)
if err != nil {
return 0
}
return length
}
func (s *DoDSettlementAPI) GetOrderInfoByAddressAndSeller(address, seller types.Address, count, offset int) (*DoDSettlementOrderInfoResp, error) {
var r DoDSettlementOrderInfoResp
err := s.client.getClient().Call(&r, "DoDSettlement_getOrderInfoByAddressAndSeller", address, count, offset)
if err != nil {
return nil, err
}
return &r, nil
}
func (s *DoDSettlementAPI) GetProductCountByAddress(address types.Address) int {
var length int
err := s.client.getClient().Call(&length, "DoDSettlement_getProductCountByAddress", address)
if err != nil {
return 0
}
return length
}
func (s *DoDSettlementAPI) GetProductInfoByAddress(address types.Address, count, offset int) (*DoDSettlementProductInfoResp, error) {
var r DoDSettlementProductInfoResp
err := s.client.getClient().Call(&r, "DoDSettlement_getProductInfoByAddress", address, count, offset)
if err != nil {
return nil, err
}
return &r, nil
}
func (s *DoDSettlementAPI) GetProductCountByAddressAndSeller(address, seller types.Address) int {
var length int
err := s.client.getClient().Call(&length, "DoDSettlement_getProductCountByAddressAndSeller", address, seller)
if err != nil {
return 0
}
return length
}
func (s *DoDSettlementAPI) GetProductInfoByAddressAndSeller(address, seller types.Address, count, offset int) (*DoDSettlementProductInfoResp, error) {
var r DoDSettlementProductInfoResp
err := s.client.getClient().Call(&r, "DoDSettlement_getProductInfoByAddress", address, count, offset)
if err != nil {
return nil, err
}
return &r, nil
}
func (s *DoDSettlementAPI) GetInternalIdByOrderId(seller types.Address, orderId string) (types.Hash, error) {
var r types.Hash
err := s.client.getClient().Call(&r, "DoDSettlement_getInternalIdByOrderId", seller, orderId)
if err != nil {
return types.ZeroHash, err
}
return r, nil
}