diff --git a/database/plugin/metadata/sqlite/models/auth_committee_hot.go b/database/plugin/metadata/sqlite/models/auth_committee_hot.go new file mode 100644 index 00000000..ba0c7345 --- /dev/null +++ b/database/plugin/metadata/sqlite/models/auth_committee_hot.go @@ -0,0 +1,26 @@ +// Copyright 2025 Blink Labs Software +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package models + +type AuthCommitteeHot struct { + ID uint `gorm:"primarykey"` + ColdCredential []byte `gorm:"index"` + HostCredential []byte `gorm:"index"` + AddedSlot uint64 +} + +func (AuthCommitteeHot) TableName() string { + return "auth_committee_hot" +} diff --git a/database/plugin/metadata/sqlite/models/deregistration.go b/database/plugin/metadata/sqlite/models/deregistration.go new file mode 100644 index 00000000..3e6f992c --- /dev/null +++ b/database/plugin/metadata/sqlite/models/deregistration.go @@ -0,0 +1,25 @@ +// Copyright 2025 Blink Labs Software +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package models + +type Deregistration struct { + ID uint `gorm:"primarykey"` + StakingKey []byte `gorm:"index"` + AddedSlot uint64 +} + +func (Deregistration) TableName() string { + return "deregistration" +} diff --git a/database/plugin/metadata/sqlite/models/deregistration_drep.go b/database/plugin/metadata/sqlite/models/deregistration_drep.go new file mode 100644 index 00000000..7f8dfba2 --- /dev/null +++ b/database/plugin/metadata/sqlite/models/deregistration_drep.go @@ -0,0 +1,26 @@ +// Copyright 2025 Blink Labs Software +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package models + +type DeregistrationDrep struct { + ID uint `gorm:"primarykey"` + DrepCredential []byte `gorm:"index"` + AddedSlot uint64 + DepositAmount uint64 +} + +func (DeregistrationDrep) TableName() string { + return "deregistration_drep" +} diff --git a/database/plugin/metadata/sqlite/models/drep.go b/database/plugin/metadata/sqlite/models/drep.go new file mode 100644 index 00000000..5b45ca4b --- /dev/null +++ b/database/plugin/metadata/sqlite/models/drep.go @@ -0,0 +1,27 @@ +// Copyright 2025 Blink Labs Software +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package models + +type Drep struct { + ID uint `gorm:"primarykey"` + Credential []byte `gorm:"index"` + AnchorUrl string + AnchorHash []byte + AddedSlot uint64 +} + +func (d *Drep) TableName() string { + return "drep" +} diff --git a/database/plugin/metadata/sqlite/models/models.go b/database/plugin/metadata/sqlite/models/models.go index 7b9d3e20..713662ec 100644 --- a/database/plugin/metadata/sqlite/models/models.go +++ b/database/plugin/metadata/sqlite/models/models.go @@ -16,6 +16,9 @@ package models // MigrateModels contains a list of model objects that should have DB migrations applied var MigrateModels = []any{ + &AuthCommitteeHot{}, + &Deregistration{}, + &Drep{}, &Epoch{}, &PoolRegistration{}, &PoolRegistrationOwner{}, @@ -23,9 +26,18 @@ var MigrateModels = []any{ &PoolRetirement{}, &PParams{}, &PParamUpdate{}, + &Registration{}, + &RegistrationDrep{}, + &ResignCommitteeCold{}, &StakeDelegation{}, &StakeDeregistration{}, &StakeRegistration{}, + &StakeRegistrationDelegation{}, + &StakeVoteDelegation{}, + &StakeVoteRegistrationDelegation{}, &Tip{}, + &UpdateDrep{}, &Utxo{}, + &VoteDelegation{}, + &VoteRegistrationDelegation{}, } diff --git a/database/plugin/metadata/sqlite/models/registration.go b/database/plugin/metadata/sqlite/models/registration.go new file mode 100644 index 00000000..661e6315 --- /dev/null +++ b/database/plugin/metadata/sqlite/models/registration.go @@ -0,0 +1,26 @@ +// Copyright 2025 Blink Labs Software +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package models + +type Registration struct { + ID uint `gorm:"primarykey"` + StakingKey []byte `gorm:"index"` + AddedSlot uint64 + DepositAmount uint64 +} + +func (Registration) TableName() string { + return "registration" +} diff --git a/database/plugin/metadata/sqlite/models/registration_drep.go b/database/plugin/metadata/sqlite/models/registration_drep.go new file mode 100644 index 00000000..18744d0f --- /dev/null +++ b/database/plugin/metadata/sqlite/models/registration_drep.go @@ -0,0 +1,28 @@ +// Copyright 2025 Blink Labs Software +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package models + +type RegistrationDrep struct { + ID uint `gorm:"primarykey"` + DrepCredential []byte `gorm:"index"` + AddedSlot uint64 + DepositAmount uint64 + AnchorUrl string + AnchorHash []byte +} + +func (RegistrationDrep) TableName() string { + return "registration_drep" +} diff --git a/database/plugin/metadata/sqlite/models/resign_committee_cold.go b/database/plugin/metadata/sqlite/models/resign_committee_cold.go new file mode 100644 index 00000000..38c21c85 --- /dev/null +++ b/database/plugin/metadata/sqlite/models/resign_committee_cold.go @@ -0,0 +1,27 @@ +// Copyright 2025 Blink Labs Software +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package models + +type ResignCommitteeCold struct { + ID uint `gorm:"primarykey"` + ColdCredential []byte `gorm:"index"` + AnchorUrl string + AnchorHash []byte + AddedSlot uint64 +} + +func (ResignCommitteeCold) TableName() string { + return "resign_committee_cold" +} diff --git a/database/plugin/metadata/sqlite/models/stake_registration_delegation.go b/database/plugin/metadata/sqlite/models/stake_registration_delegation.go new file mode 100644 index 00000000..34435588 --- /dev/null +++ b/database/plugin/metadata/sqlite/models/stake_registration_delegation.go @@ -0,0 +1,27 @@ +// Copyright 2025 Blink Labs Software +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package models + +type StakeRegistrationDelegation struct { + ID uint `gorm:"primarykey"` + StakingKey []byte `gorm:"index"` + PoolKeyHash []byte `gorm:"index"` + AddedSlot uint64 + DepositAmount uint64 +} + +func (StakeRegistrationDelegation) TableName() string { + return "stake_registration_delegation" +} diff --git a/database/plugin/metadata/sqlite/models/stake_vote_delegation.go b/database/plugin/metadata/sqlite/models/stake_vote_delegation.go new file mode 100644 index 00000000..dfde8a8f --- /dev/null +++ b/database/plugin/metadata/sqlite/models/stake_vote_delegation.go @@ -0,0 +1,27 @@ +// Copyright 2025 Blink Labs Software +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package models + +type StakeVoteDelegation struct { + ID uint `gorm:"primarykey"` + StakingKey []byte `gorm:"index"` + PoolKeyHash []byte `gorm:"index"` + Drep []byte `gorm:"index"` + AddedSlot uint64 +} + +func (StakeVoteDelegation) TableName() string { + return "stake_vote_delegation" +} diff --git a/database/plugin/metadata/sqlite/models/stake_vote_registration_delegation.go b/database/plugin/metadata/sqlite/models/stake_vote_registration_delegation.go new file mode 100644 index 00000000..c8f74f10 --- /dev/null +++ b/database/plugin/metadata/sqlite/models/stake_vote_registration_delegation.go @@ -0,0 +1,27 @@ +// Copyright 2025 Blink Labs Software +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package models + +type StakeVoteRegistrationDelegation struct { + ID uint `gorm:"primarykey"` + StakingKey []byte `gorm:"index"` + PoolKeyHash []byte `gorm:"index"` + Drep []byte `gorm:"index"` + AddedSlot uint64 +} + +func (StakeVoteRegistrationDelegation) TableName() string { + return "stake_vote_registration_delegation" +} diff --git a/database/plugin/metadata/sqlite/models/update_drep.go b/database/plugin/metadata/sqlite/models/update_drep.go new file mode 100644 index 00000000..f590627a --- /dev/null +++ b/database/plugin/metadata/sqlite/models/update_drep.go @@ -0,0 +1,27 @@ +// Copyright 2025 Blink Labs Software +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package models + +type UpdateDrep struct { + ID uint `gorm:"primarykey"` + Credential []byte `gorm:"index"` + AnchorUrl string + AnchorHash []byte + AddedSlot uint64 +} + +func (UpdateDrep) TableName() string { + return "update_drep" +} diff --git a/database/plugin/metadata/sqlite/models/vote_delegation.go b/database/plugin/metadata/sqlite/models/vote_delegation.go new file mode 100644 index 00000000..544ff1a6 --- /dev/null +++ b/database/plugin/metadata/sqlite/models/vote_delegation.go @@ -0,0 +1,26 @@ +// Copyright 2025 Blink Labs Software +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package models + +type VoteDelegation struct { + ID uint `gorm:"primarykey"` + StakingKey []byte `gorm:"index"` + Drep []byte `gorm:"index"` + AddedSlot uint64 +} + +func (VoteDelegation) TableName() string { + return "vote_delegation" +} diff --git a/database/plugin/metadata/sqlite/models/vote_registration_delegation.go b/database/plugin/metadata/sqlite/models/vote_registration_delegation.go new file mode 100644 index 00000000..2a2d27df --- /dev/null +++ b/database/plugin/metadata/sqlite/models/vote_registration_delegation.go @@ -0,0 +1,26 @@ +// Copyright 2025 Blink Labs Software +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +package models + +type VoteRegistrationDelegation struct { + ID uint `gorm:"primarykey"` + StakingKey []byte `gorm:"index"` + Drep []byte `gorm:"index"` + AddedSlot uint64 +} + +func (VoteRegistrationDelegation) TableName() string { + return "vote_registration_delegation" +}