feature/did accounts (#23)

* feat: add support for DID number as primary key for Controllers

* refactor: rename pkg/proxy to app/proxy

* feat: add vault module keeper tests

* feat(vault): add DID keeper to vault module

* refactor: move vault client code to its own package

* refactor(vault): extract schema definition

* refactor: use vaulttypes for MsgAllocateVault

* refactor: update vault assembly logic to use new methods

* feat: add dwn-proxy command

* refactor: remove unused context.go file

* refactor: remove unused web-related code

* feat: add DWN proxy server

* feat: add BuildTx RPC to vault module

* fix: Implement BuildTx endpoint

* feat: add devbox integration to project
This commit is contained in:
Prad Nukala 2024-09-25 19:45:28 -04:00 committed by GitHub
parent 97b3f9836a
commit 60c48d2409
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
216 changed files with 18162 additions and 9232 deletions

15
.devcontainer/Dockerfile Normal file
View File

@ -0,0 +1,15 @@
FROM jetpackio/devbox:latest
# Installing your devbox project
WORKDIR /code
USER root:root
RUN mkdir -p /code && chown ${DEVBOX_USER}:${DEVBOX_USER} /code
USER ${DEVBOX_USER}:${DEVBOX_USER}
COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} devbox.json devbox.json
COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} devbox.lock devbox.lock
RUN devbox run -- echo "Installed Packages."
RUN devbox shellenv --init-hook >> ~/.profile

View File

@ -0,0 +1,16 @@
{
"name": "Devbox Remote Container",
"build": {
"dockerfile": "./Dockerfile",
"context": ".."
},
"customizations": {
"vscode": {
"settings": {},
"extensions": [
"jetpack-io.devbox"
]
}
},
"remoteUser": "devbox"
}

View File

@ -1,65 +0,0 @@
name: self-hosted testnet
#
# Setup a runner on your own hardware or in a public cloud like GCP, Hetzner, etc.
# This is required if your chain is closed source but you want a dev/semi-public testnet
# - https://github.com/<org>/<repo>/settings/actions/runners/new?arch=x64&os=linux
#
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+' # ignore rc
env:
GO_VERSION: 1.21.0
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
LOCALIC_PORT: 8080
LOCALIC_AUTH_KEY: ""
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
launch-testnet:
runs-on: self-hosted
steps:
- uses: actions/checkout@v3
- name: Setup System
run: |
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt -y install make gcc jq bison ca-certificates curl
wget https://go.dev/dl/go1.22.1.linux-amd64.tar.gz
sudo rm -rf /usr/local/go && sudo tar -C /usr/local -xzf go1.22.1.linux-amd64.tar.gz
echo "export PATH=$PATH:/usr/local/go/bin" >> ~/.bashrc
export PATH=$PATH:/usr/local/go/bin
sudo DEBIAN_FRONTEND=noninteractive apt-get remove -y containerd.io || true
sudo DEBIAN_FRONTEND=noninteractive apt-get -y install docker.io docker-compose
sudo apt-get update
wget https://github.com/strangelove-ventures/interchaintest/releases/download/v8.2.0/local-ic && chmod +x local-ic
sudo mv local-ic /usr/local/bin
git clone https://github.com/strangelove-ventures/heighliner.git && cd heighliner
go build && chmod +x heighliner
sudo mv heighliner /usr/local/bin
cd .. && rm -rf heighliner
- name: Build + Run Testnet
run: |
killall local-ic || true
docker kill $(docker ps -q) || true
export PATH=$PATH:/usr/local/go/bin
make local-image
sudo screen -S testnet-${{ github.ref_name }} -d -m local-ic start ibc-testnet --api-address=0.0.0.0 --api-port=${{ env.LOCALIC_PORT }} --auth-key=${{ env.LOCALIC_AUTH_KEY }}
# Add other commands here you perform for setup once local-ic has started (poll on LOCALIC_PORT) such as contract upload.

View File

@ -301,11 +301,7 @@ sh-testnet: mod-tidy
dwn: dwn:
@echo "(dwn) Building dwn.wasm -> IPFS Vault" @echo "(dwn) Building dwn.wasm -> IPFS Vault"
GOOS=js GOARCH=wasm go build -o ./pkg/vault/app.wasm ./internal/dwn/main.go GOOS=js GOARCH=wasm go build -o ./x/vault/internal/app.wasm ./x/vault/client/dwn/main.go
motr:
@echo "(web) Building app.wasm -> Deploy to Cloudflare Workers"
GOOS=js GOARCH=wasm go build -o ./pkg/proxy/build/app.wasm ./pkg/proxy/main.go
templ: templ:
@echo "(templ) Generating templ files" @echo "(templ) Generating templ files"
@ -316,8 +312,6 @@ pkl:
@echo "(pkl) Building PKL" @echo "(pkl) Building PKL"
go run github.com/apple/pkl-go/cmd/pkl-gen-go ./config/pkl/dwn.pkl go run github.com/apple/pkl-go/cmd/pkl-gen-go ./config/pkl/dwn.pkl
go run github.com/apple/pkl-go/cmd/pkl-gen-go ./config/pkl/orm.pkl go run github.com/apple/pkl-go/cmd/pkl-gen-go ./config/pkl/orm.pkl
go run github.com/apple/pkl-go/cmd/pkl-gen-go ./config/pkl/web.pkl
go run github.com/apple/pkl-go/cmd/pkl-gen-go ./config/pkl/txns.pkl
air: air:
@echo "(air) Building air" @echo "(air) Building air"

View File

@ -591,49 +591,49 @@ func (x *_Params_2_map) IsValid() bool {
return x.m != nil return x.m != nil
} }
var _ protoreflect.List = (*_Params_6_list)(nil) var _ protoreflect.List = (*_Params_4_list)(nil)
type _Params_6_list struct { type _Params_4_list struct {
list *[]string list *[]string
} }
func (x *_Params_6_list) Len() int { func (x *_Params_4_list) Len() int {
if x.list == nil { if x.list == nil {
return 0 return 0
} }
return len(*x.list) return len(*x.list)
} }
func (x *_Params_6_list) Get(i int) protoreflect.Value { func (x *_Params_4_list) Get(i int) protoreflect.Value {
return protoreflect.ValueOfString((*x.list)[i]) return protoreflect.ValueOfString((*x.list)[i])
} }
func (x *_Params_6_list) Set(i int, value protoreflect.Value) { func (x *_Params_4_list) Set(i int, value protoreflect.Value) {
valueUnwrapped := value.String() valueUnwrapped := value.String()
concreteValue := valueUnwrapped concreteValue := valueUnwrapped
(*x.list)[i] = concreteValue (*x.list)[i] = concreteValue
} }
func (x *_Params_6_list) Append(value protoreflect.Value) { func (x *_Params_4_list) Append(value protoreflect.Value) {
valueUnwrapped := value.String() valueUnwrapped := value.String()
concreteValue := valueUnwrapped concreteValue := valueUnwrapped
*x.list = append(*x.list, concreteValue) *x.list = append(*x.list, concreteValue)
} }
func (x *_Params_6_list) AppendMutable() protoreflect.Value { func (x *_Params_4_list) AppendMutable() protoreflect.Value {
panic(fmt.Errorf("AppendMutable can not be called on message Params at list field AttestationFormats as it is not of Message kind")) panic(fmt.Errorf("AppendMutable can not be called on message Params at list field AttestationFormats as it is not of Message kind"))
} }
func (x *_Params_6_list) Truncate(n int) { func (x *_Params_4_list) Truncate(n int) {
*x.list = (*x.list)[:n] *x.list = (*x.list)[:n]
} }
func (x *_Params_6_list) NewElement() protoreflect.Value { func (x *_Params_4_list) NewElement() protoreflect.Value {
v := "" v := ""
return protoreflect.ValueOfString(v) return protoreflect.ValueOfString(v)
} }
func (x *_Params_6_list) IsValid() bool { func (x *_Params_4_list) IsValid() bool {
return x.list != nil return x.list != nil
} }
@ -641,8 +641,6 @@ var (
md_Params protoreflect.MessageDescriptor md_Params protoreflect.MessageDescriptor
fd_Params_whitelisted_assets protoreflect.FieldDescriptor fd_Params_whitelisted_assets protoreflect.FieldDescriptor
fd_Params_allowed_public_keys protoreflect.FieldDescriptor fd_Params_allowed_public_keys protoreflect.FieldDescriptor
fd_Params_ipfs_active protoreflect.FieldDescriptor
fd_Params_localhost_registration_enabled protoreflect.FieldDescriptor
fd_Params_conveyance_preference protoreflect.FieldDescriptor fd_Params_conveyance_preference protoreflect.FieldDescriptor
fd_Params_attestation_formats protoreflect.FieldDescriptor fd_Params_attestation_formats protoreflect.FieldDescriptor
) )
@ -652,8 +650,6 @@ func init() {
md_Params = File_did_v1_genesis_proto.Messages().ByName("Params") md_Params = File_did_v1_genesis_proto.Messages().ByName("Params")
fd_Params_whitelisted_assets = md_Params.Fields().ByName("whitelisted_assets") fd_Params_whitelisted_assets = md_Params.Fields().ByName("whitelisted_assets")
fd_Params_allowed_public_keys = md_Params.Fields().ByName("allowed_public_keys") fd_Params_allowed_public_keys = md_Params.Fields().ByName("allowed_public_keys")
fd_Params_ipfs_active = md_Params.Fields().ByName("ipfs_active")
fd_Params_localhost_registration_enabled = md_Params.Fields().ByName("localhost_registration_enabled")
fd_Params_conveyance_preference = md_Params.Fields().ByName("conveyance_preference") fd_Params_conveyance_preference = md_Params.Fields().ByName("conveyance_preference")
fd_Params_attestation_formats = md_Params.Fields().ByName("attestation_formats") fd_Params_attestation_formats = md_Params.Fields().ByName("attestation_formats")
} }
@ -735,18 +731,6 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto
return return
} }
} }
if x.IpfsActive != false {
value := protoreflect.ValueOfBool(x.IpfsActive)
if !f(fd_Params_ipfs_active, value) {
return
}
}
if x.LocalhostRegistrationEnabled != false {
value := protoreflect.ValueOfBool(x.LocalhostRegistrationEnabled)
if !f(fd_Params_localhost_registration_enabled, value) {
return
}
}
if x.ConveyancePreference != "" { if x.ConveyancePreference != "" {
value := protoreflect.ValueOfString(x.ConveyancePreference) value := protoreflect.ValueOfString(x.ConveyancePreference)
if !f(fd_Params_conveyance_preference, value) { if !f(fd_Params_conveyance_preference, value) {
@ -754,7 +738,7 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto
} }
} }
if len(x.AttestationFormats) != 0 { if len(x.AttestationFormats) != 0 {
value := protoreflect.ValueOfList(&_Params_6_list{list: &x.AttestationFormats}) value := protoreflect.ValueOfList(&_Params_4_list{list: &x.AttestationFormats})
if !f(fd_Params_attestation_formats, value) { if !f(fd_Params_attestation_formats, value) {
return return
} }
@ -778,10 +762,6 @@ func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool {
return len(x.WhitelistedAssets) != 0 return len(x.WhitelistedAssets) != 0
case "did.v1.Params.allowed_public_keys": case "did.v1.Params.allowed_public_keys":
return len(x.AllowedPublicKeys) != 0 return len(x.AllowedPublicKeys) != 0
case "did.v1.Params.ipfs_active":
return x.IpfsActive != false
case "did.v1.Params.localhost_registration_enabled":
return x.LocalhostRegistrationEnabled != false
case "did.v1.Params.conveyance_preference": case "did.v1.Params.conveyance_preference":
return x.ConveyancePreference != "" return x.ConveyancePreference != ""
case "did.v1.Params.attestation_formats": case "did.v1.Params.attestation_formats":
@ -806,10 +786,6 @@ func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) {
x.WhitelistedAssets = nil x.WhitelistedAssets = nil
case "did.v1.Params.allowed_public_keys": case "did.v1.Params.allowed_public_keys":
x.AllowedPublicKeys = nil x.AllowedPublicKeys = nil
case "did.v1.Params.ipfs_active":
x.IpfsActive = false
case "did.v1.Params.localhost_registration_enabled":
x.LocalhostRegistrationEnabled = false
case "did.v1.Params.conveyance_preference": case "did.v1.Params.conveyance_preference":
x.ConveyancePreference = "" x.ConveyancePreference = ""
case "did.v1.Params.attestation_formats": case "did.v1.Params.attestation_formats":
@ -842,20 +818,14 @@ func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) pro
} }
mapValue := &_Params_2_map{m: &x.AllowedPublicKeys} mapValue := &_Params_2_map{m: &x.AllowedPublicKeys}
return protoreflect.ValueOfMap(mapValue) return protoreflect.ValueOfMap(mapValue)
case "did.v1.Params.ipfs_active":
value := x.IpfsActive
return protoreflect.ValueOfBool(value)
case "did.v1.Params.localhost_registration_enabled":
value := x.LocalhostRegistrationEnabled
return protoreflect.ValueOfBool(value)
case "did.v1.Params.conveyance_preference": case "did.v1.Params.conveyance_preference":
value := x.ConveyancePreference value := x.ConveyancePreference
return protoreflect.ValueOfString(value) return protoreflect.ValueOfString(value)
case "did.v1.Params.attestation_formats": case "did.v1.Params.attestation_formats":
if len(x.AttestationFormats) == 0 { if len(x.AttestationFormats) == 0 {
return protoreflect.ValueOfList(&_Params_6_list{}) return protoreflect.ValueOfList(&_Params_4_list{})
} }
listValue := &_Params_6_list{list: &x.AttestationFormats} listValue := &_Params_4_list{list: &x.AttestationFormats}
return protoreflect.ValueOfList(listValue) return protoreflect.ValueOfList(listValue)
default: default:
if descriptor.IsExtension() { if descriptor.IsExtension() {
@ -885,15 +855,11 @@ func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value proto
mv := value.Map() mv := value.Map()
cmv := mv.(*_Params_2_map) cmv := mv.(*_Params_2_map)
x.AllowedPublicKeys = *cmv.m x.AllowedPublicKeys = *cmv.m
case "did.v1.Params.ipfs_active":
x.IpfsActive = value.Bool()
case "did.v1.Params.localhost_registration_enabled":
x.LocalhostRegistrationEnabled = value.Bool()
case "did.v1.Params.conveyance_preference": case "did.v1.Params.conveyance_preference":
x.ConveyancePreference = value.Interface().(string) x.ConveyancePreference = value.Interface().(string)
case "did.v1.Params.attestation_formats": case "did.v1.Params.attestation_formats":
lv := value.List() lv := value.List()
clv := lv.(*_Params_6_list) clv := lv.(*_Params_4_list)
x.AttestationFormats = *clv.list x.AttestationFormats = *clv.list
default: default:
if fd.IsExtension() { if fd.IsExtension() {
@ -931,12 +897,8 @@ func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protore
if x.AttestationFormats == nil { if x.AttestationFormats == nil {
x.AttestationFormats = []string{} x.AttestationFormats = []string{}
} }
value := &_Params_6_list{list: &x.AttestationFormats} value := &_Params_4_list{list: &x.AttestationFormats}
return protoreflect.ValueOfList(value) return protoreflect.ValueOfList(value)
case "did.v1.Params.ipfs_active":
panic(fmt.Errorf("field ipfs_active of message did.v1.Params is not mutable"))
case "did.v1.Params.localhost_registration_enabled":
panic(fmt.Errorf("field localhost_registration_enabled of message did.v1.Params is not mutable"))
case "did.v1.Params.conveyance_preference": case "did.v1.Params.conveyance_preference":
panic(fmt.Errorf("field conveyance_preference of message did.v1.Params is not mutable")) panic(fmt.Errorf("field conveyance_preference of message did.v1.Params is not mutable"))
default: default:
@ -958,15 +920,11 @@ func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protor
case "did.v1.Params.allowed_public_keys": case "did.v1.Params.allowed_public_keys":
m := make(map[string]*KeyInfo) m := make(map[string]*KeyInfo)
return protoreflect.ValueOfMap(&_Params_2_map{m: &m}) return protoreflect.ValueOfMap(&_Params_2_map{m: &m})
case "did.v1.Params.ipfs_active":
return protoreflect.ValueOfBool(false)
case "did.v1.Params.localhost_registration_enabled":
return protoreflect.ValueOfBool(false)
case "did.v1.Params.conveyance_preference": case "did.v1.Params.conveyance_preference":
return protoreflect.ValueOfString("") return protoreflect.ValueOfString("")
case "did.v1.Params.attestation_formats": case "did.v1.Params.attestation_formats":
list := []string{} list := []string{}
return protoreflect.ValueOfList(&_Params_6_list{list: &list}) return protoreflect.ValueOfList(&_Params_4_list{list: &list})
default: default:
if fd.IsExtension() { if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Params")) panic(fmt.Errorf("proto3 declared messages do not support extensions: did.v1.Params"))
@ -1068,12 +1026,6 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods {
} }
} }
} }
if x.IpfsActive {
n += 2
}
if x.LocalhostRegistrationEnabled {
n += 2
}
l = len(x.ConveyancePreference) l = len(x.ConveyancePreference)
if l > 0 { if l > 0 {
n += 1 + l + runtime.Sov(uint64(l)) n += 1 + l + runtime.Sov(uint64(l))
@ -1119,7 +1071,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods {
copy(dAtA[i:], x.AttestationFormats[iNdEx]) copy(dAtA[i:], x.AttestationFormats[iNdEx])
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AttestationFormats[iNdEx]))) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AttestationFormats[iNdEx])))
i-- i--
dAtA[i] = 0x32 dAtA[i] = 0x22
} }
} }
if len(x.ConveyancePreference) > 0 { if len(x.ConveyancePreference) > 0 {
@ -1127,27 +1079,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods {
copy(dAtA[i:], x.ConveyancePreference) copy(dAtA[i:], x.ConveyancePreference)
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ConveyancePreference))) i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ConveyancePreference)))
i-- i--
dAtA[i] = 0x2a dAtA[i] = 0x1a
}
if x.LocalhostRegistrationEnabled {
i--
if x.LocalhostRegistrationEnabled {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i--
dAtA[i] = 0x20
}
if x.IpfsActive {
i--
if x.IpfsActive {
dAtA[i] = 1
} else {
dAtA[i] = 0
}
i--
dAtA[i] = 0x18
} }
if len(x.AllowedPublicKeys) > 0 { if len(x.AllowedPublicKeys) > 0 {
MaRsHaLmAp := func(k string, v *KeyInfo) (protoiface.MarshalOutput, error) { MaRsHaLmAp := func(k string, v *KeyInfo) (protoiface.MarshalOutput, error) {
@ -1428,46 +1360,6 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods {
x.AllowedPublicKeys[mapkey] = mapvalue x.AllowedPublicKeys[mapkey] = mapvalue
iNdEx = postIndex iNdEx = postIndex
case 3: case 3:
if wireType != 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field IpfsActive", wireType)
}
var v int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
x.IpfsActive = bool(v != 0)
case 4:
if wireType != 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field LocalhostRegistrationEnabled", wireType)
}
var v int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
v |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
x.LocalhostRegistrationEnabled = bool(v != 0)
case 5:
if wireType != 2 { if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ConveyancePreference", wireType) return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ConveyancePreference", wireType)
} }
@ -1499,7 +1391,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods {
} }
x.ConveyancePreference = string(dAtA[iNdEx:postIndex]) x.ConveyancePreference = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex iNdEx = postIndex
case 6: case 4:
if wireType != 2 { if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AttestationFormats", wireType) return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AttestationFormats", wireType)
} }
@ -6975,14 +6867,10 @@ type Params struct {
WhitelistedAssets []*AssetInfo `protobuf:"bytes,1,rep,name=whitelisted_assets,json=whitelistedAssets,proto3" json:"whitelisted_assets,omitempty"` WhitelistedAssets []*AssetInfo `protobuf:"bytes,1,rep,name=whitelisted_assets,json=whitelistedAssets,proto3" json:"whitelisted_assets,omitempty"`
// Whitelisted Key Types // Whitelisted Key Types
AllowedPublicKeys map[string]*KeyInfo `protobuf:"bytes,2,rep,name=allowed_public_keys,json=allowedPublicKeys,proto3" json:"allowed_public_keys,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` AllowedPublicKeys map[string]*KeyInfo `protobuf:"bytes,2,rep,name=allowed_public_keys,json=allowedPublicKeys,proto3" json:"allowed_public_keys,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"`
// IpfsActive is a flag to enable/disable ipfs
IpfsActive bool `protobuf:"varint,3,opt,name=ipfs_active,json=ipfsActive,proto3" json:"ipfs_active,omitempty"`
// Localhost Registration Enabled
LocalhostRegistrationEnabled bool `protobuf:"varint,4,opt,name=localhost_registration_enabled,json=localhostRegistrationEnabled,proto3" json:"localhost_registration_enabled,omitempty"`
// ConveyancePreference defines the conveyance preference // ConveyancePreference defines the conveyance preference
ConveyancePreference string `protobuf:"bytes,5,opt,name=conveyance_preference,json=conveyancePreference,proto3" json:"conveyance_preference,omitempty"` ConveyancePreference string `protobuf:"bytes,3,opt,name=conveyance_preference,json=conveyancePreference,proto3" json:"conveyance_preference,omitempty"`
// AttestationFormats defines the attestation formats // AttestationFormats defines the attestation formats
AttestationFormats []string `protobuf:"bytes,6,rep,name=attestation_formats,json=attestationFormats,proto3" json:"attestation_formats,omitempty"` AttestationFormats []string `protobuf:"bytes,4,rep,name=attestation_formats,json=attestationFormats,proto3" json:"attestation_formats,omitempty"`
} }
func (x *Params) Reset() { func (x *Params) Reset() {
@ -7019,20 +6907,6 @@ func (x *Params) GetAllowedPublicKeys() map[string]*KeyInfo {
return nil return nil
} }
func (x *Params) GetIpfsActive() bool {
if x != nil {
return x.IpfsActive
}
return false
}
func (x *Params) GetLocalhostRegistrationEnabled() bool {
if x != nil {
return x.LocalhostRegistrationEnabled
}
return false
}
func (x *Params) GetConveyancePreference() string { func (x *Params) GetConveyancePreference() string {
if x != nil { if x != nil {
return x.ConveyancePreference return x.ConveyancePreference
@ -7222,7 +7096,8 @@ type KeyInfo struct {
Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"` Role string `protobuf:"bytes,1,opt,name=role,proto3" json:"role,omitempty"`
Algorithm string `protobuf:"bytes,2,opt,name=algorithm,proto3" json:"algorithm,omitempty"` // e.g., "ES256", "EdDSA", "ES256K" Algorithm string `protobuf:"bytes,2,opt,name=algorithm,proto3" json:"algorithm,omitempty"` // e.g., "ES256", "EdDSA", "ES256K"
Encoding string `protobuf:"bytes,3,opt,name=encoding,proto3" json:"encoding,omitempty"` // e.g., "hex", "base64", "multibase" Encoding string `protobuf:"bytes,3,opt,name=encoding,proto3" json:"encoding,omitempty"` // e.g., "hex", "base64", "multibase"
Curve string `protobuf:"bytes,4,opt,name=curve,proto3" json:"curve,omitempty"` // e.g., "P256", "P384", "P521", "X25519", "X448", "Ed25519", "Ed448", "secp256k1" Curve string `protobuf:"bytes,4,opt,name=curve,proto3" json:"curve,omitempty"` // e.g., "P256", "P384", "P521", "X25519", "X448",
// "Ed25519", "Ed448", "secp256k1"
Type_ string `protobuf:"bytes,5,opt,name=type,proto3" json:"type,omitempty"` // e.g., "Octet", "Elliptic", "RSA", "Symmetric", "HMAC" Type_ string `protobuf:"bytes,5,opt,name=type,proto3" json:"type,omitempty"` // e.g., "Octet", "Elliptic", "RSA", "Symmetric", "HMAC"
} }
@ -7536,7 +7411,7 @@ var file_did_v1_genesis_proto_rawDesc = []byte{
0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2c, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x2c, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d,
0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31,
0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70,
0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0xde, 0x03, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0xf7, 0x02, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73,
0x12, 0x40, 0x0a, 0x12, 0x77, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, 0x5f, 0x12, 0x40, 0x0a, 0x12, 0x77, 0x68, 0x69, 0x74, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x65, 0x64, 0x5f,
0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x64, 0x61, 0x73, 0x73, 0x65, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x64,
0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x73, 0x73, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52,
@ -7546,116 +7421,110 @@ var file_did_v1_genesis_proto_rawDesc = []byte{
0x25, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x25, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e,
0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79,
0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x50, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x50,
0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x70, 0x66, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x12, 0x33, 0x0a, 0x15, 0x63, 0x6f, 0x6e,
0x73, 0x5f, 0x61, 0x63, 0x74, 0x69, 0x76, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0a, 0x76, 0x65, 0x79, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e,
0x69, 0x70, 0x66, 0x73, 0x41, 0x63, 0x74, 0x69, 0x76, 0x65, 0x12, 0x44, 0x0a, 0x1e, 0x6c, 0x6f, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x79,
0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x72, 0x61, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x2f,
0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x65, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x0a, 0x13, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x6f,
0x28, 0x08, 0x52, 0x1c, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x52, 0x65, 0x67, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x12, 0x61, 0x74, 0x74,
0x69, 0x73, 0x74, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x1a,
0x12, 0x33, 0x0a, 0x15, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x79, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x70, 0x55, 0x0a, 0x16, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63,
0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x4b, 0x65, 0x79, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79,
0x14, 0x63, 0x6f, 0x6e, 0x76, 0x65, 0x79, 0x61, 0x6e, 0x63, 0x65, 0x50, 0x72, 0x65, 0x66, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x25, 0x0a, 0x05, 0x76,
0x72, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x2f, 0x0a, 0x13, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x64, 0x69, 0x64,
0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x76, 0x61, 0x6c,
0x28, 0x09, 0x52, 0x12, 0x61, 0x74, 0x74, 0x65, 0x73, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x46, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x17, 0x98, 0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01,
0x6f, 0x72, 0x6d, 0x61, 0x74, 0x73, 0x1a, 0x55, 0x0a, 0x16, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x8a, 0xe7, 0xb0, 0x2a, 0x0a, 0x64, 0x69, 0x64, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22,
0x64, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x99, 0x01, 0x0a, 0x09, 0x41, 0x73, 0x73, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a,
0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x69, 0x6e,
0x64, 0x65, 0x78, 0x12, 0x10, 0x0a, 0x03, 0x68, 0x72, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
0x52, 0x03, 0x68, 0x72, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18,
0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x1d, 0x0a,
0x0a, 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28,
0x09, 0x52, 0x09, 0x61, 0x73, 0x73, 0x65, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04,
0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65,
0x12, 0x19, 0x0a, 0x08, 0x69, 0x63, 0x6f, 0x6e, 0x5f, 0x75, 0x72, 0x6c, 0x18, 0x06, 0x20, 0x01,
0x28, 0x09, 0x52, 0x07, 0x69, 0x63, 0x6f, 0x6e, 0x55, 0x72, 0x6c, 0x22, 0x91, 0x02, 0x0a, 0x08,
0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74,
0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f,
0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12, 0x26, 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x68,
0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09,
0x52, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x12, 0x29, 0x0a, 0x10, 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65,
0x74, 0x68, 0x6f, 0x64, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0f, 0x61, 0x73, 0x73, 0x65,
0x72, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x33, 0x0a, 0x15, 0x63,
0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x14, 0x63, 0x61, 0x70, 0x61,
0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x44, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x12, 0x33, 0x0a, 0x15, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x69,
0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52,
0x14, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x49, 0x6e, 0x76, 0x6f, 0x63,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22,
0x81, 0x01, 0x0a, 0x07, 0x4b, 0x65, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x72,
0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12,
0x1c, 0x0a, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x52, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x1a, 0x0a,
0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x75, 0x72,
0x76, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x75, 0x72, 0x76, 0x65, 0x12,
0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74,
0x79, 0x70, 0x65, 0x22, 0xa2, 0x02, 0x0a, 0x06, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x12, 0x12,
0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f,
0x6c, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x18,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d,
0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01,
0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67, 0x12, 0x14, 0x0a, 0x05,
0x63, 0x75, 0x72, 0x76, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x63, 0x75, 0x72,
0x76, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x65, 0x79, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05,
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79, 0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a,
0x03, 0x72, 0x61, 0x77, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x72, 0x61, 0x77, 0x12,
0x24, 0x0a, 0x03, 0x6a, 0x77, 0x6b, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x64,
0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62, 0x4b, 0x65, 0x79, 0x2e, 0x4a, 0x57, 0x4b,
0x52, 0x03, 0x6a, 0x77, 0x6b, 0x1a, 0x61, 0x0a, 0x03, 0x4a, 0x57, 0x4b, 0x12, 0x10, 0x0a, 0x03,
0x6b, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x74, 0x79, 0x12, 0x10,
0x0a, 0x03, 0x63, 0x72, 0x76, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x63, 0x72, 0x76,
0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x78, 0x12, 0x0c,
0x0a, 0x01, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x79, 0x12, 0x0c, 0x0a, 0x01,
0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x6e, 0x12, 0x0c, 0x0a, 0x01, 0x65, 0x18,
0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x65, 0x22, 0xb1, 0x03, 0x0a, 0x07, 0x53, 0x65, 0x72,
0x76, 0x69, 0x63, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x52, 0x02, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f,
0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76,
0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f,
0x72, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68,
0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18,
0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x12, 0x20, 0x0a,
0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01,
0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12,
0x52, 0x0a, 0x11, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x65, 0x6e, 0x64, 0x70, 0x6f,
0x69, 0x6e, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x64, 0x69, 0x64,
0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x53, 0x65, 0x72, 0x76,
0x69, 0x63, 0x65, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72,
0x79, 0x52, 0x10, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69,
0x6e, 0x74, 0x73, 0x12, 0x42, 0x0a, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f,
0x6e, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76,
0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73,
0x73, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x6d,
0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x43, 0x0a, 0x15, 0x53, 0x65, 0x72, 0x76, 0x69,
0x63, 0x65, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79,
0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b,
0x65, 0x79, 0x12, 0x25, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
0x0b, 0x32, 0x0f, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x4b, 0x65, 0x79, 0x49, 0x6e, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x3e, 0x0a, 0x10,
0x66, 0x6f, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x3a, 0x17, 0x98, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79,
0xa0, 0x1f, 0x00, 0xe8, 0xa0, 0x1f, 0x01, 0x8a, 0xe7, 0xb0, 0x2a, 0x0a, 0x64, 0x69, 0x64, 0x2f, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b,
0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x22, 0x99, 0x01, 0x0a, 0x09, 0x41, 0x73, 0x73, 0x65, 0x74, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
0x49, 0x6e, 0x66, 0x6f, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x7c, 0x0a, 0x0a,
0x01, 0x28, 0x03, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x10, 0x0a, 0x03, 0x68, 0x72, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65,
0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x68, 0x72, 0x70, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68,
0x73, 0x79, 0x6d, 0x62, 0x6f, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x79, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f,
0x6d, 0x62, 0x6f, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, 0x74, 0x79, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x69, 0x64, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x69,
0x70, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x73, 0x73, 0x65, 0x74, 0x54, 0x64, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x44, 0x69, 0x64, 0x2e,
0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x56, 0x31, 0xca, 0x02, 0x06, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x12, 0x44, 0x69,
0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x69, 0x63, 0x6f, 0x6e, 0x5f, 0x64, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61,
0x75, 0x72, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x69, 0x63, 0x6f, 0x6e, 0x55, 0xea, 0x02, 0x07, 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
0x72, 0x6c, 0x22, 0x91, 0x02, 0x0a, 0x08, 0x44, 0x6f, 0x63, 0x75, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x6f, 0x33,
0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12,
0x1e, 0x0a, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x12,
0x26, 0x0a, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0e, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74,
0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x29, 0x0a, 0x10, 0x61, 0x73, 0x73, 0x65, 0x72,
0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x04, 0x20, 0x03, 0x28,
0x09, 0x52, 0x0f, 0x61, 0x73, 0x73, 0x65, 0x72, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68,
0x6f, 0x64, 0x12, 0x33, 0x0a, 0x15, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79,
0x5f, 0x64, 0x65, 0x6c, 0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x03, 0x28,
0x09, 0x52, 0x14, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x44, 0x65, 0x6c,
0x65, 0x67, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x33, 0x0a, 0x15, 0x63, 0x61, 0x70, 0x61, 0x62,
0x69, 0x6c, 0x69, 0x74, 0x79, 0x5f, 0x69, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x18, 0x06, 0x20, 0x03, 0x28, 0x09, 0x52, 0x14, 0x63, 0x61, 0x70, 0x61, 0x62, 0x69, 0x6c, 0x69,
0x74, 0x79, 0x49, 0x6e, 0x76, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07,
0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x73,
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x22, 0x81, 0x01, 0x0a, 0x07, 0x4b, 0x65, 0x79, 0x49, 0x6e,
0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72, 0x69,
0x74, 0x68, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x6c, 0x67, 0x6f, 0x72,
0x69, 0x74, 0x68, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67,
0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64, 0x69, 0x6e, 0x67,
0x12, 0x14, 0x0a, 0x05, 0x63, 0x75, 0x72, 0x76, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,
0x05, 0x63, 0x75, 0x72, 0x76, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05,
0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0xa2, 0x02, 0x0a, 0x06, 0x50,
0x75, 0x62, 0x4b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x6c, 0x67,
0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x6c,
0x67, 0x6f, 0x72, 0x69, 0x74, 0x68, 0x6d, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64,
0x69, 0x6e, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x63, 0x6f, 0x64,
0x69, 0x6e, 0x67, 0x12, 0x14, 0x0a, 0x05, 0x63, 0x75, 0x72, 0x76, 0x65, 0x18, 0x04, 0x20, 0x01,
0x28, 0x09, 0x52, 0x05, 0x63, 0x75, 0x72, 0x76, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6b, 0x65, 0x79,
0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6b, 0x65, 0x79,
0x54, 0x79, 0x70, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x72, 0x61, 0x77, 0x18, 0x06, 0x20, 0x01, 0x28,
0x0c, 0x52, 0x03, 0x72, 0x61, 0x77, 0x12, 0x24, 0x0a, 0x03, 0x6a, 0x77, 0x6b, 0x18, 0x07, 0x20,
0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x75, 0x62,
0x4b, 0x65, 0x79, 0x2e, 0x4a, 0x57, 0x4b, 0x52, 0x03, 0x6a, 0x77, 0x6b, 0x1a, 0x61, 0x0a, 0x03,
0x4a, 0x57, 0x4b, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x52, 0x03, 0x6b, 0x74, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x72, 0x76, 0x18, 0x02, 0x20, 0x01,
0x28, 0x09, 0x52, 0x03, 0x63, 0x72, 0x76, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x03, 0x20, 0x01,
0x28, 0x09, 0x52, 0x01, 0x78, 0x12, 0x0c, 0x0a, 0x01, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09,
0x52, 0x01, 0x79, 0x12, 0x0c, 0x0a, 0x01, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01,
0x6e, 0x12, 0x0c, 0x0a, 0x01, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x01, 0x65, 0x22,
0xb1, 0x03, 0x0a, 0x07, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x73,
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
0x09, 0x52, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1c,
0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28,
0x09, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x16, 0x0a, 0x06,
0x6f, 0x72, 0x69, 0x67, 0x69, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6f, 0x72,
0x69, 0x67, 0x69, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74,
0x69, 0x6f, 0x6e, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72,
0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x52, 0x0a, 0x11, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63,
0x65, 0x5f, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28,
0x0b, 0x32, 0x25, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69,
0x63, 0x65, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69,
0x6e, 0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x10, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63,
0x65, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x12, 0x42, 0x0a, 0x0b, 0x70, 0x65,
0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x20, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
0x2e, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72,
0x79, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x1a, 0x43,
0x0a, 0x15, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x45, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e,
0x74, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c,
0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a,
0x02, 0x38, 0x01, 0x1a, 0x3e, 0x0a, 0x10, 0x50, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f,
0x6e, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c,
0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a,
0x02, 0x38, 0x01, 0x42, 0x7c, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x64, 0x69, 0x64, 0x2e, 0x76,
0x31, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50,
0x01, 0x5a, 0x27, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f, 0x6e,
0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x64, 0x69,
0x64, 0x2f, 0x76, 0x31, 0x3b, 0x64, 0x69, 0x64, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x44, 0x58, 0x58,
0xaa, 0x02, 0x06, 0x44, 0x69, 0x64, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x06, 0x44, 0x69, 0x64, 0x5c,
0x56, 0x31, 0xe2, 0x02, 0x12, 0x44, 0x69, 0x64, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d,
0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x07, 0x44, 0x69, 0x64, 0x3a, 0x3a, 0x56,
0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (

File diff suppressed because it is too large Load Diff

View File

@ -21,7 +21,6 @@ const _ = grpc.SupportPackageIsVersion7
const ( const (
Query_Params_FullMethodName = "/did.v1.Query/Params" Query_Params_FullMethodName = "/did.v1.Query/Params"
Query_Resolve_FullMethodName = "/did.v1.Query/Resolve" Query_Resolve_FullMethodName = "/did.v1.Query/Resolve"
Query_Sync_FullMethodName = "/did.v1.Query/Sync"
) )
// QueryClient is the client API for Query service. // QueryClient is the client API for Query service.
@ -32,8 +31,6 @@ type QueryClient interface {
Params(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) Params(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
// Resolve queries the DID document by its id. // Resolve queries the DID document by its id.
Resolve(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResolveResponse, error) Resolve(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResolveResponse, error)
// Sync queries the DID document by its id. And returns the required PKL information
Sync(ctx context.Context, in *SyncRequest, opts ...grpc.CallOption) (*SyncResponse, error)
} }
type queryClient struct { type queryClient struct {
@ -62,15 +59,6 @@ func (c *queryClient) Resolve(ctx context.Context, in *QueryRequest, opts ...grp
return out, nil return out, nil
} }
func (c *queryClient) Sync(ctx context.Context, in *SyncRequest, opts ...grpc.CallOption) (*SyncResponse, error) {
out := new(SyncResponse)
err := c.cc.Invoke(ctx, Query_Sync_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// QueryServer is the server API for Query service. // QueryServer is the server API for Query service.
// All implementations must embed UnimplementedQueryServer // All implementations must embed UnimplementedQueryServer
// for forward compatibility // for forward compatibility
@ -79,8 +67,6 @@ type QueryServer interface {
Params(context.Context, *QueryRequest) (*QueryParamsResponse, error) Params(context.Context, *QueryRequest) (*QueryParamsResponse, error)
// Resolve queries the DID document by its id. // Resolve queries the DID document by its id.
Resolve(context.Context, *QueryRequest) (*QueryResolveResponse, error) Resolve(context.Context, *QueryRequest) (*QueryResolveResponse, error)
// Sync queries the DID document by its id. And returns the required PKL information
Sync(context.Context, *SyncRequest) (*SyncResponse, error)
mustEmbedUnimplementedQueryServer() mustEmbedUnimplementedQueryServer()
} }
@ -94,9 +80,6 @@ func (UnimplementedQueryServer) Params(context.Context, *QueryRequest) (*QueryPa
func (UnimplementedQueryServer) Resolve(context.Context, *QueryRequest) (*QueryResolveResponse, error) { func (UnimplementedQueryServer) Resolve(context.Context, *QueryRequest) (*QueryResolveResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Resolve not implemented") return nil, status.Errorf(codes.Unimplemented, "method Resolve not implemented")
} }
func (UnimplementedQueryServer) Sync(context.Context, *SyncRequest) (*SyncResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Sync not implemented")
}
func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {}
// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. // UnsafeQueryServer may be embedded to opt out of forward compatibility for this service.
@ -146,24 +129,6 @@ func _Query_Resolve_Handler(srv interface{}, ctx context.Context, dec func(inter
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _Query_Sync_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SyncRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).Sync(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_Sync_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).Sync(ctx, req.(*SyncRequest))
}
return interceptor(ctx, in, info, handler)
}
// Query_ServiceDesc is the grpc.ServiceDesc for Query service. // Query_ServiceDesc is the grpc.ServiceDesc for Query service.
// It's only intended for direct use with grpc.RegisterService, // It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy) // and not to be introspected or modified (even as a copy)
@ -179,10 +144,6 @@ var Query_ServiceDesc = grpc.ServiceDesc{
MethodName: "Resolve", MethodName: "Resolve",
Handler: _Query_Resolve_Handler, Handler: _Query_Resolve_Handler,
}, },
{
MethodName: "Sync",
Handler: _Query_Sync_Handler,
},
}, },
Streams: []grpc.StreamDesc{}, Streams: []grpc.StreamDesc{},
Metadata: "did/v1/query.proto", Metadata: "did/v1/query.proto",

View File

@ -168,12 +168,14 @@ func NewAliasTable(db ormtable.Schema) (AliasTable, error) {
type ControllerTable interface { type ControllerTable interface {
Insert(ctx context.Context, controller *Controller) error Insert(ctx context.Context, controller *Controller) error
InsertReturningNumber(ctx context.Context, controller *Controller) (uint64, error)
LastInsertedSequence(ctx context.Context) (uint64, error)
Update(ctx context.Context, controller *Controller) error Update(ctx context.Context, controller *Controller) error
Save(ctx context.Context, controller *Controller) error Save(ctx context.Context, controller *Controller) error
Delete(ctx context.Context, controller *Controller) error Delete(ctx context.Context, controller *Controller) error
Has(ctx context.Context, id string) (found bool, err error) Has(ctx context.Context, number uint64) (found bool, err error)
// Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. // Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
Get(ctx context.Context, id string) (*Controller, error) Get(ctx context.Context, number uint64) (*Controller, error)
HasBySonrAddress(ctx context.Context, sonr_address string) (found bool, err error) HasBySonrAddress(ctx context.Context, sonr_address string) (found bool, err error)
// GetBySonrAddress returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. // GetBySonrAddress returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
GetBySonrAddress(ctx context.Context, sonr_address string) (*Controller, error) GetBySonrAddress(ctx context.Context, sonr_address string) (*Controller, error)
@ -183,12 +185,9 @@ type ControllerTable interface {
HasByBtcAddress(ctx context.Context, btc_address string) (found bool, err error) HasByBtcAddress(ctx context.Context, btc_address string) (found bool, err error)
// GetByBtcAddress returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. // GetByBtcAddress returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
GetByBtcAddress(ctx context.Context, btc_address string) (*Controller, error) GetByBtcAddress(ctx context.Context, btc_address string) (*Controller, error)
HasByVaultCid(ctx context.Context, vault_cid string) (found bool, err error) HasByDid(ctx context.Context, did string) (found bool, err error)
// GetByVaultCid returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. // GetByDid returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
GetByVaultCid(ctx context.Context, vault_cid string) (*Controller, error) GetByDid(ctx context.Context, did string) (*Controller, error)
HasByStatusVaultCid(ctx context.Context, status string, vault_cid string) (found bool, err error)
// GetByStatusVaultCid returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
GetByStatusVaultCid(ctx context.Context, status string, vault_cid string) (*Controller, error)
List(ctx context.Context, prefixKey ControllerIndexKey, opts ...ormlist.Option) (ControllerIterator, error) List(ctx context.Context, prefixKey ControllerIndexKey, opts ...ormlist.Option) (ControllerIterator, error)
ListRange(ctx context.Context, from, to ControllerIndexKey, opts ...ormlist.Option) (ControllerIterator, error) ListRange(ctx context.Context, from, to ControllerIndexKey, opts ...ormlist.Option) (ControllerIterator, error)
DeleteBy(ctx context.Context, prefixKey ControllerIndexKey) error DeleteBy(ctx context.Context, prefixKey ControllerIndexKey) error
@ -214,18 +213,18 @@ type ControllerIndexKey interface {
} }
// primary key starting index.. // primary key starting index..
type ControllerPrimaryKey = ControllerIdIndexKey type ControllerPrimaryKey = ControllerNumberIndexKey
type ControllerIdIndexKey struct { type ControllerNumberIndexKey struct {
vs []interface{} vs []interface{}
} }
func (x ControllerIdIndexKey) id() uint32 { return 0 } func (x ControllerNumberIndexKey) id() uint32 { return 0 }
func (x ControllerIdIndexKey) values() []interface{} { return x.vs } func (x ControllerNumberIndexKey) values() []interface{} { return x.vs }
func (x ControllerIdIndexKey) controllerIndexKey() {} func (x ControllerNumberIndexKey) controllerIndexKey() {}
func (this ControllerIdIndexKey) WithId(id string) ControllerIdIndexKey { func (this ControllerNumberIndexKey) WithNumber(number uint64) ControllerNumberIndexKey {
this.vs = []interface{}{id} this.vs = []interface{}{number}
return this return this
} }
@ -268,39 +267,21 @@ func (this ControllerBtcAddressIndexKey) WithBtcAddress(btc_address string) Cont
return this return this
} }
type ControllerVaultCidIndexKey struct { type ControllerDidIndexKey struct {
vs []interface{} vs []interface{}
} }
func (x ControllerVaultCidIndexKey) id() uint32 { return 4 } func (x ControllerDidIndexKey) id() uint32 { return 4 }
func (x ControllerVaultCidIndexKey) values() []interface{} { return x.vs } func (x ControllerDidIndexKey) values() []interface{} { return x.vs }
func (x ControllerVaultCidIndexKey) controllerIndexKey() {} func (x ControllerDidIndexKey) controllerIndexKey() {}
func (this ControllerVaultCidIndexKey) WithVaultCid(vault_cid string) ControllerVaultCidIndexKey { func (this ControllerDidIndexKey) WithDid(did string) ControllerDidIndexKey {
this.vs = []interface{}{vault_cid} this.vs = []interface{}{did}
return this
}
type ControllerStatusVaultCidIndexKey struct {
vs []interface{}
}
func (x ControllerStatusVaultCidIndexKey) id() uint32 { return 5 }
func (x ControllerStatusVaultCidIndexKey) values() []interface{} { return x.vs }
func (x ControllerStatusVaultCidIndexKey) controllerIndexKey() {}
func (this ControllerStatusVaultCidIndexKey) WithStatus(status string) ControllerStatusVaultCidIndexKey {
this.vs = []interface{}{status}
return this
}
func (this ControllerStatusVaultCidIndexKey) WithStatusVaultCid(status string, vault_cid string) ControllerStatusVaultCidIndexKey {
this.vs = []interface{}{status, vault_cid}
return this return this
} }
type controllerTable struct { type controllerTable struct {
table ormtable.Table table ormtable.AutoIncrementTable
} }
func (this controllerTable) Insert(ctx context.Context, controller *Controller) error { func (this controllerTable) Insert(ctx context.Context, controller *Controller) error {
@ -319,13 +300,21 @@ func (this controllerTable) Delete(ctx context.Context, controller *Controller)
return this.table.Delete(ctx, controller) return this.table.Delete(ctx, controller)
} }
func (this controllerTable) Has(ctx context.Context, id string) (found bool, err error) { func (this controllerTable) InsertReturningNumber(ctx context.Context, controller *Controller) (uint64, error) {
return this.table.PrimaryKey().Has(ctx, id) return this.table.InsertReturningPKey(ctx, controller)
} }
func (this controllerTable) Get(ctx context.Context, id string) (*Controller, error) { func (this controllerTable) LastInsertedSequence(ctx context.Context) (uint64, error) {
return this.table.LastInsertedSequence(ctx)
}
func (this controllerTable) Has(ctx context.Context, number uint64) (found bool, err error) {
return this.table.PrimaryKey().Has(ctx, number)
}
func (this controllerTable) Get(ctx context.Context, number uint64) (*Controller, error) {
var controller Controller var controller Controller
found, err := this.table.PrimaryKey().Get(ctx, &controller, id) found, err := this.table.PrimaryKey().Get(ctx, &controller, number)
if err != nil { if err != nil {
return nil, err return nil, err
} }
@ -395,38 +384,16 @@ func (this controllerTable) GetByBtcAddress(ctx context.Context, btc_address str
return &controller, nil return &controller, nil
} }
func (this controllerTable) HasByVaultCid(ctx context.Context, vault_cid string) (found bool, err error) { func (this controllerTable) HasByDid(ctx context.Context, did string) (found bool, err error) {
return this.table.GetIndexByID(4).(ormtable.UniqueIndex).Has(ctx, return this.table.GetIndexByID(4).(ormtable.UniqueIndex).Has(ctx,
vault_cid, did,
) )
} }
func (this controllerTable) GetByVaultCid(ctx context.Context, vault_cid string) (*Controller, error) { func (this controllerTable) GetByDid(ctx context.Context, did string) (*Controller, error) {
var controller Controller var controller Controller
found, err := this.table.GetIndexByID(4).(ormtable.UniqueIndex).Get(ctx, &controller, found, err := this.table.GetIndexByID(4).(ormtable.UniqueIndex).Get(ctx, &controller,
vault_cid, did,
)
if err != nil {
return nil, err
}
if !found {
return nil, ormerrors.NotFound
}
return &controller, nil
}
func (this controllerTable) HasByStatusVaultCid(ctx context.Context, status string, vault_cid string) (found bool, err error) {
return this.table.GetIndexByID(5).(ormtable.UniqueIndex).Has(ctx,
status,
vault_cid,
)
}
func (this controllerTable) GetByStatusVaultCid(ctx context.Context, status string, vault_cid string) (*Controller, error) {
var controller Controller
found, err := this.table.GetIndexByID(5).(ormtable.UniqueIndex).Get(ctx, &controller,
status,
vault_cid,
) )
if err != nil { if err != nil {
return nil, err return nil, err
@ -464,7 +431,7 @@ func NewControllerTable(db ormtable.Schema) (ControllerTable, error) {
if table == nil { if table == nil {
return nil, ormerrors.TableNotFound.Wrap(string((&Controller{}).ProtoReflect().Descriptor().FullName())) return nil, ormerrors.TableNotFound.Wrap(string((&Controller{}).ProtoReflect().Descriptor().FullName()))
} }
return controllerTable{table}, nil return controllerTable{table.(ormtable.AutoIncrementTable)}, nil
} }
type VerificationTable interface { type VerificationTable interface {
@ -472,9 +439,9 @@ type VerificationTable interface {
Update(ctx context.Context, verification *Verification) error Update(ctx context.Context, verification *Verification) error
Save(ctx context.Context, verification *Verification) error Save(ctx context.Context, verification *Verification) error
Delete(ctx context.Context, verification *Verification) error Delete(ctx context.Context, verification *Verification) error
Has(ctx context.Context, id string) (found bool, err error) Has(ctx context.Context, did string) (found bool, err error)
// Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. // Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
Get(ctx context.Context, id string) (*Verification, error) Get(ctx context.Context, did string) (*Verification, error)
HasByIssuerSubject(ctx context.Context, issuer string, subject string) (found bool, err error) HasByIssuerSubject(ctx context.Context, issuer string, subject string) (found bool, err error)
// GetByIssuerSubject returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found. // GetByIssuerSubject returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
GetByIssuerSubject(ctx context.Context, issuer string, subject string) (*Verification, error) GetByIssuerSubject(ctx context.Context, issuer string, subject string) (*Verification, error)
@ -509,18 +476,18 @@ type VerificationIndexKey interface {
} }
// primary key starting index.. // primary key starting index..
type VerificationPrimaryKey = VerificationIdIndexKey type VerificationPrimaryKey = VerificationDidIndexKey
type VerificationIdIndexKey struct { type VerificationDidIndexKey struct {
vs []interface{} vs []interface{}
} }
func (x VerificationIdIndexKey) id() uint32 { return 0 } func (x VerificationDidIndexKey) id() uint32 { return 0 }
func (x VerificationIdIndexKey) values() []interface{} { return x.vs } func (x VerificationDidIndexKey) values() []interface{} { return x.vs }
func (x VerificationIdIndexKey) verificationIndexKey() {} func (x VerificationDidIndexKey) verificationIndexKey() {}
func (this VerificationIdIndexKey) WithId(id string) VerificationIdIndexKey { func (this VerificationDidIndexKey) WithDid(did string) VerificationDidIndexKey {
this.vs = []interface{}{id} this.vs = []interface{}{did}
return this return this
} }
@ -608,13 +575,13 @@ func (this verificationTable) Delete(ctx context.Context, verification *Verifica
return this.table.Delete(ctx, verification) return this.table.Delete(ctx, verification)
} }
func (this verificationTable) Has(ctx context.Context, id string) (found bool, err error) { func (this verificationTable) Has(ctx context.Context, did string) (found bool, err error) {
return this.table.PrimaryKey().Has(ctx, id) return this.table.PrimaryKey().Has(ctx, did)
} }
func (this verificationTable) Get(ctx context.Context, id string) (*Verification, error) { func (this verificationTable) Get(ctx context.Context, did string) (*Verification, error) {
var verification Verification var verification Verification
found, err := this.table.PrimaryKey().Get(ctx, &verification, id) found, err := this.table.PrimaryKey().Get(ctx, &verification, did)
if err != nil { if err != nil {
return nil, err return nil, err
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -19,7 +19,6 @@ import (
const _ = grpc.SupportPackageIsVersion7 const _ = grpc.SupportPackageIsVersion7
const ( const (
Msg_AllocateVault_FullMethodName = "/did.v1.Msg/AllocateVault"
Msg_AuthorizeService_FullMethodName = "/did.v1.Msg/AuthorizeService" Msg_AuthorizeService_FullMethodName = "/did.v1.Msg/AuthorizeService"
Msg_ExecuteTx_FullMethodName = "/did.v1.Msg/ExecuteTx" Msg_ExecuteTx_FullMethodName = "/did.v1.Msg/ExecuteTx"
Msg_RegisterController_FullMethodName = "/did.v1.Msg/RegisterController" Msg_RegisterController_FullMethodName = "/did.v1.Msg/RegisterController"
@ -31,16 +30,17 @@ const (
// //
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. // For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type MsgClient interface { type MsgClient interface {
// AllocateVault assembles a sqlite3 database in a local directory and returns the CID of the database. // AuthorizeService asserts the given controller is the owner of the given
// this operation is called by services initiating a controller registration. // address.
AllocateVault(ctx context.Context, in *MsgAllocateVault, opts ...grpc.CallOption) (*MsgAllocateVaultResponse, error)
// AuthorizeService asserts the given controller is the owner of the given address.
AuthorizeService(ctx context.Context, in *MsgAuthorizeService, opts ...grpc.CallOption) (*MsgAuthorizeServiceResponse, error) AuthorizeService(ctx context.Context, in *MsgAuthorizeService, opts ...grpc.CallOption) (*MsgAuthorizeServiceResponse, error)
// ExecuteTx executes a transaction on the Sonr Blockchain. It leverages Macaroon for verification. // ExecuteTx executes a transaction on the Sonr Blockchain. It leverages
// Macaroon for verification.
ExecuteTx(ctx context.Context, in *MsgExecuteTx, opts ...grpc.CallOption) (*MsgExecuteTxResponse, error) ExecuteTx(ctx context.Context, in *MsgExecuteTx, opts ...grpc.CallOption) (*MsgExecuteTxResponse, error)
// RegisterController initializes a controller with the given authentication set, address, cid, publicKey, and user-defined alias. // RegisterController initializes a controller with the given authentication
// set, address, cid, publicKey, and user-defined alias.
RegisterController(ctx context.Context, in *MsgRegisterController, opts ...grpc.CallOption) (*MsgRegisterControllerResponse, error) RegisterController(ctx context.Context, in *MsgRegisterController, opts ...grpc.CallOption) (*MsgRegisterControllerResponse, error)
// RegisterService initializes a Service with a given permission scope and URI. The domain must have a valid TXT record containing the public key. // RegisterService initializes a Service with a given permission scope and
// URI. The domain must have a valid TXT record containing the public key.
RegisterService(ctx context.Context, in *MsgRegisterService, opts ...grpc.CallOption) (*MsgRegisterServiceResponse, error) RegisterService(ctx context.Context, in *MsgRegisterService, opts ...grpc.CallOption) (*MsgRegisterServiceResponse, error)
// UpdateParams defines a governance operation for updating the parameters. // UpdateParams defines a governance operation for updating the parameters.
UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error)
@ -54,15 +54,6 @@ func NewMsgClient(cc grpc.ClientConnInterface) MsgClient {
return &msgClient{cc} return &msgClient{cc}
} }
func (c *msgClient) AllocateVault(ctx context.Context, in *MsgAllocateVault, opts ...grpc.CallOption) (*MsgAllocateVaultResponse, error) {
out := new(MsgAllocateVaultResponse)
err := c.cc.Invoke(ctx, Msg_AllocateVault_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *msgClient) AuthorizeService(ctx context.Context, in *MsgAuthorizeService, opts ...grpc.CallOption) (*MsgAuthorizeServiceResponse, error) { func (c *msgClient) AuthorizeService(ctx context.Context, in *MsgAuthorizeService, opts ...grpc.CallOption) (*MsgAuthorizeServiceResponse, error) {
out := new(MsgAuthorizeServiceResponse) out := new(MsgAuthorizeServiceResponse)
err := c.cc.Invoke(ctx, Msg_AuthorizeService_FullMethodName, in, out, opts...) err := c.cc.Invoke(ctx, Msg_AuthorizeService_FullMethodName, in, out, opts...)
@ -112,16 +103,17 @@ func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts
// All implementations must embed UnimplementedMsgServer // All implementations must embed UnimplementedMsgServer
// for forward compatibility // for forward compatibility
type MsgServer interface { type MsgServer interface {
// AllocateVault assembles a sqlite3 database in a local directory and returns the CID of the database. // AuthorizeService asserts the given controller is the owner of the given
// this operation is called by services initiating a controller registration. // address.
AllocateVault(context.Context, *MsgAllocateVault) (*MsgAllocateVaultResponse, error)
// AuthorizeService asserts the given controller is the owner of the given address.
AuthorizeService(context.Context, *MsgAuthorizeService) (*MsgAuthorizeServiceResponse, error) AuthorizeService(context.Context, *MsgAuthorizeService) (*MsgAuthorizeServiceResponse, error)
// ExecuteTx executes a transaction on the Sonr Blockchain. It leverages Macaroon for verification. // ExecuteTx executes a transaction on the Sonr Blockchain. It leverages
// Macaroon for verification.
ExecuteTx(context.Context, *MsgExecuteTx) (*MsgExecuteTxResponse, error) ExecuteTx(context.Context, *MsgExecuteTx) (*MsgExecuteTxResponse, error)
// RegisterController initializes a controller with the given authentication set, address, cid, publicKey, and user-defined alias. // RegisterController initializes a controller with the given authentication
// set, address, cid, publicKey, and user-defined alias.
RegisterController(context.Context, *MsgRegisterController) (*MsgRegisterControllerResponse, error) RegisterController(context.Context, *MsgRegisterController) (*MsgRegisterControllerResponse, error)
// RegisterService initializes a Service with a given permission scope and URI. The domain must have a valid TXT record containing the public key. // RegisterService initializes a Service with a given permission scope and
// URI. The domain must have a valid TXT record containing the public key.
RegisterService(context.Context, *MsgRegisterService) (*MsgRegisterServiceResponse, error) RegisterService(context.Context, *MsgRegisterService) (*MsgRegisterServiceResponse, error)
// UpdateParams defines a governance operation for updating the parameters. // UpdateParams defines a governance operation for updating the parameters.
UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error)
@ -132,9 +124,6 @@ type MsgServer interface {
type UnimplementedMsgServer struct { type UnimplementedMsgServer struct {
} }
func (UnimplementedMsgServer) AllocateVault(context.Context, *MsgAllocateVault) (*MsgAllocateVaultResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method AllocateVault not implemented")
}
func (UnimplementedMsgServer) AuthorizeService(context.Context, *MsgAuthorizeService) (*MsgAuthorizeServiceResponse, error) { func (UnimplementedMsgServer) AuthorizeService(context.Context, *MsgAuthorizeService) (*MsgAuthorizeServiceResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method AuthorizeService not implemented") return nil, status.Errorf(codes.Unimplemented, "method AuthorizeService not implemented")
} }
@ -163,24 +152,6 @@ func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) {
s.RegisterService(&Msg_ServiceDesc, srv) s.RegisterService(&Msg_ServiceDesc, srv)
} }
func _Msg_AllocateVault_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgAllocateVault)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).AllocateVault(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_AllocateVault_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).AllocateVault(ctx, req.(*MsgAllocateVault))
}
return interceptor(ctx, in, info, handler)
}
func _Msg_AuthorizeService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _Msg_AuthorizeService_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgAuthorizeService) in := new(MsgAuthorizeService)
if err := dec(in); err != nil { if err := dec(in); err != nil {
@ -278,10 +249,6 @@ var Msg_ServiceDesc = grpc.ServiceDesc{
ServiceName: "did.v1.Msg", ServiceName: "did.v1.Msg",
HandlerType: (*MsgServer)(nil), HandlerType: (*MsgServer)(nil),
Methods: []grpc.MethodDesc{ Methods: []grpc.MethodDesc{
{
MethodName: "AllocateVault",
Handler: _Msg_AllocateVault_Handler,
},
{ {
MethodName: "AuthorizeService", MethodName: "AuthorizeService",
Handler: _Msg_AuthorizeService_Handler, Handler: _Msg_AuthorizeService_Handler,

View File

@ -0,0 +1,499 @@
// Code generated by protoc-gen-go-pulsar. DO NOT EDIT.
package modulev1
import (
_ "cosmossdk.io/api/cosmos/app/v1alpha1"
fmt "fmt"
runtime "github.com/cosmos/cosmos-proto/runtime"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoiface "google.golang.org/protobuf/runtime/protoiface"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
io "io"
reflect "reflect"
sync "sync"
)
var (
md_Module protoreflect.MessageDescriptor
)
func init() {
file_vault_module_v1_module_proto_init()
md_Module = File_vault_module_v1_module_proto.Messages().ByName("Module")
}
var _ protoreflect.Message = (*fastReflection_Module)(nil)
type fastReflection_Module Module
func (x *Module) ProtoReflect() protoreflect.Message {
return (*fastReflection_Module)(x)
}
func (x *Module) slowProtoReflect() protoreflect.Message {
mi := &file_vault_module_v1_module_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
var _fastReflection_Module_messageType fastReflection_Module_messageType
var _ protoreflect.MessageType = fastReflection_Module_messageType{}
type fastReflection_Module_messageType struct{}
func (x fastReflection_Module_messageType) Zero() protoreflect.Message {
return (*fastReflection_Module)(nil)
}
func (x fastReflection_Module_messageType) New() protoreflect.Message {
return new(fastReflection_Module)
}
func (x fastReflection_Module_messageType) Descriptor() protoreflect.MessageDescriptor {
return md_Module
}
// Descriptor returns message descriptor, which contains only the protobuf
// type information for the message.
func (x *fastReflection_Module) Descriptor() protoreflect.MessageDescriptor {
return md_Module
}
// Type returns the message type, which encapsulates both Go and protobuf
// type information. If the Go type information is not needed,
// it is recommended that the message descriptor be used instead.
func (x *fastReflection_Module) Type() protoreflect.MessageType {
return _fastReflection_Module_messageType
}
// New returns a newly allocated and mutable empty message.
func (x *fastReflection_Module) New() protoreflect.Message {
return new(fastReflection_Module)
}
// Interface unwraps the message reflection interface and
// returns the underlying ProtoMessage interface.
func (x *fastReflection_Module) Interface() protoreflect.ProtoMessage {
return (*Module)(x)
}
// Range iterates over every populated field in an undefined order,
// calling f for each field descriptor and value encountered.
// Range returns immediately if f returns false.
// While iterating, mutating operations may only be performed
// on the current field descriptor.
func (x *fastReflection_Module) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
}
// Has reports whether a field is populated.
//
// Some fields have the property of nullability where it is possible to
// distinguish between the default value of a field and whether the field
// was explicitly populated with the default value. Singular message fields,
// member fields of a oneof, and proto2 scalar fields are nullable. Such
// fields are populated only if explicitly set.
//
// In other cases (aside from the nullable cases above),
// a proto3 scalar field is populated if it contains a non-zero value, and
// a repeated field is populated if it is non-empty.
func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool {
switch fd.FullName() {
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.module.v1.Module"))
}
panic(fmt.Errorf("message vault.module.v1.Module does not contain field %s", fd.FullName()))
}
}
// Clear clears the field such that a subsequent Has call reports false.
//
// Clearing an extension field clears both the extension type and value
// associated with the given field number.
//
// Clear is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) {
switch fd.FullName() {
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.module.v1.Module"))
}
panic(fmt.Errorf("message vault.module.v1.Module does not contain field %s", fd.FullName()))
}
}
// Get retrieves the value for a field.
//
// For unpopulated scalars, it returns the default value, where
// the default value of a bytes scalar is guaranteed to be a copy.
// For unpopulated composite types, it returns an empty, read-only view
// of the value; to obtain a mutable reference, use Mutable.
func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
switch descriptor.FullName() {
default:
if descriptor.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.module.v1.Module"))
}
panic(fmt.Errorf("message vault.module.v1.Module does not contain field %s", descriptor.FullName()))
}
}
// Set stores the value for a field.
//
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType.
// When setting a composite type, it is unspecified whether the stored value
// aliases the source's memory in any way. If the composite value is an
// empty, read-only value, then it panics.
//
// Set is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
switch fd.FullName() {
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.module.v1.Module"))
}
panic(fmt.Errorf("message vault.module.v1.Module does not contain field %s", fd.FullName()))
}
}
// Mutable returns a mutable reference to a composite type.
//
// If the field is unpopulated, it may allocate a composite value.
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType
// if not already stored.
// It panics if the field does not contain a composite type.
//
// Mutable is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.module.v1.Module"))
}
panic(fmt.Errorf("message vault.module.v1.Module does not contain field %s", fd.FullName()))
}
}
// NewField returns a new value that is assignable to the field
// for the given descriptor. For scalars, this returns the default value.
// For lists, maps, and messages, this returns a new, empty, mutable value.
func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.module.v1.Module"))
}
panic(fmt.Errorf("message vault.module.v1.Module does not contain field %s", fd.FullName()))
}
}
// WhichOneof reports which field within the oneof is populated,
// returning nil if none are populated.
// It panics if the oneof descriptor does not belong to this message.
func (x *fastReflection_Module) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
switch d.FullName() {
default:
panic(fmt.Errorf("%s is not a oneof field in vault.module.v1.Module", d.FullName()))
}
panic("unreachable")
}
// GetUnknown retrieves the entire list of unknown fields.
// The caller may only mutate the contents of the RawFields
// if the mutated bytes are stored back into the message with SetUnknown.
func (x *fastReflection_Module) GetUnknown() protoreflect.RawFields {
return x.unknownFields
}
// SetUnknown stores an entire list of unknown fields.
// The raw fields must be syntactically valid according to the wire format.
// An implementation may panic if this is not the case.
// Once stored, the caller must not mutate the content of the RawFields.
// An empty RawFields may be passed to clear the fields.
//
// SetUnknown is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_Module) SetUnknown(fields protoreflect.RawFields) {
x.unknownFields = fields
}
// IsValid reports whether the message is valid.
//
// An invalid message is an empty, read-only value.
//
// An invalid message often corresponds to a nil pointer of the concrete
// message type, but the details are implementation dependent.
// Validity is not part of the protobuf data model, and may not
// be preserved in marshaling or other operations.
func (x *fastReflection_Module) IsValid() bool {
return x != nil
}
// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations.
// This method may return nil.
//
// The returned methods type is identical to
// "google.golang.org/protobuf/runtime/protoiface".Methods.
// Consult the protoiface package documentation for details.
func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods {
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
x := input.Message.Interface().(*Module)
if x == nil {
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: 0,
}
}
options := runtime.SizeInputToOptions(input)
_ = options
var n int
var l int
_ = l
if x.unknownFields != nil {
n += len(x.unknownFields)
}
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: n,
}
}
marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) {
x := input.Message.Interface().(*Module)
if x == nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
options := runtime.MarshalInputToOptions(input)
_ = options
size := options.Size(x)
dAtA := make([]byte, size)
i := len(dAtA)
_ = i
var l int
_ = l
if x.unknownFields != nil {
i -= len(x.unknownFields)
copy(dAtA[i:], x.unknownFields)
}
if input.Buf != nil {
input.Buf = append(input.Buf, dAtA...)
} else {
input.Buf = dAtA
}
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) {
x := input.Message.Interface().(*Module)
if x == nil {
return protoiface.UnmarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Flags: input.Flags,
}, nil
}
options := runtime.UnmarshalInputToOptions(input)
_ = options
dAtA := input.Buf
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: wiretype end group for non-group")
}
if fieldNum <= 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Module: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
default:
iNdEx = preIndex
skippy, err := runtime.Skip(dAtA[iNdEx:])
if err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if (iNdEx + skippy) > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
if !options.DiscardUnknown {
x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
}
iNdEx += skippy
}
}
if iNdEx > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil
}
return &protoiface.Methods{
NoUnkeyedLiterals: struct{}{},
Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown,
Size: size,
Marshal: marshal,
Unmarshal: unmarshal,
Merge: nil,
CheckInitialized: nil,
}
}
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.0
// protoc (unknown)
// source: vault/module/v1/module.proto
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// Module is the app config object of the module.
// Learn more: https://docs.cosmos.network/main/building-modules/depinject
type Module struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *Module) Reset() {
*x = Module{}
if protoimpl.UnsafeEnabled {
mi := &file_vault_module_v1_module_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Module) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Module) ProtoMessage() {}
// Deprecated: Use Module.ProtoReflect.Descriptor instead.
func (*Module) Descriptor() ([]byte, []int) {
return file_vault_module_v1_module_proto_rawDescGZIP(), []int{0}
}
var File_vault_module_v1_module_proto protoreflect.FileDescriptor
var file_vault_module_v1_module_proto_rawDesc = []byte{
0x0a, 0x1c, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76,
0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0f,
0x76, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a,
0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c,
0x70, 0x68, 0x61, 0x31, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x22, 0x28, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x1e, 0xba, 0xc0, 0x96,
0xda, 0x01, 0x18, 0x0a, 0x16, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
0x6f, 0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x42, 0xb5, 0x01, 0x0a, 0x13,
0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65,
0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f,
0x50, 0x01, 0x5a, 0x33, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f,
0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76,
0x61, 0x75, 0x6c, 0x74, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x6d,
0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x56, 0x4d, 0x58, 0xaa, 0x02, 0x0f,
0x56, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca,
0x02, 0x0f, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56,
0x31, 0xe2, 0x02, 0x1b, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65,
0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea,
0x02, 0x11, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a,
0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_vault_module_v1_module_proto_rawDescOnce sync.Once
file_vault_module_v1_module_proto_rawDescData = file_vault_module_v1_module_proto_rawDesc
)
func file_vault_module_v1_module_proto_rawDescGZIP() []byte {
file_vault_module_v1_module_proto_rawDescOnce.Do(func() {
file_vault_module_v1_module_proto_rawDescData = protoimpl.X.CompressGZIP(file_vault_module_v1_module_proto_rawDescData)
})
return file_vault_module_v1_module_proto_rawDescData
}
var file_vault_module_v1_module_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_vault_module_v1_module_proto_goTypes = []interface{}{
(*Module)(nil), // 0: vault.module.v1.Module
}
var file_vault_module_v1_module_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_vault_module_v1_module_proto_init() }
func file_vault_module_v1_module_proto_init() {
if File_vault_module_v1_module_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_vault_module_v1_module_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Module); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_vault_module_v1_module_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_vault_module_v1_module_proto_goTypes,
DependencyIndexes: file_vault_module_v1_module_proto_depIdxs,
MessageInfos: file_vault_module_v1_module_proto_msgTypes,
}.Build()
File_vault_module_v1_module_proto = out.File
file_vault_module_v1_module_proto_rawDesc = nil
file_vault_module_v1_module_proto_goTypes = nil
file_vault_module_v1_module_proto_depIdxs = nil
}

File diff suppressed because it is too large Load Diff

3881
api/vault/v1/query.pulsar.go Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,191 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc (unknown)
// source: vault/v1/query.proto
package vaultv1
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
const (
Query_Params_FullMethodName = "/vault.v1.Query/Params"
Query_BuildTx_FullMethodName = "/vault.v1.Query/BuildTx"
Query_Sync_FullMethodName = "/vault.v1.Query/Sync"
)
// QueryClient is the client API for Query service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type QueryClient interface {
// Params queries all parameters of the module.
Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error)
// BuildTx builds an unsigned transaction message for the given PKL.
BuildTx(ctx context.Context, in *BuildTxRequest, opts ...grpc.CallOption) (*BuildTxResponse, error)
// Sync queries the DID document by its id. And returns the required PKL
// information
Sync(ctx context.Context, in *SyncRequest, opts ...grpc.CallOption) (*SyncResponse, error)
}
type queryClient struct {
cc grpc.ClientConnInterface
}
func NewQueryClient(cc grpc.ClientConnInterface) QueryClient {
return &queryClient{cc}
}
func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) {
out := new(QueryParamsResponse)
err := c.cc.Invoke(ctx, Query_Params_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) BuildTx(ctx context.Context, in *BuildTxRequest, opts ...grpc.CallOption) (*BuildTxResponse, error) {
out := new(BuildTxResponse)
err := c.cc.Invoke(ctx, Query_BuildTx_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *queryClient) Sync(ctx context.Context, in *SyncRequest, opts ...grpc.CallOption) (*SyncResponse, error) {
out := new(SyncResponse)
err := c.cc.Invoke(ctx, Query_Sync_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// QueryServer is the server API for Query service.
// All implementations must embed UnimplementedQueryServer
// for forward compatibility
type QueryServer interface {
// Params queries all parameters of the module.
Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error)
// BuildTx builds an unsigned transaction message for the given PKL.
BuildTx(context.Context, *BuildTxRequest) (*BuildTxResponse, error)
// Sync queries the DID document by its id. And returns the required PKL
// information
Sync(context.Context, *SyncRequest) (*SyncResponse, error)
mustEmbedUnimplementedQueryServer()
}
// UnimplementedQueryServer must be embedded to have forward compatible implementations.
type UnimplementedQueryServer struct {
}
func (UnimplementedQueryServer) Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Params not implemented")
}
func (UnimplementedQueryServer) BuildTx(context.Context, *BuildTxRequest) (*BuildTxResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method BuildTx not implemented")
}
func (UnimplementedQueryServer) Sync(context.Context, *SyncRequest) (*SyncResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Sync not implemented")
}
func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {}
// UnsafeQueryServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to QueryServer will
// result in compilation errors.
type UnsafeQueryServer interface {
mustEmbedUnimplementedQueryServer()
}
func RegisterQueryServer(s grpc.ServiceRegistrar, srv QueryServer) {
s.RegisterService(&Query_ServiceDesc, srv)
}
func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(QueryParamsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).Params(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_Params_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_BuildTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(BuildTxRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).BuildTx(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_BuildTx_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).BuildTx(ctx, req.(*BuildTxRequest))
}
return interceptor(ctx, in, info, handler)
}
func _Query_Sync_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SyncRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(QueryServer).Sync(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Query_Sync_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(QueryServer).Sync(ctx, req.(*SyncRequest))
}
return interceptor(ctx, in, info, handler)
}
// Query_ServiceDesc is the grpc.ServiceDesc for Query service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Query_ServiceDesc = grpc.ServiceDesc{
ServiceName: "vault.v1.Query",
HandlerType: (*QueryServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Params",
Handler: _Query_Params_Handler,
},
{
MethodName: "BuildTx",
Handler: _Query_BuildTx_Handler,
},
{
MethodName: "Sync",
Handler: _Query_Sync_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "vault/v1/query.proto",
}

View File

@ -0,0 +1,166 @@
// Code generated by protoc-gen-go-cosmos-orm. DO NOT EDIT.
package vaultv1
import (
context "context"
ormlist "cosmossdk.io/orm/model/ormlist"
ormtable "cosmossdk.io/orm/model/ormtable"
ormerrors "cosmossdk.io/orm/types/ormerrors"
)
type DWNTable interface {
Insert(ctx context.Context, dWN *DWN) error
Update(ctx context.Context, dWN *DWN) error
Save(ctx context.Context, dWN *DWN) error
Delete(ctx context.Context, dWN *DWN) error
Has(ctx context.Context, account []byte) (found bool, err error)
// Get returns nil and an error which responds true to ormerrors.IsNotFound() if the record was not found.
Get(ctx context.Context, account []byte) (*DWN, error)
List(ctx context.Context, prefixKey DWNIndexKey, opts ...ormlist.Option) (DWNIterator, error)
ListRange(ctx context.Context, from, to DWNIndexKey, opts ...ormlist.Option) (DWNIterator, error)
DeleteBy(ctx context.Context, prefixKey DWNIndexKey) error
DeleteRange(ctx context.Context, from, to DWNIndexKey) error
doNotImplement()
}
type DWNIterator struct {
ormtable.Iterator
}
func (i DWNIterator) Value() (*DWN, error) {
var dWN DWN
err := i.UnmarshalMessage(&dWN)
return &dWN, err
}
type DWNIndexKey interface {
id() uint32
values() []interface{}
dWNIndexKey()
}
// primary key starting index..
type DWNPrimaryKey = DWNAccountIndexKey
type DWNAccountIndexKey struct {
vs []interface{}
}
func (x DWNAccountIndexKey) id() uint32 { return 0 }
func (x DWNAccountIndexKey) values() []interface{} { return x.vs }
func (x DWNAccountIndexKey) dWNIndexKey() {}
func (this DWNAccountIndexKey) WithAccount(account []byte) DWNAccountIndexKey {
this.vs = []interface{}{account}
return this
}
type DWNAmountIndexKey struct {
vs []interface{}
}
func (x DWNAmountIndexKey) id() uint32 { return 1 }
func (x DWNAmountIndexKey) values() []interface{} { return x.vs }
func (x DWNAmountIndexKey) dWNIndexKey() {}
func (this DWNAmountIndexKey) WithAmount(amount uint64) DWNAmountIndexKey {
this.vs = []interface{}{amount}
return this
}
type dWNTable struct {
table ormtable.Table
}
func (this dWNTable) Insert(ctx context.Context, dWN *DWN) error {
return this.table.Insert(ctx, dWN)
}
func (this dWNTable) Update(ctx context.Context, dWN *DWN) error {
return this.table.Update(ctx, dWN)
}
func (this dWNTable) Save(ctx context.Context, dWN *DWN) error {
return this.table.Save(ctx, dWN)
}
func (this dWNTable) Delete(ctx context.Context, dWN *DWN) error {
return this.table.Delete(ctx, dWN)
}
func (this dWNTable) Has(ctx context.Context, account []byte) (found bool, err error) {
return this.table.PrimaryKey().Has(ctx, account)
}
func (this dWNTable) Get(ctx context.Context, account []byte) (*DWN, error) {
var dWN DWN
found, err := this.table.PrimaryKey().Get(ctx, &dWN, account)
if err != nil {
return nil, err
}
if !found {
return nil, ormerrors.NotFound
}
return &dWN, nil
}
func (this dWNTable) List(ctx context.Context, prefixKey DWNIndexKey, opts ...ormlist.Option) (DWNIterator, error) {
it, err := this.table.GetIndexByID(prefixKey.id()).List(ctx, prefixKey.values(), opts...)
return DWNIterator{it}, err
}
func (this dWNTable) ListRange(ctx context.Context, from, to DWNIndexKey, opts ...ormlist.Option) (DWNIterator, error) {
it, err := this.table.GetIndexByID(from.id()).ListRange(ctx, from.values(), to.values(), opts...)
return DWNIterator{it}, err
}
func (this dWNTable) DeleteBy(ctx context.Context, prefixKey DWNIndexKey) error {
return this.table.GetIndexByID(prefixKey.id()).DeleteBy(ctx, prefixKey.values()...)
}
func (this dWNTable) DeleteRange(ctx context.Context, from, to DWNIndexKey) error {
return this.table.GetIndexByID(from.id()).DeleteRange(ctx, from.values(), to.values())
}
func (this dWNTable) doNotImplement() {}
var _ DWNTable = dWNTable{}
func NewDWNTable(db ormtable.Schema) (DWNTable, error) {
table := db.GetTable(&DWN{})
if table == nil {
return nil, ormerrors.TableNotFound.Wrap(string((&DWN{}).ProtoReflect().Descriptor().FullName()))
}
return dWNTable{table}, nil
}
type StateStore interface {
DWNTable() DWNTable
doNotImplement()
}
type stateStore struct {
dWN DWNTable
}
func (x stateStore) DWNTable() DWNTable {
return x.dWN
}
func (stateStore) doNotImplement() {}
var _ StateStore = stateStore{}
func NewStateStore(db ormtable.Schema) (StateStore, error) {
dWNTable, err := NewDWNTable(db)
if err != nil {
return nil, err
}
return stateStore{
dWNTable,
}, nil
}

View File

@ -0,0 +1,627 @@
// Code generated by protoc-gen-go-pulsar. DO NOT EDIT.
package vaultv1
import (
_ "cosmossdk.io/api/cosmos/orm/v1"
fmt "fmt"
runtime "github.com/cosmos/cosmos-proto/runtime"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoiface "google.golang.org/protobuf/runtime/protoiface"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
io "io"
reflect "reflect"
sync "sync"
)
var (
md_DWN protoreflect.MessageDescriptor
fd_DWN_account protoreflect.FieldDescriptor
fd_DWN_amount protoreflect.FieldDescriptor
)
func init() {
file_vault_v1_state_proto_init()
md_DWN = File_vault_v1_state_proto.Messages().ByName("DWN")
fd_DWN_account = md_DWN.Fields().ByName("account")
fd_DWN_amount = md_DWN.Fields().ByName("amount")
}
var _ protoreflect.Message = (*fastReflection_DWN)(nil)
type fastReflection_DWN DWN
func (x *DWN) ProtoReflect() protoreflect.Message {
return (*fastReflection_DWN)(x)
}
func (x *DWN) slowProtoReflect() protoreflect.Message {
mi := &file_vault_v1_state_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
var _fastReflection_DWN_messageType fastReflection_DWN_messageType
var _ protoreflect.MessageType = fastReflection_DWN_messageType{}
type fastReflection_DWN_messageType struct{}
func (x fastReflection_DWN_messageType) Zero() protoreflect.Message {
return (*fastReflection_DWN)(nil)
}
func (x fastReflection_DWN_messageType) New() protoreflect.Message {
return new(fastReflection_DWN)
}
func (x fastReflection_DWN_messageType) Descriptor() protoreflect.MessageDescriptor {
return md_DWN
}
// Descriptor returns message descriptor, which contains only the protobuf
// type information for the message.
func (x *fastReflection_DWN) Descriptor() protoreflect.MessageDescriptor {
return md_DWN
}
// Type returns the message type, which encapsulates both Go and protobuf
// type information. If the Go type information is not needed,
// it is recommended that the message descriptor be used instead.
func (x *fastReflection_DWN) Type() protoreflect.MessageType {
return _fastReflection_DWN_messageType
}
// New returns a newly allocated and mutable empty message.
func (x *fastReflection_DWN) New() protoreflect.Message {
return new(fastReflection_DWN)
}
// Interface unwraps the message reflection interface and
// returns the underlying ProtoMessage interface.
func (x *fastReflection_DWN) Interface() protoreflect.ProtoMessage {
return (*DWN)(x)
}
// Range iterates over every populated field in an undefined order,
// calling f for each field descriptor and value encountered.
// Range returns immediately if f returns false.
// While iterating, mutating operations may only be performed
// on the current field descriptor.
func (x *fastReflection_DWN) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) {
if len(x.Account) != 0 {
value := protoreflect.ValueOfBytes(x.Account)
if !f(fd_DWN_account, value) {
return
}
}
if x.Amount != uint64(0) {
value := protoreflect.ValueOfUint64(x.Amount)
if !f(fd_DWN_amount, value) {
return
}
}
}
// Has reports whether a field is populated.
//
// Some fields have the property of nullability where it is possible to
// distinguish between the default value of a field and whether the field
// was explicitly populated with the default value. Singular message fields,
// member fields of a oneof, and proto2 scalar fields are nullable. Such
// fields are populated only if explicitly set.
//
// In other cases (aside from the nullable cases above),
// a proto3 scalar field is populated if it contains a non-zero value, and
// a repeated field is populated if it is non-empty.
func (x *fastReflection_DWN) Has(fd protoreflect.FieldDescriptor) bool {
switch fd.FullName() {
case "vault.v1.DWN.account":
return len(x.Account) != 0
case "vault.v1.DWN.amount":
return x.Amount != uint64(0)
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.DWN"))
}
panic(fmt.Errorf("message vault.v1.DWN does not contain field %s", fd.FullName()))
}
}
// Clear clears the field such that a subsequent Has call reports false.
//
// Clearing an extension field clears both the extension type and value
// associated with the given field number.
//
// Clear is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_DWN) Clear(fd protoreflect.FieldDescriptor) {
switch fd.FullName() {
case "vault.v1.DWN.account":
x.Account = nil
case "vault.v1.DWN.amount":
x.Amount = uint64(0)
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.DWN"))
}
panic(fmt.Errorf("message vault.v1.DWN does not contain field %s", fd.FullName()))
}
}
// Get retrieves the value for a field.
//
// For unpopulated scalars, it returns the default value, where
// the default value of a bytes scalar is guaranteed to be a copy.
// For unpopulated composite types, it returns an empty, read-only view
// of the value; to obtain a mutable reference, use Mutable.
func (x *fastReflection_DWN) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value {
switch descriptor.FullName() {
case "vault.v1.DWN.account":
value := x.Account
return protoreflect.ValueOfBytes(value)
case "vault.v1.DWN.amount":
value := x.Amount
return protoreflect.ValueOfUint64(value)
default:
if descriptor.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.DWN"))
}
panic(fmt.Errorf("message vault.v1.DWN does not contain field %s", descriptor.FullName()))
}
}
// Set stores the value for a field.
//
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType.
// When setting a composite type, it is unspecified whether the stored value
// aliases the source's memory in any way. If the composite value is an
// empty, read-only value, then it panics.
//
// Set is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_DWN) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) {
switch fd.FullName() {
case "vault.v1.DWN.account":
x.Account = value.Bytes()
case "vault.v1.DWN.amount":
x.Amount = value.Uint()
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.DWN"))
}
panic(fmt.Errorf("message vault.v1.DWN does not contain field %s", fd.FullName()))
}
}
// Mutable returns a mutable reference to a composite type.
//
// If the field is unpopulated, it may allocate a composite value.
// For a field belonging to a oneof, it implicitly clears any other field
// that may be currently set within the same oneof.
// For extension fields, it implicitly stores the provided ExtensionType
// if not already stored.
// It panics if the field does not contain a composite type.
//
// Mutable is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_DWN) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "vault.v1.DWN.account":
panic(fmt.Errorf("field account of message vault.v1.DWN is not mutable"))
case "vault.v1.DWN.amount":
panic(fmt.Errorf("field amount of message vault.v1.DWN is not mutable"))
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.DWN"))
}
panic(fmt.Errorf("message vault.v1.DWN does not contain field %s", fd.FullName()))
}
}
// NewField returns a new value that is assignable to the field
// for the given descriptor. For scalars, this returns the default value.
// For lists, maps, and messages, this returns a new, empty, mutable value.
func (x *fastReflection_DWN) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value {
switch fd.FullName() {
case "vault.v1.DWN.account":
return protoreflect.ValueOfBytes(nil)
case "vault.v1.DWN.amount":
return protoreflect.ValueOfUint64(uint64(0))
default:
if fd.IsExtension() {
panic(fmt.Errorf("proto3 declared messages do not support extensions: vault.v1.DWN"))
}
panic(fmt.Errorf("message vault.v1.DWN does not contain field %s", fd.FullName()))
}
}
// WhichOneof reports which field within the oneof is populated,
// returning nil if none are populated.
// It panics if the oneof descriptor does not belong to this message.
func (x *fastReflection_DWN) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor {
switch d.FullName() {
default:
panic(fmt.Errorf("%s is not a oneof field in vault.v1.DWN", d.FullName()))
}
panic("unreachable")
}
// GetUnknown retrieves the entire list of unknown fields.
// The caller may only mutate the contents of the RawFields
// if the mutated bytes are stored back into the message with SetUnknown.
func (x *fastReflection_DWN) GetUnknown() protoreflect.RawFields {
return x.unknownFields
}
// SetUnknown stores an entire list of unknown fields.
// The raw fields must be syntactically valid according to the wire format.
// An implementation may panic if this is not the case.
// Once stored, the caller must not mutate the content of the RawFields.
// An empty RawFields may be passed to clear the fields.
//
// SetUnknown is a mutating operation and unsafe for concurrent use.
func (x *fastReflection_DWN) SetUnknown(fields protoreflect.RawFields) {
x.unknownFields = fields
}
// IsValid reports whether the message is valid.
//
// An invalid message is an empty, read-only value.
//
// An invalid message often corresponds to a nil pointer of the concrete
// message type, but the details are implementation dependent.
// Validity is not part of the protobuf data model, and may not
// be preserved in marshaling or other operations.
func (x *fastReflection_DWN) IsValid() bool {
return x != nil
}
// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations.
// This method may return nil.
//
// The returned methods type is identical to
// "google.golang.org/protobuf/runtime/protoiface".Methods.
// Consult the protoiface package documentation for details.
func (x *fastReflection_DWN) ProtoMethods() *protoiface.Methods {
size := func(input protoiface.SizeInput) protoiface.SizeOutput {
x := input.Message.Interface().(*DWN)
if x == nil {
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: 0,
}
}
options := runtime.SizeInputToOptions(input)
_ = options
var n int
var l int
_ = l
l = len(x.Account)
if l > 0 {
n += 1 + l + runtime.Sov(uint64(l))
}
if x.Amount != 0 {
n += 1 + runtime.Sov(uint64(x.Amount))
}
if x.unknownFields != nil {
n += len(x.unknownFields)
}
return protoiface.SizeOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Size: n,
}
}
marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) {
x := input.Message.Interface().(*DWN)
if x == nil {
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
options := runtime.MarshalInputToOptions(input)
_ = options
size := options.Size(x)
dAtA := make([]byte, size)
i := len(dAtA)
_ = i
var l int
_ = l
if x.unknownFields != nil {
i -= len(x.unknownFields)
copy(dAtA[i:], x.unknownFields)
}
if x.Amount != 0 {
i = runtime.EncodeVarint(dAtA, i, uint64(x.Amount))
i--
dAtA[i] = 0x10
}
if len(x.Account) > 0 {
i -= len(x.Account)
copy(dAtA[i:], x.Account)
i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Account)))
i--
dAtA[i] = 0xa
}
if input.Buf != nil {
input.Buf = append(input.Buf, dAtA...)
} else {
input.Buf = dAtA
}
return protoiface.MarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Buf: input.Buf,
}, nil
}
unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) {
x := input.Message.Interface().(*DWN)
if x == nil {
return protoiface.UnmarshalOutput{
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
Flags: input.Flags,
}, nil
}
options := runtime.UnmarshalInputToOptions(input)
_ = options
dAtA := input.Buf
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DWN: wiretype end group for non-group")
}
if fieldNum <= 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DWN: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Account", wireType)
}
var byteLen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
byteLen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if byteLen < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
postIndex := iNdEx + byteLen
if postIndex < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if postIndex > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
x.Account = append(x.Account[:0], dAtA[iNdEx:postIndex]...)
if x.Account == nil {
x.Account = []byte{}
}
iNdEx = postIndex
case 2:
if wireType != 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Amount", wireType)
}
x.Amount = 0
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow
}
if iNdEx >= l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
x.Amount |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
default:
iNdEx = preIndex
skippy, err := runtime.Skip(dAtA[iNdEx:])
if err != nil {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
}
if (skippy < 0) || (iNdEx+skippy) < 0 {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength
}
if (iNdEx + skippy) > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
if !options.DiscardUnknown {
x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...)
}
iNdEx += skippy
}
}
if iNdEx > l {
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
}
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil
}
return &protoiface.Methods{
NoUnkeyedLiterals: struct{}{},
Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown,
Size: size,
Marshal: marshal,
Unmarshal: unmarshal,
Merge: nil,
CheckInitialized: nil,
}
}
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.0
// protoc (unknown)
// source: vault/v1/state.proto
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type DWN struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Account []byte `protobuf:"bytes,1,opt,name=account,proto3" json:"account,omitempty"`
Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"`
}
func (x *DWN) Reset() {
*x = DWN{}
if protoimpl.UnsafeEnabled {
mi := &file_vault_v1_state_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *DWN) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*DWN) ProtoMessage() {}
// Deprecated: Use DWN.ProtoReflect.Descriptor instead.
func (*DWN) Descriptor() ([]byte, []int) {
return file_vault_v1_state_proto_rawDescGZIP(), []int{0}
}
func (x *DWN) GetAccount() []byte {
if x != nil {
return x.Account
}
return nil
}
func (x *DWN) GetAmount() uint64 {
if x != nil {
return x.Amount
}
return 0
}
var File_vault_v1_state_proto protoreflect.FileDescriptor
var file_vault_v1_state_proto_rawDesc = []byte{
0x0a, 0x14, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x74, 0x61, 0x74, 0x65,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x76, 0x31,
0x1a, 0x17, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x6f, 0x72, 0x6d, 0x2f, 0x76, 0x31, 0x2f,
0x6f, 0x72, 0x6d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x58, 0x0a, 0x03, 0x44, 0x57, 0x4e,
0x12, 0x18, 0x0a, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28,
0x0c, 0x52, 0x07, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d,
0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75,
0x6e, 0x74, 0x3a, 0x1f, 0xf2, 0x9e, 0xd3, 0x8e, 0x03, 0x19, 0x0a, 0x09, 0x0a, 0x07, 0x61, 0x63,
0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x0a, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x10,
0x01, 0x18, 0x01, 0x42, 0x88, 0x01, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x2e, 0x76, 0x61, 0x75, 0x6c,
0x74, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x53, 0x74, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f,
0x50, 0x01, 0x5a, 0x2b, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6f,
0x6e, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x73, 0x6f, 0x6e, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76,
0x61, 0x75, 0x6c, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x76, 0x61, 0x75, 0x6c, 0x74, 0x76, 0x31, 0xa2,
0x02, 0x03, 0x56, 0x58, 0x58, 0xaa, 0x02, 0x08, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x2e, 0x56, 0x31,
0xca, 0x02, 0x08, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x14, 0x56, 0x61,
0x75, 0x6c, 0x74, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61,
0x74, 0x61, 0xea, 0x02, 0x09, 0x56, 0x61, 0x75, 0x6c, 0x74, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_vault_v1_state_proto_rawDescOnce sync.Once
file_vault_v1_state_proto_rawDescData = file_vault_v1_state_proto_rawDesc
)
func file_vault_v1_state_proto_rawDescGZIP() []byte {
file_vault_v1_state_proto_rawDescOnce.Do(func() {
file_vault_v1_state_proto_rawDescData = protoimpl.X.CompressGZIP(file_vault_v1_state_proto_rawDescData)
})
return file_vault_v1_state_proto_rawDescData
}
var file_vault_v1_state_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_vault_v1_state_proto_goTypes = []interface{}{
(*DWN)(nil), // 0: vault.v1.DWN
}
var file_vault_v1_state_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_vault_v1_state_proto_init() }
func file_vault_v1_state_proto_init() {
if File_vault_v1_state_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_vault_v1_state_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*DWN); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_vault_v1_state_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_vault_v1_state_proto_goTypes,
DependencyIndexes: file_vault_v1_state_proto_depIdxs,
MessageInfos: file_vault_v1_state_proto_msgTypes,
}.Build()
File_vault_v1_state_proto = out.File
file_vault_v1_state_proto_rawDesc = nil
file_vault_v1_state_proto_goTypes = nil
file_vault_v1_state_proto_depIdxs = nil
}

2388
api/vault/v1/tx.pulsar.go Normal file

File diff suppressed because it is too large Load Diff

158
api/vault/v1/tx_grpc.pb.go Normal file
View File

@ -0,0 +1,158 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc (unknown)
// source: vault/v1/tx.proto
package vaultv1
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
const (
Msg_AllocateVault_FullMethodName = "/vault.v1.Msg/AllocateVault"
Msg_UpdateParams_FullMethodName = "/vault.v1.Msg/UpdateParams"
)
// MsgClient is the client API for Msg service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type MsgClient interface {
// AllocateVault assembles a sqlite3 database in a local directory and returns
// the CID of the database. this operation is called by services initiating a
// controller registration.
AllocateVault(ctx context.Context, in *MsgAllocateVault, opts ...grpc.CallOption) (*MsgAllocateVaultResponse, error)
// UpdateParams defines a governance operation for updating the parameters.
//
// Since: cosmos-sdk 0.47
UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error)
}
type msgClient struct {
cc grpc.ClientConnInterface
}
func NewMsgClient(cc grpc.ClientConnInterface) MsgClient {
return &msgClient{cc}
}
func (c *msgClient) AllocateVault(ctx context.Context, in *MsgAllocateVault, opts ...grpc.CallOption) (*MsgAllocateVaultResponse, error) {
out := new(MsgAllocateVaultResponse)
err := c.cc.Invoke(ctx, Msg_AllocateVault_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *msgClient) UpdateParams(ctx context.Context, in *MsgUpdateParams, opts ...grpc.CallOption) (*MsgUpdateParamsResponse, error) {
out := new(MsgUpdateParamsResponse)
err := c.cc.Invoke(ctx, Msg_UpdateParams_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// MsgServer is the server API for Msg service.
// All implementations must embed UnimplementedMsgServer
// for forward compatibility
type MsgServer interface {
// AllocateVault assembles a sqlite3 database in a local directory and returns
// the CID of the database. this operation is called by services initiating a
// controller registration.
AllocateVault(context.Context, *MsgAllocateVault) (*MsgAllocateVaultResponse, error)
// UpdateParams defines a governance operation for updating the parameters.
//
// Since: cosmos-sdk 0.47
UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error)
mustEmbedUnimplementedMsgServer()
}
// UnimplementedMsgServer must be embedded to have forward compatible implementations.
type UnimplementedMsgServer struct {
}
func (UnimplementedMsgServer) AllocateVault(context.Context, *MsgAllocateVault) (*MsgAllocateVaultResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method AllocateVault not implemented")
}
func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (*MsgUpdateParamsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateParams not implemented")
}
func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {}
// UnsafeMsgServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to MsgServer will
// result in compilation errors.
type UnsafeMsgServer interface {
mustEmbedUnimplementedMsgServer()
}
func RegisterMsgServer(s grpc.ServiceRegistrar, srv MsgServer) {
s.RegisterService(&Msg_ServiceDesc, srv)
}
func _Msg_AllocateVault_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgAllocateVault)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).AllocateVault(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_AllocateVault_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).AllocateVault(ctx, req.(*MsgAllocateVault))
}
return interceptor(ctx, in, info, handler)
}
func _Msg_UpdateParams_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(MsgUpdateParams)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(MsgServer).UpdateParams(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: Msg_UpdateParams_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(MsgServer).UpdateParams(ctx, req.(*MsgUpdateParams))
}
return interceptor(ctx, in, info, handler)
}
// Msg_ServiceDesc is the grpc.ServiceDesc for Msg service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var Msg_ServiceDesc = grpc.ServiceDesc{
ServiceName: "vault.v1.Msg",
HandlerType: (*MsgServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "AllocateVault",
Handler: _Msg_AllocateVault_Handler,
},
{
MethodName: "UpdateParams",
Handler: _Msg_UpdateParams_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "vault/v1/tx.proto",
}

View File

@ -134,6 +134,12 @@ import (
ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported"
ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper" ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper"
ibctm "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint" ibctm "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint"
did "github.com/onsonr/sonr/x/did"
didkeeper "github.com/onsonr/sonr/x/did/keeper"
didtypes "github.com/onsonr/sonr/x/did/types"
vault "github.com/onsonr/sonr/x/vault"
vaultkeeper "github.com/onsonr/sonr/x/vault/keeper"
vaulttypes "github.com/onsonr/sonr/x/vault/types"
"github.com/spf13/cast" "github.com/spf13/cast"
globalfee "github.com/strangelove-ventures/globalfee/x/globalfee" globalfee "github.com/strangelove-ventures/globalfee/x/globalfee"
globalfeekeeper "github.com/strangelove-ventures/globalfee/x/globalfee/keeper" globalfeekeeper "github.com/strangelove-ventures/globalfee/x/globalfee/keeper"
@ -144,10 +150,6 @@ import (
tokenfactory "github.com/strangelove-ventures/tokenfactory/x/tokenfactory" tokenfactory "github.com/strangelove-ventures/tokenfactory/x/tokenfactory"
tokenfactorykeeper "github.com/strangelove-ventures/tokenfactory/x/tokenfactory/keeper" tokenfactorykeeper "github.com/strangelove-ventures/tokenfactory/x/tokenfactory/keeper"
tokenfactorytypes "github.com/strangelove-ventures/tokenfactory/x/tokenfactory/types" tokenfactorytypes "github.com/strangelove-ventures/tokenfactory/x/tokenfactory/types"
did "github.com/onsonr/sonr/x/did"
didkeeper "github.com/onsonr/sonr/x/did/keeper"
didtypes "github.com/onsonr/sonr/x/did/types"
) )
const appName = "sonr" const appName = "sonr"
@ -226,6 +228,7 @@ type SonrApp struct {
CrisisKeeper *crisiskeeper.Keeper CrisisKeeper *crisiskeeper.Keeper
UpgradeKeeper *upgradekeeper.Keeper UpgradeKeeper *upgradekeeper.Keeper
legacyAmino *codec.LegacyAmino legacyAmino *codec.LegacyAmino
VaultKeeper vaultkeeper.Keeper
sm *module.SimulationManager sm *module.SimulationManager
BasicModuleManager module.BasicManager BasicModuleManager module.BasicManager
ModuleManager *module.Manager ModuleManager *module.Manager
@ -358,6 +361,7 @@ func NewChainApp(
globalfeetypes.StoreKey, globalfeetypes.StoreKey,
packetforwardtypes.StoreKey, packetforwardtypes.StoreKey,
didtypes.StoreKey, didtypes.StoreKey,
vaulttypes.StoreKey,
) )
tkeys := storetypes.NewTransientStoreKeys(paramstypes.TStoreKey) tkeys := storetypes.NewTransientStoreKeys(paramstypes.TStoreKey)
@ -606,6 +610,15 @@ func NewChainApp(
// If evidence needs to be handled for the app, set routes in router here and seal // If evidence needs to be handled for the app, set routes in router here and seal
app.EvidenceKeeper = *evidenceKeeper app.EvidenceKeeper = *evidenceKeeper
// Create the vault Keeper
app.VaultKeeper = vaultkeeper.NewKeeper(
appCodec,
sdkruntime.NewKVStoreService(keys[vaulttypes.StoreKey]),
logger,
authtypes.NewModuleAddress(govtypes.ModuleName).String(),
app.DidKeeper,
)
// Create the did Keeper // Create the did Keeper
app.DidKeeper = didkeeper.NewKeeper( app.DidKeeper = didkeeper.NewKeeper(
appCodec, appCodec,
@ -874,6 +887,7 @@ func NewChainApp(
), ),
did.NewAppModule(appCodec, app.DidKeeper, app.NFTKeeper), did.NewAppModule(appCodec, app.DidKeeper, app.NFTKeeper),
vault.NewAppModule(appCodec, app.VaultKeeper),
) )
// BasicModuleManager defines the module BasicManager is in charge of setting up basic, // BasicModuleManager defines the module BasicManager is in charge of setting up basic,
@ -922,6 +936,7 @@ func NewChainApp(
tokenfactorytypes.ModuleName, tokenfactorytypes.ModuleName,
packetforwardtypes.ModuleName, packetforwardtypes.ModuleName,
didtypes.ModuleName, didtypes.ModuleName,
vaulttypes.ModuleName,
) )
app.ModuleManager.SetOrderEndBlockers( app.ModuleManager.SetOrderEndBlockers(
@ -941,6 +956,7 @@ func NewChainApp(
tokenfactorytypes.ModuleName, tokenfactorytypes.ModuleName,
packetforwardtypes.ModuleName, packetforwardtypes.ModuleName,
didtypes.ModuleName, didtypes.ModuleName,
vaulttypes.ModuleName,
) )
// NOTE: The genutils module must occur after staking so that pools are // NOTE: The genutils module must occur after staking so that pools are
@ -969,6 +985,7 @@ func NewChainApp(
globalfeetypes.ModuleName, globalfeetypes.ModuleName,
packetforwardtypes.ModuleName, packetforwardtypes.ModuleName,
didtypes.ModuleName, didtypes.ModuleName,
vaulttypes.ModuleName,
} }
app.ModuleManager.SetOrderInitGenesis(genesisModuleOrder...) app.ModuleManager.SetOrderInitGenesis(genesisModuleOrder...)
app.ModuleManager.SetOrderExportGenesis(genesisModuleOrder...) app.ModuleManager.SetOrderExportGenesis(genesisModuleOrder...)
@ -1127,7 +1144,7 @@ func GetDefaultBypassFeeMessages() []string {
sdk.MsgTypeURL(&ibcchanneltypes.MsgChannelOpenTry{}), sdk.MsgTypeURL(&ibcchanneltypes.MsgChannelOpenTry{}),
sdk.MsgTypeURL(&ibcchanneltypes.MsgChannelOpenConfirm{}), sdk.MsgTypeURL(&ibcchanneltypes.MsgChannelOpenConfirm{}),
sdk.MsgTypeURL(&ibcchanneltypes.MsgChannelOpenAck{}), sdk.MsgTypeURL(&ibcchanneltypes.MsgChannelOpenAck{}),
sdk.MsgTypeURL(&didtypes.MsgAllocateVault{}), sdk.MsgTypeURL(&vaulttypes.MsgAllocateVault{}),
sdk.MsgTypeURL(&didtypes.MsgRegisterController{}), sdk.MsgTypeURL(&didtypes.MsgRegisterController{}),
} }
} }
@ -1428,6 +1445,7 @@ func initParamsKeeper(
paramsKeeper.Subspace(packetforwardtypes.ModuleName). paramsKeeper.Subspace(packetforwardtypes.ModuleName).
WithKeyTable(packetforwardtypes.ParamKeyTable()) WithKeyTable(packetforwardtypes.ParamKeyTable())
paramsKeeper.Subspace(didtypes.ModuleName) paramsKeeper.Subspace(didtypes.ModuleName)
paramsKeeper.Subspace(vaulttypes.ModuleName)
return paramsKeeper return paramsKeeper
} }

View File

@ -5,17 +5,12 @@ import (
"github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types" codectypes "github.com/cosmos/cosmos-sdk/codec/types"
"github.com/onsonr/sonr/internal/cli/dexmodel" "github.com/onsonr/sonr/app/cli/dexmodel"
"github.com/onsonr/sonr/internal/cli/txmodel" "github.com/onsonr/sonr/app/cli/txmodel"
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
func AddTUICmds(rootCmd *cobra.Command) { func NewBuildTxnTUICmd() *cobra.Command {
rootCmd.AddCommand(newBuildTxnTUICmd())
rootCmd.AddCommand(newExplorerTUICmd())
}
func newBuildTxnTUICmd() *cobra.Command {
return &cobra.Command{ return &cobra.Command{
Use: "dash", Use: "dash",
Short: "TUI for managing the local Sonr validator node", Short: "TUI for managing the local Sonr validator node",
@ -40,7 +35,7 @@ func newBuildTxnTUICmd() *cobra.Command {
} }
} }
func newExplorerTUICmd() *cobra.Command { func NewExplorerTUICmd() *cobra.Command {
return &cobra.Command{ return &cobra.Command{
Use: "cosmos-explorer", Use: "cosmos-explorer",
Short: "A terminal-based Cosmos blockchain explorer", Short: "A terminal-based Cosmos blockchain explorer",

View File

@ -1,23 +0,0 @@
package app
import (
"context"
"github.com/go-webauthn/webauthn/protocol"
)
// Default Key in gRPC Metadata for the Session ID
const MetadataSessionIDKey = "sonr-session-id"
// SonrContext is the context for the Sonr API
type SonrContext struct {
Context context.Context
SessionID string `json:"session_id"`
UserAddress string `json:"user_address"`
ValidatorAddress string `json:"validator_address"`
ServiceOrigin string `json:"service_origin"`
PeerID string `json:"peer_id"`
ChainID string `json:"chain_id"`
Token string `json:"token"`
Challenge protocol.URLEncodedBase64 `json:"challenge"`
}

56
app/proxy/command.go Normal file
View File

@ -0,0 +1,56 @@
package proxy
import (
"context"
"net/http"
"os"
"os/signal"
"time"
"github.com/labstack/echo/v4"
"github.com/labstack/gommon/log"
"github.com/onsonr/sonr/nebula/pages"
"github.com/spf13/cobra"
)
func NewProxyCmd() *cobra.Command {
return &cobra.Command{
Use: "dwn-proxy",
Short: "Starts the DWN proxy server for the local IPFS node",
Run: func(cmd *cobra.Command, args []string) {
// Echo instance
e := echo.New()
e.Logger.SetLevel(log.INFO)
// Load config
_, err := LoadConfig("./")
if err != nil {
e.Logger.Error(err)
}
// Configure the server
e.GET("/", pages.Home)
e.GET("/allocate", pages.Profile)
// Start server
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt)
defer stop()
// Start server
go func() {
if err := e.Start(":1323"); err != nil && err != http.ErrServerClosed {
e.Logger.Fatal("shutting down the server")
}
}()
// Wait for interrupt signal to gracefully shutdown the server with a timeout of 10 seconds.
<-ctx.Done()
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
// Shutdown the server with 10 seconds timeout.
if err := e.Shutdown(ctx); err != nil {
e.Logger.Fatal(err)
}
},
}
}

31
app/proxy/config.go Normal file
View File

@ -0,0 +1,31 @@
package proxy
import "github.com/spf13/viper"
type Config struct {
Host string `mapstructure:"HOST"`
Port string `mapstructure:"PORT"`
SSL bool `mapstructure:"SSL"`
CertFile string `mapstructure:"CERT_FILE"`
KeyFile string `mapstructure:"KEY_FILE"`
}
func (c *Config) GetHostname() string {
return c.Host + ":" + c.Port
}
func LoadConfig(path string) (config Config, err error) {
viper.AddConfigPath(path)
viper.SetConfigName("app")
viper.SetConfigType("env")
viper.AutomaticEnv()
err = viper.ReadInConfig()
if err != nil {
return
}
err = viper.Unmarshal(&config)
return
}

View File

@ -8,12 +8,15 @@ import (
_ "github.com/joho/godotenv/autoload" _ "github.com/joho/godotenv/autoload"
"github.com/onsonr/sonr/app" "github.com/onsonr/sonr/app"
"github.com/onsonr/sonr/internal/cli" "github.com/onsonr/sonr/app/cli"
"github.com/onsonr/sonr/app/proxy"
) )
func main() { func main() {
rootCmd := NewRootCmd() rootCmd := NewRootCmd()
cli.AddTUICmds(rootCmd) rootCmd.AddCommand(cli.NewBuildTxnTUICmd())
rootCmd.AddCommand(cli.NewExplorerTUICmd())
rootCmd.AddCommand(proxy.NewProxyCmd())
if err := svrcmd.Execute(rootCmd, "", app.DefaultNodeHome); err != nil { if err := svrcmd.Execute(rootCmd, "", app.DefaultNodeHome); err != nil {
log.NewLogger(rootCmd.OutOrStderr()).Error("failure when running app", "err", err) log.NewLogger(rootCmd.OutOrStderr()).Error("failure when running app", "err", err)

View File

@ -1,6 +1,6 @@
@go.Package { name = "github.com/onsonr/sonr/internal/orm" } @go.Package { name = "github.com/onsonr/sonr/x/did/types/orm" }
module orm module models
import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl" import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl"

View File

@ -1,72 +0,0 @@
@go.Package { name = "github.com/onsonr/sonr/internal/orm/browser" }
module browser
import "package://pkg.pkl-lang.org/pkl-go/pkl.golang@0.5.0#/go.pkl"
class JsonField extends go.Field {
structTags {
["json"] = "%{name},omitempty"
}
}
class PublicKeyCredentialRequestOptions {
challenge: String
timeout: Int
rpId: String
allowCredentials: List<PublicKeyCredentialDescriptor>
userVerification: String
extensions: List<PublicKeyCredentialParameters>
}
class PublicKeyCredentialDescriptor {
id: String
transports: List<String>
type: String
}
class PublicKeyCredentialParameters {
type: String
alg: Int?
}
class AuthenticatorSelectionCriteria {
authenticatorAttachment: String
requireResidentKey: Boolean
userVerification: String
}
class PublicKeyCredentialCreationOptions {
rp: RpEntity
user: UserEntity
challenge: String
pubKeyCredParams: List<PublicKeyCredentialParameters>
timeout: Int
excludeCredentials: List<PublicKeyCredentialDescriptor>
authenticatorSelection: AuthenticatorSelectionCriteria?
attestation: String
extensions: List<PublicKeyCredentialParameters>
}
class RpEntity {
id: String
name: String?
icon: String?
}
class UserEntity {
id: String
displayName: String?
name: String?
}
class SWT {
origin: String
location: String
identifier: String
scopes: List<String>
properties: Map<String, String>
expiryBlock: Int
}

View File

@ -1,89 +0,0 @@
FROM jetpackio/devbox:latest AS sonrvm
# Installing your devbox project
WORKDIR /code
USER root:root
RUN mkdir -p /code && chown ${DEVBOX_USER}:${DEVBOX_USER} /code
USER ${DEVBOX_USER}:${DEVBOX_USER}
COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} devbox.json devbox.json
COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} deploy/process-compose.yaml process-compose.yaml
RUN devbox run -- echo "Installed Packages."
ENTRYPOINT ["devbox", "run"]
# --------------------------------------------------------
FROM jetpackio/devbox:latest AS sonr-runner
WORKDIR /code
USER root:root
RUN mkdir -p /code && chown ${DEVBOX_USER}:${DEVBOX_USER} /code
USER ${DEVBOX_USER}:${DEVBOX_USER}
COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} devbox.json devbox.json
COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} deploy/process-compose.yaml process-compose.yaml
COPY --chown=${DEVBOX_USER}:${DEVBOX_USER} . .
RUN devbox run -- echo "Installed Packages."
RUN git config --global --add safe.directory /code
ENTRYPOINT ["devbox", "run", "testnet"]
# --------------------------------------------------------
FROM golang:1.22-alpine AS go-builder
SHELL ["/bin/sh", "-ecuxo", "pipefail"]
RUN apk add --no-cache ca-certificates build-base git
WORKDIR /code
COPY go.mod go.sum ./
RUN set -eux; \
export ARCH=$(uname -m); \
WASM_VERSION=$(go list -m all | grep github.com/CosmWasm/wasmvm || true); \
if [ ! -z "${WASM_VERSION}" ]; then \
WASMVM_REPO=$(echo $WASM_VERSION | awk '{print $1}');\
WASMVM_VERS=$(echo $WASM_VERSION | awk '{print $2}');\
wget -O /lib/libwasmvm_muslc.a https://${WASMVM_REPO}/releases/download/${WASMVM_VERS}/libwasmvm_muslc.$(uname -m).a;\
fi; \
go mod download;
# Copy over code
COPY . /code
# force it to use static lib (from above) not standard libgo_cosmwasm.so file
# then log output of file /code/bin/sonrd
# then ensure static linking
RUN LEDGER_ENABLED=false BUILD_TAGS=muslc LINK_STATICALLY=true make build \
&& file /code/build/sonrd \
&& echo "Ensuring binary is statically linked ..." \
&& (file /code/build/sonrd | grep "statically linked")
# --------------------------------------------------------
FROM debian:11-slim
COPY --from=go-builder /code/build/sonrd /usr/bin/sonrd
# Install dependencies for Debian 11
RUN apt-get update && apt-get install -y \
curl \
make \
bash \
jq \
sed \
&& rm -rf /var/lib/apt/lists/*
COPY scripts/test_node.sh /usr/bin/test_node.sh
WORKDIR /opt
# rest server, tendermint p2p, tendermint rpc
EXPOSE 1317 26656 26657 6060
ENTRYPOINT ["/usr/bin/sonrd"]

View File

@ -1,50 +0,0 @@
root = "."
testdata_dir = "testdata"
tmp_dir = "tmp"
[build]
delay = 1000
cmd = "devbox run build:motr"
exclude_dir = ["assets", "tmp", "vendor", "testdata"]
exclude_file = []
exclude_regex = ["_test.go", ".pk.go", "_templ.go", ".pb.go"]
exclude_unchanged = true
follow_symlink = false
full_bin = "bunx wrangler -c ./pkg/proxy/wrangler.toml dev"
include_dir = ["web", "internal/dwn", "pkl"]
include_ext = ["go", "templ", "html", "pkl", "js", "mjs"]
include_file = [
"wrangler.toml",
"Dockerfile",
".goreleaser.yaml",
"go.mod",
"devbox.json",
".air.toml",
]
kill_delay = "2s"
log = "build-errors.log"
poll = false
poll_interval = 0
post_cmd = []
pre_cmd = ["templ generate", "devbox run gen:pkl"]
rerun = false
rerun_delay = 500
send_interrupt = false
stop_on_error = false
[color]
build = "yellow"
main = "magenta"
runner = "green"
watcher = "cyan"
[log]
main_only = true
time = true
[misc]
clean_on_exit = true
[screen]
clear_on_rebuild = true
keep_scroll = true

View File

@ -1,30 +0,0 @@
version: "3"
services:
sonr-node:
build:
context: .
dockerfile: Dockerfile
volumes:
- /home/prad/.scnr:/root/.sonr
ports:
- "26657:26657"
- "1317:1317"
- "9090:9090"
environment:
- CHAIN_ID=local-1
- MONIKER=localvalidator
- KEYRING=test
- KEY=user1
- KEY2=user2
- DENOM=usnr
- CLEAN=true
- BLOCK_TIME=5s
command: "start --pruning=nothing"
restart: always
networks:
- sonr-network
networks:
sonr-network:
name: sonr-network

View File

@ -1,9 +1,7 @@
{ {
"$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.12.0/.schema/devbox.schema.json", "$schema": "https://raw.githubusercontent.com/jetify-com/devbox/0.12.0/.schema/devbox.schema.json",
"packages": [ "packages": [
"go@1.22", "go@1.22"
"bun@latest",
"process-compose@latest"
], ],
"env": { "env": {
"CLOUDFLARE_API_TOKEN": "$CLOUDFLARE_API_TOKEN", "CLOUDFLARE_API_TOKEN": "$CLOUDFLARE_API_TOKEN",
@ -30,9 +28,6 @@
"build:image": [ "build:image": [
"make local-image" "make local-image"
], ],
"build:motr": [
"make motr"
],
"gen:proto": [ "gen:proto": [
"make proto-gen" "make proto-gen"
], ],
@ -53,6 +48,9 @@
], ],
"serve:sonr": [ "serve:sonr": [
"make sh-testnet" "make sh-testnet"
],
"serve:proxy": [
"make sh-testnet"
] ]
} }
} }

7
go.mod
View File

@ -48,7 +48,6 @@ require (
cosmossdk.io/x/upgrade v0.1.1 cosmossdk.io/x/upgrade v0.1.1
github.com/a-h/templ v0.2.778 github.com/a-h/templ v0.2.778
github.com/apple/pkl-go v0.8.0 github.com/apple/pkl-go v0.8.0
github.com/btcsuite/btcd/btcec/v2 v2.3.3
github.com/charmbracelet/bubbles v0.19.0 github.com/charmbracelet/bubbles v0.19.0
github.com/charmbracelet/bubbletea v1.1.0 github.com/charmbracelet/bubbletea v1.1.0
github.com/charmbracelet/huh v0.5.3 github.com/charmbracelet/huh v0.5.3
@ -65,11 +64,13 @@ require (
github.com/ethereum/go-ethereum v1.14.6 github.com/ethereum/go-ethereum v1.14.6
github.com/go-webauthn/webauthn v0.10.2 github.com/go-webauthn/webauthn v0.10.2
github.com/golang/protobuf v1.5.4 github.com/golang/protobuf v1.5.4
github.com/gorilla/mux v1.8.1
github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/ipfs/boxo v0.21.0 github.com/ipfs/boxo v0.21.0
github.com/ipfs/kubo v0.29.0 github.com/ipfs/kubo v0.29.0
github.com/joho/godotenv v1.5.1 github.com/joho/godotenv v1.5.1
github.com/labstack/echo/v4 v4.10.2 github.com/labstack/echo/v4 v4.10.2
github.com/labstack/gommon v0.4.0
github.com/nlepage/go-js-promise v1.0.0 github.com/nlepage/go-js-promise v1.0.0
github.com/onsonr/crypto v1.32.0 github.com/onsonr/crypto v1.32.0
github.com/segmentio/ksuid v1.0.4 github.com/segmentio/ksuid v1.0.4
@ -81,7 +82,6 @@ require (
github.com/strangelove-ventures/poa v0.50.0 github.com/strangelove-ventures/poa v0.50.0
github.com/strangelove-ventures/tokenfactory v0.50.0 github.com/strangelove-ventures/tokenfactory v0.50.0
github.com/stretchr/testify v1.9.0 github.com/stretchr/testify v1.9.0
github.com/syumai/workers v0.26.3
golang.org/x/crypto v0.26.0 golang.org/x/crypto v0.26.0
google.golang.org/genproto/googleapis/api v0.0.0-20240617180043-68d350f18fd4 google.golang.org/genproto/googleapis/api v0.0.0-20240617180043-68d350f18fd4
google.golang.org/grpc v1.64.0 google.golang.org/grpc v1.64.0
@ -108,6 +108,7 @@ require (
github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect
github.com/bits-and-blooms/bitset v1.13.0 // indirect github.com/bits-and-blooms/bitset v1.13.0 // indirect
github.com/blang/semver/v4 v4.0.0 // indirect github.com/blang/semver/v4 v4.0.0 // indirect
github.com/btcsuite/btcd/btcec/v2 v2.3.3 // indirect
github.com/btcsuite/btcd/btcutil v1.1.5 // indirect github.com/btcsuite/btcd/btcutil v1.1.5 // indirect
github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 // indirect github.com/btcsuite/btcd/chaincfg/chainhash v1.1.0 // indirect
github.com/bwesterb/go-ristretto v1.2.3 // indirect github.com/bwesterb/go-ristretto v1.2.3 // indirect
@ -180,7 +181,6 @@ require (
github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect github.com/googleapis/enterprise-certificate-proxy v0.3.2 // indirect
github.com/googleapis/gax-go/v2 v2.12.2 // indirect github.com/googleapis/gax-go/v2 v2.12.2 // indirect
github.com/gorilla/handlers v1.5.2 // indirect github.com/gorilla/handlers v1.5.2 // indirect
github.com/gorilla/mux v1.8.1 // indirect
github.com/gorilla/websocket v1.5.3 // indirect github.com/gorilla/websocket v1.5.3 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 // indirect
github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect
@ -232,7 +232,6 @@ require (
github.com/klauspost/cpuid/v2 v2.2.8 // indirect github.com/klauspost/cpuid/v2 v2.2.8 // indirect
github.com/kr/pretty v0.3.1 // indirect github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect github.com/kr/text v0.2.0 // indirect
github.com/labstack/gommon v0.4.0 // indirect
github.com/lib/pq v1.10.7 // indirect github.com/lib/pq v1.10.7 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/libp2p/go-cidranger v1.1.0 // indirect github.com/libp2p/go-cidranger v1.1.0 // indirect

2
go.sum
View File

@ -2048,8 +2048,6 @@ github.com/subosito/gotenv v1.6.0 h1:9NlTDc1FTs4qu0DDq7AEtTPNw6SVm7uBMsUCUjABIf8
github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU= github.com/subosito/gotenv v1.6.0/go.mod h1:Dk4QP5c2W3ibzajGcXpNraDfq2IrhjMIvMSWPKKo0FU=
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 h1:epCh84lMvA70Z7CTTCmYQn2CKbY8j86K7/FAIr141uY=
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc= github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7/go.mod h1:q4W45IWZaF22tdD+VEXcAWRA037jwmWEB5VWYORlTpc=
github.com/syumai/workers v0.26.3 h1:AF+IBaRccbR4JIj2kNJLJblruPFMD/pAbzkopejGcP8=
github.com/syumai/workers v0.26.3/go.mod h1:ZnqmdiHNBrbxOLrZ/HJ5jzHy6af9cmiNZk10R9NrIEA=
github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E=
github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME=
github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI= github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI=

View File

@ -1,116 +0,0 @@
package orm
import (
"crypto/hmac"
"crypto/sha512"
"encoding/binary"
"encoding/hex"
"errors"
"math/big"
"github.com/btcsuite/btcd/btcec/v2"
"github.com/onsonr/sonr/internal/orm/didmethod"
)
type ChainCode uint32
func GetChainCode(m didmethod.DIDMethod) ChainCode {
switch m {
case didmethod.Bitcoin:
return 0 // 0
case didmethod.Ethereum:
return 64 // 60
case didmethod.Ibc:
return 118 // 118
case didmethod.Sonr:
return 703 // 703
default:
return 0
}
}
func FormatAddress(pubKey *PublicKey, m didmethod.DIDMethod) (string, error) {
hexPubKey, err := hex.DecodeString(pubKey.Raw)
if err != nil {
return "", err
}
// switch m {
// case didmethod.Bitcoin:
// return bech32.Encode("bc", pubKey.Bytes())
//
// case didmethod.Ethereum:
// epk, err := pubKey.ECDSA()
// if err != nil {
// return "", err
// }
// return ComputeEthAddress(*epk), nil
//
// case didmethod.Sonr:
// return bech32.Encode("idx", hexPubKey)
//
// case didmethod.Ibc:
// return bech32.Encode("cosmos", hexPubKey)
//
// }
return string(hexPubKey), nil
}
// ComputeAccountPublicKey computes the public key of a child key given the extended public key, chain code, and index.
func ComputeBip32AccountPublicKey(extPubKey PublicKey, chainCode ChainCode, index int) (*PublicKey, error) {
// Check if the index is a hardened child key
if chainCode&0x80000000 != 0 && index < 0 {
return nil, errors.New("invalid index")
}
hexPubKey, err := hex.DecodeString(extPubKey.Raw)
if err != nil {
return nil, err
}
// Serialize the public key
pubKey, err := btcec.ParsePubKey(hexPubKey)
if err != nil {
return nil, err
}
pubKeyBytes := pubKey.SerializeCompressed()
// Serialize the index
indexBytes := make([]byte, 4)
binary.BigEndian.PutUint32(indexBytes, uint32(index))
// Compute the HMAC-SHA512
mac := hmac.New(sha512.New, []byte{byte(chainCode)})
mac.Write(pubKeyBytes)
mac.Write(indexBytes)
I := mac.Sum(nil)
// Split I into two 32-byte sequences
IL := I[:32]
// Convert IL to a big integer
ilNum := new(big.Int).SetBytes(IL)
// Check if parse256(IL) >= n
curve := btcec.S256()
if ilNum.Cmp(curve.N) >= 0 {
return nil, errors.New("invalid child key")
}
// Compute the child public key
ilx, ily := curve.ScalarBaseMult(IL)
childX, childY := curve.Add(ilx, ily, pubKey.X(), pubKey.Y())
lx := newBigIntFieldVal(childX)
ly := newBigIntFieldVal(childY)
// Create the child public key
_ = btcec.NewPublicKey(lx, ly)
return &PublicKey{}, nil
}
// newBigIntFieldVal creates a new field value from a big integer.
func newBigIntFieldVal(val *big.Int) *btcec.FieldVal {
lx := new(btcec.FieldVal)
lx.SetByteSlice(val.Bytes())
return lx
}

View File

@ -1,10 +0,0 @@
// Code generated from Pkl module `browser`. DO NOT EDIT.
package browser
type AuthenticatorSelectionCriteria struct {
AuthenticatorAttachment string `pkl:"authenticatorAttachment"`
RequireResidentKey bool `pkl:"requireResidentKey"`
UserVerification string `pkl:"userVerification"`
}

View File

@ -1,36 +0,0 @@
// Code generated from Pkl module `browser`. DO NOT EDIT.
package browser
import (
"context"
"github.com/apple/pkl-go/pkl"
)
type Browser struct {
}
// LoadFromPath loads the pkl module at the given path and evaluates it into a Browser
func LoadFromPath(ctx context.Context, path string) (ret *Browser, 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 Browser
func Load(ctx context.Context, evaluator pkl.Evaluator, source *pkl.ModuleSource) (*Browser, error) {
var ret Browser
if err := evaluator.EvaluateModule(ctx, source, &ret); err != nil {
return nil, err
}
return &ret, nil
}

View File

@ -1,22 +0,0 @@
// Code generated from Pkl module `browser`. DO NOT EDIT.
package browser
type PublicKeyCredentialCreationOptions struct {
Rp *RpEntity `pkl:"rp"`
User *UserEntity `pkl:"user"`
Challenge string `pkl:"challenge"`
PubKeyCredParams []*PublicKeyCredentialParameters `pkl:"pubKeyCredParams"`
Timeout int `pkl:"timeout"`
ExcludeCredentials []*PublicKeyCredentialDescriptor `pkl:"excludeCredentials"`
AuthenticatorSelection *AuthenticatorSelectionCriteria `pkl:"authenticatorSelection"`
Attestation string `pkl:"attestation"`
Extensions []*PublicKeyCredentialParameters `pkl:"extensions"`
}

View File

@ -1,10 +0,0 @@
// Code generated from Pkl module `browser`. DO NOT EDIT.
package browser
type PublicKeyCredentialDescriptor struct {
Id string `pkl:"id"`
Transports []string `pkl:"transports"`
Type string `pkl:"type"`
}

View File

@ -1,8 +0,0 @@
// Code generated from Pkl module `browser`. DO NOT EDIT.
package browser
type PublicKeyCredentialParameters struct {
Type string `pkl:"type"`
Alg *int `pkl:"alg"`
}

View File

@ -1,16 +0,0 @@
// Code generated from Pkl module `browser`. DO NOT EDIT.
package browser
type PublicKeyCredentialRequestOptions struct {
Challenge string `pkl:"challenge"`
Timeout int `pkl:"timeout"`
RpId string `pkl:"rpId"`
AllowCredentials []*PublicKeyCredentialDescriptor `pkl:"allowCredentials"`
UserVerification string `pkl:"userVerification"`
Extensions []*PublicKeyCredentialParameters `pkl:"extensions"`
}

View File

@ -1,10 +0,0 @@
// Code generated from Pkl module `browser`. DO NOT EDIT.
package browser
type RpEntity struct {
Id string `pkl:"id"`
Name *string `pkl:"name"`
Icon *string `pkl:"icon"`
}

View File

@ -1,16 +0,0 @@
// Code generated from Pkl module `browser`. DO NOT EDIT.
package browser
type SWT struct {
Origin string `pkl:"origin"`
Location string `pkl:"location"`
Identifier string `pkl:"identifier"`
Scopes []string `pkl:"scopes"`
Properties map[string]string `pkl:"properties"`
ExpiryBlock int `pkl:"expiryBlock"`
}

View File

@ -1,10 +0,0 @@
// Code generated from Pkl module `browser`. DO NOT EDIT.
package browser
type UserEntity struct {
Id string `pkl:"id"`
DisplayName *string `pkl:"displayName"`
Name *string `pkl:"name"`
}

View File

@ -1,16 +0,0 @@
// Code generated from Pkl module `browser`. DO NOT EDIT.
package browser
import "github.com/apple/pkl-go/pkl"
func init() {
pkl.RegisterMapping("browser", Browser{})
pkl.RegisterMapping("browser#PublicKeyCredentialRequestOptions", PublicKeyCredentialRequestOptions{})
pkl.RegisterMapping("browser#PublicKeyCredentialDescriptor", PublicKeyCredentialDescriptor{})
pkl.RegisterMapping("browser#PublicKeyCredentialParameters", PublicKeyCredentialParameters{})
pkl.RegisterMapping("browser#AuthenticatorSelectionCriteria", AuthenticatorSelectionCriteria{})
pkl.RegisterMapping("browser#PublicKeyCredentialCreationOptions", PublicKeyCredentialCreationOptions{})
pkl.RegisterMapping("browser#RpEntity", RpEntity{})
pkl.RegisterMapping("browser#UserEntity", UserEntity{})
pkl.RegisterMapping("browser#SWT", SWT{})
}

View File

@ -1,334 +0,0 @@
package orm
import (
"github.com/onsonr/sonr/x/did/types"
)
type (
AuthenticatorAttachment string
AuthenticatorTransport string
)
const (
// Platform represents a platform authenticator is attached using a client device-specific transport, called
// platform attachment, and is usually not removable from the client device. A public key credential bound to a
// platform authenticator is called a platform credential.
Platform AuthenticatorAttachment = "platform"
// CrossPlatform represents a roaming authenticator is attached using cross-platform transports, called
// cross-platform attachment. Authenticators of this class are removable from, and can "roam" among, client devices.
// A public key credential bound to a roaming authenticator is called a roaming credential.
CrossPlatform AuthenticatorAttachment = "cross-platform"
)
func ParseAuthenticatorAttachment(s string) AuthenticatorAttachment {
switch s {
case "platform":
return Platform
default:
return CrossPlatform
}
}
const (
// USB indicates the respective authenticator can be contacted over removable USB.
USB AuthenticatorTransport = "usb"
// NFC indicates the respective authenticator can be contacted over Near Field Communication (NFC).
NFC AuthenticatorTransport = "nfc"
// BLE indicates the respective authenticator can be contacted over Bluetooth Smart (Bluetooth Low Energy / BLE).
BLE AuthenticatorTransport = "ble"
// SmartCard indicates the respective authenticator can be contacted over ISO/IEC 7816 smart card with contacts.
//
// WebAuthn Level 3.
SmartCard AuthenticatorTransport = "smart-card"
// Hybrid indicates the respective authenticator can be contacted using a combination of (often separate)
// data-transport and proximity mechanisms. This supports, for example, authentication on a desktop computer using
// a smartphone.
//
// WebAuthn Level 3.
Hybrid AuthenticatorTransport = "hybrid"
// Internal indicates the respective authenticator is contacted using a client device-specific transport, i.e., it
// is a platform authenticator. These authenticators are not removable from the client device.
Internal AuthenticatorTransport = "internal"
)
func ParseAuthenticatorTransport(s string) AuthenticatorTransport {
switch s {
case "usb":
return USB
case "nfc":
return NFC
case "ble":
return BLE
case "smart-card":
return SmartCard
case "hybrid":
return Hybrid
default:
return Internal
}
}
type AuthenticatorFlags byte
const (
// FlagUserPresent Bit 00000001 in the byte sequence. Tells us if user is present. Also referred to as the UP flag.
FlagUserPresent AuthenticatorFlags = 1 << iota // Referred to as UP
// FlagRFU1 is a reserved for future use flag.
FlagRFU1
// FlagUserVerified Bit 00000100 in the byte sequence. Tells us if user is verified
// by the authenticator using a biometric or PIN. Also referred to as the UV flag.
FlagUserVerified
// FlagBackupEligible Bit 00001000 in the byte sequence. Tells us if a backup is eligible for device. Also referred
// to as the BE flag.
FlagBackupEligible // Referred to as BE
// FlagBackupState Bit 00010000 in the byte sequence. Tells us if a backup state for device. Also referred to as the
// BS flag.
FlagBackupState
// FlagRFU2 is a reserved for future use flag.
FlagRFU2
// FlagAttestedCredentialData Bit 01000000 in the byte sequence. Indicates whether
// the authenticator added attested credential data. Also referred to as the AT flag.
FlagAttestedCredentialData
// FlagHasExtensions Bit 10000000 in the byte sequence. Indicates if the authenticator data has extensions. Also
// referred to as the ED flag.
FlagHasExtensions
)
type AttestationFormat string
const (
// AttestationFormatPacked is the "packed" attestation statement format is a WebAuthn-optimized format for
// attestation. It uses a very compact but still extensible encoding method. This format is implementable by
// authenticators with limited resources (e.g., secure elements).
AttestationFormatPacked AttestationFormat = "packed"
// AttestationFormatTPM is the TPM attestation statement format returns an attestation statement in the same format
// as the packed attestation statement format, although the rawData and signature fields are computed differently.
AttestationFormatTPM AttestationFormat = "tpm"
// AttestationFormatAndroidKey is the attestation statement format for platform authenticators on versions "N", and
// later, which may provide this proprietary "hardware attestation" statement.
AttestationFormatAndroidKey AttestationFormat = "android-key"
// AttestationFormatAndroidSafetyNet is the attestation statement format that Android-based platform authenticators
// MAY produce an attestation statement based on the Android SafetyNet API.
AttestationFormatAndroidSafetyNet AttestationFormat = "android-safetynet"
// AttestationFormatFIDOUniversalSecondFactor is the attestation statement format that is used with FIDO U2F
// authenticators.
AttestationFormatFIDOUniversalSecondFactor AttestationFormat = "fido-u2f"
// AttestationFormatApple is the attestation statement format that is used with Apple devices' platform
// authenticators.
AttestationFormatApple AttestationFormat = "apple"
// AttestationFormatNone is the attestation statement format that is used to replace any authenticator-provided
// attestation statement when a WebAuthn Relying Party indicates it does not wish to receive attestation information.
AttestationFormatNone AttestationFormat = "none"
)
func ExtractAttestationFormats(p *types.Params) []AttestationFormat {
var formats []AttestationFormat
for _, v := range p.AttestationFormats {
formats = append(formats, parseAttestationFormat(v))
}
return formats
}
func parseAttestationFormat(s string) AttestationFormat {
switch s {
case "packed":
return AttestationFormatPacked
case "tpm":
return AttestationFormatTPM
case "android-key":
return AttestationFormatAndroidKey
case "android-safetynet":
return AttestationFormatAndroidSafetyNet
case "fido-u2f":
return AttestationFormatFIDOUniversalSecondFactor
case "apple":
return AttestationFormatApple
case "none":
return AttestationFormatNone
default:
return AttestationFormatPacked
}
}
type CredentialType string
const (
CredentialTypePublicKeyCredential CredentialType = "public-key"
)
type ConveyancePreference string
const (
// PreferNoAttestation is a ConveyancePreference value.
//
// This value indicates that the Relying Party is not interested in authenticator attestation. For example, in order
// to potentially avoid having to obtain user consent to relay identifying information to the Relying Party, or to
// save a round trip to an Attestation CA or Anonymization CA.
//
// This is the default value.
//
// Specification: §5.4.7. Attestation Conveyance Preference Enumeration (https://www.w3.org/TR/webauthn/#dom-attestationconveyancepreference-none)
PreferNoAttestation ConveyancePreference = "none"
// PreferIndirectAttestation is a ConveyancePreference value.
//
// This value indicates that the Relying Party prefers an attestation conveyance yielding verifiable attestation
// statements, but allows the client to decide how to obtain such attestation statements. The client MAY replace the
// authenticator-generated attestation statements with attestation statements generated by an Anonymization CA, in
// order to protect the users privacy, or to assist Relying Parties with attestation verification in a
// heterogeneous ecosystem.
//
// Note: There is no guarantee that the Relying Party will obtain a verifiable attestation statement in this case.
// For example, in the case that the authenticator employs self attestation.
//
// Specification: §5.4.7. Attestation Conveyance Preference Enumeration (https://www.w3.org/TR/webauthn/#dom-attestationconveyancepreference-indirect)
PreferIndirectAttestation ConveyancePreference = "indirect"
// PreferDirectAttestation is a ConveyancePreference value.
//
// This value indicates that the Relying Party wants to receive the attestation statement as generated by the
// authenticator.
//
// Specification: §5.4.7. Attestation Conveyance Preference Enumeration (https://www.w3.org/TR/webauthn/#dom-attestationconveyancepreference-direct)
PreferDirectAttestation ConveyancePreference = "direct"
// PreferEnterpriseAttestation is a ConveyancePreference value.
//
// This value indicates that the Relying Party wants to receive an attestation statement that may include uniquely
// identifying information. This is intended for controlled deployments within an enterprise where the organization
// wishes to tie registrations to specific authenticators. User agents MUST NOT provide such an attestation unless
// the user agent or authenticator configuration permits it for the requested RP ID.
//
// If permitted, the user agent SHOULD signal to the authenticator (at invocation time) that enterprise
// attestation is requested, and convey the resulting AAGUID and attestation statement, unaltered, to the Relying
// Party.
//
// Specification: §5.4.7. Attestation Conveyance Preference Enumeration (https://www.w3.org/TR/webauthn/#dom-attestationconveyancepreference-enterprise)
PreferEnterpriseAttestation ConveyancePreference = "enterprise"
)
func ExtractConveyancePreference(p *types.Params) ConveyancePreference {
switch p.ConveyancePreference {
case "none":
return PreferNoAttestation
case "indirect":
return PreferIndirectAttestation
case "direct":
return PreferDirectAttestation
case "enterprise":
return PreferEnterpriseAttestation
default:
return PreferNoAttestation
}
}
type PublicKeyCredentialHints string
const (
// PublicKeyCredentialHintSecurityKey is a PublicKeyCredentialHint that indicates that the Relying Party believes
// that users will satisfy this request with a physical security key. For example, an enterprise Relying Party may
// set this hint if they have issued security keys to their employees and will only accept those authenticators for
// registration and authentication.
//
// For compatibility with older user agents, when this hint is used in PublicKeyCredentialCreationOptions, the
// authenticatorAttachment SHOULD be set to cross-platform.
PublicKeyCredentialHintSecurityKey PublicKeyCredentialHints = "security-key"
// PublicKeyCredentialHintClientDevice is a PublicKeyCredentialHint that indicates that the Relying Party believes
// that users will satisfy this request with a platform authenticator attached to the client device.
//
// For compatibility with older user agents, when this hint is used in PublicKeyCredentialCreationOptions, the
// authenticatorAttachment SHOULD be set to platform.
PublicKeyCredentialHintClientDevice PublicKeyCredentialHints = "client-device"
// PublicKeyCredentialHintHybrid is a PublicKeyCredentialHint that indicates that the Relying Party believes that
// users will satisfy this request with general-purpose authenticators such as smartphones. For example, a consumer
// Relying Party may believe that only a small fraction of their customers possesses dedicated security keys. This
// option also implies that the local platform authenticator should not be promoted in the UI.
//
// For compatibility with older user agents, when this hint is used in PublicKeyCredentialCreationOptions, the
// authenticatorAttachment SHOULD be set to cross-platform.
PublicKeyCredentialHintHybrid PublicKeyCredentialHints = "hybrid"
)
func ParsePublicKeyCredentialHints(s string) PublicKeyCredentialHints {
switch s {
case "security-key":
return PublicKeyCredentialHintSecurityKey
case "client-device":
return PublicKeyCredentialHintClientDevice
case "hybrid":
return PublicKeyCredentialHintHybrid
default:
return ""
}
}
type AttestedCredentialData struct {
AAGUID []byte `json:"aaguid"`
CredentialID []byte `json:"credential_id"`
// The raw credential public key bytes received from the attestation data.
CredentialPublicKey []byte `json:"public_key"`
}
type ResidentKeyRequirement string
const (
// ResidentKeyRequirementDiscouraged indicates the Relying Party prefers creating a server-side credential, but will
// accept a client-side discoverable credential. This is the default.
ResidentKeyRequirementDiscouraged ResidentKeyRequirement = "discouraged"
// ResidentKeyRequirementPreferred indicates to the client we would prefer a discoverable credential.
ResidentKeyRequirementPreferred ResidentKeyRequirement = "preferred"
// ResidentKeyRequirementRequired indicates the Relying Party requires a client-side discoverable credential, and is
// prepared to receive an error if a client-side discoverable credential cannot be created.
ResidentKeyRequirementRequired ResidentKeyRequirement = "required"
)
func ParseResidentKeyRequirement(s string) ResidentKeyRequirement {
switch s {
case "discouraged":
return ResidentKeyRequirementDiscouraged
case "preferred":
return ResidentKeyRequirementPreferred
default:
return ResidentKeyRequirementRequired
}
}
type (
AuthenticationExtensions map[string]any
UserVerificationRequirement string
)
const (
// VerificationRequired User verification is required to create/release a credential
VerificationRequired UserVerificationRequirement = "required"
// VerificationPreferred User verification is preferred to create/release a credential
VerificationPreferred UserVerificationRequirement = "preferred" // This is the default
// VerificationDiscouraged The authenticator should not verify the user for the credential
VerificationDiscouraged UserVerificationRequirement = "discouraged"
)

View File

@ -1,56 +0,0 @@
package orm
import (
"encoding/base64"
"github.com/go-webauthn/webauthn/protocol"
)
// NewCredential will return a credential pointer on successful validation of a registration response.
func NewCredential(c *protocol.ParsedCredentialCreationData, origin, handle string) *Credential {
return &Credential{
Subject: handle,
Origin: origin,
AttestationType: c.Response.AttestationObject.Format,
CredentialId: BytesToBase64(c.Response.AttestationObject.AuthData.AttData.CredentialID),
PublicKey: BytesToBase64(c.Response.AttestationObject.AuthData.AttData.CredentialPublicKey),
Transport: NormalizeTransports(c.Response.Transports),
SignCount: uint(c.Response.AttestationObject.AuthData.Counter),
UserPresent: c.Response.AttestationObject.AuthData.Flags.HasUserPresent(),
UserVerified: c.Response.AttestationObject.AuthData.Flags.HasUserVerified(),
BackupEligible: c.Response.AttestationObject.AuthData.Flags.HasBackupEligible(),
BackupState: c.Response.AttestationObject.AuthData.Flags.HasAttestedCredentialData(),
}
}
func BytesToBase64(b []byte) string {
return base64.RawURLEncoding.EncodeToString(b)
}
func Base64ToBytes(b string) ([]byte, error) {
return base64.RawURLEncoding.DecodeString(b)
}
// Descriptor converts a Credential into a protocol.CredentialDescriptor.
func (c *Credential) Descriptor() protocol.CredentialDescriptor {
id, err := base64.RawURLEncoding.DecodeString(c.CredentialId)
if err != nil {
panic(err)
}
return protocol.CredentialDescriptor{
Type: protocol.PublicKeyCredentialType,
CredentialID: id,
Transport: ConvertTransports(c.Transport),
AttestationType: c.AttestationType,
}
}
// This is a signal that the authenticator may be cloned, see CloneWarning above for more information.
func (a *Credential) UpdateCounter(authDataCount uint) {
if authDataCount <= a.SignCount && (authDataCount != 0 || a.SignCount != 0) {
a.CloneWarning = true
return
}
a.SignCount = authDataCount
}

View File

@ -1,17 +0,0 @@
// Code generated from Pkl module `orm`. DO NOT EDIT.
package orm
import "github.com/apple/pkl-go/pkl"
func init() {
pkl.RegisterMapping("orm", Orm{})
pkl.RegisterMapping("orm#Account", Account{})
pkl.RegisterMapping("orm#Asset", Asset{})
pkl.RegisterMapping("orm#Chain", Chain{})
pkl.RegisterMapping("orm#Credential", Credential{})
pkl.RegisterMapping("orm#JWK", JWK{})
pkl.RegisterMapping("orm#Grant", Grant{})
pkl.RegisterMapping("orm#Keyshare", Keyshare{})
pkl.RegisterMapping("orm#PublicKey", PublicKey{})
pkl.RegisterMapping("orm#Profile", Profile{})
}

View File

@ -1,111 +0,0 @@
package orm
import (
"encoding/base64"
"fmt"
"github.com/go-webauthn/webauthn/protocol"
"github.com/go-webauthn/webauthn/protocol/webauthncose"
)
func FormatEC2PublicKey(key *webauthncose.EC2PublicKeyData) (*JWK, error) {
curve, err := GetCOSECurveName(key.Curve)
if err != nil {
return nil, err
}
jwkMap := map[string]interface{}{
"kty": "EC",
"crv": curve,
"x": base64.RawURLEncoding.EncodeToString(key.XCoord),
"y": base64.RawURLEncoding.EncodeToString(key.YCoord),
}
return MapToJWK(jwkMap)
}
func FormatRSAPublicKey(key *webauthncose.RSAPublicKeyData) (*JWK, error) {
jwkMap := map[string]interface{}{
"kty": "RSA",
"n": base64.RawURLEncoding.EncodeToString(key.Modulus),
"e": base64.RawURLEncoding.EncodeToString(key.Exponent),
}
return MapToJWK(jwkMap)
}
func FormatOKPPublicKey(key *webauthncose.OKPPublicKeyData) (*JWK, error) {
curve, err := GetOKPCurveName(key.Curve)
if err != nil {
return nil, err
}
jwkMap := map[string]interface{}{
"kty": "OKP",
"crv": curve,
"x": base64.RawURLEncoding.EncodeToString(key.XCoord),
}
return MapToJWK(jwkMap)
}
func MapToJWK(m map[string]interface{}) (*JWK, error) {
jwk := &JWK{}
for k, v := range m {
switch k {
case "kty":
jwk.Kty = v.(string)
case "crv":
jwk.Crv = v.(string)
case "x":
jwk.X = v.(string)
case "y":
jwk.Y = v.(string)
case "n":
jwk.N = v.(string)
case "e":
jwk.E = v.(string)
}
}
return jwk, nil
}
func GetCOSECurveName(curveID int64) (string, error) {
switch curveID {
case int64(webauthncose.P256):
return "P-256", nil
case int64(webauthncose.P384):
return "P-384", nil
case int64(webauthncose.P521):
return "P-521", nil
default:
return "", fmt.Errorf("unknown curve ID: %d", curveID)
}
}
func GetOKPCurveName(curveID int64) (string, error) {
switch curveID {
case int64(webauthncose.Ed25519):
return "Ed25519", nil
default:
return "", fmt.Errorf("unknown OKP curve ID: %d", curveID)
}
}
// ConvertTransports converts the transports from strings to protocol.AuthenticatorTransport
func ConvertTransports(transports []string) []protocol.AuthenticatorTransport {
tss := make([]protocol.AuthenticatorTransport, len(transports))
for i, t := range transports {
tss[i] = protocol.AuthenticatorTransport(t)
}
return tss
}
// NormalizeTransports returns the transports as strings
func NormalizeTransports(transports []protocol.AuthenticatorTransport) []string {
tss := make([]string, len(transports))
for i, t := range transports {
tss[i] = string(t)
}
return tss
}

View File

@ -1,22 +0,0 @@
package orm
import "github.com/onsonr/sonr/internal/orm/keyalgorithm"
type COSEAlgorithmIdentifier int
func GetCoseIdentifier(alg keyalgorithm.KeyAlgorithm) COSEAlgorithmIdentifier {
switch alg {
case keyalgorithm.Es256:
return COSEAlgorithmIdentifier(-7)
case keyalgorithm.Es384:
return COSEAlgorithmIdentifier(-35)
case keyalgorithm.Es512:
return COSEAlgorithmIdentifier(-36)
case keyalgorithm.Eddsa:
return COSEAlgorithmIdentifier(-8)
case keyalgorithm.Es256k:
return COSEAlgorithmIdentifier(-10)
default:
return COSEAlgorithmIdentifier(0)
}
}

View File

@ -1,26 +0,0 @@
package orm
import (
"fmt"
"github.com/go-webauthn/webauthn/protocol/webauthncose"
)
// ExtractWebAuthnPublicKey parses the raw public key bytes and returns a JWK representation
func ExtractWebAuthnPublicKey(keyBytes []byte) (*JWK, error) {
key, err := webauthncose.ParsePublicKey(keyBytes)
if err != nil {
return nil, fmt.Errorf("failed to parse public key: %w", err)
}
switch k := key.(type) {
case *webauthncose.EC2PublicKeyData:
return FormatEC2PublicKey(k)
case *webauthncose.RSAPublicKeyData:
return FormatRSAPublicKey(k)
case *webauthncose.OKPPublicKeyData:
return FormatOKPPublicKey(k)
default:
return nil, fmt.Errorf("unsupported key type")
}
}

View File

@ -1,6 +0,0 @@
// Code generated from Pkl module `transactions`. DO NOT EDIT.
package transactions
type Msg interface {
GetTypeUrl() string
}

View File

@ -1,44 +0,0 @@
// Code generated from Pkl module `transactions`. DO NOT EDIT.
package transactions
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
}

View File

@ -1,60 +0,0 @@
// Code generated from Pkl module `transactions`. DO NOT EDIT.
package transactions
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
}

View File

@ -1,52 +0,0 @@
// Code generated from Pkl module `transactions`. DO NOT EDIT.
package transactions
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
}

View File

@ -1,60 +0,0 @@
// Code generated from Pkl module `transactions`. DO NOT EDIT.
package transactions
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
}

View File

@ -1,76 +0,0 @@
// Code generated from Pkl module `transactions`. DO NOT EDIT.
package transactions
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
}

View File

@ -1,36 +0,0 @@
// Code generated from Pkl module `transactions`. DO NOT EDIT.
package transactions
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
}

View File

@ -1,44 +0,0 @@
// Code generated from Pkl module `transactions`. DO NOT EDIT.
package transactions
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
}

View File

@ -1,44 +0,0 @@
// Code generated from Pkl module `transactions`. DO NOT EDIT.
package transactions
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
}

View File

@ -1,45 +0,0 @@
// Code generated from Pkl module `transactions`. DO NOT EDIT.
package transactions
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
}

View File

@ -1,42 +0,0 @@
// Code generated from Pkl module `transactions`. DO NOT EDIT.
package transactions
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
}

View File

@ -1,45 +0,0 @@
// Code generated from Pkl module `transactions`. DO NOT EDIT.
package transactions
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
}

View File

@ -1,60 +0,0 @@
// Code generated from Pkl module `transactions`. DO NOT EDIT.
package transactions
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
}

View File

@ -1,58 +0,0 @@
// Code generated from Pkl module `transactions`. DO NOT EDIT.
package transactions
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
}

View File

@ -1,52 +0,0 @@
// Code generated from Pkl module `transactions`. DO NOT EDIT.
package transactions
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
}

View File

@ -1,77 +0,0 @@
// Code generated from Pkl module `transactions`. DO NOT EDIT.
package transactions
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
}

View File

@ -1,44 +0,0 @@
// Code generated from Pkl module `transactions`. DO NOT EDIT.
package transactions
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
}

View File

@ -1,44 +0,0 @@
// Code generated from Pkl module `transactions`. DO NOT EDIT.
package transactions
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
}

View File

@ -1,11 +0,0 @@
// Code generated from Pkl module `transactions`. DO NOT EDIT.
package transactions
// 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"`
}

View File

@ -1,36 +0,0 @@
// Code generated from Pkl module `transactions`. DO NOT EDIT.
package transactions
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
}

View File

@ -1,17 +0,0 @@
// Code generated from Pkl module `transactions`. DO NOT EDIT.
package transactions
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"`
}

View File

@ -1,27 +0,0 @@
// Code generated from Pkl module `transactions`. DO NOT EDIT.
package transactions
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{})
}

3
nebula/README.md Normal file
View File

@ -0,0 +1,3 @@
# Nebula
A Templ component library for the Sonr DWN (Decentralized Web Node) client.

View File

@ -56,7 +56,7 @@ func alertElement(attrs templ.Attributes, title, message string, icon templ.Comp
var templ_7745c5c3_Var2 string var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(title) templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(title)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/alert.templ`, Line: 10, Col: 66} return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/alert.templ`, Line: 10, Col: 66}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@ -69,7 +69,7 @@ func alertElement(attrs templ.Attributes, title, message string, icon templ.Comp
var templ_7745c5c3_Var3 string var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(message) templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(message)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/alert.templ`, Line: 11, Col: 43} return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/alert.templ`, Line: 11, Col: 43}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {

View File

@ -157,7 +157,7 @@ func renderHxGetButton(c *button, attrs templ.Attributes) templ.Component {
var templ_7745c5c3_Var3 string var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(c.hxGet) templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(c.hxGet)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/button.templ`, Line: 86, Col: 25} return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/button.templ`, Line: 86, Col: 25}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@ -170,7 +170,7 @@ func renderHxGetButton(c *button, attrs templ.Attributes) templ.Component {
var templ_7745c5c3_Var4 string var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(c.hxTarget) templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(c.hxTarget)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/button.templ`, Line: 86, Col: 69} return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/button.templ`, Line: 86, Col: 69}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@ -183,7 +183,7 @@ func renderHxGetButton(c *button, attrs templ.Attributes) templ.Component {
var templ_7745c5c3_Var5 string var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(c.hxTrigger) templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(c.hxTrigger)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/button.templ`, Line: 86, Col: 96} return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/button.templ`, Line: 86, Col: 96}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@ -196,7 +196,7 @@ func renderHxGetButton(c *button, attrs templ.Attributes) templ.Component {
var templ_7745c5c3_Var6 string var templ_7745c5c3_Var6 string
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(c.hxSwap) templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(c.hxSwap)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/button.templ`, Line: 86, Col: 117} return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/button.templ`, Line: 86, Col: 117}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@ -254,7 +254,7 @@ func renderHxPostButton(c *button, attrs templ.Attributes) templ.Component {
var templ_7745c5c3_Var8 string var templ_7745c5c3_Var8 string
templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(c.hxPost) templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs(c.hxPost)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/button.templ`, Line: 92, Col: 27} return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/button.templ`, Line: 92, Col: 27}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@ -267,7 +267,7 @@ func renderHxPostButton(c *button, attrs templ.Attributes) templ.Component {
var templ_7745c5c3_Var9 string var templ_7745c5c3_Var9 string
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(c.hxTarget) templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(c.hxTarget)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/button.templ`, Line: 92, Col: 52} return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/button.templ`, Line: 92, Col: 52}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@ -280,7 +280,7 @@ func renderHxPostButton(c *button, attrs templ.Attributes) templ.Component {
var templ_7745c5c3_Var10 string var templ_7745c5c3_Var10 string
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(c.hxTrigger) templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(c.hxTrigger)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/button.templ`, Line: 92, Col: 79} return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/button.templ`, Line: 92, Col: 79}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@ -293,7 +293,7 @@ func renderHxPostButton(c *button, attrs templ.Attributes) templ.Component {
var templ_7745c5c3_Var11 string var templ_7745c5c3_Var11 string
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(c.hxSwap) templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(c.hxSwap)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/button.templ`, Line: 92, Col: 100} return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/button.templ`, Line: 92, Col: 100}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {

View File

@ -40,7 +40,7 @@ func renderCard(id string, attrs templ.Attributes) templ.Component {
var templ_7745c5c3_Var2 string var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(id) templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(id)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/card.templ`, Line: 8, Col: 13} return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/card.templ`, Line: 8, Col: 13}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {

View File

@ -54,7 +54,7 @@ func renderText(level int, text string) templ.Component {
var templ_7745c5c3_Var2 string var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(text) templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(text)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/fonts.templ`, Line: 23, Col: 10} return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/fonts.templ`, Line: 23, Col: 10}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@ -72,7 +72,7 @@ func renderText(level int, text string) templ.Component {
var templ_7745c5c3_Var3 string var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(text) templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(text)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/fonts.templ`, Line: 27, Col: 10} return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/fonts.templ`, Line: 27, Col: 10}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@ -90,7 +90,7 @@ func renderText(level int, text string) templ.Component {
var templ_7745c5c3_Var4 string var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(text) templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(text)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/fonts.templ`, Line: 31, Col: 10} return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/fonts.templ`, Line: 31, Col: 10}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@ -108,7 +108,7 @@ func renderText(level int, text string) templ.Component {
var templ_7745c5c3_Var5 string var templ_7745c5c3_Var5 string
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(text) templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(text)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/fonts.templ`, Line: 35, Col: 10} return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/fonts.templ`, Line: 35, Col: 10}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@ -159,7 +159,7 @@ func renderLink(attrs templ.Attributes, text string) templ.Component {
var templ_7745c5c3_Var7 string var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(text) templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(text)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/fonts.templ`, Line: 42, Col: 8} return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/fonts.templ`, Line: 42, Col: 8}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@ -209,7 +209,7 @@ func renderStrong(attrs templ.Attributes, text string) templ.Component {
var templ_7745c5c3_Var9 string var templ_7745c5c3_Var9 string
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(text) templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(text)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/fonts.templ`, Line: 48, Col: 8} return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/fonts.templ`, Line: 48, Col: 8}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@ -259,7 +259,7 @@ func renderEmphasis(attrs templ.Attributes, text string) templ.Component {
var templ_7745c5c3_Var11 string var templ_7745c5c3_Var11 string
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(text) templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(text)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/fonts.templ`, Line: 54, Col: 8} return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/fonts.templ`, Line: 54, Col: 8}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@ -309,7 +309,7 @@ func renderCode(attrs templ.Attributes, text string) templ.Component {
var templ_7745c5c3_Var13 string var templ_7745c5c3_Var13 string
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(text) templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(text)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/fonts.templ`, Line: 60, Col: 8} return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/fonts.templ`, Line: 60, Col: 8}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {

View File

@ -46,7 +46,7 @@ func TextInput(state InputState, label string, placeholder string) templ.Compone
var templ_7745c5c3_Var2 string var templ_7745c5c3_Var2 string
templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(label) templ_7745c5c3_Var2, templ_7745c5c3_Err = templ.JoinStringErrs(label)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/inputs.templ`, Line: 15, Col: 128} return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/inputs.templ`, Line: 15, Col: 128}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var2))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@ -64,7 +64,7 @@ func TextInput(state InputState, label string, placeholder string) templ.Compone
var templ_7745c5c3_Var3 string var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(label) templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(label)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/inputs.templ`, Line: 20, Col: 128} return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/inputs.templ`, Line: 20, Col: 128}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@ -82,7 +82,7 @@ func TextInput(state InputState, label string, placeholder string) templ.Compone
var templ_7745c5c3_Var4 string var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(label) templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(label)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/inputs.templ`, Line: 25, Col: 128} return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/inputs.templ`, Line: 25, Col: 128}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {

View File

@ -100,7 +100,7 @@ func breadcrumbItem(title string, active bool) templ.Component {
var templ_7745c5c3_Var3 string var templ_7745c5c3_Var3 string
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(title) templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs(title)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/panel.templ`, Line: 25, Col: 126} return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/panel.templ`, Line: 25, Col: 126}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
@ -118,7 +118,7 @@ func breadcrumbItem(title string, active bool) templ.Component {
var templ_7745c5c3_Var4 string var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(title) templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(title)
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {
return templ.Error{Err: templ_7745c5c3_Err, FileName: `pkg/nebula/blocks/panel.templ`, Line: 27, Col: 118} return templ.Error{Err: templ_7745c5c3_Err, FileName: `nebula/blocks/panel.templ`, Line: 27, Col: 118}
} }
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
if templ_7745c5c3_Err != nil { if templ_7745c5c3_Err != nil {

Some files were not shown because too many files have changed in this diff Show More