feature/refactor did state (#10)

* feat(did): remove account types

* feat: Refactor Property to Proof in zkprop.go

* feat: add ZKP proof mechanism for verifications

* fix: return bool and error from pinInitialVault

* feat: implement KeyshareSet for managing user and validator keyshares

* feat: Update Credential type in protobuf

* feat: update credential schema with sign count

* feat: migrate  and  modules to middleware

* refactor: rename vault module to ORM

* chore(dwn): add service worker registration to index template

* feat: integrate service worker for offline functionality

* refactor(did): use DIDNamespace enum for verification method in proto reflection

* refactor: update protobuf definitions to support Keyshare

* feat: expose did keeper in app keepers

* Add Motr Web App

* refactor: rename motr/handlers/discovery.go to motr/handlers/openid.go

* refactor: move session related code to middleware

* feat: add database operations for managing assets, chains, and credentials

* feat: add htmx support for UI updates

* refactor: extract common helper scripts

* chore: remove unused storage GUI components

* refactor: Move frontend rendering to dedicated handlers

* refactor: rename  to

* refactor: move alert implementation to templ

* feat: add alert component with icon, title, and message

* feat: add new RequestHeaders struct to store request headers

* Feature/create home view (#9)

* refactor: move view logic to new htmx handler

* refactor: remove unnecessary dependencies

* refactor: remove unused dependencies

* feat(devbox): integrate air for local development

* feat: implement openid connect discovery document

* refactor: rename  to

* refactor(did): update service handling to support DNS discovery

* feat: add support for user and validator keyshares

* refactor: move keyshare signing logic to signer
This commit is contained in:
Prad Nukala
2024-09-11 15:10:54 -04:00
committed by GitHub
parent 4f2d342649
commit bbfe2a2329
197 changed files with 14668 additions and 27810 deletions
+6
View File
@@ -0,0 +1,6 @@
// Code generated from Pkl module `transactions`. DO NOT EDIT.
package txns
type Msg interface {
GetTypeUrl() string
}
+44
View File
@@ -0,0 +1,44 @@
// Code generated from Pkl module `transactions`. DO NOT EDIT.
package txns
import "github.com/apple/pkl-go/pkl"
type MsgDidAllocateVault interface {
Msg
GetAuthority() string
GetSubject() string
GetToken() *pkl.Object
}
var _ MsgDidAllocateVault = (*MsgDidAllocateVaultImpl)(nil)
type MsgDidAllocateVaultImpl struct {
// The type URL for the message
TypeUrl string `pkl:"typeUrl"`
Authority string `pkl:"authority"`
Subject string `pkl:"subject"`
Token *pkl.Object `pkl:"token"`
}
// The type URL for the message
func (rcv *MsgDidAllocateVaultImpl) GetTypeUrl() string {
return rcv.TypeUrl
}
func (rcv *MsgDidAllocateVaultImpl) GetAuthority() string {
return rcv.Authority
}
func (rcv *MsgDidAllocateVaultImpl) GetSubject() string {
return rcv.Subject
}
func (rcv *MsgDidAllocateVaultImpl) GetToken() *pkl.Object {
return rcv.Token
}
+60
View File
@@ -0,0 +1,60 @@
// Code generated from Pkl module `transactions`. DO NOT EDIT.
package txns
import "github.com/apple/pkl-go/pkl"
type MsgDidAuthorize interface {
Msg
GetAuthority() string
GetController() string
GetAddress() string
GetOrigin() string
GetToken() *pkl.Object
}
var _ MsgDidAuthorize = (*MsgDidAuthorizeImpl)(nil)
type MsgDidAuthorizeImpl struct {
// The type URL for the message
TypeUrl string `pkl:"typeUrl"`
Authority string `pkl:"authority"`
Controller string `pkl:"controller"`
Address string `pkl:"address"`
Origin string `pkl:"origin"`
Token *pkl.Object `pkl:"token"`
}
// The type URL for the message
func (rcv *MsgDidAuthorizeImpl) GetTypeUrl() string {
return rcv.TypeUrl
}
func (rcv *MsgDidAuthorizeImpl) GetAuthority() string {
return rcv.Authority
}
func (rcv *MsgDidAuthorizeImpl) GetController() string {
return rcv.Controller
}
func (rcv *MsgDidAuthorizeImpl) GetAddress() string {
return rcv.Address
}
func (rcv *MsgDidAuthorizeImpl) GetOrigin() string {
return rcv.Origin
}
func (rcv *MsgDidAuthorizeImpl) GetToken() *pkl.Object {
return rcv.Token
}
+52
View File
@@ -0,0 +1,52 @@
// Code generated from Pkl module `transactions`. DO NOT EDIT.
package txns
import "github.com/apple/pkl-go/pkl"
type MsgDidProveWitness interface {
Msg
GetAuthority() string
GetProperty() string
GetWitness() []int
GetToken() *pkl.Object
}
var _ MsgDidProveWitness = (*MsgDidProveWitnessImpl)(nil)
type MsgDidProveWitnessImpl struct {
// The type URL for the message
TypeUrl string `pkl:"typeUrl"`
Authority string `pkl:"authority"`
Property string `pkl:"property"`
Witness []int `pkl:"witness"`
Token *pkl.Object `pkl:"token"`
}
// The type URL for the message
func (rcv *MsgDidProveWitnessImpl) GetTypeUrl() string {
return rcv.TypeUrl
}
func (rcv *MsgDidProveWitnessImpl) GetAuthority() string {
return rcv.Authority
}
func (rcv *MsgDidProveWitnessImpl) GetProperty() string {
return rcv.Property
}
func (rcv *MsgDidProveWitnessImpl) GetWitness() []int {
return rcv.Witness
}
func (rcv *MsgDidProveWitnessImpl) GetToken() *pkl.Object {
return rcv.Token
}
+60
View File
@@ -0,0 +1,60 @@
// Code generated from Pkl module `transactions`. DO NOT EDIT.
package txns
import "github.com/apple/pkl-go/pkl"
type MsgDidRegisterController interface {
Msg
GetAuthority() string
GetCid() string
GetOrigin() string
GetAuthentication() []*pkl.Object
GetToken() *pkl.Object
}
var _ MsgDidRegisterController = (*MsgDidRegisterControllerImpl)(nil)
type MsgDidRegisterControllerImpl struct {
// The type URL for the message
TypeUrl string `pkl:"typeUrl"`
Authority string `pkl:"authority"`
Cid string `pkl:"cid"`
Origin string `pkl:"origin"`
Authentication []*pkl.Object `pkl:"authentication"`
Token *pkl.Object `pkl:"token"`
}
// The type URL for the message
func (rcv *MsgDidRegisterControllerImpl) GetTypeUrl() string {
return rcv.TypeUrl
}
func (rcv *MsgDidRegisterControllerImpl) GetAuthority() string {
return rcv.Authority
}
func (rcv *MsgDidRegisterControllerImpl) GetCid() string {
return rcv.Cid
}
func (rcv *MsgDidRegisterControllerImpl) GetOrigin() string {
return rcv.Origin
}
func (rcv *MsgDidRegisterControllerImpl) GetAuthentication() []*pkl.Object {
return rcv.Authentication
}
func (rcv *MsgDidRegisterControllerImpl) GetToken() *pkl.Object {
return rcv.Token
}
+76
View File
@@ -0,0 +1,76 @@
// Code generated from Pkl module `transactions`. DO NOT EDIT.
package txns
import "github.com/apple/pkl-go/pkl"
type MsgDidRegisterService interface {
Msg
GetController() string
GetOriginUri() string
GetScopes() *pkl.Object
GetDescription() string
GetServiceEndpoints() map[string]string
GetMetadata() *pkl.Object
GetToken() *pkl.Object
}
var _ MsgDidRegisterService = (*MsgDidRegisterServiceImpl)(nil)
type MsgDidRegisterServiceImpl struct {
// The type URL for the message
TypeUrl string `pkl:"typeUrl"`
Controller string `pkl:"controller"`
OriginUri string `pkl:"originUri"`
Scopes *pkl.Object `pkl:"scopes"`
Description string `pkl:"description"`
ServiceEndpoints map[string]string `pkl:"serviceEndpoints"`
Metadata *pkl.Object `pkl:"metadata"`
Token *pkl.Object `pkl:"token"`
}
// The type URL for the message
func (rcv *MsgDidRegisterServiceImpl) GetTypeUrl() string {
return rcv.TypeUrl
}
func (rcv *MsgDidRegisterServiceImpl) GetController() string {
return rcv.Controller
}
func (rcv *MsgDidRegisterServiceImpl) GetOriginUri() string {
return rcv.OriginUri
}
func (rcv *MsgDidRegisterServiceImpl) GetScopes() *pkl.Object {
return rcv.Scopes
}
func (rcv *MsgDidRegisterServiceImpl) GetDescription() string {
return rcv.Description
}
func (rcv *MsgDidRegisterServiceImpl) GetServiceEndpoints() map[string]string {
return rcv.ServiceEndpoints
}
func (rcv *MsgDidRegisterServiceImpl) GetMetadata() *pkl.Object {
return rcv.Metadata
}
func (rcv *MsgDidRegisterServiceImpl) GetToken() *pkl.Object {
return rcv.Token
}
+36
View File
@@ -0,0 +1,36 @@
// Code generated from Pkl module `transactions`. DO NOT EDIT.
package txns
import "github.com/apple/pkl-go/pkl"
type MsgDidSyncVault interface {
Msg
GetController() string
GetToken() *pkl.Object
}
var _ MsgDidSyncVault = (*MsgDidSyncVaultImpl)(nil)
type MsgDidSyncVaultImpl struct {
// The type URL for the message
TypeUrl string `pkl:"typeUrl"`
Controller string `pkl:"controller"`
Token *pkl.Object `pkl:"token"`
}
// The type URL for the message
func (rcv *MsgDidSyncVaultImpl) GetTypeUrl() string {
return rcv.TypeUrl
}
func (rcv *MsgDidSyncVaultImpl) GetController() string {
return rcv.Controller
}
func (rcv *MsgDidSyncVaultImpl) GetToken() *pkl.Object {
return rcv.Token
}
+44
View File
@@ -0,0 +1,44 @@
// Code generated from Pkl module `transactions`. DO NOT EDIT.
package txns
import "github.com/apple/pkl-go/pkl"
type MsgDidUpdateParams interface {
Msg
GetAuthority() string
GetParams() *pkl.Object
GetToken() *pkl.Object
}
var _ MsgDidUpdateParams = (*MsgDidUpdateParamsImpl)(nil)
type MsgDidUpdateParamsImpl struct {
// The type URL for the message
TypeUrl string `pkl:"typeUrl"`
Authority string `pkl:"authority"`
Params *pkl.Object `pkl:"params"`
Token *pkl.Object `pkl:"token"`
}
// The type URL for the message
func (rcv *MsgDidUpdateParamsImpl) GetTypeUrl() string {
return rcv.TypeUrl
}
func (rcv *MsgDidUpdateParamsImpl) GetAuthority() string {
return rcv.Authority
}
func (rcv *MsgDidUpdateParamsImpl) GetParams() *pkl.Object {
return rcv.Params
}
func (rcv *MsgDidUpdateParamsImpl) GetToken() *pkl.Object {
return rcv.Token
}
+44
View File
@@ -0,0 +1,44 @@
// Code generated from Pkl module `transactions`. DO NOT EDIT.
package txns
import "github.com/apple/pkl-go/pkl"
type MsgGovDeposit interface {
Msg
GetProposalId() int
GetDepositor() string
GetAmount() []*pkl.Object
}
var _ MsgGovDeposit = (*MsgGovDepositImpl)(nil)
type MsgGovDepositImpl struct {
// The type URL for the message
TypeUrl string `pkl:"typeUrl"`
ProposalId int `pkl:"proposalId"`
Depositor string `pkl:"depositor"`
Amount []*pkl.Object `pkl:"amount"`
}
// The type URL for the message
func (rcv *MsgGovDepositImpl) GetTypeUrl() string {
return rcv.TypeUrl
}
func (rcv *MsgGovDepositImpl) GetProposalId() int {
return rcv.ProposalId
}
func (rcv *MsgGovDepositImpl) GetDepositor() string {
return rcv.Depositor
}
func (rcv *MsgGovDepositImpl) GetAmount() []*pkl.Object {
return rcv.Amount
}
+45
View File
@@ -0,0 +1,45 @@
// Code generated from Pkl module `transactions`. DO NOT EDIT.
package txns
import "github.com/apple/pkl-go/pkl"
type MsgGovSubmitProposal interface {
Msg
GetContent() *Proposal
GetInitialDeposit() []*pkl.Object
GetProposer() string
}
var _ MsgGovSubmitProposal = (*MsgGovSubmitProposalImpl)(nil)
// Gov module messages
type MsgGovSubmitProposalImpl struct {
// The type URL for the message
TypeUrl string `pkl:"typeUrl"`
Content *Proposal `pkl:"content"`
InitialDeposit []*pkl.Object `pkl:"initialDeposit"`
Proposer string `pkl:"proposer"`
}
// The type URL for the message
func (rcv *MsgGovSubmitProposalImpl) GetTypeUrl() string {
return rcv.TypeUrl
}
func (rcv *MsgGovSubmitProposalImpl) GetContent() *Proposal {
return rcv.Content
}
func (rcv *MsgGovSubmitProposalImpl) GetInitialDeposit() []*pkl.Object {
return rcv.InitialDeposit
}
func (rcv *MsgGovSubmitProposalImpl) GetProposer() string {
return rcv.Proposer
}
+42
View File
@@ -0,0 +1,42 @@
// Code generated from Pkl module `transactions`. DO NOT EDIT.
package txns
type MsgGovVote interface {
Msg
GetProposalId() int
GetVoter() string
GetOption() int
}
var _ MsgGovVote = (*MsgGovVoteImpl)(nil)
type MsgGovVoteImpl struct {
// The type URL for the message
TypeUrl string `pkl:"typeUrl"`
ProposalId int `pkl:"proposalId"`
Voter string `pkl:"voter"`
Option int `pkl:"option"`
}
// The type URL for the message
func (rcv *MsgGovVoteImpl) GetTypeUrl() string {
return rcv.TypeUrl
}
func (rcv *MsgGovVoteImpl) GetProposalId() int {
return rcv.ProposalId
}
func (rcv *MsgGovVoteImpl) GetVoter() string {
return rcv.Voter
}
func (rcv *MsgGovVoteImpl) GetOption() int {
return rcv.Option
}
+45
View File
@@ -0,0 +1,45 @@
// Code generated from Pkl module `transactions`. DO NOT EDIT.
package txns
import "github.com/apple/pkl-go/pkl"
type MsgGroupCreateGroup interface {
Msg
GetAdmin() string
GetMembers() []*pkl.Object
GetMetadata() string
}
var _ MsgGroupCreateGroup = (*MsgGroupCreateGroupImpl)(nil)
// Group module messages
type MsgGroupCreateGroupImpl struct {
// The type URL for the message
TypeUrl string `pkl:"typeUrl"`
Admin string `pkl:"admin"`
Members []*pkl.Object `pkl:"members"`
Metadata string `pkl:"metadata"`
}
// The type URL for the message
func (rcv *MsgGroupCreateGroupImpl) GetTypeUrl() string {
return rcv.TypeUrl
}
func (rcv *MsgGroupCreateGroupImpl) GetAdmin() string {
return rcv.Admin
}
func (rcv *MsgGroupCreateGroupImpl) GetMembers() []*pkl.Object {
return rcv.Members
}
func (rcv *MsgGroupCreateGroupImpl) GetMetadata() string {
return rcv.Metadata
}
+60
View File
@@ -0,0 +1,60 @@
// Code generated from Pkl module `transactions`. DO NOT EDIT.
package txns
import "github.com/apple/pkl-go/pkl"
type MsgGroupSubmitProposal interface {
Msg
GetGroupPolicyAddress() string
GetProposers() []string
GetMetadata() string
GetMessages() []*pkl.Object
GetExec() int
}
var _ MsgGroupSubmitProposal = (*MsgGroupSubmitProposalImpl)(nil)
type MsgGroupSubmitProposalImpl struct {
// The type URL for the message
TypeUrl string `pkl:"typeUrl"`
GroupPolicyAddress string `pkl:"groupPolicyAddress"`
Proposers []string `pkl:"proposers"`
Metadata string `pkl:"metadata"`
Messages []*pkl.Object `pkl:"messages"`
Exec int `pkl:"exec"`
}
// The type URL for the message
func (rcv *MsgGroupSubmitProposalImpl) GetTypeUrl() string {
return rcv.TypeUrl
}
func (rcv *MsgGroupSubmitProposalImpl) GetGroupPolicyAddress() string {
return rcv.GroupPolicyAddress
}
func (rcv *MsgGroupSubmitProposalImpl) GetProposers() []string {
return rcv.Proposers
}
func (rcv *MsgGroupSubmitProposalImpl) GetMetadata() string {
return rcv.Metadata
}
func (rcv *MsgGroupSubmitProposalImpl) GetMessages() []*pkl.Object {
return rcv.Messages
}
func (rcv *MsgGroupSubmitProposalImpl) GetExec() int {
return rcv.Exec
}
+58
View File
@@ -0,0 +1,58 @@
// Code generated from Pkl module `transactions`. DO NOT EDIT.
package txns
type MsgGroupVote interface {
Msg
GetProposalId() int
GetVoter() string
GetOption() int
GetMetadata() string
GetExec() int
}
var _ MsgGroupVote = (*MsgGroupVoteImpl)(nil)
type MsgGroupVoteImpl struct {
// The type URL for the message
TypeUrl string `pkl:"typeUrl"`
ProposalId int `pkl:"proposalId"`
Voter string `pkl:"voter"`
Option int `pkl:"option"`
Metadata string `pkl:"metadata"`
Exec int `pkl:"exec"`
}
// The type URL for the message
func (rcv *MsgGroupVoteImpl) GetTypeUrl() string {
return rcv.TypeUrl
}
func (rcv *MsgGroupVoteImpl) GetProposalId() int {
return rcv.ProposalId
}
func (rcv *MsgGroupVoteImpl) GetVoter() string {
return rcv.Voter
}
func (rcv *MsgGroupVoteImpl) GetOption() int {
return rcv.Option
}
func (rcv *MsgGroupVoteImpl) GetMetadata() string {
return rcv.Metadata
}
func (rcv *MsgGroupVoteImpl) GetExec() int {
return rcv.Exec
}
+52
View File
@@ -0,0 +1,52 @@
// Code generated from Pkl module `transactions`. DO NOT EDIT.
package txns
import "github.com/apple/pkl-go/pkl"
type MsgStakingBeginRedelegate interface {
Msg
GetDelegatorAddress() string
GetValidatorSrcAddress() string
GetValidatorDstAddress() string
GetAmount() *pkl.Object
}
var _ MsgStakingBeginRedelegate = (*MsgStakingBeginRedelegateImpl)(nil)
type MsgStakingBeginRedelegateImpl struct {
// The type URL for the message
TypeUrl string `pkl:"typeUrl"`
DelegatorAddress string `pkl:"delegatorAddress"`
ValidatorSrcAddress string `pkl:"validatorSrcAddress"`
ValidatorDstAddress string `pkl:"validatorDstAddress"`
Amount *pkl.Object `pkl:"amount"`
}
// The type URL for the message
func (rcv *MsgStakingBeginRedelegateImpl) GetTypeUrl() string {
return rcv.TypeUrl
}
func (rcv *MsgStakingBeginRedelegateImpl) GetDelegatorAddress() string {
return rcv.DelegatorAddress
}
func (rcv *MsgStakingBeginRedelegateImpl) GetValidatorSrcAddress() string {
return rcv.ValidatorSrcAddress
}
func (rcv *MsgStakingBeginRedelegateImpl) GetValidatorDstAddress() string {
return rcv.ValidatorDstAddress
}
func (rcv *MsgStakingBeginRedelegateImpl) GetAmount() *pkl.Object {
return rcv.Amount
}
+77
View File
@@ -0,0 +1,77 @@
// Code generated from Pkl module `transactions`. DO NOT EDIT.
package txns
import "github.com/apple/pkl-go/pkl"
type MsgStakingCreateValidator interface {
Msg
GetDescription() *pkl.Object
GetCommission() *pkl.Object
GetMinSelfDelegation() string
GetDelegatorAddress() string
GetValidatorAddress() string
GetPubkey() *pkl.Object
GetValue() *pkl.Object
}
var _ MsgStakingCreateValidator = (*MsgStakingCreateValidatorImpl)(nil)
// Staking module messages
type MsgStakingCreateValidatorImpl struct {
// The type URL for the message
TypeUrl string `pkl:"typeUrl"`
Description *pkl.Object `pkl:"description"`
Commission *pkl.Object `pkl:"commission"`
MinSelfDelegation string `pkl:"minSelfDelegation"`
DelegatorAddress string `pkl:"delegatorAddress"`
ValidatorAddress string `pkl:"validatorAddress"`
Pubkey *pkl.Object `pkl:"pubkey"`
Value *pkl.Object `pkl:"value"`
}
// The type URL for the message
func (rcv *MsgStakingCreateValidatorImpl) GetTypeUrl() string {
return rcv.TypeUrl
}
func (rcv *MsgStakingCreateValidatorImpl) GetDescription() *pkl.Object {
return rcv.Description
}
func (rcv *MsgStakingCreateValidatorImpl) GetCommission() *pkl.Object {
return rcv.Commission
}
func (rcv *MsgStakingCreateValidatorImpl) GetMinSelfDelegation() string {
return rcv.MinSelfDelegation
}
func (rcv *MsgStakingCreateValidatorImpl) GetDelegatorAddress() string {
return rcv.DelegatorAddress
}
func (rcv *MsgStakingCreateValidatorImpl) GetValidatorAddress() string {
return rcv.ValidatorAddress
}
func (rcv *MsgStakingCreateValidatorImpl) GetPubkey() *pkl.Object {
return rcv.Pubkey
}
func (rcv *MsgStakingCreateValidatorImpl) GetValue() *pkl.Object {
return rcv.Value
}
+44
View File
@@ -0,0 +1,44 @@
// Code generated from Pkl module `transactions`. DO NOT EDIT.
package txns
import "github.com/apple/pkl-go/pkl"
type MsgStakingDelegate interface {
Msg
GetDelegatorAddress() string
GetValidatorAddress() string
GetAmount() *pkl.Object
}
var _ MsgStakingDelegate = (*MsgStakingDelegateImpl)(nil)
type MsgStakingDelegateImpl struct {
// The type URL for the message
TypeUrl string `pkl:"typeUrl"`
DelegatorAddress string `pkl:"delegatorAddress"`
ValidatorAddress string `pkl:"validatorAddress"`
Amount *pkl.Object `pkl:"amount"`
}
// The type URL for the message
func (rcv *MsgStakingDelegateImpl) GetTypeUrl() string {
return rcv.TypeUrl
}
func (rcv *MsgStakingDelegateImpl) GetDelegatorAddress() string {
return rcv.DelegatorAddress
}
func (rcv *MsgStakingDelegateImpl) GetValidatorAddress() string {
return rcv.ValidatorAddress
}
func (rcv *MsgStakingDelegateImpl) GetAmount() *pkl.Object {
return rcv.Amount
}
+44
View File
@@ -0,0 +1,44 @@
// Code generated from Pkl module `transactions`. DO NOT EDIT.
package txns
import "github.com/apple/pkl-go/pkl"
type MsgStakingUndelegate interface {
Msg
GetDelegatorAddress() string
GetValidatorAddress() string
GetAmount() *pkl.Object
}
var _ MsgStakingUndelegate = (*MsgStakingUndelegateImpl)(nil)
type MsgStakingUndelegateImpl struct {
// The type URL for the message
TypeUrl string `pkl:"typeUrl"`
DelegatorAddress string `pkl:"delegatorAddress"`
ValidatorAddress string `pkl:"validatorAddress"`
Amount *pkl.Object `pkl:"amount"`
}
// The type URL for the message
func (rcv *MsgStakingUndelegateImpl) GetTypeUrl() string {
return rcv.TypeUrl
}
func (rcv *MsgStakingUndelegateImpl) GetDelegatorAddress() string {
return rcv.DelegatorAddress
}
func (rcv *MsgStakingUndelegateImpl) GetValidatorAddress() string {
return rcv.ValidatorAddress
}
func (rcv *MsgStakingUndelegateImpl) GetAmount() *pkl.Object {
return rcv.Amount
}
+11
View File
@@ -0,0 +1,11 @@
// Code generated from Pkl module `transactions`. DO NOT EDIT.
package txns
// Base class for all proposals
type Proposal struct {
// The title of the proposal
Title string `pkl:"title"`
// The description of the proposal
Description string `pkl:"description"`
}
+36
View File
@@ -0,0 +1,36 @@
// Code generated from Pkl module `transactions`. DO NOT EDIT.
package txns
import (
"context"
"github.com/apple/pkl-go/pkl"
)
type Transactions struct {
}
// LoadFromPath loads the pkl module at the given path and evaluates it into a Transactions
func LoadFromPath(ctx context.Context, path string) (ret *Transactions, err error) {
evaluator, err := pkl.NewEvaluator(ctx, pkl.PreconfiguredOptions)
if err != nil {
return nil, err
}
defer func() {
cerr := evaluator.Close()
if err == nil {
err = cerr
}
}()
ret, err = Load(ctx, evaluator, pkl.FileSource(path))
return ret, err
}
// Load loads the pkl module at the given source and evaluates it with the given evaluator into a Transactions
func Load(ctx context.Context, evaluator pkl.Evaluator, source *pkl.ModuleSource) (*Transactions, error) {
var ret Transactions
if err := evaluator.EvaluateModule(ctx, source, &ret); err != nil {
return nil, err
}
return &ret, nil
}
+17
View File
@@ -0,0 +1,17 @@
// Code generated from Pkl module `transactions`. DO NOT EDIT.
package txns
import "github.com/apple/pkl-go/pkl"
// Represents a transaction body
type TxBody struct {
Messages []Msg `pkl:"messages"`
Memo *string `pkl:"memo"`
TimeoutHeight *int `pkl:"timeoutHeight"`
ExtensionOptions *[]*pkl.Object `pkl:"extensionOptions"`
NonCriticalExtensionOptions *[]*pkl.Object `pkl:"nonCriticalExtensionOptions"`
}
+27
View File
@@ -0,0 +1,27 @@
// Code generated from Pkl module `transactions`. DO NOT EDIT.
package txns
import "github.com/apple/pkl-go/pkl"
func init() {
pkl.RegisterMapping("transactions", Transactions{})
pkl.RegisterMapping("transactions#Proposal", Proposal{})
pkl.RegisterMapping("transactions#MsgGovSubmitProposal", MsgGovSubmitProposalImpl{})
pkl.RegisterMapping("transactions#MsgGovVote", MsgGovVoteImpl{})
pkl.RegisterMapping("transactions#MsgGovDeposit", MsgGovDepositImpl{})
pkl.RegisterMapping("transactions#MsgGroupCreateGroup", MsgGroupCreateGroupImpl{})
pkl.RegisterMapping("transactions#MsgGroupSubmitProposal", MsgGroupSubmitProposalImpl{})
pkl.RegisterMapping("transactions#MsgGroupVote", MsgGroupVoteImpl{})
pkl.RegisterMapping("transactions#MsgStakingCreateValidator", MsgStakingCreateValidatorImpl{})
pkl.RegisterMapping("transactions#MsgStakingDelegate", MsgStakingDelegateImpl{})
pkl.RegisterMapping("transactions#MsgStakingUndelegate", MsgStakingUndelegateImpl{})
pkl.RegisterMapping("transactions#MsgStakingBeginRedelegate", MsgStakingBeginRedelegateImpl{})
pkl.RegisterMapping("transactions#MsgDidUpdateParams", MsgDidUpdateParamsImpl{})
pkl.RegisterMapping("transactions#MsgDidAllocateVault", MsgDidAllocateVaultImpl{})
pkl.RegisterMapping("transactions#MsgDidProveWitness", MsgDidProveWitnessImpl{})
pkl.RegisterMapping("transactions#MsgDidSyncVault", MsgDidSyncVaultImpl{})
pkl.RegisterMapping("transactions#MsgDidRegisterController", MsgDidRegisterControllerImpl{})
pkl.RegisterMapping("transactions#MsgDidAuthorize", MsgDidAuthorizeImpl{})
pkl.RegisterMapping("transactions#MsgDidRegisterService", MsgDidRegisterServiceImpl{})
pkl.RegisterMapping("transactions#TxBody", TxBody{})
}