-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcore.go
More file actions
11214 lines (9119 loc) · 381 KB
/
Copy pathcore.go
File metadata and controls
11214 lines (9119 loc) · 381 KB
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
package core
import (
"errors"
"fmt"
"math/big"
"strings"
chainlinkapi "github.com/smartcontractkit/chainlink-canton/bindings/generated/latest/chainlink/chainlinkapi"
api "github.com/smartcontractkit/chainlink-canton/bindings/generated/latest/mcms/api"
splice_api_token_holding_v1 "github.com/smartcontractkit/chainlink-canton/bindings/generated/latest/splice/splice_api_token_holding_v1"
"github.com/smartcontractkit/go-daml/pkg/bind"
"github.com/smartcontractkit/go-daml/pkg/codec"
"github.com/smartcontractkit/go-daml/pkg/model"
"github.com/smartcontractkit/go-daml/pkg/types"
)
var (
_ = fmt.Sprintf
_ = errors.New
_ = big.NewInt
_ = strings.NewReader
_ = model.Command{}
_ bind.BoundTemplate
)
const (
PackageName = "ccip-core"
PackageID = "4c42daa70c1b656229cce81d1e83da7072efa3ce8d26ef0e3297d4f65663d3a2"
SDKVersion = "3.4.11"
)
type Template interface {
CreateCommand() *model.CreateCommand
GetTemplateID() string
}
const (
TokenConfigKey = types.TEXT("token-config")
TokenAdminRegistryKey = types.TEXT("token-admin-registry")
GlobalCurseSubject = types.TEXT("01000000000000000000000000000001")
UsdPerUsdCent = types.NUMERIC("100000000.")
PremiumIdentity = types.NUMERIC("10000000000.")
MinTokenDecimals = types.INT64(0)
MaxTokenDecimals = types.INT64(37)
E10PerPercent = types.NUMERIC("100000000.")
BaseNumeric = types.NUMERIC("100000000.")
BaseInt = types.INT64(100000000)
MaxUint256DecimalText = types.TEXT("115792089237316195423570985008687907853269984665640564039457584007913129639935")
MaxNumeric0DecimalText = types.TEXT("99999999999999999999999999999999999999")
RmnRemoteKey = types.TEXT("rmn-remote")
FeeQuoterKey = types.TEXT("fee-quoter")
WaitForFinalityFlag = types.TEXT("00000000")
MinBlockDepth = types.INT64(1)
MaxBlockDepth = types.INT64(65535)
FinalityConfigByteLength = types.INT64(4)
MaxNumeric0IntegerText = types.TEXT("99999999999999999999999999999999999999")
GlobalConfigKey = types.TEXT("global-config")
MaxCCVsPerMessage = types.INT64(255)
RateLimiterKey = types.TEXT("rate-limiter")
)
func argsToMap(args any) map[string]any {
if args == nil {
return map[string]any{}
}
if m, ok := args.(map[string]any); ok {
return m
}
type mapper interface {
ToMap() map[string]any
}
if mapper, ok := args.(mapper); ok {
return mapper.ToMap()
}
return map[string]any{"args": args}
}
// AcceptAdminParams is a Record type
type AcceptAdminParams struct {
InstrumentId splice_api_token_holding_v1.InstrumentId `json:"instrumentId"`
}
// ToMap converts AcceptAdminParams to a map for DAML arguments
func (t AcceptAdminParams) ToMap() map[string]any {
m := make(map[string]any)
m["instrumentId"] = model.NestedToDAMLValue(t.InstrumentId)
return m
}
func (t AcceptAdminParams) MarshalJSON() ([]byte, error) {
jsonCodec := codec.NewJsonCodec()
return jsonCodec.Marshal(t)
}
func (t *AcceptAdminParams) UnmarshalJSON(data []byte) error {
jsonCodec := codec.NewJsonCodec()
return jsonCodec.Unmarshal(data, t)
}
// MarshalHex encodes AcceptAdminParams to hex string (Canton MCMS format)
func (t AcceptAdminParams) MarshalHex() (string, error) {
hexCodec := codec.NewHexCodec()
return hexCodec.Marshal(t)
}
// UnmarshalHex decodes AcceptAdminParams from hex string (Canton MCMS format)
func (t *AcceptAdminParams) UnmarshalHex(data string) error {
hexCodec := codec.NewHexCodec()
return hexCodec.Unmarshal(data, t)
}
// AcceptAdminRole is a Record type
type AcceptAdminRole struct {
TokenConfigCid types.CONTRACT_ID `json:"tokenConfigCid"`
InstrumentId splice_api_token_holding_v1.InstrumentId `json:"instrumentId"`
Caller types.PARTY `json:"caller"`
}
// ToMap converts AcceptAdminRole to a map for DAML arguments
func (t AcceptAdminRole) ToMap() map[string]any {
m := make(map[string]any)
m["tokenConfigCid"] = model.NestedToDAMLValue(t.TokenConfigCid)
m["instrumentId"] = model.NestedToDAMLValue(t.InstrumentId)
m["caller"] = t.Caller.ToMap()
return m
}
func (t AcceptAdminRole) MarshalJSON() ([]byte, error) {
jsonCodec := codec.NewJsonCodec()
return jsonCodec.Marshal(t)
}
func (t *AcceptAdminRole) UnmarshalJSON(data []byte) error {
jsonCodec := codec.NewJsonCodec()
return jsonCodec.Unmarshal(data, t)
}
// MarshalHex encodes AcceptAdminRole to hex string (Canton MCMS format)
func (t AcceptAdminRole) MarshalHex() (string, error) {
hexCodec := codec.NewHexCodec()
return hexCodec.Marshal(t)
}
// UnmarshalHex decodes AcceptAdminRole from hex string (Canton MCMS format)
func (t *AcceptAdminRole) UnmarshalHex(data string) error {
hexCodec := codec.NewHexCodec()
return hexCodec.Unmarshal(data, t)
}
// AcceptAdminRoleMCMSParams is AcceptAdminRole without the Caller field for MCMS operationData encoding.
// Use this when encoding choice arguments for MCMS timelock operations.
type AcceptAdminRoleMCMSParams struct {
TokenConfigCid types.CONTRACT_ID `json:"tokenConfigCid"`
InstrumentId splice_api_token_holding_v1.InstrumentId `json:"instrumentId"`
}
// MarshalHex encodes AcceptAdminRoleMCMSParams to hex string for MCMS operationData.
func (t AcceptAdminRoleMCMSParams) MarshalHex() (string, error) {
hexCodec := codec.NewHexCodec()
return hexCodec.Marshal(t)
}
// UnmarshalHex decodes AcceptAdminRoleMCMSParams from hex string.
func (t *AcceptAdminRoleMCMSParams) UnmarshalHex(data string) error {
hexCodec := codec.NewHexCodec()
return hexCodec.Unmarshal(data, t)
}
// AddCCVFee is a Record type
type AddCCVFee struct {
CcvInstanceId types.TEXT `json:"ccvInstanceId"`
FeeUSDCents types.NUMERIC `json:"feeUSDCents"`
DestGasLimit types.INT64 `json:"destGasLimit"`
DestBytesOverhead types.INT64 `json:"destBytesOverhead"`
Caller types.PARTY `json:"caller"`
}
// ToMap converts AddCCVFee to a map for DAML arguments
func (t AddCCVFee) ToMap() map[string]any {
m := make(map[string]any)
m["ccvInstanceId"] = string(t.CcvInstanceId)
m["feeUSDCents"] = t.FeeUSDCents
m["destGasLimit"] = int64(t.DestGasLimit)
m["destBytesOverhead"] = int64(t.DestBytesOverhead)
m["caller"] = t.Caller.ToMap()
return m
}
func (t AddCCVFee) MarshalJSON() ([]byte, error) {
jsonCodec := codec.NewJsonCodec()
return jsonCodec.Marshal(t)
}
func (t *AddCCVFee) UnmarshalJSON(data []byte) error {
jsonCodec := codec.NewJsonCodec()
return jsonCodec.Unmarshal(data, t)
}
// MarshalHex encodes AddCCVFee to hex string (Canton MCMS format)
func (t AddCCVFee) MarshalHex() (string, error) {
hexCodec := codec.NewHexCodec()
return hexCodec.Marshal(t)
}
// UnmarshalHex decodes AddCCVFee from hex string (Canton MCMS format)
func (t *AddCCVFee) UnmarshalHex(data string) error {
hexCodec := codec.NewHexCodec()
return hexCodec.Unmarshal(data, t)
}
// AddCCVFeeMCMSParams is AddCCVFee without the Caller field for MCMS operationData encoding.
// Use this when encoding choice arguments for MCMS timelock operations.
type AddCCVFeeMCMSParams struct {
CcvInstanceId types.TEXT `json:"ccvInstanceId"`
FeeUSDCents types.NUMERIC `json:"feeUSDCents"`
DestGasLimit types.INT64 `json:"destGasLimit"`
DestBytesOverhead types.INT64 `json:"destBytesOverhead"`
}
// MarshalHex encodes AddCCVFeeMCMSParams to hex string for MCMS operationData.
func (t AddCCVFeeMCMSParams) MarshalHex() (string, error) {
hexCodec := codec.NewHexCodec()
return hexCodec.Marshal(t)
}
// UnmarshalHex decodes AddCCVFeeMCMSParams from hex string.
func (t *AddCCVFeeMCMSParams) UnmarshalHex(data string) error {
hexCodec := codec.NewHexCodec()
return hexCodec.Unmarshal(data, t)
}
// AddCCVVerification is a Record type
type AddCCVVerification struct {
CcvInstanceId types.TEXT `json:"ccvInstanceId"`
VersionTag types.TEXT `json:"versionTag" hex:"bytes"`
Caller types.PARTY `json:"caller"`
}
// ToMap converts AddCCVVerification to a map for DAML arguments
func (t AddCCVVerification) ToMap() map[string]any {
m := make(map[string]any)
m["ccvInstanceId"] = string(t.CcvInstanceId)
m["versionTag"] = string(t.VersionTag)
m["caller"] = t.Caller.ToMap()
return m
}
func (t AddCCVVerification) MarshalJSON() ([]byte, error) {
jsonCodec := codec.NewJsonCodec()
return jsonCodec.Marshal(t)
}
func (t *AddCCVVerification) UnmarshalJSON(data []byte) error {
jsonCodec := codec.NewJsonCodec()
return jsonCodec.Unmarshal(data, t)
}
// MarshalHex encodes AddCCVVerification to hex string (Canton MCMS format)
func (t AddCCVVerification) MarshalHex() (string, error) {
hexCodec := codec.NewHexCodec()
return hexCodec.Marshal(t)
}
// UnmarshalHex decodes AddCCVVerification from hex string (Canton MCMS format)
func (t *AddCCVVerification) UnmarshalHex(data string) error {
hexCodec := codec.NewHexCodec()
return hexCodec.Unmarshal(data, t)
}
// AddCCVVerificationMCMSParams is AddCCVVerification without the Caller field for MCMS operationData encoding.
// Use this when encoding choice arguments for MCMS timelock operations.
type AddCCVVerificationMCMSParams struct {
CcvInstanceId types.TEXT `json:"ccvInstanceId"`
VersionTag types.TEXT `json:"versionTag" hex:"bytes"`
}
// MarshalHex encodes AddCCVVerificationMCMSParams to hex string for MCMS operationData.
func (t AddCCVVerificationMCMSParams) MarshalHex() (string, error) {
hexCodec := codec.NewHexCodec()
return hexCodec.Marshal(t)
}
// UnmarshalHex decodes AddCCVVerificationMCMSParams from hex string.
func (t *AddCCVVerificationMCMSParams) UnmarshalHex(data string) error {
hexCodec := codec.NewHexCodec()
return hexCodec.Unmarshal(data, t)
}
// AddCustomObservers is a Record type
type AddCustomObservers struct {
Parties []types.PARTY `json:"parties"`
}
// ToMap converts AddCustomObservers to a map for DAML arguments
func (t AddCustomObservers) ToMap() map[string]any {
m := make(map[string]any)
m["parties"] = func() []any {
res := make([]any, 0, len(t.Parties))
for _, e := range t.Parties {
res = append(res, e.ToMap())
}
return res
}()
return m
}
func (t AddCustomObservers) MarshalJSON() ([]byte, error) {
jsonCodec := codec.NewJsonCodec()
return jsonCodec.Marshal(t)
}
func (t *AddCustomObservers) UnmarshalJSON(data []byte) error {
jsonCodec := codec.NewJsonCodec()
return jsonCodec.Unmarshal(data, t)
}
// MarshalHex encodes AddCustomObservers to hex string (Canton MCMS format)
func (t AddCustomObservers) MarshalHex() (string, error) {
hexCodec := codec.NewHexCodec()
return hexCodec.Marshal(t)
}
// UnmarshalHex decodes AddCustomObservers from hex string (Canton MCMS format)
func (t *AddCustomObservers) UnmarshalHex(data string) error {
hexCodec := codec.NewHexCodec()
return hexCodec.Unmarshal(data, t)
}
// AddCustomObserversParams is a Record type
type AddCustomObserversParams struct {
Parties []types.PARTY `json:"parties"`
}
// ToMap converts AddCustomObserversParams to a map for DAML arguments
func (t AddCustomObserversParams) ToMap() map[string]any {
m := make(map[string]any)
m["parties"] = func() []any {
res := make([]any, 0, len(t.Parties))
for _, e := range t.Parties {
res = append(res, e.ToMap())
}
return res
}()
return m
}
func (t AddCustomObserversParams) MarshalJSON() ([]byte, error) {
jsonCodec := codec.NewJsonCodec()
return jsonCodec.Marshal(t)
}
func (t *AddCustomObserversParams) UnmarshalJSON(data []byte) error {
jsonCodec := codec.NewJsonCodec()
return jsonCodec.Unmarshal(data, t)
}
// MarshalHex encodes AddCustomObserversParams to hex string (Canton MCMS format)
func (t AddCustomObserversParams) MarshalHex() (string, error) {
hexCodec := codec.NewHexCodec()
return hexCodec.Marshal(t)
}
// UnmarshalHex decodes AddCustomObserversParams from hex string (Canton MCMS format)
func (t *AddCustomObserversParams) UnmarshalHex(data string) error {
hexCodec := codec.NewHexCodec()
return hexCodec.Unmarshal(data, t)
}
// AddExecutorFee is a Record type
type AddExecutorFee struct {
ExecutorInstanceId types.TEXT `json:"executorInstanceId"`
ExecutorArgs types.TEXT `json:"executorArgs"`
FeeUSDCents types.NUMERIC `json:"feeUSDCents"`
Caller types.PARTY `json:"caller"`
}
// ToMap converts AddExecutorFee to a map for DAML arguments
func (t AddExecutorFee) ToMap() map[string]any {
m := make(map[string]any)
m["executorInstanceId"] = string(t.ExecutorInstanceId)
m["executorArgs"] = string(t.ExecutorArgs)
m["feeUSDCents"] = t.FeeUSDCents
m["caller"] = t.Caller.ToMap()
return m
}
func (t AddExecutorFee) MarshalJSON() ([]byte, error) {
jsonCodec := codec.NewJsonCodec()
return jsonCodec.Marshal(t)
}
func (t *AddExecutorFee) UnmarshalJSON(data []byte) error {
jsonCodec := codec.NewJsonCodec()
return jsonCodec.Unmarshal(data, t)
}
// MarshalHex encodes AddExecutorFee to hex string (Canton MCMS format)
func (t AddExecutorFee) MarshalHex() (string, error) {
hexCodec := codec.NewHexCodec()
return hexCodec.Marshal(t)
}
// UnmarshalHex decodes AddExecutorFee from hex string (Canton MCMS format)
func (t *AddExecutorFee) UnmarshalHex(data string) error {
hexCodec := codec.NewHexCodec()
return hexCodec.Unmarshal(data, t)
}
// AddExecutorFeeMCMSParams is AddExecutorFee without the Caller field for MCMS operationData encoding.
// Use this when encoding choice arguments for MCMS timelock operations.
type AddExecutorFeeMCMSParams struct {
ExecutorInstanceId types.TEXT `json:"executorInstanceId"`
ExecutorArgs types.TEXT `json:"executorArgs"`
FeeUSDCents types.NUMERIC `json:"feeUSDCents"`
}
// MarshalHex encodes AddExecutorFeeMCMSParams to hex string for MCMS operationData.
func (t AddExecutorFeeMCMSParams) MarshalHex() (string, error) {
hexCodec := codec.NewHexCodec()
return hexCodec.Marshal(t)
}
// UnmarshalHex decodes AddExecutorFeeMCMSParams from hex string.
func (t *AddExecutorFeeMCMSParams) UnmarshalHex(data string) error {
hexCodec := codec.NewHexCodec()
return hexCodec.Unmarshal(data, t)
}
// AddPriceUpdaters is a Record type
type AddPriceUpdaters struct {
Parties []types.PARTY `json:"parties"`
}
// ToMap converts AddPriceUpdaters to a map for DAML arguments
func (t AddPriceUpdaters) ToMap() map[string]any {
m := make(map[string]any)
m["parties"] = func() []any {
res := make([]any, 0, len(t.Parties))
for _, e := range t.Parties {
res = append(res, e.ToMap())
}
return res
}()
return m
}
func (t AddPriceUpdaters) MarshalJSON() ([]byte, error) {
jsonCodec := codec.NewJsonCodec()
return jsonCodec.Marshal(t)
}
func (t *AddPriceUpdaters) UnmarshalJSON(data []byte) error {
jsonCodec := codec.NewJsonCodec()
return jsonCodec.Unmarshal(data, t)
}
// MarshalHex encodes AddPriceUpdaters to hex string (Canton MCMS format)
func (t AddPriceUpdaters) MarshalHex() (string, error) {
hexCodec := codec.NewHexCodec()
return hexCodec.Marshal(t)
}
// UnmarshalHex decodes AddPriceUpdaters from hex string (Canton MCMS format)
func (t *AddPriceUpdaters) UnmarshalHex(data string) error {
hexCodec := codec.NewHexCodec()
return hexCodec.Unmarshal(data, t)
}
// AddTokenSend is a Record type
type AddTokenSend struct {
PoolInstanceId types.TEXT `json:"poolInstanceId"`
PoolOwner types.PARTY `json:"poolOwner"`
InstrumentId splice_api_token_holding_v1.InstrumentId `json:"instrumentId"`
Amount types.TEXT `json:"amount"`
DestTokenAddress types.TEXT `json:"destTokenAddress"`
ExtraData types.TEXT `json:"extraData"`
}
// ToMap converts AddTokenSend to a map for DAML arguments
func (t AddTokenSend) ToMap() map[string]any {
m := make(map[string]any)
m["poolInstanceId"] = string(t.PoolInstanceId)
m["poolOwner"] = t.PoolOwner.ToMap()
m["instrumentId"] = model.NestedToDAMLValue(t.InstrumentId)
m["amount"] = string(t.Amount)
m["destTokenAddress"] = string(t.DestTokenAddress)
m["extraData"] = string(t.ExtraData)
return m
}
func (t AddTokenSend) MarshalJSON() ([]byte, error) {
jsonCodec := codec.NewJsonCodec()
return jsonCodec.Marshal(t)
}
func (t *AddTokenSend) UnmarshalJSON(data []byte) error {
jsonCodec := codec.NewJsonCodec()
return jsonCodec.Unmarshal(data, t)
}
// MarshalHex encodes AddTokenSend to hex string (Canton MCMS format)
func (t AddTokenSend) MarshalHex() (string, error) {
hexCodec := codec.NewHexCodec()
return hexCodec.Marshal(t)
}
// UnmarshalHex decodes AddTokenSend from hex string (Canton MCMS format)
func (t *AddTokenSend) UnmarshalHex(data string) error {
hexCodec := codec.NewHexCodec()
return hexCodec.Unmarshal(data, t)
}
// AddTokenSendFee is a Record type
type AddTokenSendFee struct {
PoolInstanceId types.TEXT `json:"poolInstanceId"`
PoolOwner types.PARTY `json:"poolOwner"`
FeeUSDCents types.NUMERIC `json:"feeUSDCents"`
DestGasOverhead types.INT64 `json:"destGasOverhead"`
DestBytesOverhead types.INT64 `json:"destBytesOverhead"`
}
// ToMap converts AddTokenSendFee to a map for DAML arguments
func (t AddTokenSendFee) ToMap() map[string]any {
m := make(map[string]any)
m["poolInstanceId"] = string(t.PoolInstanceId)
m["poolOwner"] = t.PoolOwner.ToMap()
m["feeUSDCents"] = t.FeeUSDCents
m["destGasOverhead"] = int64(t.DestGasOverhead)
m["destBytesOverhead"] = int64(t.DestBytesOverhead)
return m
}
func (t AddTokenSendFee) MarshalJSON() ([]byte, error) {
jsonCodec := codec.NewJsonCodec()
return jsonCodec.Marshal(t)
}
func (t *AddTokenSendFee) UnmarshalJSON(data []byte) error {
jsonCodec := codec.NewJsonCodec()
return jsonCodec.Unmarshal(data, t)
}
// MarshalHex encodes AddTokenSendFee to hex string (Canton MCMS format)
func (t AddTokenSendFee) MarshalHex() (string, error) {
hexCodec := codec.NewHexCodec()
return hexCodec.Marshal(t)
}
// UnmarshalHex decodes AddTokenSendFee from hex string (Canton MCMS format)
func (t *AddTokenSendFee) UnmarshalHex(data string) error {
hexCodec := codec.NewHexCodec()
return hexCodec.Unmarshal(data, t)
}
// AddVerifierData is a Record type
type AddVerifierData struct {
CcvInstanceId types.TEXT `json:"ccvInstanceId"`
VersionTag types.TEXT `json:"versionTag" hex:"bytes"`
VerifierBlob types.TEXT `json:"verifierBlob"`
MessageSentObservers []types.PARTY `json:"messageSentObservers"`
Caller types.PARTY `json:"caller"`
}
// ToMap converts AddVerifierData to a map for DAML arguments
func (t AddVerifierData) ToMap() map[string]any {
m := make(map[string]any)
m["ccvInstanceId"] = string(t.CcvInstanceId)
m["versionTag"] = string(t.VersionTag)
m["verifierBlob"] = string(t.VerifierBlob)
m["messageSentObservers"] = func() []any {
res := make([]any, 0, len(t.MessageSentObservers))
for _, e := range t.MessageSentObservers {
res = append(res, e.ToMap())
}
return res
}()
m["caller"] = t.Caller.ToMap()
return m
}
func (t AddVerifierData) MarshalJSON() ([]byte, error) {
jsonCodec := codec.NewJsonCodec()
return jsonCodec.Marshal(t)
}
func (t *AddVerifierData) UnmarshalJSON(data []byte) error {
jsonCodec := codec.NewJsonCodec()
return jsonCodec.Unmarshal(data, t)
}
// MarshalHex encodes AddVerifierData to hex string (Canton MCMS format)
func (t AddVerifierData) MarshalHex() (string, error) {
hexCodec := codec.NewHexCodec()
return hexCodec.Marshal(t)
}
// UnmarshalHex decodes AddVerifierData from hex string (Canton MCMS format)
func (t *AddVerifierData) UnmarshalHex(data string) error {
hexCodec := codec.NewHexCodec()
return hexCodec.Unmarshal(data, t)
}
// AddVerifierDataMCMSParams is AddVerifierData without the Caller field for MCMS operationData encoding.
// Use this when encoding choice arguments for MCMS timelock operations.
type AddVerifierDataMCMSParams struct {
CcvInstanceId types.TEXT `json:"ccvInstanceId"`
VersionTag types.TEXT `json:"versionTag" hex:"bytes"`
VerifierBlob types.TEXT `json:"verifierBlob"`
MessageSentObservers []types.PARTY `json:"messageSentObservers"`
}
// MarshalHex encodes AddVerifierDataMCMSParams to hex string for MCMS operationData.
func (t AddVerifierDataMCMSParams) MarshalHex() (string, error) {
hexCodec := codec.NewHexCodec()
return hexCodec.Marshal(t)
}
// UnmarshalHex decodes AddVerifierDataMCMSParams from hex string.
func (t *AddVerifierDataMCMSParams) UnmarshalHex(data string) error {
hexCodec := codec.NewHexCodec()
return hexCodec.Unmarshal(data, t)
}
// ApplyDestChainConfigUpdates is a Record type
type ApplyDestChainConfigUpdates struct {
DestChainConfigUpdates []DestChainConfigArgs `json:"destChainConfigUpdates"`
}
// ToMap converts ApplyDestChainConfigUpdates to a map for DAML arguments
func (t ApplyDestChainConfigUpdates) ToMap() map[string]any {
m := make(map[string]any)
m["destChainConfigUpdates"] = func() []any {
res := make([]any, 0, len(t.DestChainConfigUpdates))
for _, e := range t.DestChainConfigUpdates {
res = append(res, model.NestedToDAMLValue(e))
}
return res
}()
return m
}
func (t ApplyDestChainConfigUpdates) MarshalJSON() ([]byte, error) {
jsonCodec := codec.NewJsonCodec()
return jsonCodec.Marshal(t)
}
func (t *ApplyDestChainConfigUpdates) UnmarshalJSON(data []byte) error {
jsonCodec := codec.NewJsonCodec()
return jsonCodec.Unmarshal(data, t)
}
// MarshalHex encodes ApplyDestChainConfigUpdates to hex string (Canton MCMS format)
func (t ApplyDestChainConfigUpdates) MarshalHex() (string, error) {
hexCodec := codec.NewHexCodec()
return hexCodec.Marshal(t)
}
// UnmarshalHex decodes ApplyDestChainConfigUpdates from hex string (Canton MCMS format)
func (t *ApplyDestChainConfigUpdates) UnmarshalHex(data string) error {
hexCodec := codec.NewHexCodec()
return hexCodec.Unmarshal(data, t)
}
// ApplyDestChainConfigUpdatesParams is a Record type
type ApplyDestChainConfigUpdatesParams struct {
DestChainConfigArgs []DestChainConfigArgs `json:"destChainConfigArgs"`
}
// ToMap converts ApplyDestChainConfigUpdatesParams to a map for DAML arguments
func (t ApplyDestChainConfigUpdatesParams) ToMap() map[string]any {
m := make(map[string]any)
m["destChainConfigArgs"] = func() []any {
res := make([]any, 0, len(t.DestChainConfigArgs))
for _, e := range t.DestChainConfigArgs {
res = append(res, model.NestedToDAMLValue(e))
}
return res
}()
return m
}
func (t ApplyDestChainConfigUpdatesParams) MarshalJSON() ([]byte, error) {
jsonCodec := codec.NewJsonCodec()
return jsonCodec.Marshal(t)
}
func (t *ApplyDestChainConfigUpdatesParams) UnmarshalJSON(data []byte) error {
jsonCodec := codec.NewJsonCodec()
return jsonCodec.Unmarshal(data, t)
}
// MarshalHex encodes ApplyDestChainConfigUpdatesParams to hex string (Canton MCMS format)
func (t ApplyDestChainConfigUpdatesParams) MarshalHex() (string, error) {
hexCodec := codec.NewHexCodec()
return hexCodec.Marshal(t)
}
// UnmarshalHex decodes ApplyDestChainConfigUpdatesParams from hex string (Canton MCMS format)
func (t *ApplyDestChainConfigUpdatesParams) UnmarshalHex(data string) error {
hexCodec := codec.NewHexCodec()
return hexCodec.Unmarshal(data, t)
}
// ApplyFeeQuoterDestChainConfigUpdates is a Record type
type ApplyFeeQuoterDestChainConfigUpdates struct {
DestChainConfigArgs []FeeQuoterDestChainConfigArgs `json:"destChainConfigArgs"`
}
// ToMap converts ApplyFeeQuoterDestChainConfigUpdates to a map for DAML arguments
func (t ApplyFeeQuoterDestChainConfigUpdates) ToMap() map[string]any {
m := make(map[string]any)
m["destChainConfigArgs"] = func() []any {
res := make([]any, 0, len(t.DestChainConfigArgs))
for _, e := range t.DestChainConfigArgs {
res = append(res, model.NestedToDAMLValue(e))
}
return res
}()
return m
}
func (t ApplyFeeQuoterDestChainConfigUpdates) MarshalJSON() ([]byte, error) {
jsonCodec := codec.NewJsonCodec()
return jsonCodec.Marshal(t)
}
func (t *ApplyFeeQuoterDestChainConfigUpdates) UnmarshalJSON(data []byte) error {
jsonCodec := codec.NewJsonCodec()
return jsonCodec.Unmarshal(data, t)
}
// MarshalHex encodes ApplyFeeQuoterDestChainConfigUpdates to hex string (Canton MCMS format)
func (t ApplyFeeQuoterDestChainConfigUpdates) MarshalHex() (string, error) {
hexCodec := codec.NewHexCodec()
return hexCodec.Marshal(t)
}
// UnmarshalHex decodes ApplyFeeQuoterDestChainConfigUpdates from hex string (Canton MCMS format)
func (t *ApplyFeeQuoterDestChainConfigUpdates) UnmarshalHex(data string) error {
hexCodec := codec.NewHexCodec()
return hexCodec.Unmarshal(data, t)
}
// ApplyFeeQuoterDestChainConfigUpdatesParams is a Record type
type ApplyFeeQuoterDestChainConfigUpdatesParams struct {
DestChainConfigArgs []FeeQuoterDestChainConfigArgs `json:"destChainConfigArgs"`
}
// ToMap converts ApplyFeeQuoterDestChainConfigUpdatesParams to a map for DAML arguments
func (t ApplyFeeQuoterDestChainConfigUpdatesParams) ToMap() map[string]any {
m := make(map[string]any)
m["destChainConfigArgs"] = func() []any {
res := make([]any, 0, len(t.DestChainConfigArgs))
for _, e := range t.DestChainConfigArgs {
res = append(res, model.NestedToDAMLValue(e))
}
return res
}()
return m
}
func (t ApplyFeeQuoterDestChainConfigUpdatesParams) MarshalJSON() ([]byte, error) {
jsonCodec := codec.NewJsonCodec()
return jsonCodec.Marshal(t)
}
func (t *ApplyFeeQuoterDestChainConfigUpdatesParams) UnmarshalJSON(data []byte) error {
jsonCodec := codec.NewJsonCodec()
return jsonCodec.Unmarshal(data, t)
}
// MarshalHex encodes ApplyFeeQuoterDestChainConfigUpdatesParams to hex string (Canton MCMS format)
func (t ApplyFeeQuoterDestChainConfigUpdatesParams) MarshalHex() (string, error) {
hexCodec := codec.NewHexCodec()
return hexCodec.Marshal(t)
}
// UnmarshalHex decodes ApplyFeeQuoterDestChainConfigUpdatesParams from hex string (Canton MCMS format)
func (t *ApplyFeeQuoterDestChainConfigUpdatesParams) UnmarshalHex(data string) error {
hexCodec := codec.NewHexCodec()
return hexCodec.Unmarshal(data, t)
}
// ApplyPriceUpdatersUpdate is a Record type
type ApplyPriceUpdatersUpdate struct {
AddedPriceUpdaters []types.PARTY `json:"addedPriceUpdaters"`
RemovedPriceUpdaters []types.PARTY `json:"removedPriceUpdaters"`
}
// ToMap converts ApplyPriceUpdatersUpdate to a map for DAML arguments
func (t ApplyPriceUpdatersUpdate) ToMap() map[string]any {
m := make(map[string]any)
m["addedPriceUpdaters"] = func() []any {
res := make([]any, 0, len(t.AddedPriceUpdaters))
for _, e := range t.AddedPriceUpdaters {
res = append(res, e.ToMap())
}
return res
}()
m["removedPriceUpdaters"] = func() []any {
res := make([]any, 0, len(t.RemovedPriceUpdaters))
for _, e := range t.RemovedPriceUpdaters {
res = append(res, e.ToMap())
}
return res
}()
return m
}
func (t ApplyPriceUpdatersUpdate) MarshalJSON() ([]byte, error) {
jsonCodec := codec.NewJsonCodec()
return jsonCodec.Marshal(t)
}
func (t *ApplyPriceUpdatersUpdate) UnmarshalJSON(data []byte) error {
jsonCodec := codec.NewJsonCodec()
return jsonCodec.Unmarshal(data, t)
}
// MarshalHex encodes ApplyPriceUpdatersUpdate to hex string (Canton MCMS format)
func (t ApplyPriceUpdatersUpdate) MarshalHex() (string, error) {
hexCodec := codec.NewHexCodec()
return hexCodec.Marshal(t)
}
// UnmarshalHex decodes ApplyPriceUpdatersUpdate from hex string (Canton MCMS format)
func (t *ApplyPriceUpdatersUpdate) UnmarshalHex(data string) error {
hexCodec := codec.NewHexCodec()
return hexCodec.Unmarshal(data, t)
}
// ApplyPriceUpdatersUpdateParams is a Record type
type ApplyPriceUpdatersUpdateParams struct {
AddedPriceUpdaters []types.PARTY `json:"addedPriceUpdaters"`
RemovedPriceUpdaters []types.PARTY `json:"removedPriceUpdaters"`
}
// ToMap converts ApplyPriceUpdatersUpdateParams to a map for DAML arguments
func (t ApplyPriceUpdatersUpdateParams) ToMap() map[string]any {
m := make(map[string]any)
m["addedPriceUpdaters"] = func() []any {
res := make([]any, 0, len(t.AddedPriceUpdaters))
for _, e := range t.AddedPriceUpdaters {
res = append(res, e.ToMap())
}
return res
}()
m["removedPriceUpdaters"] = func() []any {
res := make([]any, 0, len(t.RemovedPriceUpdaters))
for _, e := range t.RemovedPriceUpdaters {
res = append(res, e.ToMap())
}
return res
}()
return m
}
func (t ApplyPriceUpdatersUpdateParams) MarshalJSON() ([]byte, error) {
jsonCodec := codec.NewJsonCodec()
return jsonCodec.Marshal(t)
}
func (t *ApplyPriceUpdatersUpdateParams) UnmarshalJSON(data []byte) error {
jsonCodec := codec.NewJsonCodec()
return jsonCodec.Unmarshal(data, t)
}
// MarshalHex encodes ApplyPriceUpdatersUpdateParams to hex string (Canton MCMS format)
func (t ApplyPriceUpdatersUpdateParams) MarshalHex() (string, error) {
hexCodec := codec.NewHexCodec()
return hexCodec.Marshal(t)
}
// UnmarshalHex decodes ApplyPriceUpdatersUpdateParams from hex string (Canton MCMS format)
func (t *ApplyPriceUpdatersUpdateParams) UnmarshalHex(data string) error {
hexCodec := codec.NewHexCodec()
return hexCodec.Unmarshal(data, t)
}
// ApplySourceChainConfigUpdates is a Record type
type ApplySourceChainConfigUpdates struct {
SourceChainConfigUpdates []SourceChainConfigArgs `json:"sourceChainConfigUpdates"`
}
// ToMap converts ApplySourceChainConfigUpdates to a map for DAML arguments
func (t ApplySourceChainConfigUpdates) ToMap() map[string]any {
m := make(map[string]any)
m["sourceChainConfigUpdates"] = func() []any {
res := make([]any, 0, len(t.SourceChainConfigUpdates))
for _, e := range t.SourceChainConfigUpdates {
res = append(res, model.NestedToDAMLValue(e))
}
return res
}()
return m
}
func (t ApplySourceChainConfigUpdates) MarshalJSON() ([]byte, error) {
jsonCodec := codec.NewJsonCodec()
return jsonCodec.Marshal(t)
}
func (t *ApplySourceChainConfigUpdates) UnmarshalJSON(data []byte) error {
jsonCodec := codec.NewJsonCodec()
return jsonCodec.Unmarshal(data, t)
}
// MarshalHex encodes ApplySourceChainConfigUpdates to hex string (Canton MCMS format)
func (t ApplySourceChainConfigUpdates) MarshalHex() (string, error) {
hexCodec := codec.NewHexCodec()
return hexCodec.Marshal(t)
}
// UnmarshalHex decodes ApplySourceChainConfigUpdates from hex string (Canton MCMS format)
func (t *ApplySourceChainConfigUpdates) UnmarshalHex(data string) error {
hexCodec := codec.NewHexCodec()
return hexCodec.Unmarshal(data, t)
}
// ApplySourceChainConfigUpdatesParams is a Record type
type ApplySourceChainConfigUpdatesParams struct {
SourceChainConfigArgs []SourceChainConfigArgs `json:"sourceChainConfigArgs"`
}
// ToMap converts ApplySourceChainConfigUpdatesParams to a map for DAML arguments
func (t ApplySourceChainConfigUpdatesParams) ToMap() map[string]any {
m := make(map[string]any)
m["sourceChainConfigArgs"] = func() []any {
res := make([]any, 0, len(t.SourceChainConfigArgs))
for _, e := range t.SourceChainConfigArgs {
res = append(res, model.NestedToDAMLValue(e))
}
return res