Skip to content

Commit df0597d

Browse files
Add mumbai to Node API
1 parent d92df8e commit df0597d

File tree

4 files changed

+181
-19
lines changed

4 files changed

+181
-19
lines changed

node/chain_data.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,5 +138,9 @@ func IsManager(kind string) bool {
138138
return kind == KindOrigination || kind == KindReveal || kind == KindTransaction || kind == KindSetDepositsLimit ||
139139
kind == KindDelegation || kind == KindRegisterGlobalConstant || kind == KindTxRollupCommit || kind == KindTxRollupDispatchTickets ||
140140
kind == KindTxRollupFinalizeCommitment || kind == KindTxRollupOrigination || kind == KindTxRollupRejection ||
141-
kind == KindTxRollupRemoveCommitment || kind == KindTxRollupReturnBond || kind == KindTxRollupSubmitBatch
141+
kind == KindTxRollupRemoveCommitment || kind == KindTxRollupReturnBond || kind == KindTxRollupSubmitBatch ||
142+
kind == KindSrAddMessages || kind == KindSrCement || kind == KindSrExecute ||
143+
kind == KindSrOriginate || kind == KindSrPublish || kind == KindSrRecoverBond ||
144+
kind == KindSrRefute || kind == KindSrTimeout || kind == KindIncreasePaidStorage ||
145+
kind == KindDrainDelegate || kind == KindUpdateConsensusKey
142146
}

node/consts.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,14 @@ const (
3636
KindIncreasePaidStorage = "Increase_paid_storage"
3737
KindUpdateConsensusKey = "update_consensus_key"
3838
KindDrainDelegate = "drain_delegate"
39+
KindSrAddMessages = "smart_rollup_add_messages"
40+
KindSrOriginate = "smart_rollup_originate"
41+
KindSrExecute = "smart_rollup_execute_outbox_message"
42+
KindSrRefute = "smart_rollup_refute"
43+
KindSrPublish = "smart_rollup_publish"
44+
KindSrRecoverBond = "smart_rollup_recover_bond"
45+
KindSrTimeout = "smart_rollup_timeout"
46+
KindSrCement = "smart_rollup_cement"
3947
)
4048

4149
const (

node/operations.go

Lines changed: 147 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ type OperationConstraint interface {
1616
Preendorsement | Event | VdfRevelation | TxRollupCommit | TxRollupOrigination |
1717
TxRollupDispatchTickets | TxRollupFinalizeCommitment | TxRollupRejection |
1818
TxRollupRemoveCommitment | TxRollupSubmitBatch | UpdateConsensusKey |
19-
DrainDelegate
19+
DrainDelegate | SmartRollupAddMessage | SmartRollupCement | SmartRollupExecute |
20+
SmartRollupOriginate | SmartRollupPublish | SmartRollupRecoverBond |
21+
SmartRollupRefute | SmartRollupTimeout
2022
}
2123

2224
// OperationGroup -
@@ -98,6 +100,22 @@ func (op *Operation) UnmarshalJSON(data []byte) error {
98100
err = parseOperation[UpdateConsensusKey](data, op)
99101
case KindDrainDelegate:
100102
err = parseOperation[DrainDelegate](data, op)
103+
case KindSrAddMessages:
104+
err = parseOperation[SmartRollupAddMessage](data, op)
105+
case KindSrCement:
106+
err = parseOperation[SmartRollupCement](data, op)
107+
case KindSrExecute:
108+
err = parseOperation[SmartRollupExecute](data, op)
109+
case KindSrOriginate:
110+
err = parseOperation[SmartRollupOriginate](data, op)
111+
case KindSrPublish:
112+
err = parseOperation[SmartRollupPublish](data, op)
113+
case KindSrRecoverBond:
114+
err = parseOperation[SmartRollupRecoverBond](data, op)
115+
case KindSrRefute:
116+
err = parseOperation[SmartRollupRefute](data, op)
117+
case KindSrTimeout:
118+
err = parseOperation[SmartRollupTimeout](data, op)
101119

102120
}
103121
return err
@@ -651,3 +669,131 @@ type DrainDelegate struct {
651669
Destination string `json:"destination"`
652670
Metadata *ManagerOperationMetadata `json:"metadata,omitempty"`
653671
}
672+
673+
// SmartRollupOriginate -
674+
type SmartRollupOriginate struct {
675+
Kind string `json:"kind"`
676+
Source string `json:"source"`
677+
Fee string `json:"fee"`
678+
Counter string `json:"counter"`
679+
GasLimit string `json:"gas_limit"`
680+
StorageLimit string `json:"storage_limit"`
681+
PvmKind string `json:"pvm_kind"`
682+
Kernel string `json:"kernel"`
683+
OriginationProof string `json:"origination_proof"`
684+
ParametersTy string `json:"parameters_ty"`
685+
Metadata *ManagerOperationMetadata `json:"metadata,omitempty"`
686+
}
687+
688+
// SmartRollupExecute -
689+
type SmartRollupExecute struct {
690+
Kind string `json:"kind"`
691+
Source string `json:"source"`
692+
Fee string `json:"fee"`
693+
Counter string `json:"counter"`
694+
GasLimit string `json:"gas_limit"`
695+
StorageLimit string `json:"storage_limit"`
696+
Rollup string `json:"rollup"`
697+
CementedCommitment string `json:"cemented_commitment"`
698+
OutputProof string `json:"output_proof"`
699+
Metadata *ManagerOperationMetadata `json:"metadata,omitempty"`
700+
}
701+
702+
// SmartRollupAddMessage -
703+
type SmartRollupAddMessage struct {
704+
Kind string `json:"kind"`
705+
Source string `json:"source"`
706+
Fee string `json:"fee"`
707+
Counter string `json:"counter"`
708+
GasLimit string `json:"gas_limit"`
709+
StorageLimit string `json:"storage_limit"`
710+
Message []string `json:"message"`
711+
Metadata *ManagerOperationMetadata `json:"metadata,omitempty"`
712+
}
713+
714+
// SmartRollupCement -
715+
type SmartRollupCement struct {
716+
Kind string `json:"kind"`
717+
Source string `json:"source"`
718+
Fee string `json:"fee"`
719+
Counter string `json:"counter"`
720+
GasLimit string `json:"gas_limit"`
721+
StorageLimit string `json:"storage_limit"`
722+
Rollup string `json:"rollup"`
723+
Commitment string `json:"commitment"`
724+
Metadata *ManagerOperationMetadata `json:"metadata,omitempty"`
725+
}
726+
727+
// SmartRollupPublish -
728+
type SmartRollupPublish struct {
729+
Kind string `json:"kind"`
730+
Source string `json:"source"`
731+
Fee string `json:"fee"`
732+
Counter string `json:"counter"`
733+
GasLimit string `json:"gas_limit"`
734+
StorageLimit string `json:"storage_limit"`
735+
Rollup string `json:"rollup"`
736+
Commitment SrCommitmentInfo `json:"commitment"`
737+
Metadata *ManagerOperationMetadata `json:"metadata,omitempty"`
738+
}
739+
740+
// SmartRollupRecoverBond -
741+
type SmartRollupRecoverBond struct {
742+
Kind string `json:"kind"`
743+
Source string `json:"source"`
744+
Fee string `json:"fee"`
745+
Counter string `json:"counter"`
746+
GasLimit string `json:"gas_limit"`
747+
StorageLimit string `json:"storage_limit"`
748+
Rollup string `json:"rollup"`
749+
Staker string `json:"staker"`
750+
Metadata *ManagerOperationMetadata `json:"metadata,omitempty"`
751+
}
752+
753+
// SmartRollupRefute -
754+
type SmartRollupRefute struct {
755+
Kind string `json:"kind"`
756+
Source string `json:"source"`
757+
Fee string `json:"fee"`
758+
Counter string `json:"counter"`
759+
GasLimit string `json:"gas_limit"`
760+
StorageLimit string `json:"storage_limit"`
761+
Rollup string `json:"rollup"`
762+
Opponent string `json:"opponent"`
763+
Refutation Refutation `json:"refutation"`
764+
Metadata *ManagerOperationMetadata `json:"metadata,omitempty"`
765+
}
766+
767+
// SmartRollupTimeout -
768+
type SmartRollupTimeout struct {
769+
Kind string `json:"kind"`
770+
Source string `json:"source"`
771+
Fee string `json:"fee"`
772+
Counter string `json:"counter"`
773+
GasLimit string `json:"gas_limit"`
774+
StorageLimit string `json:"storage_limit"`
775+
Rollup string `json:"rollup"`
776+
Stakers Stakers `json:"stakers"`
777+
Metadata *ManagerOperationMetadata `json:"metadata,omitempty"`
778+
}
779+
780+
// Stakers -
781+
type Stakers struct {
782+
Alice string `json:"alice"`
783+
Bob string `json:"bob"`
784+
}
785+
786+
// Refutation -
787+
type Refutation struct {
788+
RefutationKind string `json:"refutation_kind"`
789+
PlayerCommitmentHash string `json:"player_commitment_hash"`
790+
OpponentCommitmentHash string `json:"opponent_commitment_hash"`
791+
}
792+
793+
// SrCommitmentInfo -
794+
type SrCommitmentInfo struct {
795+
CompressedState string `json:"compressed_state"`
796+
InboxLevel uint64 `json:"inbox_level"`
797+
Predecessor string `json:"predecessor"`
798+
NumberOfTicks string `json:"number_of_ticks"`
799+
}

tzkt/data/operations.go

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -512,9 +512,9 @@ type DoubleBaking struct {
512512
Block string `json:"block"`
513513
Hash string `json:"hash"`
514514
AccusedLevel uint64 `json:"accusedLevel"`
515-
Accuser *Account `json:"accuser"`
515+
Accuser *Address `json:"accuser"`
516516
AccuserReward int64 `json:"accuserReward"`
517-
Offender *Account `json:"offender"`
517+
Offender *Address `json:"offender"`
518518
OffenderLoss int64 `json:"offenderLoss"`
519519
Quote *Quote `json:"quote,omitempty"`
520520
AccuserRewards int64 `json:"accuserRewards,omitempty"`
@@ -532,9 +532,9 @@ type DoubleEndorsing struct {
532532
Block string `json:"block"`
533533
Hash string `json:"hash"`
534534
AccusedLevel uint64 `json:"accusedLevel"`
535-
Accuser *Account `json:"accuser"`
535+
Accuser *Address `json:"accuser"`
536536
AccuserReward int64 `json:"accuserReward"`
537-
Offender *Account `json:"offender"`
537+
Offender *Address `json:"offender"`
538538
OffenderLoss int64 `json:"offenderLoss"`
539539
Quote *Quote `json:"quote,omitempty"`
540540
AccuserRewards int64 `json:"accuserRewards,omitempty"`
@@ -567,15 +567,15 @@ type Baking struct {
567567
Level uint64 `json:"level"`
568568
Timestamp time.Time `json:"timestamp"`
569569
Block string `json:"block"`
570-
Proposer *Account `json:"proposer"`
571-
Producer *Account `json:"producer"`
570+
Proposer *Address `json:"proposer"`
571+
Producer *Address `json:"producer"`
572572
PayloadRound int `json:"payloadRound"`
573573
BlockRound int `json:"blockRound"`
574574
Deposit int64 `json:"deposit"`
575575
Reward int64 `json:"reward"`
576576
Bonus int64 `json:"bonus"`
577577
Fees int64 `json:"fees"`
578-
Baker Account `json:"baker"`
578+
Baker Address `json:"baker"`
579579
Priority int `json:"priority"`
580580
Quote *Quote `json:"quote,omitempty"`
581581
}
@@ -587,7 +587,7 @@ type EndorsingReward struct {
587587
Level uint64 `json:"level"`
588588
Timestamp time.Time `json:"timestamp"`
589589
Block string `json:"block"`
590-
Baker *Account `json:"baker"`
590+
Baker *Address `json:"baker"`
591591
Expected int64 `json:"expected"`
592592
Received int64 `json:"received"`
593593
Quote *Quote `json:"quote,omitempty"`
@@ -600,7 +600,7 @@ type RevelationPenalty struct {
600600
Level uint64 `json:"level"`
601601
Timestamp time.Time `json:"timestamp"`
602602
Block string `json:"block"`
603-
Baker *Account `json:"baker"`
603+
Baker *Address `json:"baker"`
604604
MissedLevel int64 `json:"missedLevel"`
605605
Loss int64 `json:"loss"`
606606
Quote *Quote `json:"quote,omitempty"`
@@ -615,9 +615,9 @@ type DoublePreendorsing struct {
615615
Block string `json:"block"`
616616
Hash string `json:"hash"`
617617
AccusedLevel uint64 `json:"accusedLevel"`
618-
Accuser *Account `json:"accuser"`
618+
Accuser *Address `json:"accuser"`
619619
AccuserReward int64 `json:"accuserReward"`
620-
Offender *Account `json:"offender"`
620+
Offender *Address `json:"offender"`
621621
OffenderLoss int64 `json:"offenderLoss"`
622622
Quote *Quote `json:"quote,omitempty"`
623623
AccuserRewards int64 `json:"accuserRewards,omitempty"`
@@ -634,7 +634,7 @@ type VdfRevelation struct {
634634
Timestamp time.Time `json:"timestamp"`
635635
Block string `json:"block"`
636636
Hash string `json:"hash"`
637-
Baker *Account `json:"baker"`
637+
Baker *Address `json:"baker"`
638638
Cycle uint64 `json:"cycle"`
639639
Solution string `json:"solution"`
640640
Proof string `json:"proof"`
@@ -650,7 +650,7 @@ type IncreasePaidStorage struct {
650650
Timestamp time.Time `json:"timestamp"`
651651
Block string `json:"block"`
652652
Hash string `json:"hash"`
653-
Sender Account `json:"sender"`
653+
Sender Address `json:"sender"`
654654
Counter uint64 `json:"counter"`
655655
GasLimit uint64 `json:"gasLimit"`
656656
GasUsed uint64 `json:"gasUsed"`
@@ -659,7 +659,7 @@ type IncreasePaidStorage struct {
659659
BakerFee uint64 `json:"bakerFee"`
660660
StorageFee uint64 `json:"storageFee"`
661661
Status string `json:"status"`
662-
Contract Account `json:"contract"`
662+
Contract Address `json:"contract"`
663663
Amount decimal.Decimal `json:"amount"`
664664
}
665665

@@ -671,7 +671,7 @@ type UpdateConsensusKey struct {
671671
Timestamp time.Time `json:"timestamp"`
672672
Block string `json:"block"`
673673
Hash string `json:"hash"`
674-
Sender Account `json:"sender"`
674+
Sender Address `json:"sender"`
675675
Counter uint64 `json:"counter"`
676676
GasLimit uint64 `json:"gasLimit"`
677677
GasUsed uint64 `json:"gasUsed"`
@@ -693,8 +693,8 @@ type DrainDelegate struct {
693693
Timestamp time.Time `json:"timestamp"`
694694
Block string `json:"block"`
695695
Hash string `json:"hash"`
696-
Delegate Account `json:"delegate"`
697-
Target Account `json:"target"`
696+
Delegate Address `json:"delegate"`
697+
Target Address `json:"target"`
698698
Amount uint64 `json:"amount"`
699699
Fee uint64 `json:"fee"`
700700
Quote *Quote `json:"quote,omitempty"`
@@ -763,7 +763,9 @@ type SmartRollupExecute struct {
763763
GasLimit uint64 `json:"gasLimit"`
764764
GasUsed uint64 `json:"gasUsed"`
765765
StorageLimit uint64 `json:"storageLimit"`
766+
StorageUsed uint64 `json:"storageUsed"`
766767
BakerFee uint64 `json:"bakerFee"`
768+
StorageFee uint64 `json:"storageFee"`
767769
Status string `json:"status"`
768770
Rollup *Address `json:"rollup,omitempty"`
769771
Commitment *SrCommitmentInfo `json:"commitment,omitempty"`
@@ -783,7 +785,9 @@ type SmartRollupOriginate struct {
783785
GasLimit uint64 `json:"gasLimit"`
784786
GasUsed uint64 `json:"gasUsed"`
785787
StorageLimit uint64 `json:"storageLimit"`
788+
StorageUsed uint64 `json:"storageUsed"`
786789
BakerFee uint64 `json:"bakerFee"`
790+
StorageFee uint64 `json:"storageFee"`
787791
Status string `json:"status"`
788792
Rollup *Address `json:"rollup,omitempty"`
789793
ParameterType stdJSON.RawMessage `json:"parameterType,omitempty"`

0 commit comments

Comments
 (0)