diff --git a/.github/workflows/buf.yml b/.github/workflows/buf.yml deleted file mode 100644 index aa0ef93..0000000 --- a/.github/workflows/buf.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Buf - -on: - push: - branches: [master] - pull_request: - branches: [master] - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: bufbuild/buf-setup-action@v0.6.0 - - uses: bufbuild/buf-lint-action@v1 - with: - input: 'api-spec/protobuf' \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..c80faf3 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,37 @@ +name: Go + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + integration: + name: Tests + runs-on: ubuntu-latest + steps: + - name: Setup Go + uses: actions/setup-go@v3 + with: + go-version: ">1.17.2" + + - name: Checkout code + uses: actions/checkout@v3 + + - name: Seutup buf + uses: bufbuild/buf-setup-action@v1.3.1 + + - name: Check protos + run: make proto-lint + + - name: Run Gosec Security Scanner + uses: securego/gosec@master + with: + args: '-severity high -quiet ./...' + + - name: Get dependencies + run: go get -v -t -d ./... + + - name: Test + run: make test diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..74b9c49 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,74 @@ +name: goreleaser + +on: + workflow_dispatch: + push: + tags: + - "*" + +jobs: + goreleaser: + runs-on: ubuntu-20.04 + env: + DOCKER_CLI_EXPERIMENTAL: "enabled" + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Setup QEMU + uses: docker/setup-qemu-action@v1 + + - name: Setup Go + uses: actions/setup-go@v3 + with: + go-version: ">1.17.2" + + - name: Cache Go modules + uses: actions/cache@v1 + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} + restore-keys: | + ${{ runner.os }}-go- + + # This because https://github.com/plentico/osxcross-target/issues/2#issuecomment-815850611 + - name: Downgrade libssl + run: | + echo 'deb http://security.ubuntu.com/ubuntu bionic-security main' | sudo tee -a /etc/apt/sources.list + sudo apt update && apt-cache policy libssl1.0-dev + sudo apt-get install libssl1.0-dev + + - name: Install OSX cross-compiling targets + run: | + mkdir ../../osxcross + git clone https://github.com/plentico/osxcross-target.git ../../osxcross/target + + - name: Install Linux aarch64 cross-compiling targets + run: sudo apt install gcc make gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu + + + - name: Docker Login + uses: docker/login-action@v1 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Run GoReleaser + uses: goreleaser/goreleaser-action@v2 + with: + version: latest + args: release --rm-dist --debug + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} + + - name: Setup buf + uses: bufbuild/buf-setup-action@v1.3.1 + + - name: Publish protos to Buf Schema Registry + uses: bufbuild/buf-push-action@v1 + with: + input: api-spec/protobuf + buf_token: ${{ secrets.BUF_TOKEN }} \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7e4824a --- /dev/null +++ b/.gitignore @@ -0,0 +1,32 @@ +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# Test binary, built with `go test -c` +*.test + +# Output of the go coverage tool, specifically when used with LiteIDE +*.out + +# Dependency directories (remove the comment below to include it) +# vendor/ + +/build/ +/dist/ + +DS_Store +._.DS_Store +**/.DS_Store +**/._.DS_Store + +test/e2e/* +!test/e2e/*.go + +.vscode/ +.idea + +localhost.key +localhost.crt diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..43d50df --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,181 @@ +builds: + # daemon + + ### Linux + - id: "oceand-linux-amd64" + main: ./cmd/oceand + ldflags: + - -s -X './cmd/oceand/main.version={{.Version}}' -X './cmd/oceand/main.commit={{.Commit}}' -X './cmd/oceand/main.date={{.Date}}' + env: + - CGO_ENABLED=1 + goos: + - linux + goarch: + - amd64 + binary: oceand-linux-amd64 + + - id: "oceand-linux-arm64" + main: ./cmd/oceand + ldflags: + - -s -X './cmd/oceand/main.version={{.Version}}' -X './cmd/oceand/main.commit={{.Commit}}' -X './cmd/oceand/main.date={{.Date}}' + env: + - CGO_ENABLED=1 + - CC=aarch64-linux-gnu-gcc + - CXX=aarch64-linux-gnu-g++ + goos: + - linux + goarch: + - arm64 + binary: oceand-linux-arm64 + + ### Darwin + - id: "oceand-darwin-amd64" + main: ./cmd/oceand + ldflags: + - -s -w + env: + - CGO_ENABLED=1 + - CC=/home/runner/work/osxcross/target/bin/o64-clang + - CXX=/home/runner/work/osxcross/target/bin/o64-clang++ + goos: + - darwin + goarch: + - amd64 + binary: oceand-darwin-amd64 + + - id: "oceand-darwin-arm64" + main: ./cmd/oceand + ldflags: + - -s -X './cmd/oceand/main.version={{.Version}}' -X './cmd/oceand/main.commit={{.Commit}}' -X './cmd/oceand/main.date={{.Date}}' + env: + - CGO_ENABLED=1 + - CC=/home/runner/work/osxcross/target/bin/oa64-clang + - CXX=/home/runner/work/osxcross/target/bin/oa64-clang++ + goos: + - darwin + goarch: + - arm64 + binary: oceand-darwin-arm64 + + # CLI + - id: "ocean" + main: ./cmd/ocean + ldflags: + - -s -X 'main.version={{.Version}}' -X 'main.commit={{.Commit}}' -X 'main.date={{.Date}}' + goos: + - linux + - darwin + goarch: + - amd64 + - arm64 + binary: ocean-darwin + +## flag the semver v**.**.**-.* as pre-release on Github +release: + prerelease: auto + +checksum: + name_template: "checksums.txt" + + +snapshot: + name_template: "{{ .Tag }}-next" + +changelog: + use: github + +archives: + - id: oceand + format: binary + builds: + - oceand-linux-amd64 + - oceand-linux-arm64 + - oceand-darwin-amd64 + - oceand-darwin-arm64 + name_template: "oceand-v{{ .Version }}-{{ .Os }}-{{ .Arch }}" + + - id: ocean + format: binary + builds: + - ocean + name_template: "ocean-v{{ .Version }}-{{ .Os }}-{{ .Arch }}" + +dockers: + ########################### + # tag latest & prerelease # + ########################### + + #amd64 + - image_templates: + - "ghcr.io/vulpemventures/oceand:{{ .Tag }}-amd64" + # push always either release or prerelease with a docker tag with the semver only + skip_push: "false" + use: buildx + dockerfile: Dockerfile + # GOOS of the built binaries/packages that should be used. + goos: linux + # GOARCH of the built binaries/packages that should be used. + goarch: amd64 + # Template of the docker build flags. + build_flag_templates: + - "--platform=linux/amd64" + - "--pull" + - "--label=org.opencontainers.image.created={{.Date}}" + - "--label=org.opencontainers.image.title=oceand" + - "--label=org.opencontainers.image.revision={{.FullCommit}}" + - "--label=org.opencontainers.image.version={{.Version}}" + - "--build-arg=VERSION={{.Version}}" + - "--build-arg=COMMIT={{.Commit}}" + - "--build-arg=DATE={{.Date}}" + + extra_files: + - go.mod + - go.sum + - internal + - pkg + - cmd + - api-spec + + # arm64 + - image_templates: + - "ghcr.io/vulpemventures/oceand:{{ .Tag }}-arm64v8" + # push always either release or prerelease with a docker tag with the semver only + skip_push: "false" + use: buildx + dockerfile: Dockerfile + # GOOS of the built binaries/packages that should be used. + goos: linux + # GOARCH of the built binaries/packages that should be used. + goarch: arm64 + # Template of the docker build flags. + build_flag_templates: + - "--platform=linux/arm64/v8" + - "--pull" + - "--label=org.opencontainers.image.created={{.Date}}" + - "--label=org.opencontainers.image.title=oceand" + - "--label=org.opencontainers.image.revision={{.FullCommit}}" + - "--label=org.opencontainers.image.version={{.Version}}" + - "--build-arg=VERSION={{.Version}}" + - "--build-arg=COMMIT={{.Commit}}" + - "--build-arg=DATE={{.Date}}" + + extra_files: + - go.mod + - go.sum + - internal + - pkg + - cmd + - api-spec + +docker_manifests: + - name_template: ghcr.io/vulpemventures/oceand:{{ .Tag }} + image_templates: + - ghcr.io/vulpemventures/oceand:{{ .Tag }}-amd64 + - ghcr.io/vulpemventures/oceand:{{ .Tag }}-arm64v8 + skip_push: "false" + + - name_template: ghcr.io/vulpemventures/oceand:latest + image_templates: + - ghcr.io/vulpemventures/oceand:{{ .Tag }}-amd64 + - ghcr.io/vulpemventures/oceand:{{ .Tag }}-arm64v8 + skip_push: auto diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..bf7bd68 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,43 @@ +# first image used to build the sources +FROM golang:1.17-buster AS builder + +ARG VERSION +ARG COMMIT +ARG DATE +ARG TARGETOS +ARG TARGETARCH + + +WORKDIR /oceand + +COPY . . +RUN go mod download + +RUN CGO_ENABLED=1 GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -ldflags="-X 'main.Version=${COMMIT}' -X 'main.Commit=${COMMIT}' -X 'main.Date=${COMMIT}'" -o oceand-linux cmd/oceand/main.go +RUN go build -ldflags="-X 'main.version=${VERSION}' -X 'main.commit=${COMMIT}' -X 'main.date=${DATE}'" -o ocean cmd/ocean/* + +WORKDIR /build + +RUN cp /oceand/oceand-linux . +RUN cp /oceand/ocean . + +# Second image, running the oceand executable +FROM debian:buster + +RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates + +COPY --from=builder /build/oceand-linux / +COPY --from=builder /build/ocean / + +RUN install /ocean /bin +# Prevents `VOLUME $HOME/.oceand/` being created as owned by `root` +RUN useradd -ms /bin/bash user +USER user +RUN mkdir -p "$HOME/.oceand/" + +# Expose ports of grpc server and profiler +EXPOSE 18000 +EXPOSE 18001 + +CMD /oceand-linux + diff --git a/Makefile b/Makefile index 97c5898..107fee5 100644 --- a/Makefile +++ b/Makefile @@ -1,13 +1,60 @@ -.PHONY: docker-lint docker-proto lint proto +.PHONY: build build-cli clean cov docker-proto docker-proto-lint help proto proto-lint run test vet -docker-lint: +## build: build for all platforms +build: + @echo "Building oceand binary..." + @chmod u+x ./scripts/build + @./scripts/build + +## build-cli: build CLI for all platforms +build-cli: + @echo "Building ocean-cli binary..." + @chmod u+x ./scripts/build-cli + @./scripts/build-cli + +clean: + @echo "Cleaning..." + @go clean + +docker-proto-lint: @docker run --rm --volume "$(shell pwd):/workspace" --workdir /workspace bufbuild/buf lint -docker-proto: docker-lint +docker-proto: docker-proto-lint @docker run --rm --volume "$(shell pwd):/workspace" --workdir /workspace bufbuild/buf generate -lint: +proto: proto-lint + @buf generate + +proto-lint: @buf lint -proto: lint - @buf generate \ No newline at end of file +fmt: + @echo "Gofmt..." + @if [ -n "$(gofmt -l .)" ]; then echo "Go code is not formatted"; exit 1; fi + +run: clean + @echo "Running oceand..." + @export OCEAN_NETWORK=regtest; \ + export OCEAN_LOG_LEVEL=5; \ + export OCEAN_NO_TLS=true; \ + export OCEAN_STATS_INTERVAL=120; \ + export OCEAN_ESPLORA_URL=http://localhost:3001; \ + export OCEAN_NODE_PEERS="localhost:18886"; \ + export OCEAN_UTXO_EXPIRY_DURATION_IN_SECONDS=60; \ + go run ./cmd/oceand + +test: fmt + @echo "Testing..." + go test --race --count=1 -v ./... + +cov: + @echo "Coverage..." + go test -cover ./... + +vet: + @echo "Vet..." + @go vet ./... + +help: + @echo "Usage: \n" + @sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /' diff --git a/api-spec/protobuf/buf.yaml b/api-spec/protobuf/buf.yaml index 4a1a272..e7e7608 100644 --- a/api-spec/protobuf/buf.yaml +++ b/api-spec/protobuf/buf.yaml @@ -1,4 +1,5 @@ version: v1 +name: buf.build/vulpemventures/ocean breaking: use: - FILE diff --git a/api-spec/protobuf/gen/go/ocean/v1/account.pb.go b/api-spec/protobuf/gen/go/ocean/v1/account.pb.go new file mode 100644 index 0000000..9dbac04 --- /dev/null +++ b/api-spec/protobuf/gen/go/ocean/v1/account.pb.go @@ -0,0 +1,1428 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc (unknown) +// source: ocean/v1/account.proto + +package oceanv1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +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 CreateAccountBIP44Request struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Name of the account. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *CreateAccountBIP44Request) Reset() { + *x = CreateAccountBIP44Request{} + if protoimpl.UnsafeEnabled { + mi := &file_ocean_v1_account_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateAccountBIP44Request) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateAccountBIP44Request) ProtoMessage() {} + +func (x *CreateAccountBIP44Request) ProtoReflect() protoreflect.Message { + mi := &file_ocean_v1_account_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) +} + +// Deprecated: Use CreateAccountBIP44Request.ProtoReflect.Descriptor instead. +func (*CreateAccountBIP44Request) Descriptor() ([]byte, []int) { + return file_ocean_v1_account_proto_rawDescGZIP(), []int{0} +} + +func (x *CreateAccountBIP44Request) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type CreateAccountBIP44Response struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Account name. + AccountName string `protobuf:"bytes,1,opt,name=account_name,json=accountName,proto3" json:"account_name,omitempty"` + // Account index. + AccountIndex uint32 `protobuf:"varint,2,opt,name=account_index,json=accountIndex,proto3" json:"account_index,omitempty"` + // Xpub. + Xpub string `protobuf:"bytes,3,opt,name=xpub,proto3" json:"xpub,omitempty"` +} + +func (x *CreateAccountBIP44Response) Reset() { + *x = CreateAccountBIP44Response{} + if protoimpl.UnsafeEnabled { + mi := &file_ocean_v1_account_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateAccountBIP44Response) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateAccountBIP44Response) ProtoMessage() {} + +func (x *CreateAccountBIP44Response) ProtoReflect() protoreflect.Message { + mi := &file_ocean_v1_account_proto_msgTypes[1] + 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) +} + +// Deprecated: Use CreateAccountBIP44Response.ProtoReflect.Descriptor instead. +func (*CreateAccountBIP44Response) Descriptor() ([]byte, []int) { + return file_ocean_v1_account_proto_rawDescGZIP(), []int{1} +} + +func (x *CreateAccountBIP44Response) GetAccountName() string { + if x != nil { + return x.AccountName + } + return "" +} + +func (x *CreateAccountBIP44Response) GetAccountIndex() uint32 { + if x != nil { + return x.AccountIndex + } + return 0 +} + +func (x *CreateAccountBIP44Response) GetXpub() string { + if x != nil { + return x.Xpub + } + return "" +} + +type CreateAccountCustomRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Name of the account. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (x *CreateAccountCustomRequest) Reset() { + *x = CreateAccountCustomRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_ocean_v1_account_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateAccountCustomRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateAccountCustomRequest) ProtoMessage() {} + +func (x *CreateAccountCustomRequest) ProtoReflect() protoreflect.Message { + mi := &file_ocean_v1_account_proto_msgTypes[2] + 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) +} + +// Deprecated: Use CreateAccountCustomRequest.ProtoReflect.Descriptor instead. +func (*CreateAccountCustomRequest) Descriptor() ([]byte, []int) { + return file_ocean_v1_account_proto_rawDescGZIP(), []int{2} +} + +func (x *CreateAccountCustomRequest) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +type CreateAccountCustomResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Account name. + AccountName string `protobuf:"bytes,1,opt,name=account_name,json=accountName,proto3" json:"account_name,omitempty"` + // The custom derivation path of the new account. + DerivationPath string `protobuf:"bytes,2,opt,name=derivation_path,json=derivationPath,proto3" json:"derivation_path,omitempty"` + // Xpub. + Xpub string `protobuf:"bytes,3,opt,name=xpub,proto3" json:"xpub,omitempty"` +} + +func (x *CreateAccountCustomResponse) Reset() { + *x = CreateAccountCustomResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_ocean_v1_account_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *CreateAccountCustomResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*CreateAccountCustomResponse) ProtoMessage() {} + +func (x *CreateAccountCustomResponse) ProtoReflect() protoreflect.Message { + mi := &file_ocean_v1_account_proto_msgTypes[3] + 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) +} + +// Deprecated: Use CreateAccountCustomResponse.ProtoReflect.Descriptor instead. +func (*CreateAccountCustomResponse) Descriptor() ([]byte, []int) { + return file_ocean_v1_account_proto_rawDescGZIP(), []int{3} +} + +func (x *CreateAccountCustomResponse) GetAccountName() string { + if x != nil { + return x.AccountName + } + return "" +} + +func (x *CreateAccountCustomResponse) GetDerivationPath() string { + if x != nil { + return x.DerivationPath + } + return "" +} + +func (x *CreateAccountCustomResponse) GetXpub() string { + if x != nil { + return x.Xpub + } + return "" +} + +type SetAccountTemplateRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Account name. + AccountName string `protobuf:"bytes,1,opt,name=account_name,json=accountName,proto3" json:"account_name,omitempty"` + // Output descriptor template. + Template *Template `protobuf:"bytes,2,opt,name=template,proto3" json:"template,omitempty"` +} + +func (x *SetAccountTemplateRequest) Reset() { + *x = SetAccountTemplateRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_ocean_v1_account_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetAccountTemplateRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetAccountTemplateRequest) ProtoMessage() {} + +func (x *SetAccountTemplateRequest) ProtoReflect() protoreflect.Message { + mi := &file_ocean_v1_account_proto_msgTypes[4] + 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) +} + +// Deprecated: Use SetAccountTemplateRequest.ProtoReflect.Descriptor instead. +func (*SetAccountTemplateRequest) Descriptor() ([]byte, []int) { + return file_ocean_v1_account_proto_rawDescGZIP(), []int{4} +} + +func (x *SetAccountTemplateRequest) GetAccountName() string { + if x != nil { + return x.AccountName + } + return "" +} + +func (x *SetAccountTemplateRequest) GetTemplate() *Template { + if x != nil { + return x.Template + } + return nil +} + +type SetAccountTemplateResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *SetAccountTemplateResponse) Reset() { + *x = SetAccountTemplateResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_ocean_v1_account_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *SetAccountTemplateResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*SetAccountTemplateResponse) ProtoMessage() {} + +func (x *SetAccountTemplateResponse) ProtoReflect() protoreflect.Message { + mi := &file_ocean_v1_account_proto_msgTypes[5] + 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) +} + +// Deprecated: Use SetAccountTemplateResponse.ProtoReflect.Descriptor instead. +func (*SetAccountTemplateResponse) Descriptor() ([]byte, []int) { + return file_ocean_v1_account_proto_rawDescGZIP(), []int{5} +} + +type DeriveAddressRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Account name. + AccountName string `protobuf:"bytes,1,opt,name=account_name,json=accountName,proto3" json:"account_name,omitempty"` + // The number of addresses to generate. + NumOfAddresses uint64 `protobuf:"varint,2,opt,name=num_of_addresses,json=numOfAddresses,proto3" json:"num_of_addresses,omitempty"` +} + +func (x *DeriveAddressRequest) Reset() { + *x = DeriveAddressRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_ocean_v1_account_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeriveAddressRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeriveAddressRequest) ProtoMessage() {} + +func (x *DeriveAddressRequest) ProtoReflect() protoreflect.Message { + mi := &file_ocean_v1_account_proto_msgTypes[6] + 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) +} + +// Deprecated: Use DeriveAddressRequest.ProtoReflect.Descriptor instead. +func (*DeriveAddressRequest) Descriptor() ([]byte, []int) { + return file_ocean_v1_account_proto_rawDescGZIP(), []int{6} +} + +func (x *DeriveAddressRequest) GetAccountName() string { + if x != nil { + return x.AccountName + } + return "" +} + +func (x *DeriveAddressRequest) GetNumOfAddresses() uint64 { + if x != nil { + return x.NumOfAddresses + } + return 0 +} + +type DeriveAddressResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Addresses []string `protobuf:"bytes,1,rep,name=addresses,proto3" json:"addresses,omitempty"` +} + +func (x *DeriveAddressResponse) Reset() { + *x = DeriveAddressResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_ocean_v1_account_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeriveAddressResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeriveAddressResponse) ProtoMessage() {} + +func (x *DeriveAddressResponse) ProtoReflect() protoreflect.Message { + mi := &file_ocean_v1_account_proto_msgTypes[7] + 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) +} + +// Deprecated: Use DeriveAddressResponse.ProtoReflect.Descriptor instead. +func (*DeriveAddressResponse) Descriptor() ([]byte, []int) { + return file_ocean_v1_account_proto_rawDescGZIP(), []int{7} +} + +func (x *DeriveAddressResponse) GetAddresses() []string { + if x != nil { + return x.Addresses + } + return nil +} + +type DeriveChangeAddressRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Account name. + AccountName string `protobuf:"bytes,1,opt,name=account_name,json=accountName,proto3" json:"account_name,omitempty"` + // The number of addresses to generate. + NumOfAddresses uint64 `protobuf:"varint,2,opt,name=num_of_addresses,json=numOfAddresses,proto3" json:"num_of_addresses,omitempty"` +} + +func (x *DeriveChangeAddressRequest) Reset() { + *x = DeriveChangeAddressRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_ocean_v1_account_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeriveChangeAddressRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeriveChangeAddressRequest) ProtoMessage() {} + +func (x *DeriveChangeAddressRequest) ProtoReflect() protoreflect.Message { + mi := &file_ocean_v1_account_proto_msgTypes[8] + 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) +} + +// Deprecated: Use DeriveChangeAddressRequest.ProtoReflect.Descriptor instead. +func (*DeriveChangeAddressRequest) Descriptor() ([]byte, []int) { + return file_ocean_v1_account_proto_rawDescGZIP(), []int{8} +} + +func (x *DeriveChangeAddressRequest) GetAccountName() string { + if x != nil { + return x.AccountName + } + return "" +} + +func (x *DeriveChangeAddressRequest) GetNumOfAddresses() uint64 { + if x != nil { + return x.NumOfAddresses + } + return 0 +} + +type DeriveChangeAddressResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Addresses []string `protobuf:"bytes,1,rep,name=addresses,proto3" json:"addresses,omitempty"` +} + +func (x *DeriveChangeAddressResponse) Reset() { + *x = DeriveChangeAddressResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_ocean_v1_account_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeriveChangeAddressResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeriveChangeAddressResponse) ProtoMessage() {} + +func (x *DeriveChangeAddressResponse) ProtoReflect() protoreflect.Message { + mi := &file_ocean_v1_account_proto_msgTypes[9] + 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) +} + +// Deprecated: Use DeriveChangeAddressResponse.ProtoReflect.Descriptor instead. +func (*DeriveChangeAddressResponse) Descriptor() ([]byte, []int) { + return file_ocean_v1_account_proto_rawDescGZIP(), []int{9} +} + +func (x *DeriveChangeAddressResponse) GetAddresses() []string { + if x != nil { + return x.Addresses + } + return nil +} + +type ListAddressesRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Account name. + AccountName string `protobuf:"bytes,1,opt,name=account_name,json=accountName,proto3" json:"account_name,omitempty"` +} + +func (x *ListAddressesRequest) Reset() { + *x = ListAddressesRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_ocean_v1_account_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListAddressesRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListAddressesRequest) ProtoMessage() {} + +func (x *ListAddressesRequest) ProtoReflect() protoreflect.Message { + mi := &file_ocean_v1_account_proto_msgTypes[10] + 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) +} + +// Deprecated: Use ListAddressesRequest.ProtoReflect.Descriptor instead. +func (*ListAddressesRequest) Descriptor() ([]byte, []int) { + return file_ocean_v1_account_proto_rawDescGZIP(), []int{10} +} + +func (x *ListAddressesRequest) GetAccountName() string { + if x != nil { + return x.AccountName + } + return "" +} + +type ListAddressesResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Addresses []string `protobuf:"bytes,1,rep,name=addresses,proto3" json:"addresses,omitempty"` +} + +func (x *ListAddressesResponse) Reset() { + *x = ListAddressesResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_ocean_v1_account_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListAddressesResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListAddressesResponse) ProtoMessage() {} + +func (x *ListAddressesResponse) ProtoReflect() protoreflect.Message { + mi := &file_ocean_v1_account_proto_msgTypes[11] + 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) +} + +// Deprecated: Use ListAddressesResponse.ProtoReflect.Descriptor instead. +func (*ListAddressesResponse) Descriptor() ([]byte, []int) { + return file_ocean_v1_account_proto_rawDescGZIP(), []int{11} +} + +func (x *ListAddressesResponse) GetAddresses() []string { + if x != nil { + return x.Addresses + } + return nil +} + +type BalanceRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Account name. + AccountName string `protobuf:"bytes,1,opt,name=account_name,json=accountName,proto3" json:"account_name,omitempty"` + // Addresses for which calculating balance. If not specified, the cumulative + // balance is returned. + Addresses []string `protobuf:"bytes,3,rep,name=addresses,proto3" json:"addresses,omitempty"` +} + +func (x *BalanceRequest) Reset() { + *x = BalanceRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_ocean_v1_account_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BalanceRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BalanceRequest) ProtoMessage() {} + +func (x *BalanceRequest) ProtoReflect() protoreflect.Message { + mi := &file_ocean_v1_account_proto_msgTypes[12] + 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) +} + +// Deprecated: Use BalanceRequest.ProtoReflect.Descriptor instead. +func (*BalanceRequest) Descriptor() ([]byte, []int) { + return file_ocean_v1_account_proto_rawDescGZIP(), []int{12} +} + +func (x *BalanceRequest) GetAccountName() string { + if x != nil { + return x.AccountName + } + return "" +} + +func (x *BalanceRequest) GetAddresses() []string { + if x != nil { + return x.Addresses + } + return nil +} + +type BalanceResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The balance (total, confirmed, unconfirmed) per each asset. + Balance map[string]*BalanceInfo `protobuf:"bytes,1,rep,name=balance,proto3" json:"balance,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` +} + +func (x *BalanceResponse) Reset() { + *x = BalanceResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_ocean_v1_account_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BalanceResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BalanceResponse) ProtoMessage() {} + +func (x *BalanceResponse) ProtoReflect() protoreflect.Message { + mi := &file_ocean_v1_account_proto_msgTypes[13] + 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) +} + +// Deprecated: Use BalanceResponse.ProtoReflect.Descriptor instead. +func (*BalanceResponse) Descriptor() ([]byte, []int) { + return file_ocean_v1_account_proto_rawDescGZIP(), []int{13} +} + +func (x *BalanceResponse) GetBalance() map[string]*BalanceInfo { + if x != nil { + return x.Balance + } + return nil +} + +type ListUtxosRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Account name. + AccountName string `protobuf:"bytes,1,opt,name=account_name,json=accountName,proto3" json:"account_name,omitempty"` + // List of account's addresses for which listing utxos. If not specified, + // the list of all utxos owned by the account is returned. + Addresses []string `protobuf:"bytes,3,rep,name=addresses,proto3" json:"addresses,omitempty"` +} + +func (x *ListUtxosRequest) Reset() { + *x = ListUtxosRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_ocean_v1_account_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListUtxosRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListUtxosRequest) ProtoMessage() {} + +func (x *ListUtxosRequest) ProtoReflect() protoreflect.Message { + mi := &file_ocean_v1_account_proto_msgTypes[14] + 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) +} + +// Deprecated: Use ListUtxosRequest.ProtoReflect.Descriptor instead. +func (*ListUtxosRequest) Descriptor() ([]byte, []int) { + return file_ocean_v1_account_proto_rawDescGZIP(), []int{14} +} + +func (x *ListUtxosRequest) GetAccountName() string { + if x != nil { + return x.AccountName + } + return "" +} + +func (x *ListUtxosRequest) GetAddresses() []string { + if x != nil { + return x.Addresses + } + return nil +} + +type ListUtxosResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // List of spendable utxos. + SpendableUtxos *Utxos `protobuf:"bytes,1,opt,name=spendable_utxos,json=spendableUtxos,proto3" json:"spendable_utxos,omitempty"` + // List of currently locked utxos. + LockedUtxos *Utxos `protobuf:"bytes,2,opt,name=locked_utxos,json=lockedUtxos,proto3" json:"locked_utxos,omitempty"` +} + +func (x *ListUtxosResponse) Reset() { + *x = ListUtxosResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_ocean_v1_account_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListUtxosResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListUtxosResponse) ProtoMessage() {} + +func (x *ListUtxosResponse) ProtoReflect() protoreflect.Message { + mi := &file_ocean_v1_account_proto_msgTypes[15] + 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) +} + +// Deprecated: Use ListUtxosResponse.ProtoReflect.Descriptor instead. +func (*ListUtxosResponse) Descriptor() ([]byte, []int) { + return file_ocean_v1_account_proto_rawDescGZIP(), []int{15} +} + +func (x *ListUtxosResponse) GetSpendableUtxos() *Utxos { + if x != nil { + return x.SpendableUtxos + } + return nil +} + +func (x *ListUtxosResponse) GetLockedUtxos() *Utxos { + if x != nil { + return x.LockedUtxos + } + return nil +} + +type DeleteAccountRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Account name. + AccountName string `protobuf:"bytes,1,opt,name=account_name,json=accountName,proto3" json:"account_name,omitempty"` +} + +func (x *DeleteAccountRequest) Reset() { + *x = DeleteAccountRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_ocean_v1_account_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteAccountRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteAccountRequest) ProtoMessage() {} + +func (x *DeleteAccountRequest) ProtoReflect() protoreflect.Message { + mi := &file_ocean_v1_account_proto_msgTypes[16] + 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) +} + +// Deprecated: Use DeleteAccountRequest.ProtoReflect.Descriptor instead. +func (*DeleteAccountRequest) Descriptor() ([]byte, []int) { + return file_ocean_v1_account_proto_rawDescGZIP(), []int{16} +} + +func (x *DeleteAccountRequest) GetAccountName() string { + if x != nil { + return x.AccountName + } + return "" +} + +type DeleteAccountResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *DeleteAccountResponse) Reset() { + *x = DeleteAccountResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_ocean_v1_account_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeleteAccountResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeleteAccountResponse) ProtoMessage() {} + +func (x *DeleteAccountResponse) ProtoReflect() protoreflect.Message { + mi := &file_ocean_v1_account_proto_msgTypes[17] + 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) +} + +// Deprecated: Use DeleteAccountResponse.ProtoReflect.Descriptor instead. +func (*DeleteAccountResponse) Descriptor() ([]byte, []int) { + return file_ocean_v1_account_proto_rawDescGZIP(), []int{17} +} + +var File_ocean_v1_account_proto protoreflect.FileDescriptor + +var file_ocean_v1_account_proto_rawDesc = []byte{ + 0x0a, 0x16, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, + 0x76, 0x31, 0x1a, 0x14, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x79, 0x70, + 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2f, 0x0a, 0x19, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x49, 0x50, 0x34, 0x34, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x78, 0x0a, 0x1a, 0x43, 0x72, 0x65, + 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x49, 0x50, 0x34, 0x34, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x0c, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x64, 0x65, 0x78, 0x12, + 0x12, 0x0a, 0x04, 0x78, 0x70, 0x75, 0x62, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x78, + 0x70, 0x75, 0x62, 0x22, 0x30, 0x0a, 0x1a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x7d, 0x0a, 0x1b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x64, 0x65, 0x72, 0x69, 0x76, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0e, 0x64, 0x65, 0x72, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x74, 0x68, + 0x12, 0x12, 0x0a, 0x04, 0x78, 0x70, 0x75, 0x62, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x78, 0x70, 0x75, 0x62, 0x22, 0x6e, 0x0a, 0x19, 0x53, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2e, 0x0a, 0x08, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, + 0x31, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x08, 0x74, 0x65, 0x6d, 0x70, + 0x6c, 0x61, 0x74, 0x65, 0x22, 0x1c, 0x0a, 0x1a, 0x53, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x63, 0x0a, 0x14, 0x44, 0x65, 0x72, 0x69, 0x76, 0x65, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x28, 0x0a, + 0x10, 0x6e, 0x75, 0x6d, 0x5f, 0x6f, 0x66, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, + 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0e, 0x6e, 0x75, 0x6d, 0x4f, 0x66, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x22, 0x35, 0x0a, 0x15, 0x44, 0x65, 0x72, 0x69, 0x76, + 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, + 0x03, 0x28, 0x09, 0x52, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x22, 0x69, + 0x0a, 0x1a, 0x44, 0x65, 0x72, 0x69, 0x76, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, + 0x28, 0x0a, 0x10, 0x6e, 0x75, 0x6d, 0x5f, 0x6f, 0x66, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0e, 0x6e, 0x75, 0x6d, 0x4f, 0x66, + 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x22, 0x3b, 0x0a, 0x1b, 0x44, 0x65, 0x72, + 0x69, 0x76, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x22, 0x39, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, + 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, + 0x65, 0x22, 0x35, 0x0a, 0x15, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x22, 0x51, 0x0a, 0x0e, 0x42, 0x61, 0x6c, 0x61, + 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, + 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, + 0x52, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x22, 0xa6, 0x01, 0x0a, 0x0f, + 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x40, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x26, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x6c, 0x61, + 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x61, 0x6c, 0x61, + 0x6e, 0x63, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, + 0x65, 0x1a, 0x51, 0x0a, 0x0c, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x45, 0x6e, 0x74, 0x72, + 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, + 0x6b, 0x65, 0x79, 0x12, 0x2b, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, + 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, + 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x22, 0x53, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x74, 0x78, 0x6f, + 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x22, 0x81, 0x01, 0x0a, 0x11, 0x4c, 0x69, + 0x73, 0x74, 0x55, 0x74, 0x78, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x38, 0x0a, 0x0f, 0x73, 0x70, 0x65, 0x6e, 0x64, 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x75, 0x74, 0x78, + 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, + 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x74, 0x78, 0x6f, 0x73, 0x52, 0x0e, 0x73, 0x70, 0x65, 0x6e, 0x64, + 0x61, 0x62, 0x6c, 0x65, 0x55, 0x74, 0x78, 0x6f, 0x73, 0x12, 0x32, 0x0a, 0x0c, 0x6c, 0x6f, 0x63, + 0x6b, 0x65, 0x64, 0x5f, 0x75, 0x74, 0x78, 0x6f, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x0f, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x74, 0x78, 0x6f, 0x73, + 0x52, 0x0b, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x55, 0x74, 0x78, 0x6f, 0x73, 0x22, 0x39, 0x0a, + 0x14, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x22, 0x17, 0x0a, 0x15, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x32, 0x96, 0x06, 0x0a, 0x0e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x65, 0x72, + 0x76, 0x69, 0x63, 0x65, 0x12, 0x5f, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x49, 0x50, 0x34, 0x34, 0x12, 0x23, 0x2e, 0x6f, 0x63, 0x65, + 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x42, 0x49, 0x50, 0x34, 0x34, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x24, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x49, 0x50, 0x34, 0x34, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x62, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x12, 0x24, 0x2e, 0x6f, + 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x43, 0x75, 0x73, 0x74, 0x6f, + 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5f, 0x0a, 0x12, 0x53, 0x65, 0x74, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, + 0x23, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x41, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, + 0x53, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, + 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x0d, 0x44, 0x65, + 0x72, 0x69, 0x76, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1e, 0x2e, 0x6f, 0x63, + 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x72, 0x69, 0x76, 0x65, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6f, 0x63, + 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x72, 0x69, 0x76, 0x65, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x62, 0x0a, 0x13, + 0x44, 0x65, 0x72, 0x69, 0x76, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x12, 0x24, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x44, + 0x65, 0x72, 0x69, 0x76, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, + 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x6f, 0x63, 0x65, 0x61, + 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x72, 0x69, 0x76, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, + 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x50, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, + 0x73, 0x12, 0x1e, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x1f, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, + 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x07, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x18, 0x2e, + 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, + 0x76, 0x31, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x44, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x74, 0x78, 0x6f, 0x73, 0x12, + 0x1a, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, + 0x74, 0x78, 0x6f, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x6f, 0x63, + 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x74, 0x78, 0x6f, 0x73, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, + 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1e, 0x2e, 0x6f, 0x63, 0x65, 0x61, + 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6f, 0x63, 0x65, 0x61, + 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0xa5, 0x01, 0x0a, 0x0c, 0x63, + 0x6f, 0x6d, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x0c, 0x41, 0x63, 0x63, + 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x46, 0x67, 0x69, 0x74, + 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x76, 0x75, 0x6c, 0x70, 0x65, 0x6d, 0x76, 0x65, + 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2f, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2f, 0x61, 0x70, 0x69, + 0x2d, 0x73, 0x70, 0x65, 0x63, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x67, + 0x65, 0x6e, 0x2f, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x6f, 0x63, 0x65, 0x61, + 0x6e, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4f, 0x58, 0x58, 0xaa, 0x02, 0x08, 0x4f, 0x63, 0x65, 0x61, + 0x6e, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x08, 0x4f, 0x63, 0x65, 0x61, 0x6e, 0x5c, 0x56, 0x31, 0xe2, + 0x02, 0x14, 0x4f, 0x63, 0x65, 0x61, 0x6e, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, + 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x4f, 0x63, 0x65, 0x61, 0x6e, 0x3a, 0x3a, + 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_ocean_v1_account_proto_rawDescOnce sync.Once + file_ocean_v1_account_proto_rawDescData = file_ocean_v1_account_proto_rawDesc +) + +func file_ocean_v1_account_proto_rawDescGZIP() []byte { + file_ocean_v1_account_proto_rawDescOnce.Do(func() { + file_ocean_v1_account_proto_rawDescData = protoimpl.X.CompressGZIP(file_ocean_v1_account_proto_rawDescData) + }) + return file_ocean_v1_account_proto_rawDescData +} + +var file_ocean_v1_account_proto_msgTypes = make([]protoimpl.MessageInfo, 19) +var file_ocean_v1_account_proto_goTypes = []interface{}{ + (*CreateAccountBIP44Request)(nil), // 0: ocean.v1.CreateAccountBIP44Request + (*CreateAccountBIP44Response)(nil), // 1: ocean.v1.CreateAccountBIP44Response + (*CreateAccountCustomRequest)(nil), // 2: ocean.v1.CreateAccountCustomRequest + (*CreateAccountCustomResponse)(nil), // 3: ocean.v1.CreateAccountCustomResponse + (*SetAccountTemplateRequest)(nil), // 4: ocean.v1.SetAccountTemplateRequest + (*SetAccountTemplateResponse)(nil), // 5: ocean.v1.SetAccountTemplateResponse + (*DeriveAddressRequest)(nil), // 6: ocean.v1.DeriveAddressRequest + (*DeriveAddressResponse)(nil), // 7: ocean.v1.DeriveAddressResponse + (*DeriveChangeAddressRequest)(nil), // 8: ocean.v1.DeriveChangeAddressRequest + (*DeriveChangeAddressResponse)(nil), // 9: ocean.v1.DeriveChangeAddressResponse + (*ListAddressesRequest)(nil), // 10: ocean.v1.ListAddressesRequest + (*ListAddressesResponse)(nil), // 11: ocean.v1.ListAddressesResponse + (*BalanceRequest)(nil), // 12: ocean.v1.BalanceRequest + (*BalanceResponse)(nil), // 13: ocean.v1.BalanceResponse + (*ListUtxosRequest)(nil), // 14: ocean.v1.ListUtxosRequest + (*ListUtxosResponse)(nil), // 15: ocean.v1.ListUtxosResponse + (*DeleteAccountRequest)(nil), // 16: ocean.v1.DeleteAccountRequest + (*DeleteAccountResponse)(nil), // 17: ocean.v1.DeleteAccountResponse + nil, // 18: ocean.v1.BalanceResponse.BalanceEntry + (*Template)(nil), // 19: ocean.v1.Template + (*Utxos)(nil), // 20: ocean.v1.Utxos + (*BalanceInfo)(nil), // 21: ocean.v1.BalanceInfo +} +var file_ocean_v1_account_proto_depIdxs = []int32{ + 19, // 0: ocean.v1.SetAccountTemplateRequest.template:type_name -> ocean.v1.Template + 18, // 1: ocean.v1.BalanceResponse.balance:type_name -> ocean.v1.BalanceResponse.BalanceEntry + 20, // 2: ocean.v1.ListUtxosResponse.spendable_utxos:type_name -> ocean.v1.Utxos + 20, // 3: ocean.v1.ListUtxosResponse.locked_utxos:type_name -> ocean.v1.Utxos + 21, // 4: ocean.v1.BalanceResponse.BalanceEntry.value:type_name -> ocean.v1.BalanceInfo + 0, // 5: ocean.v1.AccountService.CreateAccountBIP44:input_type -> ocean.v1.CreateAccountBIP44Request + 2, // 6: ocean.v1.AccountService.CreateAccountCustom:input_type -> ocean.v1.CreateAccountCustomRequest + 4, // 7: ocean.v1.AccountService.SetAccountTemplate:input_type -> ocean.v1.SetAccountTemplateRequest + 6, // 8: ocean.v1.AccountService.DeriveAddress:input_type -> ocean.v1.DeriveAddressRequest + 8, // 9: ocean.v1.AccountService.DeriveChangeAddress:input_type -> ocean.v1.DeriveChangeAddressRequest + 10, // 10: ocean.v1.AccountService.ListAddresses:input_type -> ocean.v1.ListAddressesRequest + 12, // 11: ocean.v1.AccountService.Balance:input_type -> ocean.v1.BalanceRequest + 14, // 12: ocean.v1.AccountService.ListUtxos:input_type -> ocean.v1.ListUtxosRequest + 16, // 13: ocean.v1.AccountService.DeleteAccount:input_type -> ocean.v1.DeleteAccountRequest + 1, // 14: ocean.v1.AccountService.CreateAccountBIP44:output_type -> ocean.v1.CreateAccountBIP44Response + 3, // 15: ocean.v1.AccountService.CreateAccountCustom:output_type -> ocean.v1.CreateAccountCustomResponse + 5, // 16: ocean.v1.AccountService.SetAccountTemplate:output_type -> ocean.v1.SetAccountTemplateResponse + 7, // 17: ocean.v1.AccountService.DeriveAddress:output_type -> ocean.v1.DeriveAddressResponse + 9, // 18: ocean.v1.AccountService.DeriveChangeAddress:output_type -> ocean.v1.DeriveChangeAddressResponse + 11, // 19: ocean.v1.AccountService.ListAddresses:output_type -> ocean.v1.ListAddressesResponse + 13, // 20: ocean.v1.AccountService.Balance:output_type -> ocean.v1.BalanceResponse + 15, // 21: ocean.v1.AccountService.ListUtxos:output_type -> ocean.v1.ListUtxosResponse + 17, // 22: ocean.v1.AccountService.DeleteAccount:output_type -> ocean.v1.DeleteAccountResponse + 14, // [14:23] is the sub-list for method output_type + 5, // [5:14] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_ocean_v1_account_proto_init() } +func file_ocean_v1_account_proto_init() { + if File_ocean_v1_account_proto != nil { + return + } + file_ocean_v1_types_proto_init() + if !protoimpl.UnsafeEnabled { + file_ocean_v1_account_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateAccountBIP44Request); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ocean_v1_account_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateAccountBIP44Response); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ocean_v1_account_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateAccountCustomRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ocean_v1_account_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*CreateAccountCustomResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ocean_v1_account_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SetAccountTemplateRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ocean_v1_account_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*SetAccountTemplateResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ocean_v1_account_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeriveAddressRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ocean_v1_account_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeriveAddressResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ocean_v1_account_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeriveChangeAddressRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ocean_v1_account_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeriveChangeAddressResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ocean_v1_account_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListAddressesRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ocean_v1_account_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListAddressesResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ocean_v1_account_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BalanceRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ocean_v1_account_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BalanceResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ocean_v1_account_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListUtxosRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ocean_v1_account_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListUtxosResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ocean_v1_account_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteAccountRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ocean_v1_account_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeleteAccountResponse); 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_ocean_v1_account_proto_rawDesc, + NumEnums: 0, + NumMessages: 19, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_ocean_v1_account_proto_goTypes, + DependencyIndexes: file_ocean_v1_account_proto_depIdxs, + MessageInfos: file_ocean_v1_account_proto_msgTypes, + }.Build() + File_ocean_v1_account_proto = out.File + file_ocean_v1_account_proto_rawDesc = nil + file_ocean_v1_account_proto_goTypes = nil + file_ocean_v1_account_proto_depIdxs = nil +} diff --git a/api-spec/protobuf/gen/go/ocean/v1alpha/account_grpc.pb.go b/api-spec/protobuf/gen/go/ocean/v1/account_grpc.pb.go similarity index 67% rename from api-spec/protobuf/gen/go/ocean/v1alpha/account_grpc.pb.go rename to api-spec/protobuf/gen/go/ocean/v1/account_grpc.pb.go index c9c9d6d..4e7bc3c 100644 --- a/api-spec/protobuf/gen/go/ocean/v1alpha/account_grpc.pb.go +++ b/api-spec/protobuf/gen/go/ocean/v1/account_grpc.pb.go @@ -2,9 +2,9 @@ // versions: // - protoc-gen-go-grpc v1.2.0 // - protoc (unknown) -// source: ocean/v1alpha/account.proto +// source: ocean/v1/account.proto -package oceanv1alpha +package oceanv1 import ( context "context" @@ -22,8 +22,10 @@ const _ = grpc.SupportPackageIsVersion7 // // 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 AccountServiceClient interface { - // CreateAccount creates a new account. - CreateAccount(ctx context.Context, in *CreateAccountRequest, opts ...grpc.CallOption) (*CreateAccountResponse, error) + // CreateAccountBIP44 creates a new BIP44 account. + CreateAccountBIP44(ctx context.Context, in *CreateAccountBIP44Request, opts ...grpc.CallOption) (*CreateAccountBIP44Response, error) + // CreateAccountCustom creates a new custom account for which loading a template. + CreateAccountCustom(ctx context.Context, in *CreateAccountCustomRequest, opts ...grpc.CallOption) (*CreateAccountCustomResponse, error) // SetAccountTemplate sets the template for the account used to generate new addresses. SetAccountTemplate(ctx context.Context, in *SetAccountTemplateRequest, opts ...grpc.CallOption) (*SetAccountTemplateResponse, error) // DeriveAddress generates new address(es) for the account. @@ -38,6 +40,9 @@ type AccountServiceClient interface { // ListUtxos returns the utxos for the account, or specific list of // account's addresses. ListUtxos(ctx context.Context, in *ListUtxosRequest, opts ...grpc.CallOption) (*ListUtxosResponse, error) + // DeleteAccount deletes an existing account. The operation is allowed only + // if the account has zero balance. + DeleteAccount(ctx context.Context, in *DeleteAccountRequest, opts ...grpc.CallOption) (*DeleteAccountResponse, error) } type accountServiceClient struct { @@ -48,9 +53,18 @@ func NewAccountServiceClient(cc grpc.ClientConnInterface) AccountServiceClient { return &accountServiceClient{cc} } -func (c *accountServiceClient) CreateAccount(ctx context.Context, in *CreateAccountRequest, opts ...grpc.CallOption) (*CreateAccountResponse, error) { - out := new(CreateAccountResponse) - err := c.cc.Invoke(ctx, "/ocean.v1alpha.AccountService/CreateAccount", in, out, opts...) +func (c *accountServiceClient) CreateAccountBIP44(ctx context.Context, in *CreateAccountBIP44Request, opts ...grpc.CallOption) (*CreateAccountBIP44Response, error) { + out := new(CreateAccountBIP44Response) + err := c.cc.Invoke(ctx, "/ocean.v1.AccountService/CreateAccountBIP44", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *accountServiceClient) CreateAccountCustom(ctx context.Context, in *CreateAccountCustomRequest, opts ...grpc.CallOption) (*CreateAccountCustomResponse, error) { + out := new(CreateAccountCustomResponse) + err := c.cc.Invoke(ctx, "/ocean.v1.AccountService/CreateAccountCustom", in, out, opts...) if err != nil { return nil, err } @@ -59,7 +73,7 @@ func (c *accountServiceClient) CreateAccount(ctx context.Context, in *CreateAcco func (c *accountServiceClient) SetAccountTemplate(ctx context.Context, in *SetAccountTemplateRequest, opts ...grpc.CallOption) (*SetAccountTemplateResponse, error) { out := new(SetAccountTemplateResponse) - err := c.cc.Invoke(ctx, "/ocean.v1alpha.AccountService/SetAccountTemplate", in, out, opts...) + err := c.cc.Invoke(ctx, "/ocean.v1.AccountService/SetAccountTemplate", in, out, opts...) if err != nil { return nil, err } @@ -68,7 +82,7 @@ func (c *accountServiceClient) SetAccountTemplate(ctx context.Context, in *SetAc func (c *accountServiceClient) DeriveAddress(ctx context.Context, in *DeriveAddressRequest, opts ...grpc.CallOption) (*DeriveAddressResponse, error) { out := new(DeriveAddressResponse) - err := c.cc.Invoke(ctx, "/ocean.v1alpha.AccountService/DeriveAddress", in, out, opts...) + err := c.cc.Invoke(ctx, "/ocean.v1.AccountService/DeriveAddress", in, out, opts...) if err != nil { return nil, err } @@ -77,7 +91,7 @@ func (c *accountServiceClient) DeriveAddress(ctx context.Context, in *DeriveAddr func (c *accountServiceClient) DeriveChangeAddress(ctx context.Context, in *DeriveChangeAddressRequest, opts ...grpc.CallOption) (*DeriveChangeAddressResponse, error) { out := new(DeriveChangeAddressResponse) - err := c.cc.Invoke(ctx, "/ocean.v1alpha.AccountService/DeriveChangeAddress", in, out, opts...) + err := c.cc.Invoke(ctx, "/ocean.v1.AccountService/DeriveChangeAddress", in, out, opts...) if err != nil { return nil, err } @@ -86,7 +100,7 @@ func (c *accountServiceClient) DeriveChangeAddress(ctx context.Context, in *Deri func (c *accountServiceClient) ListAddresses(ctx context.Context, in *ListAddressesRequest, opts ...grpc.CallOption) (*ListAddressesResponse, error) { out := new(ListAddressesResponse) - err := c.cc.Invoke(ctx, "/ocean.v1alpha.AccountService/ListAddresses", in, out, opts...) + err := c.cc.Invoke(ctx, "/ocean.v1.AccountService/ListAddresses", in, out, opts...) if err != nil { return nil, err } @@ -95,7 +109,7 @@ func (c *accountServiceClient) ListAddresses(ctx context.Context, in *ListAddres func (c *accountServiceClient) Balance(ctx context.Context, in *BalanceRequest, opts ...grpc.CallOption) (*BalanceResponse, error) { out := new(BalanceResponse) - err := c.cc.Invoke(ctx, "/ocean.v1alpha.AccountService/Balance", in, out, opts...) + err := c.cc.Invoke(ctx, "/ocean.v1.AccountService/Balance", in, out, opts...) if err != nil { return nil, err } @@ -104,7 +118,16 @@ func (c *accountServiceClient) Balance(ctx context.Context, in *BalanceRequest, func (c *accountServiceClient) ListUtxos(ctx context.Context, in *ListUtxosRequest, opts ...grpc.CallOption) (*ListUtxosResponse, error) { out := new(ListUtxosResponse) - err := c.cc.Invoke(ctx, "/ocean.v1alpha.AccountService/ListUtxos", in, out, opts...) + err := c.cc.Invoke(ctx, "/ocean.v1.AccountService/ListUtxos", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *accountServiceClient) DeleteAccount(ctx context.Context, in *DeleteAccountRequest, opts ...grpc.CallOption) (*DeleteAccountResponse, error) { + out := new(DeleteAccountResponse) + err := c.cc.Invoke(ctx, "/ocean.v1.AccountService/DeleteAccount", in, out, opts...) if err != nil { return nil, err } @@ -115,8 +138,10 @@ func (c *accountServiceClient) ListUtxos(ctx context.Context, in *ListUtxosReque // All implementations should embed UnimplementedAccountServiceServer // for forward compatibility type AccountServiceServer interface { - // CreateAccount creates a new account. - CreateAccount(context.Context, *CreateAccountRequest) (*CreateAccountResponse, error) + // CreateAccountBIP44 creates a new BIP44 account. + CreateAccountBIP44(context.Context, *CreateAccountBIP44Request) (*CreateAccountBIP44Response, error) + // CreateAccountCustom creates a new custom account for which loading a template. + CreateAccountCustom(context.Context, *CreateAccountCustomRequest) (*CreateAccountCustomResponse, error) // SetAccountTemplate sets the template for the account used to generate new addresses. SetAccountTemplate(context.Context, *SetAccountTemplateRequest) (*SetAccountTemplateResponse, error) // DeriveAddress generates new address(es) for the account. @@ -131,14 +156,20 @@ type AccountServiceServer interface { // ListUtxos returns the utxos for the account, or specific list of // account's addresses. ListUtxos(context.Context, *ListUtxosRequest) (*ListUtxosResponse, error) + // DeleteAccount deletes an existing account. The operation is allowed only + // if the account has zero balance. + DeleteAccount(context.Context, *DeleteAccountRequest) (*DeleteAccountResponse, error) } // UnimplementedAccountServiceServer should be embedded to have forward compatible implementations. type UnimplementedAccountServiceServer struct { } -func (UnimplementedAccountServiceServer) CreateAccount(context.Context, *CreateAccountRequest) (*CreateAccountResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateAccount not implemented") +func (UnimplementedAccountServiceServer) CreateAccountBIP44(context.Context, *CreateAccountBIP44Request) (*CreateAccountBIP44Response, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateAccountBIP44 not implemented") +} +func (UnimplementedAccountServiceServer) CreateAccountCustom(context.Context, *CreateAccountCustomRequest) (*CreateAccountCustomResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateAccountCustom not implemented") } func (UnimplementedAccountServiceServer) SetAccountTemplate(context.Context, *SetAccountTemplateRequest) (*SetAccountTemplateResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method SetAccountTemplate not implemented") @@ -158,6 +189,9 @@ func (UnimplementedAccountServiceServer) Balance(context.Context, *BalanceReques func (UnimplementedAccountServiceServer) ListUtxos(context.Context, *ListUtxosRequest) (*ListUtxosResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ListUtxos not implemented") } +func (UnimplementedAccountServiceServer) DeleteAccount(context.Context, *DeleteAccountRequest) (*DeleteAccountResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteAccount not implemented") +} // UnsafeAccountServiceServer may be embedded to opt out of forward compatibility for this service. // Use of this interface is not recommended, as added methods to AccountServiceServer will @@ -170,20 +204,38 @@ func RegisterAccountServiceServer(s grpc.ServiceRegistrar, srv AccountServiceSer s.RegisterService(&AccountService_ServiceDesc, srv) } -func _AccountService_CreateAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(CreateAccountRequest) +func _AccountService_CreateAccountBIP44_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateAccountBIP44Request) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AccountServiceServer).CreateAccountBIP44(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ocean.v1.AccountService/CreateAccountBIP44", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AccountServiceServer).CreateAccountBIP44(ctx, req.(*CreateAccountBIP44Request)) + } + return interceptor(ctx, in, info, handler) +} + +func _AccountService_CreateAccountCustom_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(CreateAccountCustomRequest) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(AccountServiceServer).CreateAccount(ctx, in) + return srv.(AccountServiceServer).CreateAccountCustom(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ocean.v1alpha.AccountService/CreateAccount", + FullMethod: "/ocean.v1.AccountService/CreateAccountCustom", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(AccountServiceServer).CreateAccount(ctx, req.(*CreateAccountRequest)) + return srv.(AccountServiceServer).CreateAccountCustom(ctx, req.(*CreateAccountCustomRequest)) } return interceptor(ctx, in, info, handler) } @@ -198,7 +250,7 @@ func _AccountService_SetAccountTemplate_Handler(srv interface{}, ctx context.Con } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ocean.v1alpha.AccountService/SetAccountTemplate", + FullMethod: "/ocean.v1.AccountService/SetAccountTemplate", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AccountServiceServer).SetAccountTemplate(ctx, req.(*SetAccountTemplateRequest)) @@ -216,7 +268,7 @@ func _AccountService_DeriveAddress_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ocean.v1alpha.AccountService/DeriveAddress", + FullMethod: "/ocean.v1.AccountService/DeriveAddress", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AccountServiceServer).DeriveAddress(ctx, req.(*DeriveAddressRequest)) @@ -234,7 +286,7 @@ func _AccountService_DeriveChangeAddress_Handler(srv interface{}, ctx context.Co } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ocean.v1alpha.AccountService/DeriveChangeAddress", + FullMethod: "/ocean.v1.AccountService/DeriveChangeAddress", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AccountServiceServer).DeriveChangeAddress(ctx, req.(*DeriveChangeAddressRequest)) @@ -252,7 +304,7 @@ func _AccountService_ListAddresses_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ocean.v1alpha.AccountService/ListAddresses", + FullMethod: "/ocean.v1.AccountService/ListAddresses", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AccountServiceServer).ListAddresses(ctx, req.(*ListAddressesRequest)) @@ -270,7 +322,7 @@ func _AccountService_Balance_Handler(srv interface{}, ctx context.Context, dec f } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ocean.v1alpha.AccountService/Balance", + FullMethod: "/ocean.v1.AccountService/Balance", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AccountServiceServer).Balance(ctx, req.(*BalanceRequest)) @@ -288,7 +340,7 @@ func _AccountService_ListUtxos_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ocean.v1alpha.AccountService/ListUtxos", + FullMethod: "/ocean.v1.AccountService/ListUtxos", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(AccountServiceServer).ListUtxos(ctx, req.(*ListUtxosRequest)) @@ -296,16 +348,38 @@ func _AccountService_ListUtxos_Handler(srv interface{}, ctx context.Context, dec return interceptor(ctx, in, info, handler) } +func _AccountService_DeleteAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(DeleteAccountRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(AccountServiceServer).DeleteAccount(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ocean.v1.AccountService/DeleteAccount", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(AccountServiceServer).DeleteAccount(ctx, req.(*DeleteAccountRequest)) + } + return interceptor(ctx, in, info, handler) +} + // AccountService_ServiceDesc is the grpc.ServiceDesc for AccountService service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var AccountService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "ocean.v1alpha.AccountService", + ServiceName: "ocean.v1.AccountService", HandlerType: (*AccountServiceServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "CreateAccount", - Handler: _AccountService_CreateAccount_Handler, + MethodName: "CreateAccountBIP44", + Handler: _AccountService_CreateAccountBIP44_Handler, + }, + { + MethodName: "CreateAccountCustom", + Handler: _AccountService_CreateAccountCustom_Handler, }, { MethodName: "SetAccountTemplate", @@ -331,7 +405,11 @@ var AccountService_ServiceDesc = grpc.ServiceDesc{ MethodName: "ListUtxos", Handler: _AccountService_ListUtxos_Handler, }, + { + MethodName: "DeleteAccount", + Handler: _AccountService_DeleteAccount_Handler, + }, }, Streams: []grpc.StreamDesc{}, - Metadata: "ocean/v1alpha/account.proto", + Metadata: "ocean/v1/account.proto", } diff --git a/api-spec/protobuf/gen/go/ocean/v1/notification.pb.go b/api-spec/protobuf/gen/go/ocean/v1/notification.pb.go new file mode 100644 index 0000000..2a1b1d8 --- /dev/null +++ b/api-spec/protobuf/gen/go/ocean/v1/notification.pb.go @@ -0,0 +1,914 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc (unknown) +// source: ocean/v1/notification.proto + +package oceanv1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +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 TransactionNotificationsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *TransactionNotificationsRequest) Reset() { + *x = TransactionNotificationsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_ocean_v1_notification_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TransactionNotificationsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TransactionNotificationsRequest) ProtoMessage() {} + +func (x *TransactionNotificationsRequest) ProtoReflect() protoreflect.Message { + mi := &file_ocean_v1_notification_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) +} + +// Deprecated: Use TransactionNotificationsRequest.ProtoReflect.Descriptor instead. +func (*TransactionNotificationsRequest) Descriptor() ([]byte, []int) { + return file_ocean_v1_notification_proto_rawDescGZIP(), []int{0} +} + +type TransactionNotificationsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Account names. + AccountNames []string `protobuf:"bytes,1,rep,name=account_names,json=accountNames,proto3" json:"account_names,omitempty"` + // Txid of transaction. + Txid string `protobuf:"bytes,2,opt,name=txid,proto3" json:"txid,omitempty"` + // Tx event type. + EventType TxEventType `protobuf:"varint,3,opt,name=event_type,json=eventType,proto3,enum=ocean.v1.TxEventType" json:"event_type,omitempty"` + // Details of the block including the tx. + BlockDetails *BlockDetails `protobuf:"bytes,4,opt,name=block_details,json=blockDetails,proto3" json:"block_details,omitempty"` +} + +func (x *TransactionNotificationsResponse) Reset() { + *x = TransactionNotificationsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_ocean_v1_notification_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TransactionNotificationsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TransactionNotificationsResponse) ProtoMessage() {} + +func (x *TransactionNotificationsResponse) ProtoReflect() protoreflect.Message { + mi := &file_ocean_v1_notification_proto_msgTypes[1] + 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) +} + +// Deprecated: Use TransactionNotificationsResponse.ProtoReflect.Descriptor instead. +func (*TransactionNotificationsResponse) Descriptor() ([]byte, []int) { + return file_ocean_v1_notification_proto_rawDescGZIP(), []int{1} +} + +func (x *TransactionNotificationsResponse) GetAccountNames() []string { + if x != nil { + return x.AccountNames + } + return nil +} + +func (x *TransactionNotificationsResponse) GetTxid() string { + if x != nil { + return x.Txid + } + return "" +} + +func (x *TransactionNotificationsResponse) GetEventType() TxEventType { + if x != nil { + return x.EventType + } + return TxEventType_TX_EVENT_TYPE_UNSPECIFIED +} + +func (x *TransactionNotificationsResponse) GetBlockDetails() *BlockDetails { + if x != nil { + return x.BlockDetails + } + return nil +} + +type UtxosNotificationsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *UtxosNotificationsRequest) Reset() { + *x = UtxosNotificationsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_ocean_v1_notification_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UtxosNotificationsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UtxosNotificationsRequest) ProtoMessage() {} + +func (x *UtxosNotificationsRequest) ProtoReflect() protoreflect.Message { + mi := &file_ocean_v1_notification_proto_msgTypes[2] + 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) +} + +// Deprecated: Use UtxosNotificationsRequest.ProtoReflect.Descriptor instead. +func (*UtxosNotificationsRequest) Descriptor() ([]byte, []int) { + return file_ocean_v1_notification_proto_rawDescGZIP(), []int{2} +} + +type UtxosNotificationsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // List of utxos for which occured the event. + Utxos []*Utxo `protobuf:"bytes,1,rep,name=utxos,proto3" json:"utxos,omitempty"` + // The event's type occured for the utxos. + EventType UtxoEventType `protobuf:"varint,2,opt,name=event_type,json=eventType,proto3,enum=ocean.v1.UtxoEventType" json:"event_type,omitempty"` +} + +func (x *UtxosNotificationsResponse) Reset() { + *x = UtxosNotificationsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_ocean_v1_notification_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UtxosNotificationsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UtxosNotificationsResponse) ProtoMessage() {} + +func (x *UtxosNotificationsResponse) ProtoReflect() protoreflect.Message { + mi := &file_ocean_v1_notification_proto_msgTypes[3] + 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) +} + +// Deprecated: Use UtxosNotificationsResponse.ProtoReflect.Descriptor instead. +func (*UtxosNotificationsResponse) Descriptor() ([]byte, []int) { + return file_ocean_v1_notification_proto_rawDescGZIP(), []int{3} +} + +func (x *UtxosNotificationsResponse) GetUtxos() []*Utxo { + if x != nil { + return x.Utxos + } + return nil +} + +func (x *UtxosNotificationsResponse) GetEventType() UtxoEventType { + if x != nil { + return x.EventType + } + return UtxoEventType_UTXO_EVENT_TYPE_UNSPECIFIED +} + +type AddWebhookRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The endpoint of the external service to reach. + Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` + // The event type for which the webhook should be registered. + EventType WebhookEventType `protobuf:"varint,2,opt,name=event_type,json=eventType,proto3,enum=ocean.v1.WebhookEventType" json:"event_type,omitempty"` + // The secret to use for signign a JWT token for an authenticated request + // to the external service. + Secret string `protobuf:"bytes,3,opt,name=secret,proto3" json:"secret,omitempty"` +} + +func (x *AddWebhookRequest) Reset() { + *x = AddWebhookRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_ocean_v1_notification_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddWebhookRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddWebhookRequest) ProtoMessage() {} + +func (x *AddWebhookRequest) ProtoReflect() protoreflect.Message { + mi := &file_ocean_v1_notification_proto_msgTypes[4] + 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) +} + +// Deprecated: Use AddWebhookRequest.ProtoReflect.Descriptor instead. +func (*AddWebhookRequest) Descriptor() ([]byte, []int) { + return file_ocean_v1_notification_proto_rawDescGZIP(), []int{4} +} + +func (x *AddWebhookRequest) GetEndpoint() string { + if x != nil { + return x.Endpoint + } + return "" +} + +func (x *AddWebhookRequest) GetEventType() WebhookEventType { + if x != nil { + return x.EventType + } + return WebhookEventType_WEBHOOK_EVENT_TYPE_UNSPECIFIED +} + +func (x *AddWebhookRequest) GetSecret() string { + if x != nil { + return x.Secret + } + return "" +} + +type AddWebhookResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The id of the new webhook. + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *AddWebhookResponse) Reset() { + *x = AddWebhookResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_ocean_v1_notification_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddWebhookResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddWebhookResponse) ProtoMessage() {} + +func (x *AddWebhookResponse) ProtoReflect() protoreflect.Message { + mi := &file_ocean_v1_notification_proto_msgTypes[5] + 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) +} + +// Deprecated: Use AddWebhookResponse.ProtoReflect.Descriptor instead. +func (*AddWebhookResponse) Descriptor() ([]byte, []int) { + return file_ocean_v1_notification_proto_rawDescGZIP(), []int{5} +} + +func (x *AddWebhookResponse) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type RemoveWebhookRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The id of the webhook to remove. + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (x *RemoveWebhookRequest) Reset() { + *x = RemoveWebhookRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_ocean_v1_notification_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoveWebhookRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveWebhookRequest) ProtoMessage() {} + +func (x *RemoveWebhookRequest) ProtoReflect() protoreflect.Message { + mi := &file_ocean_v1_notification_proto_msgTypes[6] + 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) +} + +// Deprecated: Use RemoveWebhookRequest.ProtoReflect.Descriptor instead. +func (*RemoveWebhookRequest) Descriptor() ([]byte, []int) { + return file_ocean_v1_notification_proto_rawDescGZIP(), []int{6} +} + +func (x *RemoveWebhookRequest) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +type RemoveWebhookResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *RemoveWebhookResponse) Reset() { + *x = RemoveWebhookResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_ocean_v1_notification_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RemoveWebhookResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveWebhookResponse) ProtoMessage() {} + +func (x *RemoveWebhookResponse) ProtoReflect() protoreflect.Message { + mi := &file_ocean_v1_notification_proto_msgTypes[7] + 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) +} + +// Deprecated: Use RemoveWebhookResponse.ProtoReflect.Descriptor instead. +func (*RemoveWebhookResponse) Descriptor() ([]byte, []int) { + return file_ocean_v1_notification_proto_rawDescGZIP(), []int{7} +} + +type ListWebhooksRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The event type for which filtering the list of webhooks. + EventType WebhookEventType `protobuf:"varint,1,opt,name=event_type,json=eventType,proto3,enum=ocean.v1.WebhookEventType" json:"event_type,omitempty"` +} + +func (x *ListWebhooksRequest) Reset() { + *x = ListWebhooksRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_ocean_v1_notification_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListWebhooksRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListWebhooksRequest) ProtoMessage() {} + +func (x *ListWebhooksRequest) ProtoReflect() protoreflect.Message { + mi := &file_ocean_v1_notification_proto_msgTypes[8] + 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) +} + +// Deprecated: Use ListWebhooksRequest.ProtoReflect.Descriptor instead. +func (*ListWebhooksRequest) Descriptor() ([]byte, []int) { + return file_ocean_v1_notification_proto_rawDescGZIP(), []int{8} +} + +func (x *ListWebhooksRequest) GetEventType() WebhookEventType { + if x != nil { + return x.EventType + } + return WebhookEventType_WEBHOOK_EVENT_TYPE_UNSPECIFIED +} + +type ListWebhooksResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The list of info about the webhooks regitered for an action. + WebhookInfo []*WebhookInfo `protobuf:"bytes,1,rep,name=webhook_info,json=webhookInfo,proto3" json:"webhook_info,omitempty"` +} + +func (x *ListWebhooksResponse) Reset() { + *x = ListWebhooksResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_ocean_v1_notification_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ListWebhooksResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListWebhooksResponse) ProtoMessage() {} + +func (x *ListWebhooksResponse) ProtoReflect() protoreflect.Message { + mi := &file_ocean_v1_notification_proto_msgTypes[9] + 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) +} + +// Deprecated: Use ListWebhooksResponse.ProtoReflect.Descriptor instead. +func (*ListWebhooksResponse) Descriptor() ([]byte, []int) { + return file_ocean_v1_notification_proto_rawDescGZIP(), []int{9} +} + +func (x *ListWebhooksResponse) GetWebhookInfo() []*WebhookInfo { + if x != nil { + return x.WebhookInfo + } + return nil +} + +type WebhookInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // The id of the webhook. + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // The endpoint of the external service to reach. + Endpoint string `protobuf:"bytes,2,opt,name=endpoint,proto3" json:"endpoint,omitempty"` + // Whether the outgoing requests are authenticated. + IsSecured bool `protobuf:"varint,3,opt,name=is_secured,json=isSecured,proto3" json:"is_secured,omitempty"` +} + +func (x *WebhookInfo) Reset() { + *x = WebhookInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_ocean_v1_notification_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *WebhookInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*WebhookInfo) ProtoMessage() {} + +func (x *WebhookInfo) ProtoReflect() protoreflect.Message { + mi := &file_ocean_v1_notification_proto_msgTypes[10] + 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) +} + +// Deprecated: Use WebhookInfo.ProtoReflect.Descriptor instead. +func (*WebhookInfo) Descriptor() ([]byte, []int) { + return file_ocean_v1_notification_proto_rawDescGZIP(), []int{10} +} + +func (x *WebhookInfo) GetId() string { + if x != nil { + return x.Id + } + return "" +} + +func (x *WebhookInfo) GetEndpoint() string { + if x != nil { + return x.Endpoint + } + return "" +} + +func (x *WebhookInfo) GetIsSecured() bool { + if x != nil { + return x.IsSecured + } + return false +} + +var File_ocean_v1_notification_proto protoreflect.FileDescriptor + +var file_ocean_v1_notification_proto_rawDesc = []byte{ + 0x0a, 0x1b, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x6e, 0x6f, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x6f, + 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x1a, 0x14, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2f, 0x76, + 0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x21, 0x0a, + 0x1f, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x69, + 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x22, 0xce, 0x01, 0x0a, 0x20, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, + 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x78, + 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x78, 0x69, 0x64, 0x12, 0x34, + 0x0a, 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x78, + 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, + 0x54, 0x79, 0x70, 0x65, 0x12, 0x3b, 0x0a, 0x0d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x64, 0x65, + 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6f, 0x63, + 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x74, 0x61, + 0x69, 0x6c, 0x73, 0x52, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, + 0x73, 0x22, 0x1b, 0x0a, 0x19, 0x55, 0x74, 0x78, 0x6f, 0x73, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x7a, + 0x0a, 0x1a, 0x55, 0x74, 0x78, 0x6f, 0x73, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x24, 0x0a, 0x05, + 0x75, 0x74, 0x78, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x6f, 0x63, + 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x74, 0x78, 0x6f, 0x52, 0x05, 0x75, 0x74, 0x78, + 0x6f, 0x73, 0x12, 0x36, 0x0a, 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x17, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, + 0x31, 0x2e, 0x55, 0x74, 0x78, 0x6f, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, + 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x22, 0x82, 0x01, 0x0a, 0x11, 0x41, + 0x64, 0x64, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x39, 0x0a, 0x0a, + 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, + 0x32, 0x1a, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x65, 0x62, 0x68, + 0x6f, 0x6f, 0x6b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x65, 0x76, + 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, + 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, 0x74, 0x22, + 0x24, 0x0a, 0x12, 0x41, 0x64, 0x64, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x26, 0x0a, 0x14, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x57, + 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, + 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x17, 0x0a, + 0x15, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x50, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x65, + 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x39, 0x0a, + 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x0e, 0x32, 0x1a, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x65, 0x62, + 0x68, 0x6f, 0x6f, 0x6b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x65, + 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x22, 0x50, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, + 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x38, 0x0a, 0x0c, 0x77, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x5f, 0x69, 0x6e, 0x66, 0x6f, + 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, + 0x31, 0x2e, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0b, 0x77, + 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x58, 0x0a, 0x0b, 0x57, 0x65, + 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, + 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, + 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x73, 0x65, 0x63, 0x75, + 0x72, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x53, 0x65, 0x63, + 0x75, 0x72, 0x65, 0x64, 0x32, 0xdd, 0x03, 0x0a, 0x13, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x73, 0x0a, 0x18, + 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x69, 0x66, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x29, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, + 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, + 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x54, + 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, + 0x01, 0x12, 0x61, 0x0a, 0x12, 0x55, 0x74, 0x78, 0x6f, 0x73, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x23, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, + 0x76, 0x31, 0x2e, 0x55, 0x74, 0x78, 0x6f, 0x73, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, + 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x6f, + 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x74, 0x78, 0x6f, 0x73, 0x4e, 0x6f, 0x74, + 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x30, 0x01, 0x12, 0x49, 0x0a, 0x0a, 0x41, 0x64, 0x64, 0x57, 0x65, 0x62, 0x68, 0x6f, + 0x6f, 0x6b, 0x12, 0x1b, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, + 0x64, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1c, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x64, 0x64, 0x57, 0x65, + 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, + 0x52, 0x0a, 0x0d, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, + 0x12, 0x1e, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6d, 0x6f, + 0x76, 0x65, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1f, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6d, 0x6f, + 0x76, 0x65, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x65, 0x62, 0x68, 0x6f, + 0x6f, 0x6b, 0x73, 0x12, 0x1d, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4c, + 0x69, 0x73, 0x74, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, + 0x73, 0x74, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x22, 0x00, 0x42, 0xaa, 0x01, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x63, 0x65, + 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x11, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, + 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x46, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x76, 0x75, 0x6c, 0x70, 0x65, 0x6d, 0x76, 0x65, 0x6e, + 0x74, 0x75, 0x72, 0x65, 0x73, 0x2f, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2d, + 0x73, 0x70, 0x65, 0x63, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x67, 0x65, + 0x6e, 0x2f, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x6f, 0x63, 0x65, 0x61, 0x6e, + 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4f, 0x58, 0x58, 0xaa, 0x02, 0x08, 0x4f, 0x63, 0x65, 0x61, 0x6e, + 0x2e, 0x56, 0x31, 0xca, 0x02, 0x08, 0x4f, 0x63, 0x65, 0x61, 0x6e, 0x5c, 0x56, 0x31, 0xe2, 0x02, + 0x14, 0x4f, 0x63, 0x65, 0x61, 0x6e, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x4f, 0x63, 0x65, 0x61, 0x6e, 0x3a, 0x3a, 0x56, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_ocean_v1_notification_proto_rawDescOnce sync.Once + file_ocean_v1_notification_proto_rawDescData = file_ocean_v1_notification_proto_rawDesc +) + +func file_ocean_v1_notification_proto_rawDescGZIP() []byte { + file_ocean_v1_notification_proto_rawDescOnce.Do(func() { + file_ocean_v1_notification_proto_rawDescData = protoimpl.X.CompressGZIP(file_ocean_v1_notification_proto_rawDescData) + }) + return file_ocean_v1_notification_proto_rawDescData +} + +var file_ocean_v1_notification_proto_msgTypes = make([]protoimpl.MessageInfo, 11) +var file_ocean_v1_notification_proto_goTypes = []interface{}{ + (*TransactionNotificationsRequest)(nil), // 0: ocean.v1.TransactionNotificationsRequest + (*TransactionNotificationsResponse)(nil), // 1: ocean.v1.TransactionNotificationsResponse + (*UtxosNotificationsRequest)(nil), // 2: ocean.v1.UtxosNotificationsRequest + (*UtxosNotificationsResponse)(nil), // 3: ocean.v1.UtxosNotificationsResponse + (*AddWebhookRequest)(nil), // 4: ocean.v1.AddWebhookRequest + (*AddWebhookResponse)(nil), // 5: ocean.v1.AddWebhookResponse + (*RemoveWebhookRequest)(nil), // 6: ocean.v1.RemoveWebhookRequest + (*RemoveWebhookResponse)(nil), // 7: ocean.v1.RemoveWebhookResponse + (*ListWebhooksRequest)(nil), // 8: ocean.v1.ListWebhooksRequest + (*ListWebhooksResponse)(nil), // 9: ocean.v1.ListWebhooksResponse + (*WebhookInfo)(nil), // 10: ocean.v1.WebhookInfo + (TxEventType)(0), // 11: ocean.v1.TxEventType + (*BlockDetails)(nil), // 12: ocean.v1.BlockDetails + (*Utxo)(nil), // 13: ocean.v1.Utxo + (UtxoEventType)(0), // 14: ocean.v1.UtxoEventType + (WebhookEventType)(0), // 15: ocean.v1.WebhookEventType +} +var file_ocean_v1_notification_proto_depIdxs = []int32{ + 11, // 0: ocean.v1.TransactionNotificationsResponse.event_type:type_name -> ocean.v1.TxEventType + 12, // 1: ocean.v1.TransactionNotificationsResponse.block_details:type_name -> ocean.v1.BlockDetails + 13, // 2: ocean.v1.UtxosNotificationsResponse.utxos:type_name -> ocean.v1.Utxo + 14, // 3: ocean.v1.UtxosNotificationsResponse.event_type:type_name -> ocean.v1.UtxoEventType + 15, // 4: ocean.v1.AddWebhookRequest.event_type:type_name -> ocean.v1.WebhookEventType + 15, // 5: ocean.v1.ListWebhooksRequest.event_type:type_name -> ocean.v1.WebhookEventType + 10, // 6: ocean.v1.ListWebhooksResponse.webhook_info:type_name -> ocean.v1.WebhookInfo + 0, // 7: ocean.v1.NotificationService.TransactionNotifications:input_type -> ocean.v1.TransactionNotificationsRequest + 2, // 8: ocean.v1.NotificationService.UtxosNotifications:input_type -> ocean.v1.UtxosNotificationsRequest + 4, // 9: ocean.v1.NotificationService.AddWebhook:input_type -> ocean.v1.AddWebhookRequest + 6, // 10: ocean.v1.NotificationService.RemoveWebhook:input_type -> ocean.v1.RemoveWebhookRequest + 8, // 11: ocean.v1.NotificationService.ListWebhooks:input_type -> ocean.v1.ListWebhooksRequest + 1, // 12: ocean.v1.NotificationService.TransactionNotifications:output_type -> ocean.v1.TransactionNotificationsResponse + 3, // 13: ocean.v1.NotificationService.UtxosNotifications:output_type -> ocean.v1.UtxosNotificationsResponse + 5, // 14: ocean.v1.NotificationService.AddWebhook:output_type -> ocean.v1.AddWebhookResponse + 7, // 15: ocean.v1.NotificationService.RemoveWebhook:output_type -> ocean.v1.RemoveWebhookResponse + 9, // 16: ocean.v1.NotificationService.ListWebhooks:output_type -> ocean.v1.ListWebhooksResponse + 12, // [12:17] is the sub-list for method output_type + 7, // [7:12] is the sub-list for method input_type + 7, // [7:7] is the sub-list for extension type_name + 7, // [7:7] is the sub-list for extension extendee + 0, // [0:7] is the sub-list for field type_name +} + +func init() { file_ocean_v1_notification_proto_init() } +func file_ocean_v1_notification_proto_init() { + if File_ocean_v1_notification_proto != nil { + return + } + file_ocean_v1_types_proto_init() + if !protoimpl.UnsafeEnabled { + file_ocean_v1_notification_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TransactionNotificationsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ocean_v1_notification_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TransactionNotificationsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ocean_v1_notification_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UtxosNotificationsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ocean_v1_notification_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UtxosNotificationsResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ocean_v1_notification_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddWebhookRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ocean_v1_notification_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddWebhookResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ocean_v1_notification_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoveWebhookRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ocean_v1_notification_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoveWebhookResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ocean_v1_notification_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListWebhooksRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ocean_v1_notification_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*ListWebhooksResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ocean_v1_notification_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*WebhookInfo); 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_ocean_v1_notification_proto_rawDesc, + NumEnums: 0, + NumMessages: 11, + NumExtensions: 0, + NumServices: 1, + }, + GoTypes: file_ocean_v1_notification_proto_goTypes, + DependencyIndexes: file_ocean_v1_notification_proto_depIdxs, + MessageInfos: file_ocean_v1_notification_proto_msgTypes, + }.Build() + File_ocean_v1_notification_proto = out.File + file_ocean_v1_notification_proto_rawDesc = nil + file_ocean_v1_notification_proto_goTypes = nil + file_ocean_v1_notification_proto_depIdxs = nil +} diff --git a/api-spec/protobuf/gen/go/ocean/v1alpha/notification_grpc.pb.go b/api-spec/protobuf/gen/go/ocean/v1/notification_grpc.pb.go similarity index 93% rename from api-spec/protobuf/gen/go/ocean/v1alpha/notification_grpc.pb.go rename to api-spec/protobuf/gen/go/ocean/v1/notification_grpc.pb.go index cd98102..6d6d8ef 100644 --- a/api-spec/protobuf/gen/go/ocean/v1alpha/notification_grpc.pb.go +++ b/api-spec/protobuf/gen/go/ocean/v1/notification_grpc.pb.go @@ -2,9 +2,9 @@ // versions: // - protoc-gen-go-grpc v1.2.0 // - protoc (unknown) -// source: ocean/v1alpha/notification.proto +// source: ocean/v1/notification.proto -package oceanv1alpha +package oceanv1 import ( context "context" @@ -43,7 +43,7 @@ func NewNotificationServiceClient(cc grpc.ClientConnInterface) NotificationServi } func (c *notificationServiceClient) TransactionNotifications(ctx context.Context, in *TransactionNotificationsRequest, opts ...grpc.CallOption) (NotificationService_TransactionNotificationsClient, error) { - stream, err := c.cc.NewStream(ctx, &NotificationService_ServiceDesc.Streams[0], "/ocean.v1alpha.NotificationService/TransactionNotifications", opts...) + stream, err := c.cc.NewStream(ctx, &NotificationService_ServiceDesc.Streams[0], "/ocean.v1.NotificationService/TransactionNotifications", opts...) if err != nil { return nil, err } @@ -75,7 +75,7 @@ func (x *notificationServiceTransactionNotificationsClient) Recv() (*Transaction } func (c *notificationServiceClient) UtxosNotifications(ctx context.Context, in *UtxosNotificationsRequest, opts ...grpc.CallOption) (NotificationService_UtxosNotificationsClient, error) { - stream, err := c.cc.NewStream(ctx, &NotificationService_ServiceDesc.Streams[1], "/ocean.v1alpha.NotificationService/UtxosNotifications", opts...) + stream, err := c.cc.NewStream(ctx, &NotificationService_ServiceDesc.Streams[1], "/ocean.v1.NotificationService/UtxosNotifications", opts...) if err != nil { return nil, err } @@ -108,7 +108,7 @@ func (x *notificationServiceUtxosNotificationsClient) Recv() (*UtxosNotification func (c *notificationServiceClient) AddWebhook(ctx context.Context, in *AddWebhookRequest, opts ...grpc.CallOption) (*AddWebhookResponse, error) { out := new(AddWebhookResponse) - err := c.cc.Invoke(ctx, "/ocean.v1alpha.NotificationService/AddWebhook", in, out, opts...) + err := c.cc.Invoke(ctx, "/ocean.v1.NotificationService/AddWebhook", in, out, opts...) if err != nil { return nil, err } @@ -117,7 +117,7 @@ func (c *notificationServiceClient) AddWebhook(ctx context.Context, in *AddWebho func (c *notificationServiceClient) RemoveWebhook(ctx context.Context, in *RemoveWebhookRequest, opts ...grpc.CallOption) (*RemoveWebhookResponse, error) { out := new(RemoveWebhookResponse) - err := c.cc.Invoke(ctx, "/ocean.v1alpha.NotificationService/RemoveWebhook", in, out, opts...) + err := c.cc.Invoke(ctx, "/ocean.v1.NotificationService/RemoveWebhook", in, out, opts...) if err != nil { return nil, err } @@ -126,7 +126,7 @@ func (c *notificationServiceClient) RemoveWebhook(ctx context.Context, in *Remov func (c *notificationServiceClient) ListWebhooks(ctx context.Context, in *ListWebhooksRequest, opts ...grpc.CallOption) (*ListWebhooksResponse, error) { out := new(ListWebhooksResponse) - err := c.cc.Invoke(ctx, "/ocean.v1alpha.NotificationService/ListWebhooks", in, out, opts...) + err := c.cc.Invoke(ctx, "/ocean.v1.NotificationService/ListWebhooks", in, out, opts...) if err != nil { return nil, err } @@ -232,7 +232,7 @@ func _NotificationService_AddWebhook_Handler(srv interface{}, ctx context.Contex } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ocean.v1alpha.NotificationService/AddWebhook", + FullMethod: "/ocean.v1.NotificationService/AddWebhook", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(NotificationServiceServer).AddWebhook(ctx, req.(*AddWebhookRequest)) @@ -250,7 +250,7 @@ func _NotificationService_RemoveWebhook_Handler(srv interface{}, ctx context.Con } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ocean.v1alpha.NotificationService/RemoveWebhook", + FullMethod: "/ocean.v1.NotificationService/RemoveWebhook", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(NotificationServiceServer).RemoveWebhook(ctx, req.(*RemoveWebhookRequest)) @@ -268,7 +268,7 @@ func _NotificationService_ListWebhooks_Handler(srv interface{}, ctx context.Cont } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ocean.v1alpha.NotificationService/ListWebhooks", + FullMethod: "/ocean.v1.NotificationService/ListWebhooks", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(NotificationServiceServer).ListWebhooks(ctx, req.(*ListWebhooksRequest)) @@ -280,7 +280,7 @@ func _NotificationService_ListWebhooks_Handler(srv interface{}, ctx context.Cont // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var NotificationService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "ocean.v1alpha.NotificationService", + ServiceName: "ocean.v1.NotificationService", HandlerType: (*NotificationServiceServer)(nil), Methods: []grpc.MethodDesc{ { @@ -308,5 +308,5 @@ var NotificationService_ServiceDesc = grpc.ServiceDesc{ ServerStreams: true, }, }, - Metadata: "ocean/v1alpha/notification.proto", + Metadata: "ocean/v1/notification.proto", } diff --git a/api-spec/protobuf/gen/go/ocean/v1alpha/transaction.pb.go b/api-spec/protobuf/gen/go/ocean/v1/transaction.pb.go similarity index 52% rename from api-spec/protobuf/gen/go/ocean/v1alpha/transaction.pb.go rename to api-spec/protobuf/gen/go/ocean/v1/transaction.pb.go index 74128da..e034d6a 100644 --- a/api-spec/protobuf/gen/go/ocean/v1alpha/transaction.pb.go +++ b/api-spec/protobuf/gen/go/ocean/v1/transaction.pb.go @@ -1,10 +1,10 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.1 // protoc (unknown) -// source: ocean/v1alpha/transaction.proto +// source: ocean/v1/transaction.proto -package oceanv1alpha +package oceanv1 import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -54,11 +54,11 @@ func (x SelectUtxosRequest_Strategy) String() string { } func (SelectUtxosRequest_Strategy) Descriptor() protoreflect.EnumDescriptor { - return file_ocean_v1alpha_transaction_proto_enumTypes[0].Descriptor() + return file_ocean_v1_transaction_proto_enumTypes[0].Descriptor() } func (SelectUtxosRequest_Strategy) Type() protoreflect.EnumType { - return &file_ocean_v1alpha_transaction_proto_enumTypes[0] + return &file_ocean_v1_transaction_proto_enumTypes[0] } func (x SelectUtxosRequest_Strategy) Number() protoreflect.EnumNumber { @@ -67,7 +67,7 @@ func (x SelectUtxosRequest_Strategy) Number() protoreflect.EnumNumber { // Deprecated: Use SelectUtxosRequest_Strategy.Descriptor instead. func (SelectUtxosRequest_Strategy) EnumDescriptor() ([]byte, []int) { - return file_ocean_v1alpha_transaction_proto_rawDescGZIP(), []int{2, 0} + return file_ocean_v1_transaction_proto_rawDescGZIP(), []int{2, 0} } type GetTransactionRequest struct { @@ -81,7 +81,7 @@ type GetTransactionRequest struct { func (x *GetTransactionRequest) Reset() { *x = GetTransactionRequest{} if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[0] + mi := &file_ocean_v1_transaction_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -94,7 +94,7 @@ func (x *GetTransactionRequest) String() string { func (*GetTransactionRequest) ProtoMessage() {} func (x *GetTransactionRequest) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[0] + mi := &file_ocean_v1_transaction_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -107,7 +107,7 @@ func (x *GetTransactionRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetTransactionRequest.ProtoReflect.Descriptor instead. func (*GetTransactionRequest) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_transaction_proto_rawDescGZIP(), []int{0} + return file_ocean_v1_transaction_proto_rawDescGZIP(), []int{0} } func (x *GetTransactionRequest) GetTxid() string { @@ -131,7 +131,7 @@ type GetTransactionResponse struct { func (x *GetTransactionResponse) Reset() { *x = GetTransactionResponse{} if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[1] + mi := &file_ocean_v1_transaction_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -144,7 +144,7 @@ func (x *GetTransactionResponse) String() string { func (*GetTransactionResponse) ProtoMessage() {} func (x *GetTransactionResponse) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[1] + mi := &file_ocean_v1_transaction_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -157,7 +157,7 @@ func (x *GetTransactionResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetTransactionResponse.ProtoReflect.Descriptor instead. func (*GetTransactionResponse) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_transaction_proto_rawDescGZIP(), []int{1} + return file_ocean_v1_transaction_proto_rawDescGZIP(), []int{1} } func (x *GetTransactionResponse) GetTxHex() string { @@ -179,19 +179,19 @@ type SelectUtxosRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Account key. - AccountKey *AccountKey `protobuf:"bytes,1,opt,name=account_key,json=accountKey,proto3" json:"account_key,omitempty"` + // Account name. + AccountName string `protobuf:"bytes,1,opt,name=account_name,json=accountName,proto3" json:"account_name,omitempty"` // Asset hash of the utxos to select. TargetAsset string `protobuf:"bytes,2,opt,name=target_asset,json=targetAsset,proto3" json:"target_asset,omitempty"` // Target amount to cover. TargetAmount uint64 `protobuf:"varint,3,opt,name=target_amount,json=targetAmount,proto3" json:"target_amount,omitempty"` - Strategy SelectUtxosRequest_Strategy `protobuf:"varint,4,opt,name=strategy,proto3,enum=ocean.v1alpha.SelectUtxosRequest_Strategy" json:"strategy,omitempty"` + Strategy SelectUtxosRequest_Strategy `protobuf:"varint,4,opt,name=strategy,proto3,enum=ocean.v1.SelectUtxosRequest_Strategy" json:"strategy,omitempty"` } func (x *SelectUtxosRequest) Reset() { *x = SelectUtxosRequest{} if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[2] + mi := &file_ocean_v1_transaction_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -204,7 +204,7 @@ func (x *SelectUtxosRequest) String() string { func (*SelectUtxosRequest) ProtoMessage() {} func (x *SelectUtxosRequest) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[2] + mi := &file_ocean_v1_transaction_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -217,14 +217,14 @@ func (x *SelectUtxosRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SelectUtxosRequest.ProtoReflect.Descriptor instead. func (*SelectUtxosRequest) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_transaction_proto_rawDescGZIP(), []int{2} + return file_ocean_v1_transaction_proto_rawDescGZIP(), []int{2} } -func (x *SelectUtxosRequest) GetAccountKey() *AccountKey { +func (x *SelectUtxosRequest) GetAccountName() string { if x != nil { - return x.AccountKey + return x.AccountName } - return nil + return "" } func (x *SelectUtxosRequest) GetTargetAsset() string { @@ -254,14 +254,18 @@ type SelectUtxosResponse struct { unknownFields protoimpl.UnknownFields // List of selected utxos. - Utxos *Utxos `protobuf:"bytes,1,opt,name=utxos,proto3" json:"utxos,omitempty"` + Utxos []*Utxo `protobuf:"bytes,1,rep,name=utxos,proto3" json:"utxos,omitempty"` + // Eventual change amount if utxos cumulative sum exceeds the target amount. Change uint64 `protobuf:"varint,2,opt,name=change,proto3" json:"change,omitempty"` + // Expiration date for the selected utxo, which are temporary locked to + // prevent double spending them. + ExpirationDate int64 `protobuf:"varint,3,opt,name=expiration_date,json=expirationDate,proto3" json:"expiration_date,omitempty"` } func (x *SelectUtxosResponse) Reset() { *x = SelectUtxosResponse{} if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[3] + mi := &file_ocean_v1_transaction_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -274,7 +278,7 @@ func (x *SelectUtxosResponse) String() string { func (*SelectUtxosResponse) ProtoMessage() {} func (x *SelectUtxosResponse) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[3] + mi := &file_ocean_v1_transaction_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -287,10 +291,10 @@ func (x *SelectUtxosResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SelectUtxosResponse.ProtoReflect.Descriptor instead. func (*SelectUtxosResponse) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_transaction_proto_rawDescGZIP(), []int{3} + return file_ocean_v1_transaction_proto_rawDescGZIP(), []int{3} } -func (x *SelectUtxosResponse) GetUtxos() *Utxos { +func (x *SelectUtxosResponse) GetUtxos() []*Utxo { if x != nil { return x.Utxos } @@ -304,19 +308,27 @@ func (x *SelectUtxosResponse) GetChange() uint64 { return 0 } +func (x *SelectUtxosResponse) GetExpirationDate() int64 { + if x != nil { + return x.ExpirationDate + } + return 0 +} + type EstimateFeesRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Inputs []*Input `protobuf:"bytes,1,rep,name=inputs,proto3" json:"inputs,omitempty"` - Outputs []*Output `protobuf:"bytes,2,rep,name=outputs,proto3" json:"outputs,omitempty"` + Inputs []*Input `protobuf:"bytes,1,rep,name=inputs,proto3" json:"inputs,omitempty"` + Outputs []*Output `protobuf:"bytes,2,rep,name=outputs,proto3" json:"outputs,omitempty"` + MillisatsPerByte uint64 `protobuf:"varint,3,opt,name=millisats_per_byte,json=millisatsPerByte,proto3" json:"millisats_per_byte,omitempty"` } func (x *EstimateFeesRequest) Reset() { *x = EstimateFeesRequest{} if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[4] + mi := &file_ocean_v1_transaction_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -329,7 +341,7 @@ func (x *EstimateFeesRequest) String() string { func (*EstimateFeesRequest) ProtoMessage() {} func (x *EstimateFeesRequest) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[4] + mi := &file_ocean_v1_transaction_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -342,7 +354,7 @@ func (x *EstimateFeesRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use EstimateFeesRequest.ProtoReflect.Descriptor instead. func (*EstimateFeesRequest) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_transaction_proto_rawDescGZIP(), []int{4} + return file_ocean_v1_transaction_proto_rawDescGZIP(), []int{4} } func (x *EstimateFeesRequest) GetInputs() []*Input { @@ -359,6 +371,13 @@ func (x *EstimateFeesRequest) GetOutputs() []*Output { return nil } +func (x *EstimateFeesRequest) GetMillisatsPerByte() uint64 { + if x != nil { + return x.MillisatsPerByte + } + return 0 +} + type EstimateFeesResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -370,7 +389,7 @@ type EstimateFeesResponse struct { func (x *EstimateFeesResponse) Reset() { *x = EstimateFeesResponse{} if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[5] + mi := &file_ocean_v1_transaction_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -383,7 +402,7 @@ func (x *EstimateFeesResponse) String() string { func (*EstimateFeesResponse) ProtoMessage() {} func (x *EstimateFeesResponse) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[5] + mi := &file_ocean_v1_transaction_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -396,7 +415,7 @@ func (x *EstimateFeesResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use EstimateFeesResponse.ProtoReflect.Descriptor instead. func (*EstimateFeesResponse) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_transaction_proto_rawDescGZIP(), []int{5} + return file_ocean_v1_transaction_proto_rawDescGZIP(), []int{5} } func (x *EstimateFeesResponse) GetFeeAmount() uint64 { @@ -413,12 +432,14 @@ type SignTransactionRequest struct { // Raw transaction to sign. TxHex string `protobuf:"bytes,1,opt,name=tx_hex,json=txHex,proto3" json:"tx_hex,omitempty"` + // The sighash type. SIGHASH_ALL is used if not defined. + SighashType uint32 `protobuf:"varint,2,opt,name=sighash_type,json=sighashType,proto3" json:"sighash_type,omitempty"` } func (x *SignTransactionRequest) Reset() { *x = SignTransactionRequest{} if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[6] + mi := &file_ocean_v1_transaction_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -431,7 +452,7 @@ func (x *SignTransactionRequest) String() string { func (*SignTransactionRequest) ProtoMessage() {} func (x *SignTransactionRequest) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[6] + mi := &file_ocean_v1_transaction_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -444,7 +465,7 @@ func (x *SignTransactionRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SignTransactionRequest.ProtoReflect.Descriptor instead. func (*SignTransactionRequest) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_transaction_proto_rawDescGZIP(), []int{6} + return file_ocean_v1_transaction_proto_rawDescGZIP(), []int{6} } func (x *SignTransactionRequest) GetTxHex() string { @@ -454,6 +475,13 @@ func (x *SignTransactionRequest) GetTxHex() string { return "" } +func (x *SignTransactionRequest) GetSighashType() uint32 { + if x != nil { + return x.SighashType + } + return 0 +} + type SignTransactionResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -466,7 +494,7 @@ type SignTransactionResponse struct { func (x *SignTransactionResponse) Reset() { *x = SignTransactionResponse{} if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[7] + mi := &file_ocean_v1_transaction_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -479,7 +507,7 @@ func (x *SignTransactionResponse) String() string { func (*SignTransactionResponse) ProtoMessage() {} func (x *SignTransactionResponse) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[7] + mi := &file_ocean_v1_transaction_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -492,7 +520,7 @@ func (x *SignTransactionResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SignTransactionResponse.ProtoReflect.Descriptor instead. func (*SignTransactionResponse) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_transaction_proto_rawDescGZIP(), []int{7} + return file_ocean_v1_transaction_proto_rawDescGZIP(), []int{7} } func (x *SignTransactionResponse) GetTxHex() string { @@ -514,7 +542,7 @@ type BroadcastTransactionRequest struct { func (x *BroadcastTransactionRequest) Reset() { *x = BroadcastTransactionRequest{} if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[8] + mi := &file_ocean_v1_transaction_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -527,7 +555,7 @@ func (x *BroadcastTransactionRequest) String() string { func (*BroadcastTransactionRequest) ProtoMessage() {} func (x *BroadcastTransactionRequest) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[8] + mi := &file_ocean_v1_transaction_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -540,7 +568,7 @@ func (x *BroadcastTransactionRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use BroadcastTransactionRequest.ProtoReflect.Descriptor instead. func (*BroadcastTransactionRequest) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_transaction_proto_rawDescGZIP(), []int{8} + return file_ocean_v1_transaction_proto_rawDescGZIP(), []int{8} } func (x *BroadcastTransactionRequest) GetTxHex() string { @@ -562,7 +590,7 @@ type BroadcastTransactionResponse struct { func (x *BroadcastTransactionResponse) Reset() { *x = BroadcastTransactionResponse{} if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[9] + mi := &file_ocean_v1_transaction_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -575,7 +603,7 @@ func (x *BroadcastTransactionResponse) String() string { func (*BroadcastTransactionResponse) ProtoMessage() {} func (x *BroadcastTransactionResponse) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[9] + mi := &file_ocean_v1_transaction_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -588,7 +616,7 @@ func (x *BroadcastTransactionResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use BroadcastTransactionResponse.ProtoReflect.Descriptor instead. func (*BroadcastTransactionResponse) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_transaction_proto_rawDescGZIP(), []int{9} + return file_ocean_v1_transaction_proto_rawDescGZIP(), []int{9} } func (x *BroadcastTransactionResponse) GetTxid() string { @@ -612,7 +640,7 @@ type CreatePsetRequest struct { func (x *CreatePsetRequest) Reset() { *x = CreatePsetRequest{} if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[10] + mi := &file_ocean_v1_transaction_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -625,7 +653,7 @@ func (x *CreatePsetRequest) String() string { func (*CreatePsetRequest) ProtoMessage() {} func (x *CreatePsetRequest) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[10] + mi := &file_ocean_v1_transaction_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -638,7 +666,7 @@ func (x *CreatePsetRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CreatePsetRequest.ProtoReflect.Descriptor instead. func (*CreatePsetRequest) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_transaction_proto_rawDescGZIP(), []int{10} + return file_ocean_v1_transaction_proto_rawDescGZIP(), []int{10} } func (x *CreatePsetRequest) GetInputs() []*Input { @@ -667,7 +695,7 @@ type CreatePsetResponse struct { func (x *CreatePsetResponse) Reset() { *x = CreatePsetResponse{} if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[11] + mi := &file_ocean_v1_transaction_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -680,7 +708,7 @@ func (x *CreatePsetResponse) String() string { func (*CreatePsetResponse) ProtoMessage() {} func (x *CreatePsetResponse) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[11] + mi := &file_ocean_v1_transaction_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -693,7 +721,7 @@ func (x *CreatePsetResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CreatePsetResponse.ProtoReflect.Descriptor instead. func (*CreatePsetResponse) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_transaction_proto_rawDescGZIP(), []int{11} + return file_ocean_v1_transaction_proto_rawDescGZIP(), []int{11} } func (x *CreatePsetResponse) GetPset() string { @@ -719,7 +747,7 @@ type UpdatePsetRequest struct { func (x *UpdatePsetRequest) Reset() { *x = UpdatePsetRequest{} if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[12] + mi := &file_ocean_v1_transaction_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -732,7 +760,7 @@ func (x *UpdatePsetRequest) String() string { func (*UpdatePsetRequest) ProtoMessage() {} func (x *UpdatePsetRequest) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[12] + mi := &file_ocean_v1_transaction_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -745,7 +773,7 @@ func (x *UpdatePsetRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdatePsetRequest.ProtoReflect.Descriptor instead. func (*UpdatePsetRequest) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_transaction_proto_rawDescGZIP(), []int{12} + return file_ocean_v1_transaction_proto_rawDescGZIP(), []int{12} } func (x *UpdatePsetRequest) GetPset() string { @@ -781,7 +809,7 @@ type UpdatePsetResponse struct { func (x *UpdatePsetResponse) Reset() { *x = UpdatePsetResponse{} if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[13] + mi := &file_ocean_v1_transaction_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -794,7 +822,7 @@ func (x *UpdatePsetResponse) String() string { func (*UpdatePsetResponse) ProtoMessage() {} func (x *UpdatePsetResponse) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[13] + mi := &file_ocean_v1_transaction_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -807,7 +835,7 @@ func (x *UpdatePsetResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use UpdatePsetResponse.ProtoReflect.Descriptor instead. func (*UpdatePsetResponse) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_transaction_proto_rawDescGZIP(), []int{13} + return file_ocean_v1_transaction_proto_rawDescGZIP(), []int{13} } func (x *UpdatePsetResponse) GetPset() string { @@ -830,7 +858,7 @@ type BlindPsetRequest struct { func (x *BlindPsetRequest) Reset() { *x = BlindPsetRequest{} if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[14] + mi := &file_ocean_v1_transaction_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -843,7 +871,7 @@ func (x *BlindPsetRequest) String() string { func (*BlindPsetRequest) ProtoMessage() {} func (x *BlindPsetRequest) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[14] + mi := &file_ocean_v1_transaction_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -856,7 +884,7 @@ func (x *BlindPsetRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use BlindPsetRequest.ProtoReflect.Descriptor instead. func (*BlindPsetRequest) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_transaction_proto_rawDescGZIP(), []int{14} + return file_ocean_v1_transaction_proto_rawDescGZIP(), []int{14} } func (x *BlindPsetRequest) GetPset() string { @@ -885,7 +913,7 @@ type BlindPsetResponse struct { func (x *BlindPsetResponse) Reset() { *x = BlindPsetResponse{} if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[15] + mi := &file_ocean_v1_transaction_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -898,7 +926,7 @@ func (x *BlindPsetResponse) String() string { func (*BlindPsetResponse) ProtoMessage() {} func (x *BlindPsetResponse) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[15] + mi := &file_ocean_v1_transaction_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -911,7 +939,7 @@ func (x *BlindPsetResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use BlindPsetResponse.ProtoReflect.Descriptor instead. func (*BlindPsetResponse) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_transaction_proto_rawDescGZIP(), []int{15} + return file_ocean_v1_transaction_proto_rawDescGZIP(), []int{15} } func (x *BlindPsetResponse) GetPset() string { @@ -928,12 +956,15 @@ type SignPsetRequest struct { // The partial transaction to sign in base64 format. Pset string `protobuf:"bytes,1,opt,name=pset,proto3" json:"pset,omitempty"` + // The sighash type. If not specified, SIGHASH_ALL is used for any input + // to sign that doesn't already have one set. + SighashType uint32 `protobuf:"varint,2,opt,name=sighash_type,json=sighashType,proto3" json:"sighash_type,omitempty"` } func (x *SignPsetRequest) Reset() { *x = SignPsetRequest{} if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[16] + mi := &file_ocean_v1_transaction_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -946,7 +977,7 @@ func (x *SignPsetRequest) String() string { func (*SignPsetRequest) ProtoMessage() {} func (x *SignPsetRequest) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[16] + mi := &file_ocean_v1_transaction_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -959,7 +990,7 @@ func (x *SignPsetRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use SignPsetRequest.ProtoReflect.Descriptor instead. func (*SignPsetRequest) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_transaction_proto_rawDescGZIP(), []int{16} + return file_ocean_v1_transaction_proto_rawDescGZIP(), []int{16} } func (x *SignPsetRequest) GetPset() string { @@ -969,6 +1000,13 @@ func (x *SignPsetRequest) GetPset() string { return "" } +func (x *SignPsetRequest) GetSighashType() uint32 { + if x != nil { + return x.SighashType + } + return 0 +} + type SignPsetResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -981,7 +1019,7 @@ type SignPsetResponse struct { func (x *SignPsetResponse) Reset() { *x = SignPsetResponse{} if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[17] + mi := &file_ocean_v1_transaction_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -994,7 +1032,7 @@ func (x *SignPsetResponse) String() string { func (*SignPsetResponse) ProtoMessage() {} func (x *SignPsetResponse) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[17] + mi := &file_ocean_v1_transaction_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1007,7 +1045,7 @@ func (x *SignPsetResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use SignPsetResponse.ProtoReflect.Descriptor instead. func (*SignPsetResponse) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_transaction_proto_rawDescGZIP(), []int{17} + return file_ocean_v1_transaction_proto_rawDescGZIP(), []int{17} } func (x *SignPsetResponse) GetPset() string { @@ -1022,8 +1060,8 @@ type MintRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Account key. - AccountKey *AccountKey `protobuf:"bytes,1,opt,name=account_key,json=accountKey,proto3" json:"account_key,omitempty"` + // Account name. + AccountName string `protobuf:"bytes,1,opt,name=account_name,json=accountName,proto3" json:"account_name,omitempty"` // Asset amount to mint. AssetAmount uint64 `protobuf:"varint,2,opt,name=asset_amount,json=assetAmount,proto3" json:"asset_amount,omitempty"` // Token amount to mint. @@ -1034,12 +1072,14 @@ type MintRequest struct { AssetTicker string `protobuf:"bytes,5,opt,name=asset_ticker,json=assetTicker,proto3" json:"asset_ticker,omitempty"` // Domain of the asset. AssetDomain string `protobuf:"bytes,6,opt,name=asset_domain,json=assetDomain,proto3" json:"asset_domain,omitempty"` + // mSats/byte fee ratio. + MillisatsPerByte uint64 `protobuf:"varint,7,opt,name=millisats_per_byte,json=millisatsPerByte,proto3" json:"millisats_per_byte,omitempty"` } func (x *MintRequest) Reset() { *x = MintRequest{} if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[18] + mi := &file_ocean_v1_transaction_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1052,7 +1092,7 @@ func (x *MintRequest) String() string { func (*MintRequest) ProtoMessage() {} func (x *MintRequest) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[18] + mi := &file_ocean_v1_transaction_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1065,14 +1105,14 @@ func (x *MintRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use MintRequest.ProtoReflect.Descriptor instead. func (*MintRequest) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_transaction_proto_rawDescGZIP(), []int{18} + return file_ocean_v1_transaction_proto_rawDescGZIP(), []int{18} } -func (x *MintRequest) GetAccountKey() *AccountKey { +func (x *MintRequest) GetAccountName() string { if x != nil { - return x.AccountKey + return x.AccountName } - return nil + return "" } func (x *MintRequest) GetAssetAmount() uint64 { @@ -1110,6 +1150,13 @@ func (x *MintRequest) GetAssetDomain() string { return "" } +func (x *MintRequest) GetMillisatsPerByte() uint64 { + if x != nil { + return x.MillisatsPerByte + } + return 0 +} + type MintResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1122,7 +1169,7 @@ type MintResponse struct { func (x *MintResponse) Reset() { *x = MintResponse{} if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[19] + mi := &file_ocean_v1_transaction_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1135,7 +1182,7 @@ func (x *MintResponse) String() string { func (*MintResponse) ProtoMessage() {} func (x *MintResponse) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[19] + mi := &file_ocean_v1_transaction_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1148,7 +1195,7 @@ func (x *MintResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use MintResponse.ProtoReflect.Descriptor instead. func (*MintResponse) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_transaction_proto_rawDescGZIP(), []int{19} + return file_ocean_v1_transaction_proto_rawDescGZIP(), []int{19} } func (x *MintResponse) GetTxHex() string { @@ -1163,18 +1210,20 @@ type RemintRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Account key. - AccountKey *AccountKey `protobuf:"bytes,1,opt,name=account_key,json=accountKey,proto3" json:"account_key,omitempty"` + // Account name. + AccountName string `protobuf:"bytes,1,opt,name=account_name,json=accountName,proto3" json:"account_name,omitempty"` // Hash of the asset to remint. Asset string `protobuf:"bytes,2,opt,name=asset,proto3" json:"asset,omitempty"` // Amount to remint. Amount uint64 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"` + // mSats/byte fee ratio. + MillisatsPerByte uint64 `protobuf:"varint,4,opt,name=millisats_per_byte,json=millisatsPerByte,proto3" json:"millisats_per_byte,omitempty"` } func (x *RemintRequest) Reset() { *x = RemintRequest{} if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[20] + mi := &file_ocean_v1_transaction_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1187,7 +1236,7 @@ func (x *RemintRequest) String() string { func (*RemintRequest) ProtoMessage() {} func (x *RemintRequest) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[20] + mi := &file_ocean_v1_transaction_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1200,14 +1249,14 @@ func (x *RemintRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RemintRequest.ProtoReflect.Descriptor instead. func (*RemintRequest) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_transaction_proto_rawDescGZIP(), []int{20} + return file_ocean_v1_transaction_proto_rawDescGZIP(), []int{20} } -func (x *RemintRequest) GetAccountKey() *AccountKey { +func (x *RemintRequest) GetAccountName() string { if x != nil { - return x.AccountKey + return x.AccountName } - return nil + return "" } func (x *RemintRequest) GetAsset() string { @@ -1224,6 +1273,13 @@ func (x *RemintRequest) GetAmount() uint64 { return 0 } +func (x *RemintRequest) GetMillisatsPerByte() uint64 { + if x != nil { + return x.MillisatsPerByte + } + return 0 +} + type RemintResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1236,7 +1292,7 @@ type RemintResponse struct { func (x *RemintResponse) Reset() { *x = RemintResponse{} if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[21] + mi := &file_ocean_v1_transaction_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1249,7 +1305,7 @@ func (x *RemintResponse) String() string { func (*RemintResponse) ProtoMessage() {} func (x *RemintResponse) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[21] + mi := &file_ocean_v1_transaction_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1262,7 +1318,7 @@ func (x *RemintResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use RemintResponse.ProtoReflect.Descriptor instead. func (*RemintResponse) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_transaction_proto_rawDescGZIP(), []int{21} + return file_ocean_v1_transaction_proto_rawDescGZIP(), []int{21} } func (x *RemintResponse) GetTxHex() string { @@ -1277,17 +1333,19 @@ type BurnRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Account key. - AccountKey *AccountKey `protobuf:"bytes,1,opt,name=account_key,json=accountKey,proto3" json:"account_key,omitempty"` + // Account name. + AccountName string `protobuf:"bytes,1,opt,name=account_name,json=accountName,proto3" json:"account_name,omitempty"` // Receivers contains a list of asset-amount to burn and their addresses are // ignored and replaced with OP_RETURN output scripts. Receivers []*Output `protobuf:"bytes,2,rep,name=receivers,proto3" json:"receivers,omitempty"` + // mSats/byte fee ratio. + MillisatsPerByte uint64 `protobuf:"varint,3,opt,name=millisats_per_byte,json=millisatsPerByte,proto3" json:"millisats_per_byte,omitempty"` } func (x *BurnRequest) Reset() { *x = BurnRequest{} if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[22] + mi := &file_ocean_v1_transaction_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1300,7 +1358,7 @@ func (x *BurnRequest) String() string { func (*BurnRequest) ProtoMessage() {} func (x *BurnRequest) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[22] + mi := &file_ocean_v1_transaction_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1313,14 +1371,14 @@ func (x *BurnRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use BurnRequest.ProtoReflect.Descriptor instead. func (*BurnRequest) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_transaction_proto_rawDescGZIP(), []int{22} + return file_ocean_v1_transaction_proto_rawDescGZIP(), []int{22} } -func (x *BurnRequest) GetAccountKey() *AccountKey { +func (x *BurnRequest) GetAccountName() string { if x != nil { - return x.AccountKey + return x.AccountName } - return nil + return "" } func (x *BurnRequest) GetReceivers() []*Output { @@ -1330,6 +1388,13 @@ func (x *BurnRequest) GetReceivers() []*Output { return nil } +func (x *BurnRequest) GetMillisatsPerByte() uint64 { + if x != nil { + return x.MillisatsPerByte + } + return 0 +} + type BurnResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1342,7 +1407,7 @@ type BurnResponse struct { func (x *BurnResponse) Reset() { *x = BurnResponse{} if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[23] + mi := &file_ocean_v1_transaction_proto_msgTypes[23] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1355,7 +1420,7 @@ func (x *BurnResponse) String() string { func (*BurnResponse) ProtoMessage() {} func (x *BurnResponse) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[23] + mi := &file_ocean_v1_transaction_proto_msgTypes[23] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1368,7 +1433,7 @@ func (x *BurnResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use BurnResponse.ProtoReflect.Descriptor instead. func (*BurnResponse) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_transaction_proto_rawDescGZIP(), []int{23} + return file_ocean_v1_transaction_proto_rawDescGZIP(), []int{23} } func (x *BurnResponse) GetTxHex() string { @@ -1383,16 +1448,18 @@ type TransferRequest struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Account key. - AccountKey *AccountKey `protobuf:"bytes,1,opt,name=account_key,json=accountKey,proto3" json:"account_key,omitempty"` + // Account name. + AccountName string `protobuf:"bytes,1,opt,name=account_name,json=accountName,proto3" json:"account_name,omitempty"` // Receivers are the receivers of the funds. Receivers []*Output `protobuf:"bytes,2,rep,name=receivers,proto3" json:"receivers,omitempty"` + // mSats/byte fee ratio. + MillisatsPerByte uint64 `protobuf:"varint,3,opt,name=millisats_per_byte,json=millisatsPerByte,proto3" json:"millisats_per_byte,omitempty"` } func (x *TransferRequest) Reset() { *x = TransferRequest{} if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[24] + mi := &file_ocean_v1_transaction_proto_msgTypes[24] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1405,7 +1472,7 @@ func (x *TransferRequest) String() string { func (*TransferRequest) ProtoMessage() {} func (x *TransferRequest) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[24] + mi := &file_ocean_v1_transaction_proto_msgTypes[24] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1418,14 +1485,14 @@ func (x *TransferRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use TransferRequest.ProtoReflect.Descriptor instead. func (*TransferRequest) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_transaction_proto_rawDescGZIP(), []int{24} + return file_ocean_v1_transaction_proto_rawDescGZIP(), []int{24} } -func (x *TransferRequest) GetAccountKey() *AccountKey { +func (x *TransferRequest) GetAccountName() string { if x != nil { - return x.AccountKey + return x.AccountName } - return nil + return "" } func (x *TransferRequest) GetReceivers() []*Output { @@ -1435,6 +1502,13 @@ func (x *TransferRequest) GetReceivers() []*Output { return nil } +func (x *TransferRequest) GetMillisatsPerByte() uint64 { + if x != nil { + return x.MillisatsPerByte + } + return 0 +} + type TransferResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1447,7 +1521,7 @@ type TransferResponse struct { func (x *TransferResponse) Reset() { *x = TransferResponse{} if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[25] + mi := &file_ocean_v1_transaction_proto_msgTypes[25] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1460,7 +1534,7 @@ func (x *TransferResponse) String() string { func (*TransferResponse) ProtoMessage() {} func (x *TransferResponse) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[25] + mi := &file_ocean_v1_transaction_proto_msgTypes[25] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1473,7 +1547,7 @@ func (x *TransferResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use TransferResponse.ProtoReflect.Descriptor instead. func (*TransferResponse) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_transaction_proto_rawDescGZIP(), []int{25} + return file_ocean_v1_transaction_proto_rawDescGZIP(), []int{25} } func (x *TransferResponse) GetTxHex() string { @@ -1492,7 +1566,7 @@ type PegInAddressRequest struct { func (x *PegInAddressRequest) Reset() { *x = PegInAddressRequest{} if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[26] + mi := &file_ocean_v1_transaction_proto_msgTypes[26] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1505,7 +1579,7 @@ func (x *PegInAddressRequest) String() string { func (*PegInAddressRequest) ProtoMessage() {} func (x *PegInAddressRequest) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[26] + mi := &file_ocean_v1_transaction_proto_msgTypes[26] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1518,7 +1592,7 @@ func (x *PegInAddressRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use PegInAddressRequest.ProtoReflect.Descriptor instead. func (*PegInAddressRequest) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_transaction_proto_rawDescGZIP(), []int{26} + return file_ocean_v1_transaction_proto_rawDescGZIP(), []int{26} } type PegInAddressResponse struct { @@ -1526,8 +1600,8 @@ type PegInAddressResponse struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - // Account key. - AccountKey *AccountKey `protobuf:"bytes,1,opt,name=account_key,json=accountKey,proto3" json:"account_key,omitempty"` + // Account name. + AccountName string `protobuf:"bytes,1,opt,name=account_name,json=accountName,proto3" json:"account_name,omitempty"` // Main-chain deposit address to send bitcoin to. MainChainAddress string `protobuf:"bytes,2,opt,name=main_chain_address,json=mainChainAddress,proto3" json:"main_chain_address,omitempty"` // Claim script committed to by the main-chain address. @@ -1537,7 +1611,7 @@ type PegInAddressResponse struct { func (x *PegInAddressResponse) Reset() { *x = PegInAddressResponse{} if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[27] + mi := &file_ocean_v1_transaction_proto_msgTypes[27] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1550,7 +1624,7 @@ func (x *PegInAddressResponse) String() string { func (*PegInAddressResponse) ProtoMessage() {} func (x *PegInAddressResponse) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[27] + mi := &file_ocean_v1_transaction_proto_msgTypes[27] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1563,14 +1637,14 @@ func (x *PegInAddressResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use PegInAddressResponse.ProtoReflect.Descriptor instead. func (*PegInAddressResponse) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_transaction_proto_rawDescGZIP(), []int{27} + return file_ocean_v1_transaction_proto_rawDescGZIP(), []int{27} } -func (x *PegInAddressResponse) GetAccountKey() *AccountKey { +func (x *PegInAddressResponse) GetAccountName() string { if x != nil { - return x.AccountKey + return x.AccountName } - return nil + return "" } func (x *PegInAddressResponse) GetMainChainAddress() string { @@ -1603,7 +1677,7 @@ type ClaimPegInRequest struct { func (x *ClaimPegInRequest) Reset() { *x = ClaimPegInRequest{} if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[28] + mi := &file_ocean_v1_transaction_proto_msgTypes[28] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1616,7 +1690,7 @@ func (x *ClaimPegInRequest) String() string { func (*ClaimPegInRequest) ProtoMessage() {} func (x *ClaimPegInRequest) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[28] + mi := &file_ocean_v1_transaction_proto_msgTypes[28] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1629,7 +1703,7 @@ func (x *ClaimPegInRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ClaimPegInRequest.ProtoReflect.Descriptor instead. func (*ClaimPegInRequest) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_transaction_proto_rawDescGZIP(), []int{28} + return file_ocean_v1_transaction_proto_rawDescGZIP(), []int{28} } func (x *ClaimPegInRequest) GetBitcoinTx() string { @@ -1665,7 +1739,7 @@ type ClaimPegInResponse struct { func (x *ClaimPegInResponse) Reset() { *x = ClaimPegInResponse{} if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[29] + mi := &file_ocean_v1_transaction_proto_msgTypes[29] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1678,7 +1752,7 @@ func (x *ClaimPegInResponse) String() string { func (*ClaimPegInResponse) ProtoMessage() {} func (x *ClaimPegInResponse) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_transaction_proto_msgTypes[29] + mi := &file_ocean_v1_transaction_proto_msgTypes[29] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1691,7 +1765,7 @@ func (x *ClaimPegInResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ClaimPegInResponse.ProtoReflect.Descriptor instead. func (*ClaimPegInResponse) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_transaction_proto_rawDescGZIP(), []int{29} + return file_ocean_v1_transaction_proto_rawDescGZIP(), []int{29} } func (x *ClaimPegInResponse) GetTxHex() string { @@ -1701,389 +1775,377 @@ func (x *ClaimPegInResponse) GetTxHex() string { return "" } -var File_ocean_v1alpha_transaction_proto protoreflect.FileDescriptor +var File_ocean_v1_transaction_proto protoreflect.FileDescriptor -var file_ocean_v1alpha_transaction_proto_rawDesc = []byte{ - 0x0a, 0x1f, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, - 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x12, 0x0d, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x1a, 0x19, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2b, 0x0a, 0x15, 0x47, - 0x65, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x78, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x04, 0x74, 0x78, 0x69, 0x64, 0x22, 0x71, 0x0a, 0x16, 0x47, 0x65, 0x74, 0x54, - 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x15, 0x0a, 0x06, 0x74, 0x78, 0x5f, 0x68, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x74, 0x78, 0x48, 0x65, 0x78, 0x12, 0x40, 0x0a, 0x0d, 0x62, 0x6c, 0x6f, - 0x63, 0x6b, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1b, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, 0x0c, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0xb8, 0x02, 0x0a, 0x12, - 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x55, 0x74, 0x78, 0x6f, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x12, 0x3a, 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6b, 0x65, - 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4b, - 0x65, 0x79, 0x52, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x21, - 0x0a, 0x0c, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x61, 0x73, 0x73, 0x65, 0x74, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, 0x73, 0x73, 0x65, - 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x61, 0x6d, 0x6f, 0x75, - 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, - 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x46, 0x0a, 0x08, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, - 0x67, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2a, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x55, - 0x74, 0x78, 0x6f, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x74, 0x72, 0x61, - 0x74, 0x65, 0x67, 0x79, 0x52, 0x08, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x22, 0x56, - 0x0a, 0x08, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x12, 0x18, 0x0a, 0x14, 0x53, 0x54, - 0x52, 0x41, 0x54, 0x45, 0x47, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, - 0x45, 0x44, 0x10, 0x00, 0x12, 0x19, 0x0a, 0x15, 0x53, 0x54, 0x52, 0x41, 0x54, 0x45, 0x47, 0x59, - 0x5f, 0x42, 0x52, 0x41, 0x4e, 0x43, 0x48, 0x5f, 0x42, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x01, 0x12, - 0x15, 0x0a, 0x11, 0x53, 0x54, 0x52, 0x41, 0x54, 0x45, 0x47, 0x59, 0x5f, 0x46, 0x52, 0x41, 0x47, - 0x4d, 0x45, 0x4e, 0x54, 0x10, 0x02, 0x22, 0x59, 0x0a, 0x13, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, - 0x55, 0x74, 0x78, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, - 0x05, 0x75, 0x74, 0x78, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, - 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x55, 0x74, 0x78, - 0x6f, 0x73, 0x52, 0x05, 0x75, 0x74, 0x78, 0x6f, 0x73, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, - 0x6e, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x67, - 0x65, 0x22, 0x74, 0x0a, 0x13, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x46, 0x65, 0x65, - 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2c, 0x0a, 0x06, 0x69, 0x6e, 0x70, 0x75, - 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x52, 0x06, - 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x12, 0x2f, 0x0a, 0x07, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, - 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x07, - 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x73, 0x22, 0x35, 0x0a, 0x14, 0x45, 0x73, 0x74, 0x69, 0x6d, - 0x61, 0x74, 0x65, 0x46, 0x65, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x1d, 0x0a, 0x0a, 0x66, 0x65, 0x65, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x09, 0x66, 0x65, 0x65, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x2f, - 0x0a, 0x16, 0x53, 0x69, 0x67, 0x6e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, - 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x74, 0x78, 0x5f, 0x68, - 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x78, 0x48, 0x65, 0x78, 0x22, - 0x30, 0x0a, 0x17, 0x53, 0x69, 0x67, 0x6e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x15, 0x0a, 0x06, 0x74, 0x78, - 0x5f, 0x68, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x78, 0x48, 0x65, - 0x78, 0x22, 0x34, 0x0a, 0x1b, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x54, 0x72, - 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x15, 0x0a, 0x06, 0x74, 0x78, 0x5f, 0x68, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x05, 0x74, 0x78, 0x48, 0x65, 0x78, 0x22, 0x32, 0x0a, 0x1c, 0x42, 0x72, 0x6f, 0x61, 0x64, - 0x63, 0x61, 0x73, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x78, 0x69, 0x64, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x78, 0x69, 0x64, 0x22, 0x72, 0x0a, 0x11, 0x43, - 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x2c, 0x0a, 0x06, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x14, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x52, 0x06, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x12, 0x2f, - 0x0a, 0x07, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x15, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x07, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x73, 0x22, - 0x28, 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x73, 0x65, 0x74, 0x22, 0x86, 0x01, 0x0a, 0x11, 0x55, 0x70, - 0x64, 0x61, 0x74, 0x65, 0x50, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x12, 0x0a, 0x04, 0x70, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, - 0x73, 0x65, 0x74, 0x12, 0x2c, 0x0a, 0x06, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x18, 0x02, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x52, 0x06, 0x69, 0x6e, 0x70, 0x75, 0x74, - 0x73, 0x12, 0x2f, 0x0a, 0x07, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x07, 0x6f, 0x75, 0x74, 0x70, 0x75, - 0x74, 0x73, 0x22, 0x28, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x73, 0x65, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x73, 0x65, 0x74, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x73, 0x65, 0x74, 0x22, 0x49, 0x0a, 0x10, - 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x50, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x12, 0x0a, 0x04, 0x70, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x70, 0x73, 0x65, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x62, 0x6c, 0x69, - 0x6e, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x6c, 0x61, 0x73, 0x74, - 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x72, 0x22, 0x27, 0x0a, 0x11, 0x42, 0x6c, 0x69, 0x6e, 0x64, +var file_ocean_v1_transaction_proto_rawDesc = []byte{ + 0x0a, 0x1a, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, + 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x6f, 0x63, + 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x1a, 0x14, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2f, 0x76, 0x31, + 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2b, 0x0a, 0x15, + 0x47, 0x65, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x78, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x78, 0x69, 0x64, 0x22, 0x6c, 0x0a, 0x16, 0x47, 0x65, 0x74, + 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x15, 0x0a, 0x06, 0x74, 0x78, 0x5f, 0x68, 0x65, 0x78, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x78, 0x48, 0x65, 0x78, 0x12, 0x3b, 0x0a, 0x0d, 0x62, 0x6c, + 0x6f, 0x63, 0x6b, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x16, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, + 0x63, 0x6b, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x9a, 0x02, 0x0a, 0x12, 0x53, 0x65, 0x6c, 0x65, + 0x63, 0x74, 0x55, 0x74, 0x78, 0x6f, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, + 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, + 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x61, 0x73, 0x73, 0x65, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x41, + 0x73, 0x73, 0x65, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x5f, 0x61, + 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x74, 0x61, 0x72, + 0x67, 0x65, 0x74, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x41, 0x0a, 0x08, 0x73, 0x74, 0x72, + 0x61, 0x74, 0x65, 0x67, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25, 0x2e, 0x6f, 0x63, + 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x55, 0x74, 0x78, + 0x6f, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, + 0x67, 0x79, 0x52, 0x08, 0x73, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x22, 0x56, 0x0a, 0x08, + 0x53, 0x74, 0x72, 0x61, 0x74, 0x65, 0x67, 0x79, 0x12, 0x18, 0x0a, 0x14, 0x53, 0x54, 0x52, 0x41, + 0x54, 0x45, 0x47, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, + 0x10, 0x00, 0x12, 0x19, 0x0a, 0x15, 0x53, 0x54, 0x52, 0x41, 0x54, 0x45, 0x47, 0x59, 0x5f, 0x42, + 0x52, 0x41, 0x4e, 0x43, 0x48, 0x5f, 0x42, 0x4f, 0x55, 0x4e, 0x44, 0x10, 0x01, 0x12, 0x15, 0x0a, + 0x11, 0x53, 0x54, 0x52, 0x41, 0x54, 0x45, 0x47, 0x59, 0x5f, 0x46, 0x52, 0x41, 0x47, 0x4d, 0x45, + 0x4e, 0x54, 0x10, 0x02, 0x22, 0x7c, 0x0a, 0x13, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x55, 0x74, + 0x78, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x24, 0x0a, 0x05, 0x75, + 0x74, 0x78, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x6f, 0x63, 0x65, + 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x74, 0x78, 0x6f, 0x52, 0x05, 0x75, 0x74, 0x78, 0x6f, + 0x73, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x04, 0x52, 0x06, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x65, 0x78, 0x70, + 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x03, 0x52, 0x0e, 0x65, 0x78, 0x70, 0x69, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, + 0x74, 0x65, 0x22, 0x98, 0x01, 0x0a, 0x13, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x46, + 0x65, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x27, 0x0a, 0x06, 0x69, 0x6e, + 0x70, 0x75, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x63, 0x65, + 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x52, 0x06, 0x69, 0x6e, 0x70, + 0x75, 0x74, 0x73, 0x12, 0x2a, 0x0a, 0x07, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x73, 0x18, 0x02, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, + 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x07, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x73, 0x12, + 0x2c, 0x0a, 0x12, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x61, 0x74, 0x73, 0x5f, 0x70, 0x65, 0x72, + 0x5f, 0x62, 0x79, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x6d, 0x69, 0x6c, + 0x6c, 0x69, 0x73, 0x61, 0x74, 0x73, 0x50, 0x65, 0x72, 0x42, 0x79, 0x74, 0x65, 0x22, 0x35, 0x0a, + 0x14, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x46, 0x65, 0x65, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x65, 0x65, 0x5f, 0x61, 0x6d, 0x6f, + 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x09, 0x66, 0x65, 0x65, 0x41, 0x6d, + 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x52, 0x0a, 0x16, 0x53, 0x69, 0x67, 0x6e, 0x54, 0x72, 0x61, 0x6e, + 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x15, + 0x0a, 0x06, 0x74, 0x78, 0x5f, 0x68, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x74, 0x78, 0x48, 0x65, 0x78, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x69, 0x67, 0x68, 0x61, 0x73, 0x68, + 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x73, 0x69, 0x67, + 0x68, 0x61, 0x73, 0x68, 0x54, 0x79, 0x70, 0x65, 0x22, 0x30, 0x0a, 0x17, 0x53, 0x69, 0x67, 0x6e, + 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x15, 0x0a, 0x06, 0x74, 0x78, 0x5f, 0x68, 0x65, 0x78, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x78, 0x48, 0x65, 0x78, 0x22, 0x34, 0x0a, 0x1b, 0x42, 0x72, + 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x15, 0x0a, 0x06, 0x74, 0x78, 0x5f, + 0x68, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x78, 0x48, 0x65, 0x78, + 0x22, 0x32, 0x0a, 0x1c, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x54, 0x72, 0x61, + 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x74, 0x78, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x74, 0x78, 0x69, 0x64, 0x22, 0x68, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x73, + 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x27, 0x0a, 0x06, 0x69, 0x6e, 0x70, + 0x75, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x63, 0x65, 0x61, + 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x52, 0x06, 0x69, 0x6e, 0x70, 0x75, + 0x74, 0x73, 0x12, 0x2a, 0x0a, 0x07, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4f, + 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x07, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x73, 0x22, 0x28, + 0x0a, 0x12, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x70, 0x73, 0x65, 0x74, 0x22, 0x7c, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, + 0x74, 0x65, 0x50, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, + 0x04, 0x70, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x73, 0x65, + 0x74, 0x12, 0x27, 0x0a, 0x06, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x0f, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x70, + 0x75, 0x74, 0x52, 0x06, 0x69, 0x6e, 0x70, 0x75, 0x74, 0x73, 0x12, 0x2a, 0x0a, 0x07, 0x6f, 0x75, + 0x74, 0x70, 0x75, 0x74, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6f, 0x63, + 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x07, 0x6f, + 0x75, 0x74, 0x70, 0x75, 0x74, 0x73, 0x22, 0x28, 0x0a, 0x12, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x73, 0x65, 0x74, - 0x22, 0x25, 0x0a, 0x0f, 0x53, 0x69, 0x67, 0x6e, 0x50, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x70, 0x73, 0x65, 0x74, 0x22, 0x26, 0x0a, 0x10, 0x53, 0x69, 0x67, 0x6e, 0x50, - 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, - 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x73, 0x65, 0x74, 0x22, - 0xf4, 0x01, 0x0a, 0x0b, 0x4d, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x3a, 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x52, - 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x21, 0x0a, 0x0c, 0x61, - 0x73, 0x73, 0x65, 0x74, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x0b, 0x61, 0x73, 0x73, 0x65, 0x74, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x21, - 0x0a, 0x0c, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x0b, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x41, 0x6d, 0x6f, 0x75, 0x6e, - 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x73, 0x73, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, - 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x72, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x73, 0x73, 0x65, 0x74, 0x54, 0x69, 0x63, - 0x6b, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, 0x64, 0x6f, 0x6d, - 0x61, 0x69, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x73, 0x73, 0x65, 0x74, - 0x44, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x22, 0x25, 0x0a, 0x0c, 0x4d, 0x69, 0x6e, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x15, 0x0a, 0x06, 0x74, 0x78, 0x5f, 0x68, 0x65, 0x78, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x78, 0x48, 0x65, 0x78, 0x22, 0x79, 0x0a, - 0x0d, 0x52, 0x65, 0x6d, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3a, - 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x0a, - 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x73, - 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, - 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x27, 0x0a, 0x0e, 0x52, 0x65, 0x6d, 0x69, - 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x15, 0x0a, 0x06, 0x74, 0x78, - 0x5f, 0x68, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x78, 0x48, 0x65, - 0x78, 0x22, 0x7e, 0x0a, 0x0b, 0x42, 0x75, 0x72, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x12, 0x3a, 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4b, 0x65, 0x79, - 0x52, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x33, 0x0a, 0x09, - 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x15, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x09, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, - 0x73, 0x22, 0x25, 0x0a, 0x0c, 0x42, 0x75, 0x72, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x15, 0x0a, 0x06, 0x74, 0x78, 0x5f, 0x68, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x74, 0x78, 0x48, 0x65, 0x78, 0x22, 0x82, 0x01, 0x0a, 0x0f, 0x54, 0x72, 0x61, - 0x6e, 0x73, 0x66, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3a, 0x0a, 0x0b, - 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x19, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x0a, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x33, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x65, - 0x69, 0x76, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x63, - 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4f, 0x75, 0x74, 0x70, - 0x75, 0x74, 0x52, 0x09, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x73, 0x22, 0x29, 0x0a, - 0x10, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x15, 0x0a, 0x06, 0x74, 0x78, 0x5f, 0x68, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x05, 0x74, 0x78, 0x48, 0x65, 0x78, 0x22, 0x15, 0x0a, 0x13, 0x50, 0x65, 0x67, 0x49, - 0x6e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, - 0xa3, 0x01, 0x0a, 0x14, 0x50, 0x65, 0x67, 0x49, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, - 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x41, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x4b, 0x65, 0x79, 0x12, 0x2c, 0x0a, 0x12, 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x63, 0x68, 0x61, - 0x69, 0x6e, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x10, 0x6d, 0x61, 0x69, 0x6e, 0x43, 0x68, 0x61, 0x69, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x5f, 0x73, 0x63, 0x72, 0x69, - 0x70, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x53, - 0x63, 0x72, 0x69, 0x70, 0x74, 0x22, 0x77, 0x0a, 0x11, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x50, 0x65, - 0x67, 0x49, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x69, - 0x74, 0x63, 0x6f, 0x69, 0x6e, 0x5f, 0x74, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, - 0x62, 0x69, 0x74, 0x63, 0x6f, 0x69, 0x6e, 0x54, 0x78, 0x12, 0x20, 0x0a, 0x0c, 0x74, 0x78, 0x5f, - 0x6f, 0x75, 0x74, 0x5f, 0x70, 0x72, 0x6f, 0x6f, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x0a, 0x74, 0x78, 0x4f, 0x75, 0x74, 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x21, 0x0a, 0x0c, 0x63, - 0x6c, 0x61, 0x69, 0x6d, 0x5f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0b, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x22, 0x2b, - 0x0a, 0x12, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x50, 0x65, 0x67, 0x49, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x22, 0x49, 0x0a, 0x10, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x50, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x04, 0x70, 0x73, 0x65, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x6c, 0x61, 0x73, 0x74, + 0x5f, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, + 0x6c, 0x61, 0x73, 0x74, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x72, 0x22, 0x27, 0x0a, 0x11, 0x42, + 0x6c, 0x69, 0x6e, 0x64, 0x50, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x12, 0x12, 0x0a, 0x04, 0x70, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, + 0x70, 0x73, 0x65, 0x74, 0x22, 0x48, 0x0a, 0x0f, 0x53, 0x69, 0x67, 0x6e, 0x50, 0x73, 0x65, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x73, 0x65, 0x74, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x73, 0x65, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x73, + 0x69, 0x67, 0x68, 0x61, 0x73, 0x68, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0d, 0x52, 0x0b, 0x73, 0x69, 0x67, 0x68, 0x61, 0x73, 0x68, 0x54, 0x79, 0x70, 0x65, 0x22, 0x26, + 0x0a, 0x10, 0x53, 0x69, 0x67, 0x6e, 0x50, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x70, 0x73, 0x65, 0x74, 0x22, 0x89, 0x02, 0x0a, 0x0b, 0x4d, 0x69, 0x6e, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x73, 0x73, + 0x65, 0x74, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x0b, 0x61, 0x73, 0x73, 0x65, 0x74, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x21, 0x0a, 0x0c, + 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x0b, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, + 0x1d, 0x0a, 0x0a, 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x73, 0x73, 0x65, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x21, + 0x0a, 0x0c, 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, 0x74, 0x69, 0x63, 0x6b, 0x65, 0x72, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x73, 0x73, 0x65, 0x74, 0x54, 0x69, 0x63, 0x6b, 0x65, + 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x73, 0x73, 0x65, 0x74, 0x5f, 0x64, 0x6f, 0x6d, 0x61, 0x69, + 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x73, 0x73, 0x65, 0x74, 0x44, 0x6f, + 0x6d, 0x61, 0x69, 0x6e, 0x12, 0x2c, 0x0a, 0x12, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x61, 0x74, + 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x10, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x61, 0x74, 0x73, 0x50, 0x65, 0x72, 0x42, 0x79, + 0x74, 0x65, 0x22, 0x25, 0x0a, 0x0c, 0x4d, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x15, 0x0a, 0x06, 0x74, 0x78, 0x5f, 0x68, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x05, 0x74, 0x78, 0x48, 0x65, 0x78, 0x22, 0x8e, 0x01, 0x0a, 0x0d, 0x52, 0x65, + 0x6d, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x14, + 0x0a, 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, + 0x73, 0x73, 0x65, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2c, 0x0a, 0x12, + 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x61, 0x74, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x62, 0x79, + 0x74, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, + 0x61, 0x74, 0x73, 0x50, 0x65, 0x72, 0x42, 0x79, 0x74, 0x65, 0x22, 0x27, 0x0a, 0x0e, 0x52, 0x65, + 0x6d, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x15, 0x0a, 0x06, + 0x74, 0x78, 0x5f, 0x68, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x78, + 0x48, 0x65, 0x78, 0x22, 0x8e, 0x01, 0x0a, 0x0b, 0x42, 0x75, 0x72, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2e, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, + 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6f, 0x63, 0x65, 0x61, + 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x09, 0x72, 0x65, 0x63, + 0x65, 0x69, 0x76, 0x65, 0x72, 0x73, 0x12, 0x2c, 0x0a, 0x12, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, + 0x61, 0x74, 0x73, 0x5f, 0x70, 0x65, 0x72, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x04, 0x52, 0x10, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x61, 0x74, 0x73, 0x50, 0x65, 0x72, + 0x42, 0x79, 0x74, 0x65, 0x22, 0x25, 0x0a, 0x0c, 0x42, 0x75, 0x72, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x15, 0x0a, 0x06, 0x74, 0x78, 0x5f, 0x68, 0x65, 0x78, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x78, 0x48, 0x65, 0x78, 0x22, 0x92, 0x01, 0x0a, 0x0f, + 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, + 0x6d, 0x65, 0x12, 0x2e, 0x0a, 0x09, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x72, 0x73, 0x18, + 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, + 0x2e, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x52, 0x09, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, + 0x72, 0x73, 0x12, 0x2c, 0x0a, 0x12, 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x61, 0x74, 0x73, 0x5f, + 0x70, 0x65, 0x72, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, + 0x6d, 0x69, 0x6c, 0x6c, 0x69, 0x73, 0x61, 0x74, 0x73, 0x50, 0x65, 0x72, 0x42, 0x79, 0x74, 0x65, + 0x22, 0x29, 0x0a, 0x10, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x15, 0x0a, 0x06, 0x74, 0x78, 0x5f, 0x68, 0x65, 0x78, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x78, 0x48, 0x65, 0x78, 0x32, 0xfa, 0x09, 0x0a, 0x12, - 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x12, 0x5d, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x24, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x6f, 0x63, 0x65, - 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x72, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x78, 0x48, 0x65, 0x78, 0x22, 0x15, 0x0a, 0x13, 0x50, + 0x65, 0x67, 0x49, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x22, 0x8a, 0x01, 0x0a, 0x14, 0x50, 0x65, 0x67, 0x49, 0x6e, 0x41, 0x64, 0x64, 0x72, + 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x61, + 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x2c, + 0x0a, 0x12, 0x6d, 0x61, 0x69, 0x6e, 0x5f, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x6d, 0x61, 0x69, 0x6e, + 0x43, 0x68, 0x61, 0x69, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x21, 0x0a, 0x0c, + 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x5f, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x18, 0x03, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x22, + 0x77, 0x0a, 0x11, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x50, 0x65, 0x67, 0x49, 0x6e, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x69, 0x74, 0x63, 0x6f, 0x69, 0x6e, 0x5f, + 0x74, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x62, 0x69, 0x74, 0x63, 0x6f, 0x69, + 0x6e, 0x54, 0x78, 0x12, 0x20, 0x0a, 0x0c, 0x74, 0x78, 0x5f, 0x6f, 0x75, 0x74, 0x5f, 0x70, 0x72, + 0x6f, 0x6f, 0x66, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x74, 0x78, 0x4f, 0x75, 0x74, + 0x50, 0x72, 0x6f, 0x6f, 0x66, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6c, 0x61, 0x69, 0x6d, 0x5f, 0x73, + 0x63, 0x72, 0x69, 0x70, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6c, 0x61, + 0x69, 0x6d, 0x53, 0x63, 0x72, 0x69, 0x70, 0x74, 0x22, 0x2b, 0x0a, 0x12, 0x43, 0x6c, 0x61, 0x69, + 0x6d, 0x50, 0x65, 0x67, 0x49, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x15, + 0x0a, 0x06, 0x74, 0x78, 0x5f, 0x68, 0x65, 0x78, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, + 0x74, 0x78, 0x48, 0x65, 0x78, 0x32, 0xe4, 0x08, 0x0a, 0x12, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, + 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x53, 0x0a, 0x0e, + 0x47, 0x65, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1f, + 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x72, 0x61, + 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x20, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x54, 0x0a, 0x0b, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x55, 0x74, 0x78, 0x6f, 0x73, - 0x12, 0x21, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x55, 0x74, 0x78, 0x6f, 0x73, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x55, 0x74, 0x78, 0x6f, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x57, 0x0a, 0x0c, 0x45, 0x73, 0x74, 0x69, 0x6d, - 0x61, 0x74, 0x65, 0x46, 0x65, 0x65, 0x73, 0x12, 0x22, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, - 0x46, 0x65, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x6f, 0x63, - 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x45, 0x73, 0x74, 0x69, - 0x6d, 0x61, 0x74, 0x65, 0x46, 0x65, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x60, 0x0a, 0x0f, 0x53, 0x69, 0x67, 0x6e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x6f, 0x63, 0x65, - 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x54, - 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x6f, 0x0a, 0x14, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x54, - 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2a, 0x2e, 0x6f, 0x63, 0x65, - 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x42, 0x72, 0x6f, 0x61, 0x64, - 0x63, 0x61, 0x73, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2b, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, - 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x73, 0x65, - 0x74, 0x12, 0x20, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x73, 0x65, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, - 0x50, 0x73, 0x65, 0x74, 0x12, 0x20, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x73, 0x65, 0x74, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x73, 0x65, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4e, 0x0a, 0x09, 0x42, 0x6c, 0x69, - 0x6e, 0x64, 0x50, 0x73, 0x65, 0x74, 0x12, 0x1f, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x50, 0x73, 0x65, 0x74, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x50, 0x73, 0x65, - 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4b, 0x0a, 0x08, 0x53, 0x69, 0x67, - 0x6e, 0x50, 0x73, 0x65, 0x74, 0x12, 0x1e, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x50, 0x73, 0x65, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x50, 0x73, 0x65, 0x74, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, 0x0a, 0x04, 0x4d, 0x69, 0x6e, 0x74, 0x12, 0x1a, - 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4d, - 0x69, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x6f, 0x63, 0x65, - 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4d, 0x69, 0x6e, 0x74, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x45, 0x0a, 0x06, 0x52, 0x65, 0x6d, 0x69, 0x6e, - 0x74, 0x12, 0x1c, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x52, 0x65, 0x6d, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1d, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x52, 0x65, 0x6d, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3f, - 0x0a, 0x04, 0x42, 0x75, 0x72, 0x6e, 0x12, 0x1a, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x42, 0x75, 0x72, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x42, 0x75, 0x72, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x4b, 0x0a, 0x08, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x12, 0x1e, 0x2e, 0x6f, 0x63, - 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x54, 0x72, 0x61, 0x6e, - 0x73, 0x66, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6f, 0x63, - 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x54, 0x72, 0x61, 0x6e, - 0x73, 0x66, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x57, 0x0a, 0x0c, - 0x50, 0x65, 0x67, 0x49, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x22, 0x2e, 0x6f, - 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x50, 0x65, 0x67, - 0x49, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x23, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x50, 0x65, 0x67, 0x49, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x51, 0x0a, 0x0a, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x50, 0x65, - 0x67, 0x49, 0x6e, 0x12, 0x20, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x50, 0x65, 0x67, 0x49, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x50, 0x65, 0x67, 0x49, 0x6e, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0xdd, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, - 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x42, 0x10, - 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x01, 0x5a, 0x61, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x76, - 0x75, 0x6c, 0x70, 0x65, 0x6d, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2f, 0x6f, 0x63, - 0x65, 0x61, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2d, 0x73, 0x70, 0x65, 0x63, 0x2f, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2f, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x6f, 0x2f, 0x6f, 0x63, 0x65, 0x61, 0x6e, - 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x3b, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0xa2, 0x02, 0x03, 0x4f, 0x58, 0x58, 0xaa, 0x02, 0x0d, 0x4f, 0x63, - 0x65, 0x61, 0x6e, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0xca, 0x02, 0x0d, 0x4f, 0x63, - 0x65, 0x61, 0x6e, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0xe2, 0x02, 0x19, 0x4f, 0x63, - 0x65, 0x61, 0x6e, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x47, 0x50, 0x42, 0x4d, - 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4f, 0x63, 0x65, 0x61, 0x6e, 0x3a, - 0x3a, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x12, 0x4a, 0x0a, 0x0b, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, 0x55, 0x74, 0x78, 0x6f, 0x73, + 0x12, 0x1c, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x6c, 0x65, + 0x63, 0x74, 0x55, 0x74, 0x78, 0x6f, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, + 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x6c, 0x65, 0x63, 0x74, + 0x55, 0x74, 0x78, 0x6f, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, + 0x0c, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, 0x46, 0x65, 0x65, 0x73, 0x12, 0x1d, 0x2e, + 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, + 0x65, 0x46, 0x65, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x6f, + 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x73, 0x74, 0x69, 0x6d, 0x61, 0x74, 0x65, + 0x46, 0x65, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x0f, + 0x53, 0x69, 0x67, 0x6e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x20, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x54, + 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x21, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x67, + 0x6e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x65, 0x0a, 0x14, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, + 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x2e, 0x6f, + 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, + 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, + 0x72, 0x6f, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, + 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x0a, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x73, 0x65, 0x74, 0x12, 0x1b, 0x2e, 0x6f, 0x63, 0x65, 0x61, + 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x73, 0x65, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, + 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x73, + 0x65, 0x74, 0x12, 0x1b, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, + 0x64, 0x61, 0x74, 0x65, 0x50, 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x1c, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x50, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a, + 0x09, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x50, 0x73, 0x65, 0x74, 0x12, 0x1a, 0x2e, 0x6f, 0x63, 0x65, + 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x50, 0x73, 0x65, 0x74, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, + 0x31, 0x2e, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x50, 0x73, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x41, 0x0a, 0x08, 0x53, 0x69, 0x67, 0x6e, 0x50, 0x73, 0x65, 0x74, 0x12, + 0x19, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x50, + 0x73, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x6f, 0x63, 0x65, + 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x50, 0x73, 0x65, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x04, 0x4d, 0x69, 0x6e, 0x74, 0x12, 0x15, + 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x69, 0x6e, 0x74, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, + 0x2e, 0x4d, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, + 0x06, 0x52, 0x65, 0x6d, 0x69, 0x6e, 0x74, 0x12, 0x17, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, + 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6d, 0x69, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x18, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x6d, 0x69, + 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x35, 0x0a, 0x04, 0x42, 0x75, + 0x72, 0x6e, 0x12, 0x15, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x75, + 0x72, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x6f, 0x63, 0x65, 0x61, + 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x75, 0x72, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x41, 0x0a, 0x08, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x12, 0x19, 0x2e, + 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, + 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, + 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, + 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x0c, 0x50, 0x65, 0x67, 0x49, 0x6e, 0x41, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x12, 0x1d, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, + 0x50, 0x65, 0x67, 0x49, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x50, + 0x65, 0x67, 0x49, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x0a, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x50, 0x65, 0x67, 0x49, + 0x6e, 0x12, 0x1b, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x61, + 0x69, 0x6d, 0x50, 0x65, 0x67, 0x49, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, + 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x6c, 0x61, 0x69, 0x6d, 0x50, + 0x65, 0x67, 0x49, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0xa9, 0x01, 0x0a, + 0x0c, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x10, 0x54, + 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, + 0x01, 0x5a, 0x46, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x76, 0x75, + 0x6c, 0x70, 0x65, 0x6d, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2f, 0x6f, 0x63, 0x65, + 0x61, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2d, 0x73, 0x70, 0x65, 0x63, 0x2f, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2f, 0x76, + 0x31, 0x3b, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4f, 0x58, 0x58, 0xaa, + 0x02, 0x08, 0x4f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x08, 0x4f, 0x63, 0x65, + 0x61, 0x6e, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x14, 0x4f, 0x63, 0x65, 0x61, 0x6e, 0x5c, 0x56, 0x31, + 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x4f, + 0x63, 0x65, 0x61, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_ocean_v1alpha_transaction_proto_rawDescOnce sync.Once - file_ocean_v1alpha_transaction_proto_rawDescData = file_ocean_v1alpha_transaction_proto_rawDesc + file_ocean_v1_transaction_proto_rawDescOnce sync.Once + file_ocean_v1_transaction_proto_rawDescData = file_ocean_v1_transaction_proto_rawDesc ) -func file_ocean_v1alpha_transaction_proto_rawDescGZIP() []byte { - file_ocean_v1alpha_transaction_proto_rawDescOnce.Do(func() { - file_ocean_v1alpha_transaction_proto_rawDescData = protoimpl.X.CompressGZIP(file_ocean_v1alpha_transaction_proto_rawDescData) +func file_ocean_v1_transaction_proto_rawDescGZIP() []byte { + file_ocean_v1_transaction_proto_rawDescOnce.Do(func() { + file_ocean_v1_transaction_proto_rawDescData = protoimpl.X.CompressGZIP(file_ocean_v1_transaction_proto_rawDescData) }) - return file_ocean_v1alpha_transaction_proto_rawDescData -} - -var file_ocean_v1alpha_transaction_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_ocean_v1alpha_transaction_proto_msgTypes = make([]protoimpl.MessageInfo, 30) -var file_ocean_v1alpha_transaction_proto_goTypes = []interface{}{ - (SelectUtxosRequest_Strategy)(0), // 0: ocean.v1alpha.SelectUtxosRequest.Strategy - (*GetTransactionRequest)(nil), // 1: ocean.v1alpha.GetTransactionRequest - (*GetTransactionResponse)(nil), // 2: ocean.v1alpha.GetTransactionResponse - (*SelectUtxosRequest)(nil), // 3: ocean.v1alpha.SelectUtxosRequest - (*SelectUtxosResponse)(nil), // 4: ocean.v1alpha.SelectUtxosResponse - (*EstimateFeesRequest)(nil), // 5: ocean.v1alpha.EstimateFeesRequest - (*EstimateFeesResponse)(nil), // 6: ocean.v1alpha.EstimateFeesResponse - (*SignTransactionRequest)(nil), // 7: ocean.v1alpha.SignTransactionRequest - (*SignTransactionResponse)(nil), // 8: ocean.v1alpha.SignTransactionResponse - (*BroadcastTransactionRequest)(nil), // 9: ocean.v1alpha.BroadcastTransactionRequest - (*BroadcastTransactionResponse)(nil), // 10: ocean.v1alpha.BroadcastTransactionResponse - (*CreatePsetRequest)(nil), // 11: ocean.v1alpha.CreatePsetRequest - (*CreatePsetResponse)(nil), // 12: ocean.v1alpha.CreatePsetResponse - (*UpdatePsetRequest)(nil), // 13: ocean.v1alpha.UpdatePsetRequest - (*UpdatePsetResponse)(nil), // 14: ocean.v1alpha.UpdatePsetResponse - (*BlindPsetRequest)(nil), // 15: ocean.v1alpha.BlindPsetRequest - (*BlindPsetResponse)(nil), // 16: ocean.v1alpha.BlindPsetResponse - (*SignPsetRequest)(nil), // 17: ocean.v1alpha.SignPsetRequest - (*SignPsetResponse)(nil), // 18: ocean.v1alpha.SignPsetResponse - (*MintRequest)(nil), // 19: ocean.v1alpha.MintRequest - (*MintResponse)(nil), // 20: ocean.v1alpha.MintResponse - (*RemintRequest)(nil), // 21: ocean.v1alpha.RemintRequest - (*RemintResponse)(nil), // 22: ocean.v1alpha.RemintResponse - (*BurnRequest)(nil), // 23: ocean.v1alpha.BurnRequest - (*BurnResponse)(nil), // 24: ocean.v1alpha.BurnResponse - (*TransferRequest)(nil), // 25: ocean.v1alpha.TransferRequest - (*TransferResponse)(nil), // 26: ocean.v1alpha.TransferResponse - (*PegInAddressRequest)(nil), // 27: ocean.v1alpha.PegInAddressRequest - (*PegInAddressResponse)(nil), // 28: ocean.v1alpha.PegInAddressResponse - (*ClaimPegInRequest)(nil), // 29: ocean.v1alpha.ClaimPegInRequest - (*ClaimPegInResponse)(nil), // 30: ocean.v1alpha.ClaimPegInResponse - (*BlockDetails)(nil), // 31: ocean.v1alpha.BlockDetails - (*AccountKey)(nil), // 32: ocean.v1alpha.AccountKey - (*Utxos)(nil), // 33: ocean.v1alpha.Utxos - (*Input)(nil), // 34: ocean.v1alpha.Input - (*Output)(nil), // 35: ocean.v1alpha.Output -} -var file_ocean_v1alpha_transaction_proto_depIdxs = []int32{ - 31, // 0: ocean.v1alpha.GetTransactionResponse.block_details:type_name -> ocean.v1alpha.BlockDetails - 32, // 1: ocean.v1alpha.SelectUtxosRequest.account_key:type_name -> ocean.v1alpha.AccountKey - 0, // 2: ocean.v1alpha.SelectUtxosRequest.strategy:type_name -> ocean.v1alpha.SelectUtxosRequest.Strategy - 33, // 3: ocean.v1alpha.SelectUtxosResponse.utxos:type_name -> ocean.v1alpha.Utxos - 34, // 4: ocean.v1alpha.EstimateFeesRequest.inputs:type_name -> ocean.v1alpha.Input - 35, // 5: ocean.v1alpha.EstimateFeesRequest.outputs:type_name -> ocean.v1alpha.Output - 34, // 6: ocean.v1alpha.CreatePsetRequest.inputs:type_name -> ocean.v1alpha.Input - 35, // 7: ocean.v1alpha.CreatePsetRequest.outputs:type_name -> ocean.v1alpha.Output - 34, // 8: ocean.v1alpha.UpdatePsetRequest.inputs:type_name -> ocean.v1alpha.Input - 35, // 9: ocean.v1alpha.UpdatePsetRequest.outputs:type_name -> ocean.v1alpha.Output - 32, // 10: ocean.v1alpha.MintRequest.account_key:type_name -> ocean.v1alpha.AccountKey - 32, // 11: ocean.v1alpha.RemintRequest.account_key:type_name -> ocean.v1alpha.AccountKey - 32, // 12: ocean.v1alpha.BurnRequest.account_key:type_name -> ocean.v1alpha.AccountKey - 35, // 13: ocean.v1alpha.BurnRequest.receivers:type_name -> ocean.v1alpha.Output - 32, // 14: ocean.v1alpha.TransferRequest.account_key:type_name -> ocean.v1alpha.AccountKey - 35, // 15: ocean.v1alpha.TransferRequest.receivers:type_name -> ocean.v1alpha.Output - 32, // 16: ocean.v1alpha.PegInAddressResponse.account_key:type_name -> ocean.v1alpha.AccountKey - 1, // 17: ocean.v1alpha.TransactionService.GetTransaction:input_type -> ocean.v1alpha.GetTransactionRequest - 3, // 18: ocean.v1alpha.TransactionService.SelectUtxos:input_type -> ocean.v1alpha.SelectUtxosRequest - 5, // 19: ocean.v1alpha.TransactionService.EstimateFees:input_type -> ocean.v1alpha.EstimateFeesRequest - 7, // 20: ocean.v1alpha.TransactionService.SignTransaction:input_type -> ocean.v1alpha.SignTransactionRequest - 9, // 21: ocean.v1alpha.TransactionService.BroadcastTransaction:input_type -> ocean.v1alpha.BroadcastTransactionRequest - 11, // 22: ocean.v1alpha.TransactionService.CreatePset:input_type -> ocean.v1alpha.CreatePsetRequest - 13, // 23: ocean.v1alpha.TransactionService.UpdatePset:input_type -> ocean.v1alpha.UpdatePsetRequest - 15, // 24: ocean.v1alpha.TransactionService.BlindPset:input_type -> ocean.v1alpha.BlindPsetRequest - 17, // 25: ocean.v1alpha.TransactionService.SignPset:input_type -> ocean.v1alpha.SignPsetRequest - 19, // 26: ocean.v1alpha.TransactionService.Mint:input_type -> ocean.v1alpha.MintRequest - 21, // 27: ocean.v1alpha.TransactionService.Remint:input_type -> ocean.v1alpha.RemintRequest - 23, // 28: ocean.v1alpha.TransactionService.Burn:input_type -> ocean.v1alpha.BurnRequest - 25, // 29: ocean.v1alpha.TransactionService.Transfer:input_type -> ocean.v1alpha.TransferRequest - 27, // 30: ocean.v1alpha.TransactionService.PegInAddress:input_type -> ocean.v1alpha.PegInAddressRequest - 29, // 31: ocean.v1alpha.TransactionService.ClaimPegIn:input_type -> ocean.v1alpha.ClaimPegInRequest - 2, // 32: ocean.v1alpha.TransactionService.GetTransaction:output_type -> ocean.v1alpha.GetTransactionResponse - 4, // 33: ocean.v1alpha.TransactionService.SelectUtxos:output_type -> ocean.v1alpha.SelectUtxosResponse - 6, // 34: ocean.v1alpha.TransactionService.EstimateFees:output_type -> ocean.v1alpha.EstimateFeesResponse - 8, // 35: ocean.v1alpha.TransactionService.SignTransaction:output_type -> ocean.v1alpha.SignTransactionResponse - 10, // 36: ocean.v1alpha.TransactionService.BroadcastTransaction:output_type -> ocean.v1alpha.BroadcastTransactionResponse - 12, // 37: ocean.v1alpha.TransactionService.CreatePset:output_type -> ocean.v1alpha.CreatePsetResponse - 14, // 38: ocean.v1alpha.TransactionService.UpdatePset:output_type -> ocean.v1alpha.UpdatePsetResponse - 16, // 39: ocean.v1alpha.TransactionService.BlindPset:output_type -> ocean.v1alpha.BlindPsetResponse - 18, // 40: ocean.v1alpha.TransactionService.SignPset:output_type -> ocean.v1alpha.SignPsetResponse - 20, // 41: ocean.v1alpha.TransactionService.Mint:output_type -> ocean.v1alpha.MintResponse - 22, // 42: ocean.v1alpha.TransactionService.Remint:output_type -> ocean.v1alpha.RemintResponse - 24, // 43: ocean.v1alpha.TransactionService.Burn:output_type -> ocean.v1alpha.BurnResponse - 26, // 44: ocean.v1alpha.TransactionService.Transfer:output_type -> ocean.v1alpha.TransferResponse - 28, // 45: ocean.v1alpha.TransactionService.PegInAddress:output_type -> ocean.v1alpha.PegInAddressResponse - 30, // 46: ocean.v1alpha.TransactionService.ClaimPegIn:output_type -> ocean.v1alpha.ClaimPegInResponse - 32, // [32:47] is the sub-list for method output_type - 17, // [17:32] is the sub-list for method input_type - 17, // [17:17] is the sub-list for extension type_name - 17, // [17:17] is the sub-list for extension extendee - 0, // [0:17] is the sub-list for field type_name -} - -func init() { file_ocean_v1alpha_transaction_proto_init() } -func file_ocean_v1alpha_transaction_proto_init() { - if File_ocean_v1alpha_transaction_proto != nil { + return file_ocean_v1_transaction_proto_rawDescData +} + +var file_ocean_v1_transaction_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_ocean_v1_transaction_proto_msgTypes = make([]protoimpl.MessageInfo, 30) +var file_ocean_v1_transaction_proto_goTypes = []interface{}{ + (SelectUtxosRequest_Strategy)(0), // 0: ocean.v1.SelectUtxosRequest.Strategy + (*GetTransactionRequest)(nil), // 1: ocean.v1.GetTransactionRequest + (*GetTransactionResponse)(nil), // 2: ocean.v1.GetTransactionResponse + (*SelectUtxosRequest)(nil), // 3: ocean.v1.SelectUtxosRequest + (*SelectUtxosResponse)(nil), // 4: ocean.v1.SelectUtxosResponse + (*EstimateFeesRequest)(nil), // 5: ocean.v1.EstimateFeesRequest + (*EstimateFeesResponse)(nil), // 6: ocean.v1.EstimateFeesResponse + (*SignTransactionRequest)(nil), // 7: ocean.v1.SignTransactionRequest + (*SignTransactionResponse)(nil), // 8: ocean.v1.SignTransactionResponse + (*BroadcastTransactionRequest)(nil), // 9: ocean.v1.BroadcastTransactionRequest + (*BroadcastTransactionResponse)(nil), // 10: ocean.v1.BroadcastTransactionResponse + (*CreatePsetRequest)(nil), // 11: ocean.v1.CreatePsetRequest + (*CreatePsetResponse)(nil), // 12: ocean.v1.CreatePsetResponse + (*UpdatePsetRequest)(nil), // 13: ocean.v1.UpdatePsetRequest + (*UpdatePsetResponse)(nil), // 14: ocean.v1.UpdatePsetResponse + (*BlindPsetRequest)(nil), // 15: ocean.v1.BlindPsetRequest + (*BlindPsetResponse)(nil), // 16: ocean.v1.BlindPsetResponse + (*SignPsetRequest)(nil), // 17: ocean.v1.SignPsetRequest + (*SignPsetResponse)(nil), // 18: ocean.v1.SignPsetResponse + (*MintRequest)(nil), // 19: ocean.v1.MintRequest + (*MintResponse)(nil), // 20: ocean.v1.MintResponse + (*RemintRequest)(nil), // 21: ocean.v1.RemintRequest + (*RemintResponse)(nil), // 22: ocean.v1.RemintResponse + (*BurnRequest)(nil), // 23: ocean.v1.BurnRequest + (*BurnResponse)(nil), // 24: ocean.v1.BurnResponse + (*TransferRequest)(nil), // 25: ocean.v1.TransferRequest + (*TransferResponse)(nil), // 26: ocean.v1.TransferResponse + (*PegInAddressRequest)(nil), // 27: ocean.v1.PegInAddressRequest + (*PegInAddressResponse)(nil), // 28: ocean.v1.PegInAddressResponse + (*ClaimPegInRequest)(nil), // 29: ocean.v1.ClaimPegInRequest + (*ClaimPegInResponse)(nil), // 30: ocean.v1.ClaimPegInResponse + (*BlockDetails)(nil), // 31: ocean.v1.BlockDetails + (*Utxo)(nil), // 32: ocean.v1.Utxo + (*Input)(nil), // 33: ocean.v1.Input + (*Output)(nil), // 34: ocean.v1.Output +} +var file_ocean_v1_transaction_proto_depIdxs = []int32{ + 31, // 0: ocean.v1.GetTransactionResponse.block_details:type_name -> ocean.v1.BlockDetails + 0, // 1: ocean.v1.SelectUtxosRequest.strategy:type_name -> ocean.v1.SelectUtxosRequest.Strategy + 32, // 2: ocean.v1.SelectUtxosResponse.utxos:type_name -> ocean.v1.Utxo + 33, // 3: ocean.v1.EstimateFeesRequest.inputs:type_name -> ocean.v1.Input + 34, // 4: ocean.v1.EstimateFeesRequest.outputs:type_name -> ocean.v1.Output + 33, // 5: ocean.v1.CreatePsetRequest.inputs:type_name -> ocean.v1.Input + 34, // 6: ocean.v1.CreatePsetRequest.outputs:type_name -> ocean.v1.Output + 33, // 7: ocean.v1.UpdatePsetRequest.inputs:type_name -> ocean.v1.Input + 34, // 8: ocean.v1.UpdatePsetRequest.outputs:type_name -> ocean.v1.Output + 34, // 9: ocean.v1.BurnRequest.receivers:type_name -> ocean.v1.Output + 34, // 10: ocean.v1.TransferRequest.receivers:type_name -> ocean.v1.Output + 1, // 11: ocean.v1.TransactionService.GetTransaction:input_type -> ocean.v1.GetTransactionRequest + 3, // 12: ocean.v1.TransactionService.SelectUtxos:input_type -> ocean.v1.SelectUtxosRequest + 5, // 13: ocean.v1.TransactionService.EstimateFees:input_type -> ocean.v1.EstimateFeesRequest + 7, // 14: ocean.v1.TransactionService.SignTransaction:input_type -> ocean.v1.SignTransactionRequest + 9, // 15: ocean.v1.TransactionService.BroadcastTransaction:input_type -> ocean.v1.BroadcastTransactionRequest + 11, // 16: ocean.v1.TransactionService.CreatePset:input_type -> ocean.v1.CreatePsetRequest + 13, // 17: ocean.v1.TransactionService.UpdatePset:input_type -> ocean.v1.UpdatePsetRequest + 15, // 18: ocean.v1.TransactionService.BlindPset:input_type -> ocean.v1.BlindPsetRequest + 17, // 19: ocean.v1.TransactionService.SignPset:input_type -> ocean.v1.SignPsetRequest + 19, // 20: ocean.v1.TransactionService.Mint:input_type -> ocean.v1.MintRequest + 21, // 21: ocean.v1.TransactionService.Remint:input_type -> ocean.v1.RemintRequest + 23, // 22: ocean.v1.TransactionService.Burn:input_type -> ocean.v1.BurnRequest + 25, // 23: ocean.v1.TransactionService.Transfer:input_type -> ocean.v1.TransferRequest + 27, // 24: ocean.v1.TransactionService.PegInAddress:input_type -> ocean.v1.PegInAddressRequest + 29, // 25: ocean.v1.TransactionService.ClaimPegIn:input_type -> ocean.v1.ClaimPegInRequest + 2, // 26: ocean.v1.TransactionService.GetTransaction:output_type -> ocean.v1.GetTransactionResponse + 4, // 27: ocean.v1.TransactionService.SelectUtxos:output_type -> ocean.v1.SelectUtxosResponse + 6, // 28: ocean.v1.TransactionService.EstimateFees:output_type -> ocean.v1.EstimateFeesResponse + 8, // 29: ocean.v1.TransactionService.SignTransaction:output_type -> ocean.v1.SignTransactionResponse + 10, // 30: ocean.v1.TransactionService.BroadcastTransaction:output_type -> ocean.v1.BroadcastTransactionResponse + 12, // 31: ocean.v1.TransactionService.CreatePset:output_type -> ocean.v1.CreatePsetResponse + 14, // 32: ocean.v1.TransactionService.UpdatePset:output_type -> ocean.v1.UpdatePsetResponse + 16, // 33: ocean.v1.TransactionService.BlindPset:output_type -> ocean.v1.BlindPsetResponse + 18, // 34: ocean.v1.TransactionService.SignPset:output_type -> ocean.v1.SignPsetResponse + 20, // 35: ocean.v1.TransactionService.Mint:output_type -> ocean.v1.MintResponse + 22, // 36: ocean.v1.TransactionService.Remint:output_type -> ocean.v1.RemintResponse + 24, // 37: ocean.v1.TransactionService.Burn:output_type -> ocean.v1.BurnResponse + 26, // 38: ocean.v1.TransactionService.Transfer:output_type -> ocean.v1.TransferResponse + 28, // 39: ocean.v1.TransactionService.PegInAddress:output_type -> ocean.v1.PegInAddressResponse + 30, // 40: ocean.v1.TransactionService.ClaimPegIn:output_type -> ocean.v1.ClaimPegInResponse + 26, // [26:41] is the sub-list for method output_type + 11, // [11:26] is the sub-list for method input_type + 11, // [11:11] is the sub-list for extension type_name + 11, // [11:11] is the sub-list for extension extendee + 0, // [0:11] is the sub-list for field type_name +} + +func init() { file_ocean_v1_transaction_proto_init() } +func file_ocean_v1_transaction_proto_init() { + if File_ocean_v1_transaction_proto != nil { return } - file_ocean_v1alpha_types_proto_init() + file_ocean_v1_types_proto_init() if !protoimpl.UnsafeEnabled { - file_ocean_v1alpha_transaction_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_ocean_v1_transaction_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetTransactionRequest); i { case 0: return &v.state @@ -2095,7 +2157,7 @@ func file_ocean_v1alpha_transaction_proto_init() { return nil } } - file_ocean_v1alpha_transaction_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_ocean_v1_transaction_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetTransactionResponse); i { case 0: return &v.state @@ -2107,7 +2169,7 @@ func file_ocean_v1alpha_transaction_proto_init() { return nil } } - file_ocean_v1alpha_transaction_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_ocean_v1_transaction_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SelectUtxosRequest); i { case 0: return &v.state @@ -2119,7 +2181,7 @@ func file_ocean_v1alpha_transaction_proto_init() { return nil } } - file_ocean_v1alpha_transaction_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_ocean_v1_transaction_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SelectUtxosResponse); i { case 0: return &v.state @@ -2131,7 +2193,7 @@ func file_ocean_v1alpha_transaction_proto_init() { return nil } } - file_ocean_v1alpha_transaction_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_ocean_v1_transaction_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EstimateFeesRequest); i { case 0: return &v.state @@ -2143,7 +2205,7 @@ func file_ocean_v1alpha_transaction_proto_init() { return nil } } - file_ocean_v1alpha_transaction_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_ocean_v1_transaction_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*EstimateFeesResponse); i { case 0: return &v.state @@ -2155,7 +2217,7 @@ func file_ocean_v1alpha_transaction_proto_init() { return nil } } - file_ocean_v1alpha_transaction_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_ocean_v1_transaction_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SignTransactionRequest); i { case 0: return &v.state @@ -2167,7 +2229,7 @@ func file_ocean_v1alpha_transaction_proto_init() { return nil } } - file_ocean_v1alpha_transaction_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_ocean_v1_transaction_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SignTransactionResponse); i { case 0: return &v.state @@ -2179,7 +2241,7 @@ func file_ocean_v1alpha_transaction_proto_init() { return nil } } - file_ocean_v1alpha_transaction_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_ocean_v1_transaction_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BroadcastTransactionRequest); i { case 0: return &v.state @@ -2191,7 +2253,7 @@ func file_ocean_v1alpha_transaction_proto_init() { return nil } } - file_ocean_v1alpha_transaction_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_ocean_v1_transaction_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BroadcastTransactionResponse); i { case 0: return &v.state @@ -2203,7 +2265,7 @@ func file_ocean_v1alpha_transaction_proto_init() { return nil } } - file_ocean_v1alpha_transaction_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_ocean_v1_transaction_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreatePsetRequest); i { case 0: return &v.state @@ -2215,7 +2277,7 @@ func file_ocean_v1alpha_transaction_proto_init() { return nil } } - file_ocean_v1alpha_transaction_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_ocean_v1_transaction_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreatePsetResponse); i { case 0: return &v.state @@ -2227,7 +2289,7 @@ func file_ocean_v1alpha_transaction_proto_init() { return nil } } - file_ocean_v1alpha_transaction_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_ocean_v1_transaction_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdatePsetRequest); i { case 0: return &v.state @@ -2239,7 +2301,7 @@ func file_ocean_v1alpha_transaction_proto_init() { return nil } } - file_ocean_v1alpha_transaction_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_ocean_v1_transaction_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UpdatePsetResponse); i { case 0: return &v.state @@ -2251,7 +2313,7 @@ func file_ocean_v1alpha_transaction_proto_init() { return nil } } - file_ocean_v1alpha_transaction_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + file_ocean_v1_transaction_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BlindPsetRequest); i { case 0: return &v.state @@ -2263,7 +2325,7 @@ func file_ocean_v1alpha_transaction_proto_init() { return nil } } - file_ocean_v1alpha_transaction_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + file_ocean_v1_transaction_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BlindPsetResponse); i { case 0: return &v.state @@ -2275,7 +2337,7 @@ func file_ocean_v1alpha_transaction_proto_init() { return nil } } - file_ocean_v1alpha_transaction_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + file_ocean_v1_transaction_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SignPsetRequest); i { case 0: return &v.state @@ -2287,7 +2349,7 @@ func file_ocean_v1alpha_transaction_proto_init() { return nil } } - file_ocean_v1alpha_transaction_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + file_ocean_v1_transaction_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*SignPsetResponse); i { case 0: return &v.state @@ -2299,7 +2361,7 @@ func file_ocean_v1alpha_transaction_proto_init() { return nil } } - file_ocean_v1alpha_transaction_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + file_ocean_v1_transaction_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MintRequest); i { case 0: return &v.state @@ -2311,7 +2373,7 @@ func file_ocean_v1alpha_transaction_proto_init() { return nil } } - file_ocean_v1alpha_transaction_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + file_ocean_v1_transaction_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*MintResponse); i { case 0: return &v.state @@ -2323,7 +2385,7 @@ func file_ocean_v1alpha_transaction_proto_init() { return nil } } - file_ocean_v1alpha_transaction_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + file_ocean_v1_transaction_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RemintRequest); i { case 0: return &v.state @@ -2335,7 +2397,7 @@ func file_ocean_v1alpha_transaction_proto_init() { return nil } } - file_ocean_v1alpha_transaction_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + file_ocean_v1_transaction_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RemintResponse); i { case 0: return &v.state @@ -2347,7 +2409,7 @@ func file_ocean_v1alpha_transaction_proto_init() { return nil } } - file_ocean_v1alpha_transaction_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { + file_ocean_v1_transaction_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BurnRequest); i { case 0: return &v.state @@ -2359,7 +2421,7 @@ func file_ocean_v1alpha_transaction_proto_init() { return nil } } - file_ocean_v1alpha_transaction_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { + file_ocean_v1_transaction_proto_msgTypes[23].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*BurnResponse); i { case 0: return &v.state @@ -2371,7 +2433,7 @@ func file_ocean_v1alpha_transaction_proto_init() { return nil } } - file_ocean_v1alpha_transaction_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { + file_ocean_v1_transaction_proto_msgTypes[24].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*TransferRequest); i { case 0: return &v.state @@ -2383,7 +2445,7 @@ func file_ocean_v1alpha_transaction_proto_init() { return nil } } - file_ocean_v1alpha_transaction_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { + file_ocean_v1_transaction_proto_msgTypes[25].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*TransferResponse); i { case 0: return &v.state @@ -2395,7 +2457,7 @@ func file_ocean_v1alpha_transaction_proto_init() { return nil } } - file_ocean_v1alpha_transaction_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { + file_ocean_v1_transaction_proto_msgTypes[26].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PegInAddressRequest); i { case 0: return &v.state @@ -2407,7 +2469,7 @@ func file_ocean_v1alpha_transaction_proto_init() { return nil } } - file_ocean_v1alpha_transaction_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { + file_ocean_v1_transaction_proto_msgTypes[27].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*PegInAddressResponse); i { case 0: return &v.state @@ -2419,7 +2481,7 @@ func file_ocean_v1alpha_transaction_proto_init() { return nil } } - file_ocean_v1alpha_transaction_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { + file_ocean_v1_transaction_proto_msgTypes[28].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ClaimPegInRequest); i { case 0: return &v.state @@ -2431,7 +2493,7 @@ func file_ocean_v1alpha_transaction_proto_init() { return nil } } - file_ocean_v1alpha_transaction_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { + file_ocean_v1_transaction_proto_msgTypes[29].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ClaimPegInResponse); i { case 0: return &v.state @@ -2448,19 +2510,19 @@ func file_ocean_v1alpha_transaction_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_ocean_v1alpha_transaction_proto_rawDesc, + RawDescriptor: file_ocean_v1_transaction_proto_rawDesc, NumEnums: 1, NumMessages: 30, NumExtensions: 0, NumServices: 1, }, - GoTypes: file_ocean_v1alpha_transaction_proto_goTypes, - DependencyIndexes: file_ocean_v1alpha_transaction_proto_depIdxs, - EnumInfos: file_ocean_v1alpha_transaction_proto_enumTypes, - MessageInfos: file_ocean_v1alpha_transaction_proto_msgTypes, + GoTypes: file_ocean_v1_transaction_proto_goTypes, + DependencyIndexes: file_ocean_v1_transaction_proto_depIdxs, + EnumInfos: file_ocean_v1_transaction_proto_enumTypes, + MessageInfos: file_ocean_v1_transaction_proto_msgTypes, }.Build() - File_ocean_v1alpha_transaction_proto = out.File - file_ocean_v1alpha_transaction_proto_rawDesc = nil - file_ocean_v1alpha_transaction_proto_goTypes = nil - file_ocean_v1alpha_transaction_proto_depIdxs = nil + File_ocean_v1_transaction_proto = out.File + file_ocean_v1_transaction_proto_rawDesc = nil + file_ocean_v1_transaction_proto_goTypes = nil + file_ocean_v1_transaction_proto_depIdxs = nil } diff --git a/api-spec/protobuf/gen/go/ocean/v1alpha/transaction_grpc.pb.go b/api-spec/protobuf/gen/go/ocean/v1/transaction_grpc.pb.go similarity index 91% rename from api-spec/protobuf/gen/go/ocean/v1alpha/transaction_grpc.pb.go rename to api-spec/protobuf/gen/go/ocean/v1/transaction_grpc.pb.go index c045ef3..c263691 100644 --- a/api-spec/protobuf/gen/go/ocean/v1alpha/transaction_grpc.pb.go +++ b/api-spec/protobuf/gen/go/ocean/v1/transaction_grpc.pb.go @@ -2,9 +2,9 @@ // versions: // - protoc-gen-go-grpc v1.2.0 // - protoc (unknown) -// source: ocean/v1alpha/transaction.proto +// source: ocean/v1/transaction.proto -package oceanv1alpha +package oceanv1 import ( context "context" @@ -72,7 +72,7 @@ func NewTransactionServiceClient(cc grpc.ClientConnInterface) TransactionService func (c *transactionServiceClient) GetTransaction(ctx context.Context, in *GetTransactionRequest, opts ...grpc.CallOption) (*GetTransactionResponse, error) { out := new(GetTransactionResponse) - err := c.cc.Invoke(ctx, "/ocean.v1alpha.TransactionService/GetTransaction", in, out, opts...) + err := c.cc.Invoke(ctx, "/ocean.v1.TransactionService/GetTransaction", in, out, opts...) if err != nil { return nil, err } @@ -81,7 +81,7 @@ func (c *transactionServiceClient) GetTransaction(ctx context.Context, in *GetTr func (c *transactionServiceClient) SelectUtxos(ctx context.Context, in *SelectUtxosRequest, opts ...grpc.CallOption) (*SelectUtxosResponse, error) { out := new(SelectUtxosResponse) - err := c.cc.Invoke(ctx, "/ocean.v1alpha.TransactionService/SelectUtxos", in, out, opts...) + err := c.cc.Invoke(ctx, "/ocean.v1.TransactionService/SelectUtxos", in, out, opts...) if err != nil { return nil, err } @@ -90,7 +90,7 @@ func (c *transactionServiceClient) SelectUtxos(ctx context.Context, in *SelectUt func (c *transactionServiceClient) EstimateFees(ctx context.Context, in *EstimateFeesRequest, opts ...grpc.CallOption) (*EstimateFeesResponse, error) { out := new(EstimateFeesResponse) - err := c.cc.Invoke(ctx, "/ocean.v1alpha.TransactionService/EstimateFees", in, out, opts...) + err := c.cc.Invoke(ctx, "/ocean.v1.TransactionService/EstimateFees", in, out, opts...) if err != nil { return nil, err } @@ -99,7 +99,7 @@ func (c *transactionServiceClient) EstimateFees(ctx context.Context, in *Estimat func (c *transactionServiceClient) SignTransaction(ctx context.Context, in *SignTransactionRequest, opts ...grpc.CallOption) (*SignTransactionResponse, error) { out := new(SignTransactionResponse) - err := c.cc.Invoke(ctx, "/ocean.v1alpha.TransactionService/SignTransaction", in, out, opts...) + err := c.cc.Invoke(ctx, "/ocean.v1.TransactionService/SignTransaction", in, out, opts...) if err != nil { return nil, err } @@ -108,7 +108,7 @@ func (c *transactionServiceClient) SignTransaction(ctx context.Context, in *Sign func (c *transactionServiceClient) BroadcastTransaction(ctx context.Context, in *BroadcastTransactionRequest, opts ...grpc.CallOption) (*BroadcastTransactionResponse, error) { out := new(BroadcastTransactionResponse) - err := c.cc.Invoke(ctx, "/ocean.v1alpha.TransactionService/BroadcastTransaction", in, out, opts...) + err := c.cc.Invoke(ctx, "/ocean.v1.TransactionService/BroadcastTransaction", in, out, opts...) if err != nil { return nil, err } @@ -117,7 +117,7 @@ func (c *transactionServiceClient) BroadcastTransaction(ctx context.Context, in func (c *transactionServiceClient) CreatePset(ctx context.Context, in *CreatePsetRequest, opts ...grpc.CallOption) (*CreatePsetResponse, error) { out := new(CreatePsetResponse) - err := c.cc.Invoke(ctx, "/ocean.v1alpha.TransactionService/CreatePset", in, out, opts...) + err := c.cc.Invoke(ctx, "/ocean.v1.TransactionService/CreatePset", in, out, opts...) if err != nil { return nil, err } @@ -126,7 +126,7 @@ func (c *transactionServiceClient) CreatePset(ctx context.Context, in *CreatePse func (c *transactionServiceClient) UpdatePset(ctx context.Context, in *UpdatePsetRequest, opts ...grpc.CallOption) (*UpdatePsetResponse, error) { out := new(UpdatePsetResponse) - err := c.cc.Invoke(ctx, "/ocean.v1alpha.TransactionService/UpdatePset", in, out, opts...) + err := c.cc.Invoke(ctx, "/ocean.v1.TransactionService/UpdatePset", in, out, opts...) if err != nil { return nil, err } @@ -135,7 +135,7 @@ func (c *transactionServiceClient) UpdatePset(ctx context.Context, in *UpdatePse func (c *transactionServiceClient) BlindPset(ctx context.Context, in *BlindPsetRequest, opts ...grpc.CallOption) (*BlindPsetResponse, error) { out := new(BlindPsetResponse) - err := c.cc.Invoke(ctx, "/ocean.v1alpha.TransactionService/BlindPset", in, out, opts...) + err := c.cc.Invoke(ctx, "/ocean.v1.TransactionService/BlindPset", in, out, opts...) if err != nil { return nil, err } @@ -144,7 +144,7 @@ func (c *transactionServiceClient) BlindPset(ctx context.Context, in *BlindPsetR func (c *transactionServiceClient) SignPset(ctx context.Context, in *SignPsetRequest, opts ...grpc.CallOption) (*SignPsetResponse, error) { out := new(SignPsetResponse) - err := c.cc.Invoke(ctx, "/ocean.v1alpha.TransactionService/SignPset", in, out, opts...) + err := c.cc.Invoke(ctx, "/ocean.v1.TransactionService/SignPset", in, out, opts...) if err != nil { return nil, err } @@ -153,7 +153,7 @@ func (c *transactionServiceClient) SignPset(ctx context.Context, in *SignPsetReq func (c *transactionServiceClient) Mint(ctx context.Context, in *MintRequest, opts ...grpc.CallOption) (*MintResponse, error) { out := new(MintResponse) - err := c.cc.Invoke(ctx, "/ocean.v1alpha.TransactionService/Mint", in, out, opts...) + err := c.cc.Invoke(ctx, "/ocean.v1.TransactionService/Mint", in, out, opts...) if err != nil { return nil, err } @@ -162,7 +162,7 @@ func (c *transactionServiceClient) Mint(ctx context.Context, in *MintRequest, op func (c *transactionServiceClient) Remint(ctx context.Context, in *RemintRequest, opts ...grpc.CallOption) (*RemintResponse, error) { out := new(RemintResponse) - err := c.cc.Invoke(ctx, "/ocean.v1alpha.TransactionService/Remint", in, out, opts...) + err := c.cc.Invoke(ctx, "/ocean.v1.TransactionService/Remint", in, out, opts...) if err != nil { return nil, err } @@ -171,7 +171,7 @@ func (c *transactionServiceClient) Remint(ctx context.Context, in *RemintRequest func (c *transactionServiceClient) Burn(ctx context.Context, in *BurnRequest, opts ...grpc.CallOption) (*BurnResponse, error) { out := new(BurnResponse) - err := c.cc.Invoke(ctx, "/ocean.v1alpha.TransactionService/Burn", in, out, opts...) + err := c.cc.Invoke(ctx, "/ocean.v1.TransactionService/Burn", in, out, opts...) if err != nil { return nil, err } @@ -180,7 +180,7 @@ func (c *transactionServiceClient) Burn(ctx context.Context, in *BurnRequest, op func (c *transactionServiceClient) Transfer(ctx context.Context, in *TransferRequest, opts ...grpc.CallOption) (*TransferResponse, error) { out := new(TransferResponse) - err := c.cc.Invoke(ctx, "/ocean.v1alpha.TransactionService/Transfer", in, out, opts...) + err := c.cc.Invoke(ctx, "/ocean.v1.TransactionService/Transfer", in, out, opts...) if err != nil { return nil, err } @@ -189,7 +189,7 @@ func (c *transactionServiceClient) Transfer(ctx context.Context, in *TransferReq func (c *transactionServiceClient) PegInAddress(ctx context.Context, in *PegInAddressRequest, opts ...grpc.CallOption) (*PegInAddressResponse, error) { out := new(PegInAddressResponse) - err := c.cc.Invoke(ctx, "/ocean.v1alpha.TransactionService/PegInAddress", in, out, opts...) + err := c.cc.Invoke(ctx, "/ocean.v1.TransactionService/PegInAddress", in, out, opts...) if err != nil { return nil, err } @@ -198,7 +198,7 @@ func (c *transactionServiceClient) PegInAddress(ctx context.Context, in *PegInAd func (c *transactionServiceClient) ClaimPegIn(ctx context.Context, in *ClaimPegInRequest, opts ...grpc.CallOption) (*ClaimPegInResponse, error) { out := new(ClaimPegInResponse) - err := c.cc.Invoke(ctx, "/ocean.v1alpha.TransactionService/ClaimPegIn", in, out, opts...) + err := c.cc.Invoke(ctx, "/ocean.v1.TransactionService/ClaimPegIn", in, out, opts...) if err != nil { return nil, err } @@ -320,7 +320,7 @@ func _TransactionService_GetTransaction_Handler(srv interface{}, ctx context.Con } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ocean.v1alpha.TransactionService/GetTransaction", + FullMethod: "/ocean.v1.TransactionService/GetTransaction", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(TransactionServiceServer).GetTransaction(ctx, req.(*GetTransactionRequest)) @@ -338,7 +338,7 @@ func _TransactionService_SelectUtxos_Handler(srv interface{}, ctx context.Contex } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ocean.v1alpha.TransactionService/SelectUtxos", + FullMethod: "/ocean.v1.TransactionService/SelectUtxos", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(TransactionServiceServer).SelectUtxos(ctx, req.(*SelectUtxosRequest)) @@ -356,7 +356,7 @@ func _TransactionService_EstimateFees_Handler(srv interface{}, ctx context.Conte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ocean.v1alpha.TransactionService/EstimateFees", + FullMethod: "/ocean.v1.TransactionService/EstimateFees", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(TransactionServiceServer).EstimateFees(ctx, req.(*EstimateFeesRequest)) @@ -374,7 +374,7 @@ func _TransactionService_SignTransaction_Handler(srv interface{}, ctx context.Co } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ocean.v1alpha.TransactionService/SignTransaction", + FullMethod: "/ocean.v1.TransactionService/SignTransaction", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(TransactionServiceServer).SignTransaction(ctx, req.(*SignTransactionRequest)) @@ -392,7 +392,7 @@ func _TransactionService_BroadcastTransaction_Handler(srv interface{}, ctx conte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ocean.v1alpha.TransactionService/BroadcastTransaction", + FullMethod: "/ocean.v1.TransactionService/BroadcastTransaction", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(TransactionServiceServer).BroadcastTransaction(ctx, req.(*BroadcastTransactionRequest)) @@ -410,7 +410,7 @@ func _TransactionService_CreatePset_Handler(srv interface{}, ctx context.Context } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ocean.v1alpha.TransactionService/CreatePset", + FullMethod: "/ocean.v1.TransactionService/CreatePset", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(TransactionServiceServer).CreatePset(ctx, req.(*CreatePsetRequest)) @@ -428,7 +428,7 @@ func _TransactionService_UpdatePset_Handler(srv interface{}, ctx context.Context } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ocean.v1alpha.TransactionService/UpdatePset", + FullMethod: "/ocean.v1.TransactionService/UpdatePset", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(TransactionServiceServer).UpdatePset(ctx, req.(*UpdatePsetRequest)) @@ -446,7 +446,7 @@ func _TransactionService_BlindPset_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ocean.v1alpha.TransactionService/BlindPset", + FullMethod: "/ocean.v1.TransactionService/BlindPset", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(TransactionServiceServer).BlindPset(ctx, req.(*BlindPsetRequest)) @@ -464,7 +464,7 @@ func _TransactionService_SignPset_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ocean.v1alpha.TransactionService/SignPset", + FullMethod: "/ocean.v1.TransactionService/SignPset", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(TransactionServiceServer).SignPset(ctx, req.(*SignPsetRequest)) @@ -482,7 +482,7 @@ func _TransactionService_Mint_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ocean.v1alpha.TransactionService/Mint", + FullMethod: "/ocean.v1.TransactionService/Mint", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(TransactionServiceServer).Mint(ctx, req.(*MintRequest)) @@ -500,7 +500,7 @@ func _TransactionService_Remint_Handler(srv interface{}, ctx context.Context, de } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ocean.v1alpha.TransactionService/Remint", + FullMethod: "/ocean.v1.TransactionService/Remint", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(TransactionServiceServer).Remint(ctx, req.(*RemintRequest)) @@ -518,7 +518,7 @@ func _TransactionService_Burn_Handler(srv interface{}, ctx context.Context, dec } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ocean.v1alpha.TransactionService/Burn", + FullMethod: "/ocean.v1.TransactionService/Burn", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(TransactionServiceServer).Burn(ctx, req.(*BurnRequest)) @@ -536,7 +536,7 @@ func _TransactionService_Transfer_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ocean.v1alpha.TransactionService/Transfer", + FullMethod: "/ocean.v1.TransactionService/Transfer", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(TransactionServiceServer).Transfer(ctx, req.(*TransferRequest)) @@ -554,7 +554,7 @@ func _TransactionService_PegInAddress_Handler(srv interface{}, ctx context.Conte } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ocean.v1alpha.TransactionService/PegInAddress", + FullMethod: "/ocean.v1.TransactionService/PegInAddress", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(TransactionServiceServer).PegInAddress(ctx, req.(*PegInAddressRequest)) @@ -572,7 +572,7 @@ func _TransactionService_ClaimPegIn_Handler(srv interface{}, ctx context.Context } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ocean.v1alpha.TransactionService/ClaimPegIn", + FullMethod: "/ocean.v1.TransactionService/ClaimPegIn", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(TransactionServiceServer).ClaimPegIn(ctx, req.(*ClaimPegInRequest)) @@ -584,7 +584,7 @@ func _TransactionService_ClaimPegIn_Handler(srv interface{}, ctx context.Context // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var TransactionService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "ocean.v1alpha.TransactionService", + ServiceName: "ocean.v1.TransactionService", HandlerType: (*TransactionServiceServer)(nil), Methods: []grpc.MethodDesc{ { @@ -649,5 +649,5 @@ var TransactionService_ServiceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "ocean/v1alpha/transaction.proto", + Metadata: "ocean/v1/transaction.proto", } diff --git a/api-spec/protobuf/gen/go/ocean/v1/types.pb.go b/api-spec/protobuf/gen/go/ocean/v1/types.pb.go new file mode 100644 index 0000000..98304b3 --- /dev/null +++ b/api-spec/protobuf/gen/go/ocean/v1/types.pb.go @@ -0,0 +1,1262 @@ +// Code generated by protoc-gen-go. DO NOT EDIT. +// versions: +// protoc-gen-go v1.28.1 +// protoc (unknown) +// source: ocean/v1/types.proto + +package oceanv1 + +import ( + protoreflect "google.golang.org/protobuf/reflect/protoreflect" + protoimpl "google.golang.org/protobuf/runtime/protoimpl" + reflect "reflect" + sync "sync" +) + +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 TxEventType int32 + +const ( + TxEventType_TX_EVENT_TYPE_UNSPECIFIED TxEventType = 0 + // Tx broadcasted. + TxEventType_TX_EVENT_TYPE_BROADCASTED TxEventType = 1 + // Tx unconfirmed. + TxEventType_TX_EVENT_TYPE_UNCONFIRMED TxEventType = 2 + // Tx confirmed. + TxEventType_TX_EVENT_TYPE_CONFIRMED TxEventType = 3 +) + +// Enum value maps for TxEventType. +var ( + TxEventType_name = map[int32]string{ + 0: "TX_EVENT_TYPE_UNSPECIFIED", + 1: "TX_EVENT_TYPE_BROADCASTED", + 2: "TX_EVENT_TYPE_UNCONFIRMED", + 3: "TX_EVENT_TYPE_CONFIRMED", + } + TxEventType_value = map[string]int32{ + "TX_EVENT_TYPE_UNSPECIFIED": 0, + "TX_EVENT_TYPE_BROADCASTED": 1, + "TX_EVENT_TYPE_UNCONFIRMED": 2, + "TX_EVENT_TYPE_CONFIRMED": 3, + } +) + +func (x TxEventType) Enum() *TxEventType { + p := new(TxEventType) + *p = x + return p +} + +func (x TxEventType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (TxEventType) Descriptor() protoreflect.EnumDescriptor { + return file_ocean_v1_types_proto_enumTypes[0].Descriptor() +} + +func (TxEventType) Type() protoreflect.EnumType { + return &file_ocean_v1_types_proto_enumTypes[0] +} + +func (x TxEventType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use TxEventType.Descriptor instead. +func (TxEventType) EnumDescriptor() ([]byte, []int) { + return file_ocean_v1_types_proto_rawDescGZIP(), []int{0} +} + +type UtxoEventType int32 + +const ( + UtxoEventType_UTXO_EVENT_TYPE_UNSPECIFIED UtxoEventType = 0 + UtxoEventType_UTXO_EVENT_TYPE_NEW UtxoEventType = 1 + UtxoEventType_UTXO_EVENT_TYPE_CONFIRMED UtxoEventType = 2 + UtxoEventType_UTXO_EVENT_TYPE_LOCKED UtxoEventType = 3 + UtxoEventType_UTXO_EVENT_TYPE_UNLOCKED UtxoEventType = 4 + UtxoEventType_UTXO_EVENT_TYPE_SPENT UtxoEventType = 5 +) + +// Enum value maps for UtxoEventType. +var ( + UtxoEventType_name = map[int32]string{ + 0: "UTXO_EVENT_TYPE_UNSPECIFIED", + 1: "UTXO_EVENT_TYPE_NEW", + 2: "UTXO_EVENT_TYPE_CONFIRMED", + 3: "UTXO_EVENT_TYPE_LOCKED", + 4: "UTXO_EVENT_TYPE_UNLOCKED", + 5: "UTXO_EVENT_TYPE_SPENT", + } + UtxoEventType_value = map[string]int32{ + "UTXO_EVENT_TYPE_UNSPECIFIED": 0, + "UTXO_EVENT_TYPE_NEW": 1, + "UTXO_EVENT_TYPE_CONFIRMED": 2, + "UTXO_EVENT_TYPE_LOCKED": 3, + "UTXO_EVENT_TYPE_UNLOCKED": 4, + "UTXO_EVENT_TYPE_SPENT": 5, + } +) + +func (x UtxoEventType) Enum() *UtxoEventType { + p := new(UtxoEventType) + *p = x + return p +} + +func (x UtxoEventType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (UtxoEventType) Descriptor() protoreflect.EnumDescriptor { + return file_ocean_v1_types_proto_enumTypes[1].Descriptor() +} + +func (UtxoEventType) Type() protoreflect.EnumType { + return &file_ocean_v1_types_proto_enumTypes[1] +} + +func (x UtxoEventType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use UtxoEventType.Descriptor instead. +func (UtxoEventType) EnumDescriptor() ([]byte, []int) { + return file_ocean_v1_types_proto_rawDescGZIP(), []int{1} +} + +type WebhookEventType int32 + +const ( + WebhookEventType_WEBHOOK_EVENT_TYPE_UNSPECIFIED WebhookEventType = 0 + // Receive notification about transactions. + WebhookEventType_WEBHOOK_EVENT_TYPE_TRANSACTION WebhookEventType = 1 + // Receive notifications about utxos. + WebhookEventType_WEBHOOK_EVENT_TYPE_UTXO WebhookEventType = 2 +) + +// Enum value maps for WebhookEventType. +var ( + WebhookEventType_name = map[int32]string{ + 0: "WEBHOOK_EVENT_TYPE_UNSPECIFIED", + 1: "WEBHOOK_EVENT_TYPE_TRANSACTION", + 2: "WEBHOOK_EVENT_TYPE_UTXO", + } + WebhookEventType_value = map[string]int32{ + "WEBHOOK_EVENT_TYPE_UNSPECIFIED": 0, + "WEBHOOK_EVENT_TYPE_TRANSACTION": 1, + "WEBHOOK_EVENT_TYPE_UTXO": 2, + } +) + +func (x WebhookEventType) Enum() *WebhookEventType { + p := new(WebhookEventType) + *p = x + return p +} + +func (x WebhookEventType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (WebhookEventType) Descriptor() protoreflect.EnumDescriptor { + return file_ocean_v1_types_proto_enumTypes[2].Descriptor() +} + +func (WebhookEventType) Type() protoreflect.EnumType { + return &file_ocean_v1_types_proto_enumTypes[2] +} + +func (x WebhookEventType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use WebhookEventType.Descriptor instead. +func (WebhookEventType) EnumDescriptor() ([]byte, []int) { + return file_ocean_v1_types_proto_rawDescGZIP(), []int{2} +} + +type Template_Format int32 + +const ( + Template_FORMAT_UNSPECIFIED Template_Format = 0 + Template_FORMAT_DESCRIPTOR Template_Format = 1 + Template_FORMAT_MINISCRIPT Template_Format = 2 + Template_FORMAT_IONIO Template_Format = 3 + Template_FORMAT_RAW Template_Format = 4 +) + +// Enum value maps for Template_Format. +var ( + Template_Format_name = map[int32]string{ + 0: "FORMAT_UNSPECIFIED", + 1: "FORMAT_DESCRIPTOR", + 2: "FORMAT_MINISCRIPT", + 3: "FORMAT_IONIO", + 4: "FORMAT_RAW", + } + Template_Format_value = map[string]int32{ + "FORMAT_UNSPECIFIED": 0, + "FORMAT_DESCRIPTOR": 1, + "FORMAT_MINISCRIPT": 2, + "FORMAT_IONIO": 3, + "FORMAT_RAW": 4, + } +) + +func (x Template_Format) Enum() *Template_Format { + p := new(Template_Format) + *p = x + return p +} + +func (x Template_Format) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (Template_Format) Descriptor() protoreflect.EnumDescriptor { + return file_ocean_v1_types_proto_enumTypes[3].Descriptor() +} + +func (Template_Format) Type() protoreflect.EnumType { + return &file_ocean_v1_types_proto_enumTypes[3] +} + +func (x Template_Format) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use Template_Format.Descriptor instead. +func (Template_Format) EnumDescriptor() ([]byte, []int) { + return file_ocean_v1_types_proto_rawDescGZIP(), []int{9, 0} +} + +type BuildInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Number of the version. + Version string `protobuf:"bytes,1,opt,name=version,proto3" json:"version,omitempty"` + // Hash of the commit. + Commit string `protobuf:"bytes,2,opt,name=commit,proto3" json:"commit,omitempty"` + // Date of the commit. + Date string `protobuf:"bytes,3,opt,name=date,proto3" json:"date,omitempty"` +} + +func (x *BuildInfo) Reset() { + *x = BuildInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_ocean_v1_types_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BuildInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BuildInfo) ProtoMessage() {} + +func (x *BuildInfo) ProtoReflect() protoreflect.Message { + mi := &file_ocean_v1_types_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) +} + +// Deprecated: Use BuildInfo.ProtoReflect.Descriptor instead. +func (*BuildInfo) Descriptor() ([]byte, []int) { + return file_ocean_v1_types_proto_rawDescGZIP(), []int{0} +} + +func (x *BuildInfo) GetVersion() string { + if x != nil { + return x.Version + } + return "" +} + +func (x *BuildInfo) GetCommit() string { + if x != nil { + return x.Commit + } + return "" +} + +func (x *BuildInfo) GetDate() string { + if x != nil { + return x.Date + } + return "" +} + +type AccountInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Account name. + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + // Account index. + Index uint32 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"` + // Derivation path. + DerivationPath string `protobuf:"bytes,3,opt,name=derivation_path,json=derivationPath,proto3" json:"derivation_path,omitempty"` + // XPub. + Xpub string `protobuf:"bytes,4,opt,name=xpub,proto3" json:"xpub,omitempty"` +} + +func (x *AccountInfo) Reset() { + *x = AccountInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_ocean_v1_types_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AccountInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AccountInfo) ProtoMessage() {} + +func (x *AccountInfo) ProtoReflect() protoreflect.Message { + mi := &file_ocean_v1_types_proto_msgTypes[1] + 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) +} + +// Deprecated: Use AccountInfo.ProtoReflect.Descriptor instead. +func (*AccountInfo) Descriptor() ([]byte, []int) { + return file_ocean_v1_types_proto_rawDescGZIP(), []int{1} +} + +func (x *AccountInfo) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *AccountInfo) GetIndex() uint32 { + if x != nil { + return x.Index + } + return 0 +} + +func (x *AccountInfo) GetDerivationPath() string { + if x != nil { + return x.DerivationPath + } + return "" +} + +func (x *AccountInfo) GetXpub() string { + if x != nil { + return x.Xpub + } + return "" +} + +type BalanceInfo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Balance of utxos with 1+ confirmations. + ConfirmedBalance uint64 `protobuf:"varint,1,opt,name=confirmed_balance,json=confirmedBalance,proto3" json:"confirmed_balance,omitempty"` + // Balance of utxos with no confirmations. + UnconfirmedBalance uint64 `protobuf:"varint,2,opt,name=unconfirmed_balance,json=unconfirmedBalance,proto3" json:"unconfirmed_balance,omitempty"` + // Balance of locked utxos. + LockedBalance uint64 `protobuf:"varint,3,opt,name=locked_balance,json=lockedBalance,proto3" json:"locked_balance,omitempty"` + // Total balance. + TotalBalance uint64 `protobuf:"varint,4,opt,name=total_balance,json=totalBalance,proto3" json:"total_balance,omitempty"` +} + +func (x *BalanceInfo) Reset() { + *x = BalanceInfo{} + if protoimpl.UnsafeEnabled { + mi := &file_ocean_v1_types_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BalanceInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BalanceInfo) ProtoMessage() {} + +func (x *BalanceInfo) ProtoReflect() protoreflect.Message { + mi := &file_ocean_v1_types_proto_msgTypes[2] + 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) +} + +// Deprecated: Use BalanceInfo.ProtoReflect.Descriptor instead. +func (*BalanceInfo) Descriptor() ([]byte, []int) { + return file_ocean_v1_types_proto_rawDescGZIP(), []int{2} +} + +func (x *BalanceInfo) GetConfirmedBalance() uint64 { + if x != nil { + return x.ConfirmedBalance + } + return 0 +} + +func (x *BalanceInfo) GetUnconfirmedBalance() uint64 { + if x != nil { + return x.UnconfirmedBalance + } + return 0 +} + +func (x *BalanceInfo) GetLockedBalance() uint64 { + if x != nil { + return x.LockedBalance + } + return 0 +} + +func (x *BalanceInfo) GetTotalBalance() uint64 { + if x != nil { + return x.TotalBalance + } + return 0 +} + +type Input struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Previous output txid. + Txid string `protobuf:"bytes,1,opt,name=txid,proto3" json:"txid,omitempty"` + // Previous tx output index. + Index uint32 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"` +} + +func (x *Input) Reset() { + *x = Input{} + if protoimpl.UnsafeEnabled { + mi := &file_ocean_v1_types_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Input) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Input) ProtoMessage() {} + +func (x *Input) ProtoReflect() protoreflect.Message { + mi := &file_ocean_v1_types_proto_msgTypes[3] + 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) +} + +// Deprecated: Use Input.ProtoReflect.Descriptor instead. +func (*Input) Descriptor() ([]byte, []int) { + return file_ocean_v1_types_proto_rawDescGZIP(), []int{3} +} + +func (x *Input) GetTxid() string { + if x != nil { + return x.Txid + } + return "" +} + +func (x *Input) GetIndex() uint32 { + if x != nil { + return x.Index + } + return 0 +} + +type Output struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Asset hash. + Asset string `protobuf:"bytes,1,opt,name=asset,proto3" json:"asset,omitempty"` + // Sent amount. + Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` + // Address to send funds to. + Address string `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"` +} + +func (x *Output) Reset() { + *x = Output{} + if protoimpl.UnsafeEnabled { + mi := &file_ocean_v1_types_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Output) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Output) ProtoMessage() {} + +func (x *Output) ProtoReflect() protoreflect.Message { + mi := &file_ocean_v1_types_proto_msgTypes[4] + 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) +} + +// Deprecated: Use Output.ProtoReflect.Descriptor instead. +func (*Output) Descriptor() ([]byte, []int) { + return file_ocean_v1_types_proto_rawDescGZIP(), []int{4} +} + +func (x *Output) GetAsset() string { + if x != nil { + return x.Asset + } + return "" +} + +func (x *Output) GetAmount() uint64 { + if x != nil { + return x.Amount + } + return 0 +} + +func (x *Output) GetAddress() string { + if x != nil { + return x.Address + } + return "" +} + +type Utxos struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Account name. + AccountName string `protobuf:"bytes,1,opt,name=account_name,json=accountName,proto3" json:"account_name,omitempty"` + // List of utxos. + Utxos []*Utxo `protobuf:"bytes,2,rep,name=utxos,proto3" json:"utxos,omitempty"` +} + +func (x *Utxos) Reset() { + *x = Utxos{} + if protoimpl.UnsafeEnabled { + mi := &file_ocean_v1_types_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Utxos) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Utxos) ProtoMessage() {} + +func (x *Utxos) ProtoReflect() protoreflect.Message { + mi := &file_ocean_v1_types_proto_msgTypes[5] + 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) +} + +// Deprecated: Use Utxos.ProtoReflect.Descriptor instead. +func (*Utxos) Descriptor() ([]byte, []int) { + return file_ocean_v1_types_proto_rawDescGZIP(), []int{5} +} + +func (x *Utxos) GetAccountName() string { + if x != nil { + return x.AccountName + } + return "" +} + +func (x *Utxos) GetUtxos() []*Utxo { + if x != nil { + return x.Utxos + } + return nil +} + +type UtxoStatus struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Txid string `protobuf:"bytes,1,opt,name=txid,proto3" json:"txid,omitempty"` + BlockInfo *BlockDetails `protobuf:"bytes,2,opt,name=block_info,json=blockInfo,proto3" json:"block_info,omitempty"` +} + +func (x *UtxoStatus) Reset() { + *x = UtxoStatus{} + if protoimpl.UnsafeEnabled { + mi := &file_ocean_v1_types_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *UtxoStatus) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*UtxoStatus) ProtoMessage() {} + +func (x *UtxoStatus) ProtoReflect() protoreflect.Message { + mi := &file_ocean_v1_types_proto_msgTypes[6] + 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) +} + +// Deprecated: Use UtxoStatus.ProtoReflect.Descriptor instead. +func (*UtxoStatus) Descriptor() ([]byte, []int) { + return file_ocean_v1_types_proto_rawDescGZIP(), []int{6} +} + +func (x *UtxoStatus) GetTxid() string { + if x != nil { + return x.Txid + } + return "" +} + +func (x *UtxoStatus) GetBlockInfo() *BlockDetails { + if x != nil { + return x.BlockInfo + } + return nil +} + +type Utxo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Txid of the uxo. + Txid string `protobuf:"bytes,1,opt,name=txid,proto3" json:"txid,omitempty"` + // Output index. + Index uint32 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"` + // Asset. + Asset string `protobuf:"bytes,3,opt,name=asset,proto3" json:"asset,omitempty"` + // Value. + Value uint64 `protobuf:"varint,4,opt,name=value,proto3" json:"value,omitempty"` + // Script. + Script []byte `protobuf:"bytes,5,opt,name=script,proto3" json:"script,omitempty"` + // Asset blinder for confidential utxo. + AssetBlinder []byte `protobuf:"bytes,6,opt,name=asset_blinder,json=assetBlinder,proto3" json:"asset_blinder,omitempty"` + // Value blinder for confidential utxo. + ValueBlinder []byte `protobuf:"bytes,7,opt,name=value_blinder,json=valueBlinder,proto3" json:"value_blinder,omitempty"` + // Name of the account owning the utxo. + AccountName string `protobuf:"bytes,8,opt,name=account_name,json=accountName,proto3" json:"account_name,omitempty"` + // Info about utxo's spent status. + SpentStatus *UtxoStatus `protobuf:"bytes,9,opt,name=spent_status,json=spentStatus,proto3" json:"spent_status,omitempty"` + // Info about utxo's confirmation status. + ConfirmedStatus *UtxoStatus `protobuf:"bytes,10,opt,name=confirmed_status,json=confirmedStatus,proto3" json:"confirmed_status,omitempty"` +} + +func (x *Utxo) Reset() { + *x = Utxo{} + if protoimpl.UnsafeEnabled { + mi := &file_ocean_v1_types_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Utxo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Utxo) ProtoMessage() {} + +func (x *Utxo) ProtoReflect() protoreflect.Message { + mi := &file_ocean_v1_types_proto_msgTypes[7] + 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) +} + +// Deprecated: Use Utxo.ProtoReflect.Descriptor instead. +func (*Utxo) Descriptor() ([]byte, []int) { + return file_ocean_v1_types_proto_rawDescGZIP(), []int{7} +} + +func (x *Utxo) GetTxid() string { + if x != nil { + return x.Txid + } + return "" +} + +func (x *Utxo) GetIndex() uint32 { + if x != nil { + return x.Index + } + return 0 +} + +func (x *Utxo) GetAsset() string { + if x != nil { + return x.Asset + } + return "" +} + +func (x *Utxo) GetValue() uint64 { + if x != nil { + return x.Value + } + return 0 +} + +func (x *Utxo) GetScript() []byte { + if x != nil { + return x.Script + } + return nil +} + +func (x *Utxo) GetAssetBlinder() []byte { + if x != nil { + return x.AssetBlinder + } + return nil +} + +func (x *Utxo) GetValueBlinder() []byte { + if x != nil { + return x.ValueBlinder + } + return nil +} + +func (x *Utxo) GetAccountName() string { + if x != nil { + return x.AccountName + } + return "" +} + +func (x *Utxo) GetSpentStatus() *UtxoStatus { + if x != nil { + return x.SpentStatus + } + return nil +} + +func (x *Utxo) GetConfirmedStatus() *UtxoStatus { + if x != nil { + return x.ConfirmedStatus + } + return nil +} + +type BlockDetails struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Hash of the block. + Hash string `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` + // Heighth (index) of the block. + Height uint64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` + // Timestamp of the block. + Timestamp int64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` +} + +func (x *BlockDetails) Reset() { + *x = BlockDetails{} + if protoimpl.UnsafeEnabled { + mi := &file_ocean_v1_types_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *BlockDetails) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*BlockDetails) ProtoMessage() {} + +func (x *BlockDetails) ProtoReflect() protoreflect.Message { + mi := &file_ocean_v1_types_proto_msgTypes[8] + 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) +} + +// Deprecated: Use BlockDetails.ProtoReflect.Descriptor instead. +func (*BlockDetails) Descriptor() ([]byte, []int) { + return file_ocean_v1_types_proto_rawDescGZIP(), []int{8} +} + +func (x *BlockDetails) GetHash() string { + if x != nil { + return x.Hash + } + return "" +} + +func (x *BlockDetails) GetHeight() uint64 { + if x != nil { + return x.Height + } + return 0 +} + +func (x *BlockDetails) GetTimestamp() int64 { + if x != nil { + return x.Timestamp + } + return 0 +} + +type Template struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Format Template_Format `protobuf:"varint,1,opt,name=format,proto3,enum=ocean.v1.Template_Format" json:"format,omitempty"` + Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (x *Template) Reset() { + *x = Template{} + if protoimpl.UnsafeEnabled { + mi := &file_ocean_v1_types_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Template) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Template) ProtoMessage() {} + +func (x *Template) ProtoReflect() protoreflect.Message { + mi := &file_ocean_v1_types_proto_msgTypes[9] + 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) +} + +// Deprecated: Use Template.ProtoReflect.Descriptor instead. +func (*Template) Descriptor() ([]byte, []int) { + return file_ocean_v1_types_proto_rawDescGZIP(), []int{9} +} + +func (x *Template) GetFormat() Template_Format { + if x != nil { + return x.Format + } + return Template_FORMAT_UNSPECIFIED +} + +func (x *Template) GetValue() string { + if x != nil { + return x.Value + } + return "" +} + +var File_ocean_v1_types_proto protoreflect.FileDescriptor + +var file_ocean_v1_types_proto_rawDesc = []byte{ + 0x0a, 0x14, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, + 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, + 0x22, 0x51, 0x0a, 0x09, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x0a, + 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, + 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x12, + 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x64, + 0x61, 0x74, 0x65, 0x22, 0x74, 0x0a, 0x0b, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, + 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x27, 0x0a, 0x0f, + 0x64, 0x65, 0x72, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0e, 0x64, 0x65, 0x72, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, + 0x6e, 0x50, 0x61, 0x74, 0x68, 0x12, 0x12, 0x0a, 0x04, 0x78, 0x70, 0x75, 0x62, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x04, 0x78, 0x70, 0x75, 0x62, 0x22, 0xb7, 0x01, 0x0a, 0x0b, 0x42, 0x61, + 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x2b, 0x0a, 0x11, 0x63, 0x6f, 0x6e, + 0x66, 0x69, 0x72, 0x6d, 0x65, 0x64, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x65, 0x64, 0x42, + 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x2f, 0x0a, 0x13, 0x75, 0x6e, 0x63, 0x6f, 0x6e, 0x66, + 0x69, 0x72, 0x6d, 0x65, 0x64, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x04, 0x52, 0x12, 0x75, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x65, 0x64, + 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x6c, 0x6f, 0x63, 0x6b, 0x65, + 0x64, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x0d, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x23, + 0x0a, 0x0d, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x42, 0x61, 0x6c, 0x61, + 0x6e, 0x63, 0x65, 0x22, 0x31, 0x0a, 0x05, 0x49, 0x6e, 0x70, 0x75, 0x74, 0x12, 0x12, 0x0a, 0x04, + 0x74, 0x78, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x78, 0x69, 0x64, + 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x22, 0x50, 0x0a, 0x06, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, + 0x12, 0x14, 0x0a, 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x61, 0x73, 0x73, 0x65, 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, 0x12, 0x18, + 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x50, 0x0a, 0x05, 0x55, 0x74, 0x78, 0x6f, + 0x73, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6e, 0x61, 0x6d, + 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, + 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x24, 0x0a, 0x05, 0x75, 0x74, 0x78, 0x6f, 0x73, 0x18, 0x02, 0x20, + 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x55, + 0x74, 0x78, 0x6f, 0x52, 0x05, 0x75, 0x74, 0x78, 0x6f, 0x73, 0x22, 0x57, 0x0a, 0x0a, 0x55, 0x74, + 0x78, 0x6f, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x78, 0x69, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x78, 0x69, 0x64, 0x12, 0x35, 0x0a, 0x0a, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x16, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, 0x09, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x49, + 0x6e, 0x66, 0x6f, 0x22, 0xdb, 0x02, 0x0a, 0x04, 0x55, 0x74, 0x78, 0x6f, 0x12, 0x12, 0x0a, 0x04, + 0x74, 0x78, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x78, 0x69, 0x64, + 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, + 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, 0x12, 0x14, 0x0a, 0x05, + 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x76, 0x61, 0x6c, + 0x75, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x06, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x12, 0x23, 0x0a, 0x0d, 0x61, 0x73, + 0x73, 0x65, 0x74, 0x5f, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, + 0x0c, 0x52, 0x0c, 0x61, 0x73, 0x73, 0x65, 0x74, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x72, 0x12, + 0x23, 0x0a, 0x0d, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x5f, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x65, 0x72, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x42, 0x6c, 0x69, + 0x6e, 0x64, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x37, 0x0a, 0x0c, 0x73, 0x70, 0x65, 0x6e, 0x74, + 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, + 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x74, 0x78, 0x6f, 0x53, 0x74, 0x61, + 0x74, 0x75, 0x73, 0x52, 0x0b, 0x73, 0x70, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x3f, 0x0a, 0x10, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x65, 0x64, 0x5f, 0x73, 0x74, + 0x61, 0x74, 0x75, 0x73, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, 0x63, 0x65, + 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x74, 0x78, 0x6f, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x65, 0x64, 0x53, 0x74, 0x61, 0x74, 0x75, + 0x73, 0x22, 0x58, 0x0a, 0x0c, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, + 0x73, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, + 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x1c, 0x0a, + 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, + 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0xc5, 0x01, 0x0a, 0x08, + 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x31, 0x0a, 0x06, 0x66, 0x6f, 0x72, 0x6d, + 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x19, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, + 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x46, 0x6f, 0x72, + 0x6d, 0x61, 0x74, 0x52, 0x06, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x22, 0x70, 0x0a, 0x06, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x12, 0x16, 0x0a, 0x12, 0x46, + 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, + 0x44, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x44, 0x45, + 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x4f, 0x52, 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, 0x46, 0x4f, + 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x4d, 0x49, 0x4e, 0x49, 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x10, + 0x02, 0x12, 0x10, 0x0a, 0x0c, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x49, 0x4f, 0x4e, 0x49, + 0x4f, 0x10, 0x03, 0x12, 0x0e, 0x0a, 0x0a, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x52, 0x41, + 0x57, 0x10, 0x04, 0x2a, 0x87, 0x01, 0x0a, 0x0b, 0x54, 0x78, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, + 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x19, 0x54, 0x58, 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, + 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, + 0x10, 0x00, 0x12, 0x1d, 0x0a, 0x19, 0x54, 0x58, 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, + 0x59, 0x50, 0x45, 0x5f, 0x42, 0x52, 0x4f, 0x41, 0x44, 0x43, 0x41, 0x53, 0x54, 0x45, 0x44, 0x10, + 0x01, 0x12, 0x1d, 0x0a, 0x19, 0x54, 0x58, 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, + 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x52, 0x4d, 0x45, 0x44, 0x10, 0x02, + 0x12, 0x1b, 0x0a, 0x17, 0x54, 0x58, 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, + 0x45, 0x5f, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x52, 0x4d, 0x45, 0x44, 0x10, 0x03, 0x2a, 0xbd, 0x01, + 0x0a, 0x0d, 0x55, 0x74, 0x78, 0x6f, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, + 0x1f, 0x0a, 0x1b, 0x55, 0x54, 0x58, 0x4f, 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, + 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, + 0x12, 0x17, 0x0a, 0x13, 0x55, 0x54, 0x58, 0x4f, 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, + 0x59, 0x50, 0x45, 0x5f, 0x4e, 0x45, 0x57, 0x10, 0x01, 0x12, 0x1d, 0x0a, 0x19, 0x55, 0x54, 0x58, + 0x4f, 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x43, 0x4f, 0x4e, + 0x46, 0x49, 0x52, 0x4d, 0x45, 0x44, 0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x55, 0x54, 0x58, 0x4f, + 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4c, 0x4f, 0x43, 0x4b, + 0x45, 0x44, 0x10, 0x03, 0x12, 0x1c, 0x0a, 0x18, 0x55, 0x54, 0x58, 0x4f, 0x5f, 0x45, 0x56, 0x45, + 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x4c, 0x4f, 0x43, 0x4b, 0x45, 0x44, + 0x10, 0x04, 0x12, 0x19, 0x0a, 0x15, 0x55, 0x54, 0x58, 0x4f, 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, + 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x50, 0x45, 0x4e, 0x54, 0x10, 0x05, 0x2a, 0x77, 0x0a, + 0x10, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, + 0x65, 0x12, 0x22, 0x0a, 0x1e, 0x57, 0x45, 0x42, 0x48, 0x4f, 0x4f, 0x4b, 0x5f, 0x45, 0x56, 0x45, + 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, + 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x22, 0x0a, 0x1e, 0x57, 0x45, 0x42, 0x48, 0x4f, 0x4f, 0x4b, + 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x54, 0x52, 0x41, 0x4e, + 0x53, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x12, 0x1b, 0x0a, 0x17, 0x57, 0x45, 0x42, + 0x48, 0x4f, 0x4f, 0x4b, 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, + 0x55, 0x54, 0x58, 0x4f, 0x10, 0x02, 0x42, 0xa3, 0x01, 0x0a, 0x0c, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, + 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x54, 0x79, 0x70, 0x65, 0x73, 0x50, 0x72, + 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x46, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, + 0x6d, 0x2f, 0x76, 0x75, 0x6c, 0x70, 0x65, 0x6d, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, + 0x2f, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2d, 0x73, 0x70, 0x65, 0x63, 0x2f, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x6f, 0x63, 0x65, + 0x61, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x76, 0x31, 0xa2, 0x02, 0x03, + 0x4f, 0x58, 0x58, 0xaa, 0x02, 0x08, 0x4f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x56, 0x31, 0xca, 0x02, + 0x08, 0x4f, 0x63, 0x65, 0x61, 0x6e, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x14, 0x4f, 0x63, 0x65, 0x61, + 0x6e, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x09, 0x4f, 0x63, 0x65, 0x61, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, +} + +var ( + file_ocean_v1_types_proto_rawDescOnce sync.Once + file_ocean_v1_types_proto_rawDescData = file_ocean_v1_types_proto_rawDesc +) + +func file_ocean_v1_types_proto_rawDescGZIP() []byte { + file_ocean_v1_types_proto_rawDescOnce.Do(func() { + file_ocean_v1_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_ocean_v1_types_proto_rawDescData) + }) + return file_ocean_v1_types_proto_rawDescData +} + +var file_ocean_v1_types_proto_enumTypes = make([]protoimpl.EnumInfo, 4) +var file_ocean_v1_types_proto_msgTypes = make([]protoimpl.MessageInfo, 10) +var file_ocean_v1_types_proto_goTypes = []interface{}{ + (TxEventType)(0), // 0: ocean.v1.TxEventType + (UtxoEventType)(0), // 1: ocean.v1.UtxoEventType + (WebhookEventType)(0), // 2: ocean.v1.WebhookEventType + (Template_Format)(0), // 3: ocean.v1.Template.Format + (*BuildInfo)(nil), // 4: ocean.v1.BuildInfo + (*AccountInfo)(nil), // 5: ocean.v1.AccountInfo + (*BalanceInfo)(nil), // 6: ocean.v1.BalanceInfo + (*Input)(nil), // 7: ocean.v1.Input + (*Output)(nil), // 8: ocean.v1.Output + (*Utxos)(nil), // 9: ocean.v1.Utxos + (*UtxoStatus)(nil), // 10: ocean.v1.UtxoStatus + (*Utxo)(nil), // 11: ocean.v1.Utxo + (*BlockDetails)(nil), // 12: ocean.v1.BlockDetails + (*Template)(nil), // 13: ocean.v1.Template +} +var file_ocean_v1_types_proto_depIdxs = []int32{ + 11, // 0: ocean.v1.Utxos.utxos:type_name -> ocean.v1.Utxo + 12, // 1: ocean.v1.UtxoStatus.block_info:type_name -> ocean.v1.BlockDetails + 10, // 2: ocean.v1.Utxo.spent_status:type_name -> ocean.v1.UtxoStatus + 10, // 3: ocean.v1.Utxo.confirmed_status:type_name -> ocean.v1.UtxoStatus + 3, // 4: ocean.v1.Template.format:type_name -> ocean.v1.Template.Format + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name +} + +func init() { file_ocean_v1_types_proto_init() } +func file_ocean_v1_types_proto_init() { + if File_ocean_v1_types_proto != nil { + return + } + if !protoimpl.UnsafeEnabled { + file_ocean_v1_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BuildInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ocean_v1_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AccountInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ocean_v1_types_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BalanceInfo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ocean_v1_types_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Input); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ocean_v1_types_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Output); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ocean_v1_types_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Utxos); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ocean_v1_types_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*UtxoStatus); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ocean_v1_types_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Utxo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ocean_v1_types_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*BlockDetails); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ocean_v1_types_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Template); 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_ocean_v1_types_proto_rawDesc, + NumEnums: 4, + NumMessages: 10, + NumExtensions: 0, + NumServices: 0, + }, + GoTypes: file_ocean_v1_types_proto_goTypes, + DependencyIndexes: file_ocean_v1_types_proto_depIdxs, + EnumInfos: file_ocean_v1_types_proto_enumTypes, + MessageInfos: file_ocean_v1_types_proto_msgTypes, + }.Build() + File_ocean_v1_types_proto = out.File + file_ocean_v1_types_proto_rawDesc = nil + file_ocean_v1_types_proto_goTypes = nil + file_ocean_v1_types_proto_depIdxs = nil +} diff --git a/api-spec/protobuf/gen/go/ocean/v1alpha/wallet.pb.go b/api-spec/protobuf/gen/go/ocean/v1/wallet.pb.go similarity index 52% rename from api-spec/protobuf/gen/go/ocean/v1alpha/wallet.pb.go rename to api-spec/protobuf/gen/go/ocean/v1/wallet.pb.go index d58c124..f34af41 100644 --- a/api-spec/protobuf/gen/go/ocean/v1alpha/wallet.pb.go +++ b/api-spec/protobuf/gen/go/ocean/v1/wallet.pb.go @@ -1,10 +1,10 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.27.1 +// protoc-gen-go v1.28.1 // protoc (unknown) -// source: ocean/v1alpha/wallet.proto +// source: ocean/v1/wallet.proto -package oceanv1alpha +package oceanv1 import ( protoreflect "google.golang.org/protobuf/reflect/protoreflect" @@ -56,11 +56,11 @@ func (x GetInfoResponse_Network) String() string { } func (GetInfoResponse_Network) Descriptor() protoreflect.EnumDescriptor { - return file_ocean_v1alpha_wallet_proto_enumTypes[0].Descriptor() + return file_ocean_v1_wallet_proto_enumTypes[0].Descriptor() } func (GetInfoResponse_Network) Type() protoreflect.EnumType { - return &file_ocean_v1alpha_wallet_proto_enumTypes[0] + return &file_ocean_v1_wallet_proto_enumTypes[0] } func (x GetInfoResponse_Network) Number() protoreflect.EnumNumber { @@ -69,7 +69,7 @@ func (x GetInfoResponse_Network) Number() protoreflect.EnumNumber { // Deprecated: Use GetInfoResponse_Network.Descriptor instead. func (GetInfoResponse_Network) EnumDescriptor() ([]byte, []int) { - return file_ocean_v1alpha_wallet_proto_rawDescGZIP(), []int{13, 0} + return file_ocean_v1_wallet_proto_rawDescGZIP(), []int{15, 0} } type GenSeedRequest struct { @@ -81,7 +81,7 @@ type GenSeedRequest struct { func (x *GenSeedRequest) Reset() { *x = GenSeedRequest{} if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_wallet_proto_msgTypes[0] + mi := &file_ocean_v1_wallet_proto_msgTypes[0] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -94,7 +94,7 @@ func (x *GenSeedRequest) String() string { func (*GenSeedRequest) ProtoMessage() {} func (x *GenSeedRequest) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_wallet_proto_msgTypes[0] + mi := &file_ocean_v1_wallet_proto_msgTypes[0] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -107,7 +107,7 @@ func (x *GenSeedRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GenSeedRequest.ProtoReflect.Descriptor instead. func (*GenSeedRequest) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_wallet_proto_rawDescGZIP(), []int{0} + return file_ocean_v1_wallet_proto_rawDescGZIP(), []int{0} } type GenSeedResponse struct { @@ -122,7 +122,7 @@ type GenSeedResponse struct { func (x *GenSeedResponse) Reset() { *x = GenSeedResponse{} if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_wallet_proto_msgTypes[1] + mi := &file_ocean_v1_wallet_proto_msgTypes[1] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -135,7 +135,7 @@ func (x *GenSeedResponse) String() string { func (*GenSeedResponse) ProtoMessage() {} func (x *GenSeedResponse) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_wallet_proto_msgTypes[1] + mi := &file_ocean_v1_wallet_proto_msgTypes[1] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -148,7 +148,7 @@ func (x *GenSeedResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GenSeedResponse.ProtoReflect.Descriptor instead. func (*GenSeedResponse) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_wallet_proto_rawDescGZIP(), []int{1} + return file_ocean_v1_wallet_proto_rawDescGZIP(), []int{1} } func (x *GenSeedResponse) GetMnemonic() string { @@ -173,7 +173,7 @@ type CreateWalletRequest struct { func (x *CreateWalletRequest) Reset() { *x = CreateWalletRequest{} if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_wallet_proto_msgTypes[2] + mi := &file_ocean_v1_wallet_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -186,7 +186,7 @@ func (x *CreateWalletRequest) String() string { func (*CreateWalletRequest) ProtoMessage() {} func (x *CreateWalletRequest) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_wallet_proto_msgTypes[2] + mi := &file_ocean_v1_wallet_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -199,7 +199,7 @@ func (x *CreateWalletRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateWalletRequest.ProtoReflect.Descriptor instead. func (*CreateWalletRequest) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_wallet_proto_rawDescGZIP(), []int{2} + return file_ocean_v1_wallet_proto_rawDescGZIP(), []int{2} } func (x *CreateWalletRequest) GetMnemonic() string { @@ -225,7 +225,7 @@ type CreateWalletResponse struct { func (x *CreateWalletResponse) Reset() { *x = CreateWalletResponse{} if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_wallet_proto_msgTypes[3] + mi := &file_ocean_v1_wallet_proto_msgTypes[3] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -238,7 +238,7 @@ func (x *CreateWalletResponse) String() string { func (*CreateWalletResponse) ProtoMessage() {} func (x *CreateWalletResponse) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_wallet_proto_msgTypes[3] + mi := &file_ocean_v1_wallet_proto_msgTypes[3] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -251,7 +251,7 @@ func (x *CreateWalletResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use CreateWalletResponse.ProtoReflect.Descriptor instead. func (*CreateWalletResponse) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_wallet_proto_rawDescGZIP(), []int{3} + return file_ocean_v1_wallet_proto_rawDescGZIP(), []int{3} } type UnlockRequest struct { @@ -266,7 +266,7 @@ type UnlockRequest struct { func (x *UnlockRequest) Reset() { *x = UnlockRequest{} if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_wallet_proto_msgTypes[4] + mi := &file_ocean_v1_wallet_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -279,7 +279,7 @@ func (x *UnlockRequest) String() string { func (*UnlockRequest) ProtoMessage() {} func (x *UnlockRequest) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_wallet_proto_msgTypes[4] + mi := &file_ocean_v1_wallet_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -292,7 +292,7 @@ func (x *UnlockRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use UnlockRequest.ProtoReflect.Descriptor instead. func (*UnlockRequest) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_wallet_proto_rawDescGZIP(), []int{4} + return file_ocean_v1_wallet_proto_rawDescGZIP(), []int{4} } func (x *UnlockRequest) GetPassword() string { @@ -311,7 +311,7 @@ type UnlockResponse struct { func (x *UnlockResponse) Reset() { *x = UnlockResponse{} if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_wallet_proto_msgTypes[5] + mi := &file_ocean_v1_wallet_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -324,7 +324,7 @@ func (x *UnlockResponse) String() string { func (*UnlockResponse) ProtoMessage() {} func (x *UnlockResponse) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_wallet_proto_msgTypes[5] + mi := &file_ocean_v1_wallet_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -337,7 +337,83 @@ func (x *UnlockResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use UnlockResponse.ProtoReflect.Descriptor instead. func (*UnlockResponse) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_wallet_proto_rawDescGZIP(), []int{5} + return file_ocean_v1_wallet_proto_rawDescGZIP(), []int{5} +} + +type LockRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *LockRequest) Reset() { + *x = LockRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_ocean_v1_wallet_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LockRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LockRequest) ProtoMessage() {} + +func (x *LockRequest) ProtoReflect() protoreflect.Message { + mi := &file_ocean_v1_wallet_proto_msgTypes[6] + 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) +} + +// Deprecated: Use LockRequest.ProtoReflect.Descriptor instead. +func (*LockRequest) Descriptor() ([]byte, []int) { + return file_ocean_v1_wallet_proto_rawDescGZIP(), []int{6} +} + +type LockResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *LockResponse) Reset() { + *x = LockResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_ocean_v1_wallet_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *LockResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*LockResponse) ProtoMessage() {} + +func (x *LockResponse) ProtoReflect() protoreflect.Message { + mi := &file_ocean_v1_wallet_proto_msgTypes[7] + 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) +} + +// Deprecated: Use LockResponse.ProtoReflect.Descriptor instead. +func (*LockResponse) Descriptor() ([]byte, []int) { + return file_ocean_v1_wallet_proto_rawDescGZIP(), []int{7} } type ChangePasswordRequest struct { @@ -354,7 +430,7 @@ type ChangePasswordRequest struct { func (x *ChangePasswordRequest) Reset() { *x = ChangePasswordRequest{} if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_wallet_proto_msgTypes[6] + mi := &file_ocean_v1_wallet_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -367,7 +443,7 @@ func (x *ChangePasswordRequest) String() string { func (*ChangePasswordRequest) ProtoMessage() {} func (x *ChangePasswordRequest) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_wallet_proto_msgTypes[6] + mi := &file_ocean_v1_wallet_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -380,7 +456,7 @@ func (x *ChangePasswordRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use ChangePasswordRequest.ProtoReflect.Descriptor instead. func (*ChangePasswordRequest) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_wallet_proto_rawDescGZIP(), []int{6} + return file_ocean_v1_wallet_proto_rawDescGZIP(), []int{8} } func (x *ChangePasswordRequest) GetCurrentPassword() string { @@ -406,7 +482,7 @@ type ChangePasswordResponse struct { func (x *ChangePasswordResponse) Reset() { *x = ChangePasswordResponse{} if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_wallet_proto_msgTypes[7] + mi := &file_ocean_v1_wallet_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -419,7 +495,7 @@ func (x *ChangePasswordResponse) String() string { func (*ChangePasswordResponse) ProtoMessage() {} func (x *ChangePasswordResponse) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_wallet_proto_msgTypes[7] + mi := &file_ocean_v1_wallet_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -432,7 +508,7 @@ func (x *ChangePasswordResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use ChangePasswordResponse.ProtoReflect.Descriptor instead. func (*ChangePasswordResponse) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_wallet_proto_rawDescGZIP(), []int{7} + return file_ocean_v1_wallet_proto_rawDescGZIP(), []int{9} } type RestoreWalletRequest struct { @@ -442,15 +518,19 @@ type RestoreWalletRequest struct { // The mnemonic from where deriving signing and blinding key pairs. Mnemonic string `protobuf:"bytes,1,opt,name=mnemonic,proto3" json:"mnemonic,omitempty"` - // The password to decrypt HD wallet. After restoration, the wallet is locked and - // the same password is required to unlock it. - Password string `protobuf:"bytes,3,opt,name=password,proto3" json:"password,omitempty"` + // The password to decrypt HD wallet. After restoration, the wallet is locked + // and the same password is required to unlock it. + Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` + // The hash of the block at original wallet creation time. This will be the + // starting block for the wallet rescan. + // If not given, will rescan from genesis block. + BirthdayBlockHash string `protobuf:"bytes,3,opt,name=birthday_block_hash,json=birthdayBlockHash,proto3" json:"birthday_block_hash,omitempty"` } func (x *RestoreWalletRequest) Reset() { *x = RestoreWalletRequest{} if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_wallet_proto_msgTypes[8] + mi := &file_ocean_v1_wallet_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -463,7 +543,7 @@ func (x *RestoreWalletRequest) String() string { func (*RestoreWalletRequest) ProtoMessage() {} func (x *RestoreWalletRequest) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_wallet_proto_msgTypes[8] + mi := &file_ocean_v1_wallet_proto_msgTypes[10] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -476,7 +556,7 @@ func (x *RestoreWalletRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RestoreWalletRequest.ProtoReflect.Descriptor instead. func (*RestoreWalletRequest) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_wallet_proto_rawDescGZIP(), []int{8} + return file_ocean_v1_wallet_proto_rawDescGZIP(), []int{10} } func (x *RestoreWalletRequest) GetMnemonic() string { @@ -493,6 +573,13 @@ func (x *RestoreWalletRequest) GetPassword() string { return "" } +func (x *RestoreWalletRequest) GetBirthdayBlockHash() string { + if x != nil { + return x.BirthdayBlockHash + } + return "" +} + type RestoreWalletResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -502,7 +589,7 @@ type RestoreWalletResponse struct { func (x *RestoreWalletResponse) Reset() { *x = RestoreWalletResponse{} if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_wallet_proto_msgTypes[9] + mi := &file_ocean_v1_wallet_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -515,7 +602,7 @@ func (x *RestoreWalletResponse) String() string { func (*RestoreWalletResponse) ProtoMessage() {} func (x *RestoreWalletResponse) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_wallet_proto_msgTypes[9] + mi := &file_ocean_v1_wallet_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -528,7 +615,7 @@ func (x *RestoreWalletResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use RestoreWalletResponse.ProtoReflect.Descriptor instead. func (*RestoreWalletResponse) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_wallet_proto_rawDescGZIP(), []int{9} + return file_ocean_v1_wallet_proto_rawDescGZIP(), []int{11} } type StatusRequest struct { @@ -540,7 +627,7 @@ type StatusRequest struct { func (x *StatusRequest) Reset() { *x = StatusRequest{} if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_wallet_proto_msgTypes[10] + mi := &file_ocean_v1_wallet_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -553,7 +640,7 @@ func (x *StatusRequest) String() string { func (*StatusRequest) ProtoMessage() {} func (x *StatusRequest) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_wallet_proto_msgTypes[10] + mi := &file_ocean_v1_wallet_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -566,7 +653,7 @@ func (x *StatusRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use StatusRequest.ProtoReflect.Descriptor instead. func (*StatusRequest) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_wallet_proto_rawDescGZIP(), []int{10} + return file_ocean_v1_wallet_proto_rawDescGZIP(), []int{12} } type StatusResponse struct { @@ -586,7 +673,7 @@ type StatusResponse struct { func (x *StatusResponse) Reset() { *x = StatusResponse{} if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_wallet_proto_msgTypes[11] + mi := &file_ocean_v1_wallet_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -599,7 +686,7 @@ func (x *StatusResponse) String() string { func (*StatusResponse) ProtoMessage() {} func (x *StatusResponse) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_wallet_proto_msgTypes[11] + mi := &file_ocean_v1_wallet_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -612,7 +699,7 @@ func (x *StatusResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use StatusResponse.ProtoReflect.Descriptor instead. func (*StatusResponse) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_wallet_proto_rawDescGZIP(), []int{11} + return file_ocean_v1_wallet_proto_rawDescGZIP(), []int{13} } func (x *StatusResponse) GetInitialized() bool { @@ -645,7 +732,7 @@ type GetInfoRequest struct { func (x *GetInfoRequest) Reset() { *x = GetInfoRequest{} if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_wallet_proto_msgTypes[12] + mi := &file_ocean_v1_wallet_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -658,7 +745,7 @@ func (x *GetInfoRequest) String() string { func (*GetInfoRequest) ProtoMessage() {} func (x *GetInfoRequest) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_wallet_proto_msgTypes[12] + mi := &file_ocean_v1_wallet_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -671,7 +758,7 @@ func (x *GetInfoRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use GetInfoRequest.ProtoReflect.Descriptor instead. func (*GetInfoRequest) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_wallet_proto_rawDescGZIP(), []int{12} + return file_ocean_v1_wallet_proto_rawDescGZIP(), []int{14} } type GetInfoResponse struct { @@ -680,7 +767,7 @@ type GetInfoResponse struct { unknownFields protoimpl.UnknownFields // The Liquid network of the wallet - Network GetInfoResponse_Network `protobuf:"varint,1,opt,name=network,proto3,enum=ocean.v1alpha.GetInfoResponse_Network" json:"network,omitempty"` + Network GetInfoResponse_Network `protobuf:"varint,1,opt,name=network,proto3,enum=ocean.v1.GetInfoResponse_Network" json:"network,omitempty"` // The Liquid Bitcoin (LBTC) asset hash of the network. NativeAsset string `protobuf:"bytes,2,opt,name=native_asset,json=nativeAsset,proto3" json:"native_asset,omitempty"` // The root derivation path of the HD wallet. @@ -688,14 +775,20 @@ type GetInfoResponse struct { // The master blinding key derived from the blinding seed from where derive // blidning key pairs. MasterBlindingKey string `protobuf:"bytes,4,opt,name=master_blinding_key,json=masterBlindingKey,proto3" json:"master_blinding_key,omitempty"` + // The hash of the block at wallet creation time. + BirthdayBlockHash string `protobuf:"bytes,5,opt,name=birthday_block_hash,json=birthdayBlockHash,proto3" json:"birthday_block_hash,omitempty"` + // The height of the block at wallet creation time. + BirthdayBlockHeight uint32 `protobuf:"varint,6,opt,name=birthday_block_height,json=birthdayBlockHeight,proto3" json:"birthday_block_height,omitempty"` // List containing info about the wallet accounts. - Accounts []*AccountInfo `protobuf:"bytes,5,rep,name=accounts,proto3" json:"accounts,omitempty"` + Accounts []*AccountInfo `protobuf:"bytes,7,rep,name=accounts,proto3" json:"accounts,omitempty"` + // Info about the current version of the ocean wallet. + BuildInfo *BuildInfo `protobuf:"bytes,8,opt,name=build_info,json=buildInfo,proto3" json:"build_info,omitempty"` } func (x *GetInfoResponse) Reset() { *x = GetInfoResponse{} if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_wallet_proto_msgTypes[13] + mi := &file_ocean_v1_wallet_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -708,7 +801,7 @@ func (x *GetInfoResponse) String() string { func (*GetInfoResponse) ProtoMessage() {} func (x *GetInfoResponse) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_wallet_proto_msgTypes[13] + mi := &file_ocean_v1_wallet_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -721,7 +814,7 @@ func (x *GetInfoResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use GetInfoResponse.ProtoReflect.Descriptor instead. func (*GetInfoResponse) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_wallet_proto_rawDescGZIP(), []int{13} + return file_ocean_v1_wallet_proto_rawDescGZIP(), []int{15} } func (x *GetInfoResponse) GetNetwork() GetInfoResponse_Network { @@ -752,6 +845,20 @@ func (x *GetInfoResponse) GetMasterBlindingKey() string { return "" } +func (x *GetInfoResponse) GetBirthdayBlockHash() string { + if x != nil { + return x.BirthdayBlockHash + } + return "" +} + +func (x *GetInfoResponse) GetBirthdayBlockHeight() uint32 { + if x != nil { + return x.BirthdayBlockHeight + } + return 0 +} + func (x *GetInfoResponse) GetAccounts() []*AccountInfo { if x != nil { return x.Accounts @@ -759,28 +866,36 @@ func (x *GetInfoResponse) GetAccounts() []*AccountInfo { return nil } -var File_ocean_v1alpha_wallet_proto protoreflect.FileDescriptor - -var file_ocean_v1alpha_wallet_proto_rawDesc = []byte{ - 0x0a, 0x1a, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, - 0x77, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x6f, 0x63, - 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x1a, 0x19, 0x6f, 0x63, 0x65, - 0x61, 0x6e, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x10, 0x0a, 0x0e, 0x47, 0x65, 0x6e, 0x53, 0x65, 0x65, - 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x2d, 0x0a, 0x0f, 0x47, 0x65, 0x6e, 0x53, - 0x65, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6d, - 0x6e, 0x65, 0x6d, 0x6f, 0x6e, 0x69, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, - 0x6e, 0x65, 0x6d, 0x6f, 0x6e, 0x69, 0x63, 0x22, 0x4d, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, - 0x0a, 0x08, 0x6d, 0x6e, 0x65, 0x6d, 0x6f, 0x6e, 0x69, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x6d, 0x6e, 0x65, 0x6d, 0x6f, 0x6e, 0x69, 0x63, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, - 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, - 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x16, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, - 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2b, - 0x0a, 0x0d, 0x55, 0x6e, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x10, 0x0a, 0x0e, 0x55, - 0x6e, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x65, 0x0a, +func (x *GetInfoResponse) GetBuildInfo() *BuildInfo { + if x != nil { + return x.BuildInfo + } + return nil +} + +var File_ocean_v1_wallet_proto protoreflect.FileDescriptor + +var file_ocean_v1_wallet_proto_rawDesc = []byte{ + 0x0a, 0x15, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x77, 0x61, 0x6c, 0x6c, 0x65, + 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, + 0x31, 0x1a, 0x14, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, + 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x10, 0x0a, 0x0e, 0x47, 0x65, 0x6e, 0x53, 0x65, + 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x2d, 0x0a, 0x0f, 0x47, 0x65, 0x6e, + 0x53, 0x65, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1a, 0x0a, 0x08, + 0x6d, 0x6e, 0x65, 0x6d, 0x6f, 0x6e, 0x69, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, + 0x6d, 0x6e, 0x65, 0x6d, 0x6f, 0x6e, 0x69, 0x63, 0x22, 0x4d, 0x0a, 0x13, 0x43, 0x72, 0x65, 0x61, + 0x74, 0x65, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, + 0x1a, 0x0a, 0x08, 0x6d, 0x6e, 0x65, 0x6d, 0x6f, 0x6e, 0x69, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x08, 0x6d, 0x6e, 0x65, 0x6d, 0x6f, 0x6e, 0x69, 0x63, 0x12, 0x1a, 0x0a, 0x08, 0x70, + 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, + 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x16, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, + 0x65, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x2b, 0x0a, 0x0d, 0x55, 0x6e, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x10, 0x0a, 0x0e, + 0x55, 0x6e, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x0d, + 0x0a, 0x0b, 0x4c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x0e, 0x0a, + 0x0c, 0x4c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x65, 0x0a, 0x15, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x29, 0x0a, 0x10, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, @@ -788,12 +903,15 @@ var file_ocean_v1alpha_wallet_proto_rawDesc = []byte{ 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x6e, 0x65, 0x77, 0x5f, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6e, 0x65, 0x77, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x18, 0x0a, 0x16, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, - 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4e, + 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x7e, 0x0a, 0x14, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x6e, 0x65, 0x6d, 0x6f, 0x6e, 0x69, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x6e, 0x65, 0x6d, 0x6f, 0x6e, - 0x69, 0x63, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x17, + 0x69, 0x63, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x2e, + 0x0a, 0x13, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x79, 0x5f, 0x62, 0x6c, 0x6f, 0x63, 0x6b, + 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x62, 0x69, 0x72, + 0x74, 0x68, 0x64, 0x61, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x61, 0x73, 0x68, 0x22, 0x17, 0x0a, 0x15, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x0f, 0x0a, 0x0d, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x66, 0x0a, 0x0e, 0x53, 0x74, 0x61, 0x74, @@ -804,145 +922,156 @@ var file_ocean_v1alpha_wallet_proto_rawDesc = []byte{ 0x6e, 0x63, 0x65, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x75, 0x6e, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x75, 0x6e, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x22, 0x10, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x22, 0xde, 0x02, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x40, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, - 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x26, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x52, - 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x21, 0x0a, 0x0c, 0x6e, 0x61, 0x74, 0x69, - 0x76, 0x65, 0x5f, 0x61, 0x73, 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, - 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x41, 0x73, 0x73, 0x65, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x72, - 0x6f, 0x6f, 0x74, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, - 0x72, 0x6f, 0x6f, 0x74, 0x50, 0x61, 0x74, 0x68, 0x12, 0x2e, 0x0a, 0x13, 0x6d, 0x61, 0x73, 0x74, - 0x65, 0x72, 0x5f, 0x62, 0x6c, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x6b, 0x65, 0x79, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x42, 0x6c, 0x69, - 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x4b, 0x65, 0x79, 0x12, 0x36, 0x0a, 0x08, 0x61, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6f, 0x63, 0x65, - 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, - 0x22, 0x61, 0x0a, 0x07, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x17, 0x0a, 0x13, 0x4e, - 0x45, 0x54, 0x57, 0x4f, 0x52, 0x4b, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, - 0x45, 0x44, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x4e, 0x45, 0x54, 0x57, 0x4f, 0x52, 0x4b, 0x5f, - 0x4d, 0x41, 0x49, 0x4e, 0x4e, 0x45, 0x54, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x4e, 0x45, 0x54, - 0x57, 0x4f, 0x52, 0x4b, 0x5f, 0x54, 0x45, 0x53, 0x54, 0x4e, 0x45, 0x54, 0x10, 0x02, 0x12, 0x13, - 0x0a, 0x0f, 0x4e, 0x45, 0x54, 0x57, 0x4f, 0x52, 0x4b, 0x5f, 0x52, 0x45, 0x47, 0x54, 0x45, 0x53, - 0x54, 0x10, 0x03, 0x32, 0xc5, 0x04, 0x0a, 0x0d, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x53, 0x65, - 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x48, 0x0a, 0x07, 0x47, 0x65, 0x6e, 0x53, 0x65, 0x65, 0x64, - 0x12, 0x1d, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x47, 0x65, 0x6e, 0x53, 0x65, 0x65, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x1e, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x47, 0x65, 0x6e, 0x53, 0x65, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x57, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x12, - 0x22, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x45, 0x0a, 0x06, 0x55, 0x6e, 0x6c, 0x6f, - 0x63, 0x6b, 0x12, 0x1c, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x55, 0x6e, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x1d, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, + 0x73, 0x74, 0x22, 0xec, 0x03, 0x0a, 0x0f, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x07, 0x6e, 0x65, 0x74, 0x77, 0x6f, 0x72, + 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, + 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x2e, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x52, 0x07, 0x6e, 0x65, 0x74, 0x77, + 0x6f, 0x72, 0x6b, 0x12, 0x21, 0x0a, 0x0c, 0x6e, 0x61, 0x74, 0x69, 0x76, 0x65, 0x5f, 0x61, 0x73, + 0x73, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6e, 0x61, 0x74, 0x69, 0x76, + 0x65, 0x41, 0x73, 0x73, 0x65, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x72, 0x6f, 0x6f, 0x74, 0x5f, 0x70, + 0x61, 0x74, 0x68, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x72, 0x6f, 0x6f, 0x74, 0x50, + 0x61, 0x74, 0x68, 0x12, 0x2e, 0x0a, 0x13, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x5f, 0x62, 0x6c, + 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x11, 0x6d, 0x61, 0x73, 0x74, 0x65, 0x72, 0x42, 0x6c, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, + 0x4b, 0x65, 0x79, 0x12, 0x2e, 0x0a, 0x13, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x79, 0x5f, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x61, 0x73, 0x68, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x11, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x79, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x48, + 0x61, 0x73, 0x68, 0x12, 0x32, 0x0a, 0x15, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x79, 0x5f, + 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x0d, 0x52, 0x13, 0x62, 0x69, 0x72, 0x74, 0x68, 0x64, 0x61, 0x79, 0x42, 0x6c, 0x6f, 0x63, + 0x6b, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x31, 0x0a, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x6f, 0x63, 0x65, 0x61, + 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, + 0x52, 0x08, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x12, 0x32, 0x0a, 0x0a, 0x62, 0x75, + 0x69, 0x6c, 0x64, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, + 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x42, 0x75, 0x69, 0x6c, 0x64, 0x49, + 0x6e, 0x66, 0x6f, 0x52, 0x09, 0x62, 0x75, 0x69, 0x6c, 0x64, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x61, + 0x0a, 0x07, 0x4e, 0x65, 0x74, 0x77, 0x6f, 0x72, 0x6b, 0x12, 0x17, 0x0a, 0x13, 0x4e, 0x45, 0x54, + 0x57, 0x4f, 0x52, 0x4b, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, + 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x4e, 0x45, 0x54, 0x57, 0x4f, 0x52, 0x4b, 0x5f, 0x4d, 0x41, + 0x49, 0x4e, 0x4e, 0x45, 0x54, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x4e, 0x45, 0x54, 0x57, 0x4f, + 0x52, 0x4b, 0x5f, 0x54, 0x45, 0x53, 0x54, 0x4e, 0x45, 0x54, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, + 0x4e, 0x45, 0x54, 0x57, 0x4f, 0x52, 0x4b, 0x5f, 0x52, 0x45, 0x47, 0x54, 0x45, 0x53, 0x54, 0x10, + 0x03, 0x32, 0xb6, 0x04, 0x0a, 0x0d, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x53, 0x65, 0x72, 0x76, + 0x69, 0x63, 0x65, 0x12, 0x3e, 0x0a, 0x07, 0x47, 0x65, 0x6e, 0x53, 0x65, 0x65, 0x64, 0x12, 0x18, + 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x53, 0x65, 0x65, + 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x19, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, + 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x6e, 0x53, 0x65, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x12, 0x4d, 0x0a, 0x0c, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x57, 0x61, 0x6c, + 0x6c, 0x65, 0x74, 0x12, 0x1d, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x43, + 0x72, 0x65, 0x61, 0x74, 0x65, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, + 0x65, 0x61, 0x74, 0x65, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x12, 0x3b, 0x0a, 0x06, 0x55, 0x6e, 0x6c, 0x6f, 0x63, 0x6b, 0x12, 0x17, 0x2e, 0x6f, + 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x6e, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x6e, 0x6c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x5d, 0x0a, 0x0e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, - 0x64, 0x12, 0x24, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, - 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5a, - 0x0a, 0x0d, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x12, - 0x23, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x57, 0x61, 0x6c, 0x6c, - 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x45, 0x0a, 0x06, 0x53, 0x74, - 0x61, 0x74, 0x75, 0x73, 0x12, 0x1c, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x48, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1d, 0x2e, 0x6f, - 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x47, 0x65, 0x74, - 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x6f, 0x63, - 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x47, 0x65, 0x74, 0x49, - 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0xd8, 0x01, 0x0a, 0x11, - 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x42, 0x0b, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, - 0x5a, 0x61, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x76, 0x75, 0x6c, - 0x70, 0x65, 0x6d, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2f, 0x6f, 0x63, 0x65, 0x61, - 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2d, 0x73, 0x70, 0x65, 0x63, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x62, 0x75, 0x66, 0x2f, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x6f, 0x2f, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2f, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x3b, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0xa2, 0x02, 0x03, 0x4f, 0x58, 0x58, 0xaa, 0x02, 0x0d, 0x4f, 0x63, 0x65, 0x61, - 0x6e, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0xca, 0x02, 0x0d, 0x4f, 0x63, 0x65, 0x61, - 0x6e, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0xe2, 0x02, 0x19, 0x4f, 0x63, 0x65, 0x61, - 0x6e, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4f, 0x63, 0x65, 0x61, 0x6e, 0x3a, 0x3a, 0x56, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x35, 0x0a, 0x04, 0x4c, 0x6f, 0x63, 0x6b, 0x12, 0x15, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, + 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, + 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x63, 0x6b, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x53, 0x0a, 0x0e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, + 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1f, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, + 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, + 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6f, 0x63, 0x65, 0x61, + 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x50, 0x61, 0x73, 0x73, 0x77, + 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x50, 0x0a, 0x0d, 0x52, + 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x57, 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x12, 0x1e, 0x2e, 0x6f, + 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x57, + 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1f, 0x2e, 0x6f, + 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x57, + 0x61, 0x6c, 0x6c, 0x65, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3b, 0x0a, + 0x06, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x17, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, + 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x18, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, + 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x07, 0x47, 0x65, + 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x18, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, + 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, + 0x19, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, + 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0xa4, 0x01, 0x0a, 0x0c, 0x63, + 0x6f, 0x6d, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x57, 0x61, 0x6c, + 0x6c, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x46, 0x67, 0x69, 0x74, 0x68, + 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x76, 0x75, 0x6c, 0x70, 0x65, 0x6d, 0x76, 0x65, 0x6e, + 0x74, 0x75, 0x72, 0x65, 0x73, 0x2f, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2d, + 0x73, 0x70, 0x65, 0x63, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x67, 0x65, + 0x6e, 0x2f, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x6f, 0x63, 0x65, 0x61, 0x6e, + 0x76, 0x31, 0xa2, 0x02, 0x03, 0x4f, 0x58, 0x58, 0xaa, 0x02, 0x08, 0x4f, 0x63, 0x65, 0x61, 0x6e, + 0x2e, 0x56, 0x31, 0xca, 0x02, 0x08, 0x4f, 0x63, 0x65, 0x61, 0x6e, 0x5c, 0x56, 0x31, 0xe2, 0x02, + 0x14, 0x4f, 0x63, 0x65, 0x61, 0x6e, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, + 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x4f, 0x63, 0x65, 0x61, 0x6e, 0x3a, 0x3a, 0x56, + 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( - file_ocean_v1alpha_wallet_proto_rawDescOnce sync.Once - file_ocean_v1alpha_wallet_proto_rawDescData = file_ocean_v1alpha_wallet_proto_rawDesc + file_ocean_v1_wallet_proto_rawDescOnce sync.Once + file_ocean_v1_wallet_proto_rawDescData = file_ocean_v1_wallet_proto_rawDesc ) -func file_ocean_v1alpha_wallet_proto_rawDescGZIP() []byte { - file_ocean_v1alpha_wallet_proto_rawDescOnce.Do(func() { - file_ocean_v1alpha_wallet_proto_rawDescData = protoimpl.X.CompressGZIP(file_ocean_v1alpha_wallet_proto_rawDescData) +func file_ocean_v1_wallet_proto_rawDescGZIP() []byte { + file_ocean_v1_wallet_proto_rawDescOnce.Do(func() { + file_ocean_v1_wallet_proto_rawDescData = protoimpl.X.CompressGZIP(file_ocean_v1_wallet_proto_rawDescData) }) - return file_ocean_v1alpha_wallet_proto_rawDescData -} - -var file_ocean_v1alpha_wallet_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_ocean_v1alpha_wallet_proto_msgTypes = make([]protoimpl.MessageInfo, 14) -var file_ocean_v1alpha_wallet_proto_goTypes = []interface{}{ - (GetInfoResponse_Network)(0), // 0: ocean.v1alpha.GetInfoResponse.Network - (*GenSeedRequest)(nil), // 1: ocean.v1alpha.GenSeedRequest - (*GenSeedResponse)(nil), // 2: ocean.v1alpha.GenSeedResponse - (*CreateWalletRequest)(nil), // 3: ocean.v1alpha.CreateWalletRequest - (*CreateWalletResponse)(nil), // 4: ocean.v1alpha.CreateWalletResponse - (*UnlockRequest)(nil), // 5: ocean.v1alpha.UnlockRequest - (*UnlockResponse)(nil), // 6: ocean.v1alpha.UnlockResponse - (*ChangePasswordRequest)(nil), // 7: ocean.v1alpha.ChangePasswordRequest - (*ChangePasswordResponse)(nil), // 8: ocean.v1alpha.ChangePasswordResponse - (*RestoreWalletRequest)(nil), // 9: ocean.v1alpha.RestoreWalletRequest - (*RestoreWalletResponse)(nil), // 10: ocean.v1alpha.RestoreWalletResponse - (*StatusRequest)(nil), // 11: ocean.v1alpha.StatusRequest - (*StatusResponse)(nil), // 12: ocean.v1alpha.StatusResponse - (*GetInfoRequest)(nil), // 13: ocean.v1alpha.GetInfoRequest - (*GetInfoResponse)(nil), // 14: ocean.v1alpha.GetInfoResponse - (*AccountInfo)(nil), // 15: ocean.v1alpha.AccountInfo -} -var file_ocean_v1alpha_wallet_proto_depIdxs = []int32{ - 0, // 0: ocean.v1alpha.GetInfoResponse.network:type_name -> ocean.v1alpha.GetInfoResponse.Network - 15, // 1: ocean.v1alpha.GetInfoResponse.accounts:type_name -> ocean.v1alpha.AccountInfo - 1, // 2: ocean.v1alpha.WalletService.GenSeed:input_type -> ocean.v1alpha.GenSeedRequest - 3, // 3: ocean.v1alpha.WalletService.CreateWallet:input_type -> ocean.v1alpha.CreateWalletRequest - 5, // 4: ocean.v1alpha.WalletService.Unlock:input_type -> ocean.v1alpha.UnlockRequest - 7, // 5: ocean.v1alpha.WalletService.ChangePassword:input_type -> ocean.v1alpha.ChangePasswordRequest - 9, // 6: ocean.v1alpha.WalletService.RestoreWallet:input_type -> ocean.v1alpha.RestoreWalletRequest - 11, // 7: ocean.v1alpha.WalletService.Status:input_type -> ocean.v1alpha.StatusRequest - 13, // 8: ocean.v1alpha.WalletService.GetInfo:input_type -> ocean.v1alpha.GetInfoRequest - 2, // 9: ocean.v1alpha.WalletService.GenSeed:output_type -> ocean.v1alpha.GenSeedResponse - 4, // 10: ocean.v1alpha.WalletService.CreateWallet:output_type -> ocean.v1alpha.CreateWalletResponse - 6, // 11: ocean.v1alpha.WalletService.Unlock:output_type -> ocean.v1alpha.UnlockResponse - 8, // 12: ocean.v1alpha.WalletService.ChangePassword:output_type -> ocean.v1alpha.ChangePasswordResponse - 10, // 13: ocean.v1alpha.WalletService.RestoreWallet:output_type -> ocean.v1alpha.RestoreWalletResponse - 12, // 14: ocean.v1alpha.WalletService.Status:output_type -> ocean.v1alpha.StatusResponse - 14, // 15: ocean.v1alpha.WalletService.GetInfo:output_type -> ocean.v1alpha.GetInfoResponse - 9, // [9:16] is the sub-list for method output_type - 2, // [2:9] is the sub-list for method input_type - 2, // [2:2] is the sub-list for extension type_name - 2, // [2:2] is the sub-list for extension extendee - 0, // [0:2] is the sub-list for field type_name -} - -func init() { file_ocean_v1alpha_wallet_proto_init() } -func file_ocean_v1alpha_wallet_proto_init() { - if File_ocean_v1alpha_wallet_proto != nil { + return file_ocean_v1_wallet_proto_rawDescData +} + +var file_ocean_v1_wallet_proto_enumTypes = make([]protoimpl.EnumInfo, 1) +var file_ocean_v1_wallet_proto_msgTypes = make([]protoimpl.MessageInfo, 16) +var file_ocean_v1_wallet_proto_goTypes = []interface{}{ + (GetInfoResponse_Network)(0), // 0: ocean.v1.GetInfoResponse.Network + (*GenSeedRequest)(nil), // 1: ocean.v1.GenSeedRequest + (*GenSeedResponse)(nil), // 2: ocean.v1.GenSeedResponse + (*CreateWalletRequest)(nil), // 3: ocean.v1.CreateWalletRequest + (*CreateWalletResponse)(nil), // 4: ocean.v1.CreateWalletResponse + (*UnlockRequest)(nil), // 5: ocean.v1.UnlockRequest + (*UnlockResponse)(nil), // 6: ocean.v1.UnlockResponse + (*LockRequest)(nil), // 7: ocean.v1.LockRequest + (*LockResponse)(nil), // 8: ocean.v1.LockResponse + (*ChangePasswordRequest)(nil), // 9: ocean.v1.ChangePasswordRequest + (*ChangePasswordResponse)(nil), // 10: ocean.v1.ChangePasswordResponse + (*RestoreWalletRequest)(nil), // 11: ocean.v1.RestoreWalletRequest + (*RestoreWalletResponse)(nil), // 12: ocean.v1.RestoreWalletResponse + (*StatusRequest)(nil), // 13: ocean.v1.StatusRequest + (*StatusResponse)(nil), // 14: ocean.v1.StatusResponse + (*GetInfoRequest)(nil), // 15: ocean.v1.GetInfoRequest + (*GetInfoResponse)(nil), // 16: ocean.v1.GetInfoResponse + (*AccountInfo)(nil), // 17: ocean.v1.AccountInfo + (*BuildInfo)(nil), // 18: ocean.v1.BuildInfo +} +var file_ocean_v1_wallet_proto_depIdxs = []int32{ + 0, // 0: ocean.v1.GetInfoResponse.network:type_name -> ocean.v1.GetInfoResponse.Network + 17, // 1: ocean.v1.GetInfoResponse.accounts:type_name -> ocean.v1.AccountInfo + 18, // 2: ocean.v1.GetInfoResponse.build_info:type_name -> ocean.v1.BuildInfo + 1, // 3: ocean.v1.WalletService.GenSeed:input_type -> ocean.v1.GenSeedRequest + 3, // 4: ocean.v1.WalletService.CreateWallet:input_type -> ocean.v1.CreateWalletRequest + 5, // 5: ocean.v1.WalletService.Unlock:input_type -> ocean.v1.UnlockRequest + 7, // 6: ocean.v1.WalletService.Lock:input_type -> ocean.v1.LockRequest + 9, // 7: ocean.v1.WalletService.ChangePassword:input_type -> ocean.v1.ChangePasswordRequest + 11, // 8: ocean.v1.WalletService.RestoreWallet:input_type -> ocean.v1.RestoreWalletRequest + 13, // 9: ocean.v1.WalletService.Status:input_type -> ocean.v1.StatusRequest + 15, // 10: ocean.v1.WalletService.GetInfo:input_type -> ocean.v1.GetInfoRequest + 2, // 11: ocean.v1.WalletService.GenSeed:output_type -> ocean.v1.GenSeedResponse + 4, // 12: ocean.v1.WalletService.CreateWallet:output_type -> ocean.v1.CreateWalletResponse + 6, // 13: ocean.v1.WalletService.Unlock:output_type -> ocean.v1.UnlockResponse + 8, // 14: ocean.v1.WalletService.Lock:output_type -> ocean.v1.LockResponse + 10, // 15: ocean.v1.WalletService.ChangePassword:output_type -> ocean.v1.ChangePasswordResponse + 12, // 16: ocean.v1.WalletService.RestoreWallet:output_type -> ocean.v1.RestoreWalletResponse + 14, // 17: ocean.v1.WalletService.Status:output_type -> ocean.v1.StatusResponse + 16, // 18: ocean.v1.WalletService.GetInfo:output_type -> ocean.v1.GetInfoResponse + 11, // [11:19] is the sub-list for method output_type + 3, // [3:11] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name +} + +func init() { file_ocean_v1_wallet_proto_init() } +func file_ocean_v1_wallet_proto_init() { + if File_ocean_v1_wallet_proto != nil { return } - file_ocean_v1alpha_types_proto_init() + file_ocean_v1_types_proto_init() if !protoimpl.UnsafeEnabled { - file_ocean_v1alpha_wallet_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { + file_ocean_v1_wallet_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GenSeedRequest); i { case 0: return &v.state @@ -954,7 +1083,7 @@ func file_ocean_v1alpha_wallet_proto_init() { return nil } } - file_ocean_v1alpha_wallet_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + file_ocean_v1_wallet_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GenSeedResponse); i { case 0: return &v.state @@ -966,7 +1095,7 @@ func file_ocean_v1alpha_wallet_proto_init() { return nil } } - file_ocean_v1alpha_wallet_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + file_ocean_v1_wallet_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateWalletRequest); i { case 0: return &v.state @@ -978,7 +1107,7 @@ func file_ocean_v1alpha_wallet_proto_init() { return nil } } - file_ocean_v1alpha_wallet_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + file_ocean_v1_wallet_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*CreateWalletResponse); i { case 0: return &v.state @@ -990,7 +1119,7 @@ func file_ocean_v1alpha_wallet_proto_init() { return nil } } - file_ocean_v1alpha_wallet_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { + file_ocean_v1_wallet_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UnlockRequest); i { case 0: return &v.state @@ -1002,7 +1131,7 @@ func file_ocean_v1alpha_wallet_proto_init() { return nil } } - file_ocean_v1alpha_wallet_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { + file_ocean_v1_wallet_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UnlockResponse); i { case 0: return &v.state @@ -1014,7 +1143,31 @@ func file_ocean_v1alpha_wallet_proto_init() { return nil } } - file_ocean_v1alpha_wallet_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + file_ocean_v1_wallet_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LockRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ocean_v1_wallet_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*LockResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_ocean_v1_wallet_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ChangePasswordRequest); i { case 0: return &v.state @@ -1026,7 +1179,7 @@ func file_ocean_v1alpha_wallet_proto_init() { return nil } } - file_ocean_v1alpha_wallet_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { + file_ocean_v1_wallet_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*ChangePasswordResponse); i { case 0: return &v.state @@ -1038,7 +1191,7 @@ func file_ocean_v1alpha_wallet_proto_init() { return nil } } - file_ocean_v1alpha_wallet_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + file_ocean_v1_wallet_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RestoreWalletRequest); i { case 0: return &v.state @@ -1050,7 +1203,7 @@ func file_ocean_v1alpha_wallet_proto_init() { return nil } } - file_ocean_v1alpha_wallet_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { + file_ocean_v1_wallet_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RestoreWalletResponse); i { case 0: return &v.state @@ -1062,7 +1215,7 @@ func file_ocean_v1alpha_wallet_proto_init() { return nil } } - file_ocean_v1alpha_wallet_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { + file_ocean_v1_wallet_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*StatusRequest); i { case 0: return &v.state @@ -1074,7 +1227,7 @@ func file_ocean_v1alpha_wallet_proto_init() { return nil } } - file_ocean_v1alpha_wallet_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { + file_ocean_v1_wallet_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*StatusResponse); i { case 0: return &v.state @@ -1086,7 +1239,7 @@ func file_ocean_v1alpha_wallet_proto_init() { return nil } } - file_ocean_v1alpha_wallet_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + file_ocean_v1_wallet_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetInfoRequest); i { case 0: return &v.state @@ -1098,7 +1251,7 @@ func file_ocean_v1alpha_wallet_proto_init() { return nil } } - file_ocean_v1alpha_wallet_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + file_ocean_v1_wallet_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*GetInfoResponse); i { case 0: return &v.state @@ -1115,19 +1268,19 @@ func file_ocean_v1alpha_wallet_proto_init() { out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_ocean_v1alpha_wallet_proto_rawDesc, + RawDescriptor: file_ocean_v1_wallet_proto_rawDesc, NumEnums: 1, - NumMessages: 14, + NumMessages: 16, NumExtensions: 0, NumServices: 1, }, - GoTypes: file_ocean_v1alpha_wallet_proto_goTypes, - DependencyIndexes: file_ocean_v1alpha_wallet_proto_depIdxs, - EnumInfos: file_ocean_v1alpha_wallet_proto_enumTypes, - MessageInfos: file_ocean_v1alpha_wallet_proto_msgTypes, + GoTypes: file_ocean_v1_wallet_proto_goTypes, + DependencyIndexes: file_ocean_v1_wallet_proto_depIdxs, + EnumInfos: file_ocean_v1_wallet_proto_enumTypes, + MessageInfos: file_ocean_v1_wallet_proto_msgTypes, }.Build() - File_ocean_v1alpha_wallet_proto = out.File - file_ocean_v1alpha_wallet_proto_rawDesc = nil - file_ocean_v1alpha_wallet_proto_goTypes = nil - file_ocean_v1alpha_wallet_proto_depIdxs = nil + File_ocean_v1_wallet_proto = out.File + file_ocean_v1_wallet_proto_rawDesc = nil + file_ocean_v1_wallet_proto_goTypes = nil + file_ocean_v1_wallet_proto_depIdxs = nil } diff --git a/api-spec/protobuf/gen/go/ocean/v1alpha/wallet_grpc.pb.go b/api-spec/protobuf/gen/go/ocean/v1/wallet_grpc.pb.go similarity index 83% rename from api-spec/protobuf/gen/go/ocean/v1alpha/wallet_grpc.pb.go rename to api-spec/protobuf/gen/go/ocean/v1/wallet_grpc.pb.go index 75f48ab..862f198 100644 --- a/api-spec/protobuf/gen/go/ocean/v1alpha/wallet_grpc.pb.go +++ b/api-spec/protobuf/gen/go/ocean/v1/wallet_grpc.pb.go @@ -2,9 +2,9 @@ // versions: // - protoc-gen-go-grpc v1.2.0 // - protoc (unknown) -// source: ocean/v1alpha/wallet.proto +// source: ocean/v1/wallet.proto -package oceanv1alpha +package oceanv1 import ( context "context" @@ -30,6 +30,8 @@ type WalletServiceClient interface { CreateWallet(ctx context.Context, in *CreateWalletRequest, opts ...grpc.CallOption) (*CreateWalletResponse, error) // Unlock tries to unlock the HD Wallet using the given password. Unlock(ctx context.Context, in *UnlockRequest, opts ...grpc.CallOption) (*UnlockResponse, error) + // Lock locks the HD wallet. + Lock(ctx context.Context, in *LockRequest, opts ...grpc.CallOption) (*LockResponse, error) // ChangePassword changes the password used to encrypt/decrypt the HD seeds. // It requires the wallet to be locked. ChangePassword(ctx context.Context, in *ChangePasswordRequest, opts ...grpc.CallOption) (*ChangePasswordResponse, error) @@ -52,7 +54,7 @@ func NewWalletServiceClient(cc grpc.ClientConnInterface) WalletServiceClient { func (c *walletServiceClient) GenSeed(ctx context.Context, in *GenSeedRequest, opts ...grpc.CallOption) (*GenSeedResponse, error) { out := new(GenSeedResponse) - err := c.cc.Invoke(ctx, "/ocean.v1alpha.WalletService/GenSeed", in, out, opts...) + err := c.cc.Invoke(ctx, "/ocean.v1.WalletService/GenSeed", in, out, opts...) if err != nil { return nil, err } @@ -61,7 +63,7 @@ func (c *walletServiceClient) GenSeed(ctx context.Context, in *GenSeedRequest, o func (c *walletServiceClient) CreateWallet(ctx context.Context, in *CreateWalletRequest, opts ...grpc.CallOption) (*CreateWalletResponse, error) { out := new(CreateWalletResponse) - err := c.cc.Invoke(ctx, "/ocean.v1alpha.WalletService/CreateWallet", in, out, opts...) + err := c.cc.Invoke(ctx, "/ocean.v1.WalletService/CreateWallet", in, out, opts...) if err != nil { return nil, err } @@ -70,7 +72,16 @@ func (c *walletServiceClient) CreateWallet(ctx context.Context, in *CreateWallet func (c *walletServiceClient) Unlock(ctx context.Context, in *UnlockRequest, opts ...grpc.CallOption) (*UnlockResponse, error) { out := new(UnlockResponse) - err := c.cc.Invoke(ctx, "/ocean.v1alpha.WalletService/Unlock", in, out, opts...) + err := c.cc.Invoke(ctx, "/ocean.v1.WalletService/Unlock", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *walletServiceClient) Lock(ctx context.Context, in *LockRequest, opts ...grpc.CallOption) (*LockResponse, error) { + out := new(LockResponse) + err := c.cc.Invoke(ctx, "/ocean.v1.WalletService/Lock", in, out, opts...) if err != nil { return nil, err } @@ -79,7 +90,7 @@ func (c *walletServiceClient) Unlock(ctx context.Context, in *UnlockRequest, opt func (c *walletServiceClient) ChangePassword(ctx context.Context, in *ChangePasswordRequest, opts ...grpc.CallOption) (*ChangePasswordResponse, error) { out := new(ChangePasswordResponse) - err := c.cc.Invoke(ctx, "/ocean.v1alpha.WalletService/ChangePassword", in, out, opts...) + err := c.cc.Invoke(ctx, "/ocean.v1.WalletService/ChangePassword", in, out, opts...) if err != nil { return nil, err } @@ -88,7 +99,7 @@ func (c *walletServiceClient) ChangePassword(ctx context.Context, in *ChangePass func (c *walletServiceClient) RestoreWallet(ctx context.Context, in *RestoreWalletRequest, opts ...grpc.CallOption) (*RestoreWalletResponse, error) { out := new(RestoreWalletResponse) - err := c.cc.Invoke(ctx, "/ocean.v1alpha.WalletService/RestoreWallet", in, out, opts...) + err := c.cc.Invoke(ctx, "/ocean.v1.WalletService/RestoreWallet", in, out, opts...) if err != nil { return nil, err } @@ -97,7 +108,7 @@ func (c *walletServiceClient) RestoreWallet(ctx context.Context, in *RestoreWall func (c *walletServiceClient) Status(ctx context.Context, in *StatusRequest, opts ...grpc.CallOption) (*StatusResponse, error) { out := new(StatusResponse) - err := c.cc.Invoke(ctx, "/ocean.v1alpha.WalletService/Status", in, out, opts...) + err := c.cc.Invoke(ctx, "/ocean.v1.WalletService/Status", in, out, opts...) if err != nil { return nil, err } @@ -106,7 +117,7 @@ func (c *walletServiceClient) Status(ctx context.Context, in *StatusRequest, opt func (c *walletServiceClient) GetInfo(ctx context.Context, in *GetInfoRequest, opts ...grpc.CallOption) (*GetInfoResponse, error) { out := new(GetInfoResponse) - err := c.cc.Invoke(ctx, "/ocean.v1alpha.WalletService/GetInfo", in, out, opts...) + err := c.cc.Invoke(ctx, "/ocean.v1.WalletService/GetInfo", in, out, opts...) if err != nil { return nil, err } @@ -125,6 +136,8 @@ type WalletServiceServer interface { CreateWallet(context.Context, *CreateWalletRequest) (*CreateWalletResponse, error) // Unlock tries to unlock the HD Wallet using the given password. Unlock(context.Context, *UnlockRequest) (*UnlockResponse, error) + // Lock locks the HD wallet. + Lock(context.Context, *LockRequest) (*LockResponse, error) // ChangePassword changes the password used to encrypt/decrypt the HD seeds. // It requires the wallet to be locked. ChangePassword(context.Context, *ChangePasswordRequest) (*ChangePasswordResponse, error) @@ -150,6 +163,9 @@ func (UnimplementedWalletServiceServer) CreateWallet(context.Context, *CreateWal func (UnimplementedWalletServiceServer) Unlock(context.Context, *UnlockRequest) (*UnlockResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Unlock not implemented") } +func (UnimplementedWalletServiceServer) Lock(context.Context, *LockRequest) (*LockResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Lock not implemented") +} func (UnimplementedWalletServiceServer) ChangePassword(context.Context, *ChangePasswordRequest) (*ChangePasswordResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method ChangePassword not implemented") } @@ -184,7 +200,7 @@ func _WalletService_GenSeed_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ocean.v1alpha.WalletService/GenSeed", + FullMethod: "/ocean.v1.WalletService/GenSeed", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(WalletServiceServer).GenSeed(ctx, req.(*GenSeedRequest)) @@ -202,7 +218,7 @@ func _WalletService_CreateWallet_Handler(srv interface{}, ctx context.Context, d } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ocean.v1alpha.WalletService/CreateWallet", + FullMethod: "/ocean.v1.WalletService/CreateWallet", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(WalletServiceServer).CreateWallet(ctx, req.(*CreateWalletRequest)) @@ -220,7 +236,7 @@ func _WalletService_Unlock_Handler(srv interface{}, ctx context.Context, dec fun } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ocean.v1alpha.WalletService/Unlock", + FullMethod: "/ocean.v1.WalletService/Unlock", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(WalletServiceServer).Unlock(ctx, req.(*UnlockRequest)) @@ -228,6 +244,24 @@ func _WalletService_Unlock_Handler(srv interface{}, ctx context.Context, dec fun return interceptor(ctx, in, info, handler) } +func _WalletService_Lock_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(LockRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(WalletServiceServer).Lock(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/ocean.v1.WalletService/Lock", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(WalletServiceServer).Lock(ctx, req.(*LockRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _WalletService_ChangePassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(ChangePasswordRequest) if err := dec(in); err != nil { @@ -238,7 +272,7 @@ func _WalletService_ChangePassword_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ocean.v1alpha.WalletService/ChangePassword", + FullMethod: "/ocean.v1.WalletService/ChangePassword", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(WalletServiceServer).ChangePassword(ctx, req.(*ChangePasswordRequest)) @@ -256,7 +290,7 @@ func _WalletService_RestoreWallet_Handler(srv interface{}, ctx context.Context, } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ocean.v1alpha.WalletService/RestoreWallet", + FullMethod: "/ocean.v1.WalletService/RestoreWallet", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(WalletServiceServer).RestoreWallet(ctx, req.(*RestoreWalletRequest)) @@ -274,7 +308,7 @@ func _WalletService_Status_Handler(srv interface{}, ctx context.Context, dec fun } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ocean.v1alpha.WalletService/Status", + FullMethod: "/ocean.v1.WalletService/Status", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(WalletServiceServer).Status(ctx, req.(*StatusRequest)) @@ -292,7 +326,7 @@ func _WalletService_GetInfo_Handler(srv interface{}, ctx context.Context, dec fu } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/ocean.v1alpha.WalletService/GetInfo", + FullMethod: "/ocean.v1.WalletService/GetInfo", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { return srv.(WalletServiceServer).GetInfo(ctx, req.(*GetInfoRequest)) @@ -304,7 +338,7 @@ func _WalletService_GetInfo_Handler(srv interface{}, ctx context.Context, dec fu // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) var WalletService_ServiceDesc = grpc.ServiceDesc{ - ServiceName: "ocean.v1alpha.WalletService", + ServiceName: "ocean.v1.WalletService", HandlerType: (*WalletServiceServer)(nil), Methods: []grpc.MethodDesc{ { @@ -319,6 +353,10 @@ var WalletService_ServiceDesc = grpc.ServiceDesc{ MethodName: "Unlock", Handler: _WalletService_Unlock_Handler, }, + { + MethodName: "Lock", + Handler: _WalletService_Lock_Handler, + }, { MethodName: "ChangePassword", Handler: _WalletService_ChangePassword_Handler, @@ -337,5 +375,5 @@ var WalletService_ServiceDesc = grpc.ServiceDesc{ }, }, Streams: []grpc.StreamDesc{}, - Metadata: "ocean/v1alpha/wallet.proto", + Metadata: "ocean/v1/wallet.proto", } diff --git a/api-spec/protobuf/gen/go/ocean/v1alpha/account.pb.go b/api-spec/protobuf/gen/go/ocean/v1alpha/account.pb.go deleted file mode 100644 index bf629d2..0000000 --- a/api-spec/protobuf/gen/go/ocean/v1alpha/account.pb.go +++ /dev/null @@ -1,1158 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.1 -// protoc (unknown) -// source: ocean/v1alpha/account.proto - -package oceanv1alpha - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -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 CreateAccountRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Name of the account. - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *CreateAccountRequest) Reset() { - *x = CreateAccountRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_account_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateAccountRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateAccountRequest) ProtoMessage() {} - -func (x *CreateAccountRequest) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_account_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) -} - -// Deprecated: Use CreateAccountRequest.ProtoReflect.Descriptor instead. -func (*CreateAccountRequest) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_account_proto_rawDescGZIP(), []int{0} -} - -func (x *CreateAccountRequest) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -type CreateAccountResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Index assigned to the new account. - AccountIndex uint64 `protobuf:"varint,1,opt,name=account_index,json=accountIndex,proto3" json:"account_index,omitempty"` - // Xpub of the new account. - Xpub string `protobuf:"bytes,2,opt,name=xpub,proto3" json:"xpub,omitempty"` -} - -func (x *CreateAccountResponse) Reset() { - *x = CreateAccountResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_account_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *CreateAccountResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*CreateAccountResponse) ProtoMessage() {} - -func (x *CreateAccountResponse) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_account_proto_msgTypes[1] - 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) -} - -// Deprecated: Use CreateAccountResponse.ProtoReflect.Descriptor instead. -func (*CreateAccountResponse) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_account_proto_rawDescGZIP(), []int{1} -} - -func (x *CreateAccountResponse) GetAccountIndex() uint64 { - if x != nil { - return x.AccountIndex - } - return 0 -} - -func (x *CreateAccountResponse) GetXpub() string { - if x != nil { - return x.Xpub - } - return "" -} - -type SetAccountTemplateRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Account key. - AccountKey *AccountKey `protobuf:"bytes,1,opt,name=account_key,json=accountKey,proto3" json:"account_key,omitempty"` - // Output descriptor template. - Template *Template `protobuf:"bytes,2,opt,name=template,proto3" json:"template,omitempty"` -} - -func (x *SetAccountTemplateRequest) Reset() { - *x = SetAccountTemplateRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_account_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SetAccountTemplateRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetAccountTemplateRequest) ProtoMessage() {} - -func (x *SetAccountTemplateRequest) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_account_proto_msgTypes[2] - 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) -} - -// Deprecated: Use SetAccountTemplateRequest.ProtoReflect.Descriptor instead. -func (*SetAccountTemplateRequest) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_account_proto_rawDescGZIP(), []int{2} -} - -func (x *SetAccountTemplateRequest) GetAccountKey() *AccountKey { - if x != nil { - return x.AccountKey - } - return nil -} - -func (x *SetAccountTemplateRequest) GetTemplate() *Template { - if x != nil { - return x.Template - } - return nil -} - -type SetAccountTemplateResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *SetAccountTemplateResponse) Reset() { - *x = SetAccountTemplateResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_account_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *SetAccountTemplateResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*SetAccountTemplateResponse) ProtoMessage() {} - -func (x *SetAccountTemplateResponse) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_account_proto_msgTypes[3] - 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) -} - -// Deprecated: Use SetAccountTemplateResponse.ProtoReflect.Descriptor instead. -func (*SetAccountTemplateResponse) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_account_proto_rawDescGZIP(), []int{3} -} - -type DeriveAddressRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Account key. - AccountKey *AccountKey `protobuf:"bytes,1,opt,name=account_key,json=accountKey,proto3" json:"account_key,omitempty"` - // The number of addresses to generate. - NumOfAddresses uint64 `protobuf:"varint,2,opt,name=num_of_addresses,json=numOfAddresses,proto3" json:"num_of_addresses,omitempty"` -} - -func (x *DeriveAddressRequest) Reset() { - *x = DeriveAddressRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_account_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeriveAddressRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeriveAddressRequest) ProtoMessage() {} - -func (x *DeriveAddressRequest) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_account_proto_msgTypes[4] - 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) -} - -// Deprecated: Use DeriveAddressRequest.ProtoReflect.Descriptor instead. -func (*DeriveAddressRequest) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_account_proto_rawDescGZIP(), []int{4} -} - -func (x *DeriveAddressRequest) GetAccountKey() *AccountKey { - if x != nil { - return x.AccountKey - } - return nil -} - -func (x *DeriveAddressRequest) GetNumOfAddresses() uint64 { - if x != nil { - return x.NumOfAddresses - } - return 0 -} - -type DeriveAddressResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Addresses []string `protobuf:"bytes,1,rep,name=addresses,proto3" json:"addresses,omitempty"` -} - -func (x *DeriveAddressResponse) Reset() { - *x = DeriveAddressResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_account_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeriveAddressResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeriveAddressResponse) ProtoMessage() {} - -func (x *DeriveAddressResponse) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_account_proto_msgTypes[5] - 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) -} - -// Deprecated: Use DeriveAddressResponse.ProtoReflect.Descriptor instead. -func (*DeriveAddressResponse) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_account_proto_rawDescGZIP(), []int{5} -} - -func (x *DeriveAddressResponse) GetAddresses() []string { - if x != nil { - return x.Addresses - } - return nil -} - -type DeriveChangeAddressRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Account key. - AccountKey *AccountKey `protobuf:"bytes,1,opt,name=account_key,json=accountKey,proto3" json:"account_key,omitempty"` - // The number of addresses to generate. - NumOfAddresses uint64 `protobuf:"varint,2,opt,name=num_of_addresses,json=numOfAddresses,proto3" json:"num_of_addresses,omitempty"` -} - -func (x *DeriveChangeAddressRequest) Reset() { - *x = DeriveChangeAddressRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_account_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeriveChangeAddressRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeriveChangeAddressRequest) ProtoMessage() {} - -func (x *DeriveChangeAddressRequest) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_account_proto_msgTypes[6] - 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) -} - -// Deprecated: Use DeriveChangeAddressRequest.ProtoReflect.Descriptor instead. -func (*DeriveChangeAddressRequest) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_account_proto_rawDescGZIP(), []int{6} -} - -func (x *DeriveChangeAddressRequest) GetAccountKey() *AccountKey { - if x != nil { - return x.AccountKey - } - return nil -} - -func (x *DeriveChangeAddressRequest) GetNumOfAddresses() uint64 { - if x != nil { - return x.NumOfAddresses - } - return 0 -} - -type DeriveChangeAddressResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Addresses []string `protobuf:"bytes,1,rep,name=addresses,proto3" json:"addresses,omitempty"` -} - -func (x *DeriveChangeAddressResponse) Reset() { - *x = DeriveChangeAddressResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_account_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *DeriveChangeAddressResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*DeriveChangeAddressResponse) ProtoMessage() {} - -func (x *DeriveChangeAddressResponse) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_account_proto_msgTypes[7] - 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) -} - -// Deprecated: Use DeriveChangeAddressResponse.ProtoReflect.Descriptor instead. -func (*DeriveChangeAddressResponse) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_account_proto_rawDescGZIP(), []int{7} -} - -func (x *DeriveChangeAddressResponse) GetAddresses() []string { - if x != nil { - return x.Addresses - } - return nil -} - -type ListAddressesRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Account key. - AccountKey *AccountKey `protobuf:"bytes,1,opt,name=account_key,json=accountKey,proto3" json:"account_key,omitempty"` -} - -func (x *ListAddressesRequest) Reset() { - *x = ListAddressesRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_account_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListAddressesRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListAddressesRequest) ProtoMessage() {} - -func (x *ListAddressesRequest) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_account_proto_msgTypes[8] - 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) -} - -// Deprecated: Use ListAddressesRequest.ProtoReflect.Descriptor instead. -func (*ListAddressesRequest) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_account_proto_rawDescGZIP(), []int{8} -} - -func (x *ListAddressesRequest) GetAccountKey() *AccountKey { - if x != nil { - return x.AccountKey - } - return nil -} - -type ListAddressesResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Addresses []string `protobuf:"bytes,1,rep,name=addresses,proto3" json:"addresses,omitempty"` -} - -func (x *ListAddressesResponse) Reset() { - *x = ListAddressesResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_account_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListAddressesResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListAddressesResponse) ProtoMessage() {} - -func (x *ListAddressesResponse) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_account_proto_msgTypes[9] - 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) -} - -// Deprecated: Use ListAddressesResponse.ProtoReflect.Descriptor instead. -func (*ListAddressesResponse) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_account_proto_rawDescGZIP(), []int{9} -} - -func (x *ListAddressesResponse) GetAddresses() []string { - if x != nil { - return x.Addresses - } - return nil -} - -type BalanceRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Account key. - AccountKey *AccountKey `protobuf:"bytes,1,opt,name=account_key,json=accountKey,proto3" json:"account_key,omitempty"` - // Addresses for which calculating balance. If not specified, the cumulative - // balance is returned. - Addresses []string `protobuf:"bytes,3,rep,name=addresses,proto3" json:"addresses,omitempty"` -} - -func (x *BalanceRequest) Reset() { - *x = BalanceRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_account_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BalanceRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BalanceRequest) ProtoMessage() {} - -func (x *BalanceRequest) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_account_proto_msgTypes[10] - 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) -} - -// Deprecated: Use BalanceRequest.ProtoReflect.Descriptor instead. -func (*BalanceRequest) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_account_proto_rawDescGZIP(), []int{10} -} - -func (x *BalanceRequest) GetAccountKey() *AccountKey { - if x != nil { - return x.AccountKey - } - return nil -} - -func (x *BalanceRequest) GetAddresses() []string { - if x != nil { - return x.Addresses - } - return nil -} - -type BalanceResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The balance (total, confirmed, unconfirmed) per each asset. - Balance map[string]*BalanceInfo `protobuf:"bytes,1,rep,name=balance,proto3" json:"balance,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (x *BalanceResponse) Reset() { - *x = BalanceResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_account_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BalanceResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BalanceResponse) ProtoMessage() {} - -func (x *BalanceResponse) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_account_proto_msgTypes[11] - 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) -} - -// Deprecated: Use BalanceResponse.ProtoReflect.Descriptor instead. -func (*BalanceResponse) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_account_proto_rawDescGZIP(), []int{11} -} - -func (x *BalanceResponse) GetBalance() map[string]*BalanceInfo { - if x != nil { - return x.Balance - } - return nil -} - -type ListUtxosRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Account key. - AccountKey *AccountKey `protobuf:"bytes,1,opt,name=account_key,json=accountKey,proto3" json:"account_key,omitempty"` - // List of account's addresses for which listing utxos. If not specified, - // the list of all utxos owned by the account is returned. - Addresses []string `protobuf:"bytes,3,rep,name=addresses,proto3" json:"addresses,omitempty"` -} - -func (x *ListUtxosRequest) Reset() { - *x = ListUtxosRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_account_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListUtxosRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListUtxosRequest) ProtoMessage() {} - -func (x *ListUtxosRequest) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_account_proto_msgTypes[12] - 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) -} - -// Deprecated: Use ListUtxosRequest.ProtoReflect.Descriptor instead. -func (*ListUtxosRequest) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_account_proto_rawDescGZIP(), []int{12} -} - -func (x *ListUtxosRequest) GetAccountKey() *AccountKey { - if x != nil { - return x.AccountKey - } - return nil -} - -func (x *ListUtxosRequest) GetAddresses() []string { - if x != nil { - return x.Addresses - } - return nil -} - -type ListUtxosResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // List of spendable utxos. - SpendableUtxos *Utxos `protobuf:"bytes,1,opt,name=spendable_utxos,json=spendableUtxos,proto3" json:"spendable_utxos,omitempty"` - // List of currently locked utxos. - LockedUtxos *Utxos `protobuf:"bytes,2,opt,name=locked_utxos,json=lockedUtxos,proto3" json:"locked_utxos,omitempty"` -} - -func (x *ListUtxosResponse) Reset() { - *x = ListUtxosResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_account_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListUtxosResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListUtxosResponse) ProtoMessage() {} - -func (x *ListUtxosResponse) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_account_proto_msgTypes[13] - 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) -} - -// Deprecated: Use ListUtxosResponse.ProtoReflect.Descriptor instead. -func (*ListUtxosResponse) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_account_proto_rawDescGZIP(), []int{13} -} - -func (x *ListUtxosResponse) GetSpendableUtxos() *Utxos { - if x != nil { - return x.SpendableUtxos - } - return nil -} - -func (x *ListUtxosResponse) GetLockedUtxos() *Utxos { - if x != nil { - return x.LockedUtxos - } - return nil -} - -var File_ocean_v1alpha_account_proto protoreflect.FileDescriptor - -var file_ocean_v1alpha_account_proto_rawDesc = []byte{ - 0x0a, 0x1b, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, - 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x6f, - 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x1a, 0x19, 0x6f, 0x63, - 0x65, 0x61, 0x6e, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x74, 0x79, 0x70, 0x65, - 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2a, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, - 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x22, 0x50, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x23, 0x0a, 0x0d, - 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x0c, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x64, 0x65, - 0x78, 0x12, 0x12, 0x0a, 0x04, 0x78, 0x70, 0x75, 0x62, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x78, 0x70, 0x75, 0x62, 0x22, 0x8c, 0x01, 0x0a, 0x19, 0x53, 0x65, 0x74, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x3a, 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6b, - 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x4b, 0x65, 0x79, 0x52, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, - 0x33, 0x0a, 0x08, 0x74, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x17, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x08, 0x74, 0x65, 0x6d, 0x70, - 0x6c, 0x61, 0x74, 0x65, 0x22, 0x1c, 0x0a, 0x1a, 0x53, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x22, 0x7c, 0x0a, 0x14, 0x44, 0x65, 0x72, 0x69, 0x76, 0x65, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3a, 0x0a, 0x0b, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x19, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x0a, 0x61, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x28, 0x0a, 0x10, 0x6e, 0x75, 0x6d, 0x5f, 0x6f, 0x66, - 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x0e, 0x6e, 0x75, 0x6d, 0x4f, 0x66, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, - 0x22, 0x35, 0x0a, 0x15, 0x44, 0x65, 0x72, 0x69, 0x76, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x61, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x22, 0x82, 0x01, 0x0a, 0x1a, 0x44, 0x65, 0x72, 0x69, - 0x76, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3a, 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6f, 0x63, - 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x41, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4b, - 0x65, 0x79, 0x12, 0x28, 0x0a, 0x10, 0x6e, 0x75, 0x6d, 0x5f, 0x6f, 0x66, 0x5f, 0x61, 0x64, 0x64, - 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0e, 0x6e, 0x75, - 0x6d, 0x4f, 0x66, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x22, 0x3b, 0x0a, 0x1b, - 0x44, 0x65, 0x72, 0x69, 0x76, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x41, 0x64, 0x64, 0x72, - 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, - 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x22, 0x52, 0x0a, 0x14, 0x4c, 0x69, 0x73, - 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x12, 0x3a, 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4b, 0x65, - 0x79, 0x52, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x22, 0x35, 0x0a, - 0x15, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x65, 0x73, 0x22, 0x6a, 0x0a, 0x0e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3a, 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6f, 0x63, - 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x41, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4b, - 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, - 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, - 0x22, 0xb0, 0x01, 0x0a, 0x0f, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x45, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, - 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2b, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x1a, 0x56, 0x0a, 0x0c, 0x42, - 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, - 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x30, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6f, - 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x42, 0x61, 0x6c, - 0x61, 0x6e, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, - 0x02, 0x38, 0x01, 0x22, 0x6c, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x74, 0x78, 0x6f, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3a, 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6f, - 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x41, 0x63, 0x63, - 0x6f, 0x75, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x4b, 0x65, 0x79, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, - 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x09, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, - 0x73, 0x22, 0x8b, 0x01, 0x0a, 0x11, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x74, 0x78, 0x6f, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x0f, 0x73, 0x70, 0x65, 0x6e, 0x64, - 0x61, 0x62, 0x6c, 0x65, 0x5f, 0x75, 0x74, 0x78, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x14, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2e, 0x55, 0x74, 0x78, 0x6f, 0x73, 0x52, 0x0e, 0x73, 0x70, 0x65, 0x6e, 0x64, 0x61, 0x62, 0x6c, - 0x65, 0x55, 0x74, 0x78, 0x6f, 0x73, 0x12, 0x37, 0x0a, 0x0c, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, - 0x5f, 0x75, 0x74, 0x78, 0x6f, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6f, - 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x55, 0x74, 0x78, - 0x6f, 0x73, 0x52, 0x0b, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x55, 0x74, 0x78, 0x6f, 0x73, 0x32, - 0x97, 0x05, 0x0a, 0x0e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, - 0x63, 0x65, 0x12, 0x5a, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x12, 0x23, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x41, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x69, - 0x0a, 0x12, 0x53, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x54, 0x65, 0x6d, 0x70, - 0x6c, 0x61, 0x74, 0x65, 0x12, 0x28, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x53, 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x54, - 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, - 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x53, - 0x65, 0x74, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5a, 0x0a, 0x0d, 0x44, 0x65, 0x72, - 0x69, 0x76, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x23, 0x2e, 0x6f, 0x63, 0x65, - 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, 0x65, 0x72, 0x69, 0x76, - 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x24, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x44, 0x65, 0x72, 0x69, 0x76, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x6c, 0x0a, 0x13, 0x44, 0x65, 0x72, 0x69, 0x76, 0x65, 0x43, - 0x68, 0x61, 0x6e, 0x67, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x29, 0x2e, 0x6f, - 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, 0x65, 0x72, - 0x69, 0x76, 0x65, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x44, 0x65, 0x72, 0x69, 0x76, 0x65, 0x43, 0x68, - 0x61, 0x6e, 0x67, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x12, 0x5a, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x65, 0x73, 0x12, 0x23, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x6f, 0x63, 0x65, 0x61, - 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, - 0x48, 0x0a, 0x07, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1d, 0x2e, 0x6f, 0x63, 0x65, - 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e, - 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x6f, 0x63, 0x65, 0x61, - 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x4e, 0x0a, 0x09, 0x4c, 0x69, 0x73, - 0x74, 0x55, 0x74, 0x78, 0x6f, 0x73, 0x12, 0x1f, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x74, 0x78, 0x6f, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x74, 0x78, 0x6f, - 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x42, 0xd9, 0x01, 0x0a, 0x11, 0x63, 0x6f, - 0x6d, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x42, - 0x0c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, - 0x61, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x76, 0x75, 0x6c, 0x70, - 0x65, 0x6d, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2f, 0x6f, 0x63, 0x65, 0x61, 0x6e, - 0x2f, 0x61, 0x70, 0x69, 0x2d, 0x73, 0x70, 0x65, 0x63, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, - 0x75, 0x66, 0x2f, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x6f, 0x2f, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2f, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x3b, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0xa2, 0x02, 0x03, 0x4f, 0x58, 0x58, 0xaa, 0x02, 0x0d, 0x4f, 0x63, 0x65, 0x61, 0x6e, - 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0xca, 0x02, 0x0d, 0x4f, 0x63, 0x65, 0x61, 0x6e, - 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0xe2, 0x02, 0x19, 0x4f, 0x63, 0x65, 0x61, 0x6e, - 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4f, 0x63, 0x65, 0x61, 0x6e, 0x3a, 0x3a, 0x56, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_ocean_v1alpha_account_proto_rawDescOnce sync.Once - file_ocean_v1alpha_account_proto_rawDescData = file_ocean_v1alpha_account_proto_rawDesc -) - -func file_ocean_v1alpha_account_proto_rawDescGZIP() []byte { - file_ocean_v1alpha_account_proto_rawDescOnce.Do(func() { - file_ocean_v1alpha_account_proto_rawDescData = protoimpl.X.CompressGZIP(file_ocean_v1alpha_account_proto_rawDescData) - }) - return file_ocean_v1alpha_account_proto_rawDescData -} - -var file_ocean_v1alpha_account_proto_msgTypes = make([]protoimpl.MessageInfo, 15) -var file_ocean_v1alpha_account_proto_goTypes = []interface{}{ - (*CreateAccountRequest)(nil), // 0: ocean.v1alpha.CreateAccountRequest - (*CreateAccountResponse)(nil), // 1: ocean.v1alpha.CreateAccountResponse - (*SetAccountTemplateRequest)(nil), // 2: ocean.v1alpha.SetAccountTemplateRequest - (*SetAccountTemplateResponse)(nil), // 3: ocean.v1alpha.SetAccountTemplateResponse - (*DeriveAddressRequest)(nil), // 4: ocean.v1alpha.DeriveAddressRequest - (*DeriveAddressResponse)(nil), // 5: ocean.v1alpha.DeriveAddressResponse - (*DeriveChangeAddressRequest)(nil), // 6: ocean.v1alpha.DeriveChangeAddressRequest - (*DeriveChangeAddressResponse)(nil), // 7: ocean.v1alpha.DeriveChangeAddressResponse - (*ListAddressesRequest)(nil), // 8: ocean.v1alpha.ListAddressesRequest - (*ListAddressesResponse)(nil), // 9: ocean.v1alpha.ListAddressesResponse - (*BalanceRequest)(nil), // 10: ocean.v1alpha.BalanceRequest - (*BalanceResponse)(nil), // 11: ocean.v1alpha.BalanceResponse - (*ListUtxosRequest)(nil), // 12: ocean.v1alpha.ListUtxosRequest - (*ListUtxosResponse)(nil), // 13: ocean.v1alpha.ListUtxosResponse - nil, // 14: ocean.v1alpha.BalanceResponse.BalanceEntry - (*AccountKey)(nil), // 15: ocean.v1alpha.AccountKey - (*Template)(nil), // 16: ocean.v1alpha.Template - (*Utxos)(nil), // 17: ocean.v1alpha.Utxos - (*BalanceInfo)(nil), // 18: ocean.v1alpha.BalanceInfo -} -var file_ocean_v1alpha_account_proto_depIdxs = []int32{ - 15, // 0: ocean.v1alpha.SetAccountTemplateRequest.account_key:type_name -> ocean.v1alpha.AccountKey - 16, // 1: ocean.v1alpha.SetAccountTemplateRequest.template:type_name -> ocean.v1alpha.Template - 15, // 2: ocean.v1alpha.DeriveAddressRequest.account_key:type_name -> ocean.v1alpha.AccountKey - 15, // 3: ocean.v1alpha.DeriveChangeAddressRequest.account_key:type_name -> ocean.v1alpha.AccountKey - 15, // 4: ocean.v1alpha.ListAddressesRequest.account_key:type_name -> ocean.v1alpha.AccountKey - 15, // 5: ocean.v1alpha.BalanceRequest.account_key:type_name -> ocean.v1alpha.AccountKey - 14, // 6: ocean.v1alpha.BalanceResponse.balance:type_name -> ocean.v1alpha.BalanceResponse.BalanceEntry - 15, // 7: ocean.v1alpha.ListUtxosRequest.account_key:type_name -> ocean.v1alpha.AccountKey - 17, // 8: ocean.v1alpha.ListUtxosResponse.spendable_utxos:type_name -> ocean.v1alpha.Utxos - 17, // 9: ocean.v1alpha.ListUtxosResponse.locked_utxos:type_name -> ocean.v1alpha.Utxos - 18, // 10: ocean.v1alpha.BalanceResponse.BalanceEntry.value:type_name -> ocean.v1alpha.BalanceInfo - 0, // 11: ocean.v1alpha.AccountService.CreateAccount:input_type -> ocean.v1alpha.CreateAccountRequest - 2, // 12: ocean.v1alpha.AccountService.SetAccountTemplate:input_type -> ocean.v1alpha.SetAccountTemplateRequest - 4, // 13: ocean.v1alpha.AccountService.DeriveAddress:input_type -> ocean.v1alpha.DeriveAddressRequest - 6, // 14: ocean.v1alpha.AccountService.DeriveChangeAddress:input_type -> ocean.v1alpha.DeriveChangeAddressRequest - 8, // 15: ocean.v1alpha.AccountService.ListAddresses:input_type -> ocean.v1alpha.ListAddressesRequest - 10, // 16: ocean.v1alpha.AccountService.Balance:input_type -> ocean.v1alpha.BalanceRequest - 12, // 17: ocean.v1alpha.AccountService.ListUtxos:input_type -> ocean.v1alpha.ListUtxosRequest - 1, // 18: ocean.v1alpha.AccountService.CreateAccount:output_type -> ocean.v1alpha.CreateAccountResponse - 3, // 19: ocean.v1alpha.AccountService.SetAccountTemplate:output_type -> ocean.v1alpha.SetAccountTemplateResponse - 5, // 20: ocean.v1alpha.AccountService.DeriveAddress:output_type -> ocean.v1alpha.DeriveAddressResponse - 7, // 21: ocean.v1alpha.AccountService.DeriveChangeAddress:output_type -> ocean.v1alpha.DeriveChangeAddressResponse - 9, // 22: ocean.v1alpha.AccountService.ListAddresses:output_type -> ocean.v1alpha.ListAddressesResponse - 11, // 23: ocean.v1alpha.AccountService.Balance:output_type -> ocean.v1alpha.BalanceResponse - 13, // 24: ocean.v1alpha.AccountService.ListUtxos:output_type -> ocean.v1alpha.ListUtxosResponse - 18, // [18:25] is the sub-list for method output_type - 11, // [11:18] is the sub-list for method input_type - 11, // [11:11] is the sub-list for extension type_name - 11, // [11:11] is the sub-list for extension extendee - 0, // [0:11] is the sub-list for field type_name -} - -func init() { file_ocean_v1alpha_account_proto_init() } -func file_ocean_v1alpha_account_proto_init() { - if File_ocean_v1alpha_account_proto != nil { - return - } - file_ocean_v1alpha_types_proto_init() - if !protoimpl.UnsafeEnabled { - file_ocean_v1alpha_account_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateAccountRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ocean_v1alpha_account_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*CreateAccountResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ocean_v1alpha_account_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SetAccountTemplateRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ocean_v1alpha_account_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*SetAccountTemplateResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ocean_v1alpha_account_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeriveAddressRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ocean_v1alpha_account_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeriveAddressResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ocean_v1alpha_account_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeriveChangeAddressRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ocean_v1alpha_account_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DeriveChangeAddressResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ocean_v1alpha_account_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListAddressesRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ocean_v1alpha_account_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListAddressesResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ocean_v1alpha_account_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BalanceRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ocean_v1alpha_account_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BalanceResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ocean_v1alpha_account_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListUtxosRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ocean_v1alpha_account_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListUtxosResponse); 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_ocean_v1alpha_account_proto_rawDesc, - NumEnums: 0, - NumMessages: 15, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_ocean_v1alpha_account_proto_goTypes, - DependencyIndexes: file_ocean_v1alpha_account_proto_depIdxs, - MessageInfos: file_ocean_v1alpha_account_proto_msgTypes, - }.Build() - File_ocean_v1alpha_account_proto = out.File - file_ocean_v1alpha_account_proto_rawDesc = nil - file_ocean_v1alpha_account_proto_goTypes = nil - file_ocean_v1alpha_account_proto_depIdxs = nil -} diff --git a/api-spec/protobuf/gen/go/ocean/v1alpha/notification.pb.go b/api-spec/protobuf/gen/go/ocean/v1alpha/notification.pb.go deleted file mode 100644 index b9277a5..0000000 --- a/api-spec/protobuf/gen/go/ocean/v1alpha/notification.pb.go +++ /dev/null @@ -1,972 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.1 -// protoc (unknown) -// source: ocean/v1alpha/notification.proto - -package oceanv1alpha - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -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 TransactionNotificationsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The wallet account for which getting notified. If not specified, - // notifications for all accounts' txs are sent. - AccountKey *AccountKey `protobuf:"bytes,1,opt,name=account_key,json=accountKey,proto3" json:"account_key,omitempty"` -} - -func (x *TransactionNotificationsRequest) Reset() { - *x = TransactionNotificationsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_notification_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *TransactionNotificationsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TransactionNotificationsRequest) ProtoMessage() {} - -func (x *TransactionNotificationsRequest) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_notification_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) -} - -// Deprecated: Use TransactionNotificationsRequest.ProtoReflect.Descriptor instead. -func (*TransactionNotificationsRequest) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_notification_proto_rawDescGZIP(), []int{0} -} - -func (x *TransactionNotificationsRequest) GetAccountKey() *AccountKey { - if x != nil { - return x.AccountKey - } - return nil -} - -type TransactionNotificationsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Account key. - AccountKey *AccountKey `protobuf:"bytes,1,opt,name=account_key,json=accountKey,proto3" json:"account_key,omitempty"` - // Txid of transaction. - Txid string `protobuf:"bytes,2,opt,name=txid,proto3" json:"txid,omitempty"` - // Tx event type. - EventType TxEventType `protobuf:"varint,3,opt,name=event_type,json=eventType,proto3,enum=ocean.v1alpha.TxEventType" json:"event_type,omitempty"` - // Details of the block including the tx. - BlockDetails *BlockDetails `protobuf:"bytes,4,opt,name=block_details,json=blockDetails,proto3" json:"block_details,omitempty"` -} - -func (x *TransactionNotificationsResponse) Reset() { - *x = TransactionNotificationsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_notification_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *TransactionNotificationsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*TransactionNotificationsResponse) ProtoMessage() {} - -func (x *TransactionNotificationsResponse) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_notification_proto_msgTypes[1] - 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) -} - -// Deprecated: Use TransactionNotificationsResponse.ProtoReflect.Descriptor instead. -func (*TransactionNotificationsResponse) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_notification_proto_rawDescGZIP(), []int{1} -} - -func (x *TransactionNotificationsResponse) GetAccountKey() *AccountKey { - if x != nil { - return x.AccountKey - } - return nil -} - -func (x *TransactionNotificationsResponse) GetTxid() string { - if x != nil { - return x.Txid - } - return "" -} - -func (x *TransactionNotificationsResponse) GetEventType() TxEventType { - if x != nil { - return x.EventType - } - return TxEventType_TX_EVENT_TYPE_UNSPECIFIED -} - -func (x *TransactionNotificationsResponse) GetBlockDetails() *BlockDetails { - if x != nil { - return x.BlockDetails - } - return nil -} - -type UtxosNotificationsRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The wallet account for which getting notified. If not specified, - // notifications for all accounts' utxos are sent. - AccountKey *AccountKey `protobuf:"bytes,1,opt,name=account_key,json=accountKey,proto3" json:"account_key,omitempty"` -} - -func (x *UtxosNotificationsRequest) Reset() { - *x = UtxosNotificationsRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_notification_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UtxosNotificationsRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UtxosNotificationsRequest) ProtoMessage() {} - -func (x *UtxosNotificationsRequest) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_notification_proto_msgTypes[2] - 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) -} - -// Deprecated: Use UtxosNotificationsRequest.ProtoReflect.Descriptor instead. -func (*UtxosNotificationsRequest) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_notification_proto_rawDescGZIP(), []int{2} -} - -func (x *UtxosNotificationsRequest) GetAccountKey() *AccountKey { - if x != nil { - return x.AccountKey - } - return nil -} - -type UtxosNotificationsResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Account key. - AccountKey *AccountKey `protobuf:"bytes,1,opt,name=account_key,json=accountKey,proto3" json:"account_key,omitempty"` - // The unspent output. - Utxo *Utxo `protobuf:"bytes,2,opt,name=utxo,proto3" json:"utxo,omitempty"` - // The event regarding the utxo. - EventType UtxoEventType `protobuf:"varint,3,opt,name=event_type,json=eventType,proto3,enum=ocean.v1alpha.UtxoEventType" json:"event_type,omitempty"` -} - -func (x *UtxosNotificationsResponse) Reset() { - *x = UtxosNotificationsResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_notification_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *UtxosNotificationsResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*UtxosNotificationsResponse) ProtoMessage() {} - -func (x *UtxosNotificationsResponse) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_notification_proto_msgTypes[3] - 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) -} - -// Deprecated: Use UtxosNotificationsResponse.ProtoReflect.Descriptor instead. -func (*UtxosNotificationsResponse) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_notification_proto_rawDescGZIP(), []int{3} -} - -func (x *UtxosNotificationsResponse) GetAccountKey() *AccountKey { - if x != nil { - return x.AccountKey - } - return nil -} - -func (x *UtxosNotificationsResponse) GetUtxo() *Utxo { - if x != nil { - return x.Utxo - } - return nil -} - -func (x *UtxosNotificationsResponse) GetEventType() UtxoEventType { - if x != nil { - return x.EventType - } - return UtxoEventType_UTXO_EVENT_TYPE_UNSPECIFIED -} - -type AddWebhookRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The endpoint of the external service to reach. - Endpoint string `protobuf:"bytes,1,opt,name=endpoint,proto3" json:"endpoint,omitempty"` - // The event type for which the webhook should be registered. - EventType WebhookEventType `protobuf:"varint,2,opt,name=event_type,json=eventType,proto3,enum=ocean.v1alpha.WebhookEventType" json:"event_type,omitempty"` - // The secret to use for signign a JWT token for an authenticated request - // to the external service. - Secret string `protobuf:"bytes,3,opt,name=secret,proto3" json:"secret,omitempty"` -} - -func (x *AddWebhookRequest) Reset() { - *x = AddWebhookRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_notification_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AddWebhookRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddWebhookRequest) ProtoMessage() {} - -func (x *AddWebhookRequest) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_notification_proto_msgTypes[4] - 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) -} - -// Deprecated: Use AddWebhookRequest.ProtoReflect.Descriptor instead. -func (*AddWebhookRequest) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_notification_proto_rawDescGZIP(), []int{4} -} - -func (x *AddWebhookRequest) GetEndpoint() string { - if x != nil { - return x.Endpoint - } - return "" -} - -func (x *AddWebhookRequest) GetEventType() WebhookEventType { - if x != nil { - return x.EventType - } - return WebhookEventType_WEBHOOK_EVENT_TYPE_UNSPECIFIED -} - -func (x *AddWebhookRequest) GetSecret() string { - if x != nil { - return x.Secret - } - return "" -} - -type AddWebhookResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The id of the new webhook. - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *AddWebhookResponse) Reset() { - *x = AddWebhookResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_notification_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AddWebhookResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AddWebhookResponse) ProtoMessage() {} - -func (x *AddWebhookResponse) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_notification_proto_msgTypes[5] - 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) -} - -// Deprecated: Use AddWebhookResponse.ProtoReflect.Descriptor instead. -func (*AddWebhookResponse) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_notification_proto_rawDescGZIP(), []int{5} -} - -func (x *AddWebhookResponse) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -type RemoveWebhookRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The id of the webhook to remove. - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` -} - -func (x *RemoveWebhookRequest) Reset() { - *x = RemoveWebhookRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_notification_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RemoveWebhookRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoveWebhookRequest) ProtoMessage() {} - -func (x *RemoveWebhookRequest) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_notification_proto_msgTypes[6] - 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) -} - -// Deprecated: Use RemoveWebhookRequest.ProtoReflect.Descriptor instead. -func (*RemoveWebhookRequest) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_notification_proto_rawDescGZIP(), []int{6} -} - -func (x *RemoveWebhookRequest) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -type RemoveWebhookResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields -} - -func (x *RemoveWebhookResponse) Reset() { - *x = RemoveWebhookResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_notification_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *RemoveWebhookResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*RemoveWebhookResponse) ProtoMessage() {} - -func (x *RemoveWebhookResponse) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_notification_proto_msgTypes[7] - 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) -} - -// Deprecated: Use RemoveWebhookResponse.ProtoReflect.Descriptor instead. -func (*RemoveWebhookResponse) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_notification_proto_rawDescGZIP(), []int{7} -} - -type ListWebhooksRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The event type for which filtering the list of webhooks. - EventType WebhookEventType `protobuf:"varint,1,opt,name=event_type,json=eventType,proto3,enum=ocean.v1alpha.WebhookEventType" json:"event_type,omitempty"` -} - -func (x *ListWebhooksRequest) Reset() { - *x = ListWebhooksRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_notification_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListWebhooksRequest) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListWebhooksRequest) ProtoMessage() {} - -func (x *ListWebhooksRequest) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_notification_proto_msgTypes[8] - 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) -} - -// Deprecated: Use ListWebhooksRequest.ProtoReflect.Descriptor instead. -func (*ListWebhooksRequest) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_notification_proto_rawDescGZIP(), []int{8} -} - -func (x *ListWebhooksRequest) GetEventType() WebhookEventType { - if x != nil { - return x.EventType - } - return WebhookEventType_WEBHOOK_EVENT_TYPE_UNSPECIFIED -} - -type ListWebhooksResponse struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The list of info about the webhooks regitered for an action. - WebhookInfo []*WebhookInfo `protobuf:"bytes,1,rep,name=webhook_info,json=webhookInfo,proto3" json:"webhook_info,omitempty"` -} - -func (x *ListWebhooksResponse) Reset() { - *x = ListWebhooksResponse{} - if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_notification_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *ListWebhooksResponse) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*ListWebhooksResponse) ProtoMessage() {} - -func (x *ListWebhooksResponse) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_notification_proto_msgTypes[9] - 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) -} - -// Deprecated: Use ListWebhooksResponse.ProtoReflect.Descriptor instead. -func (*ListWebhooksResponse) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_notification_proto_rawDescGZIP(), []int{9} -} - -func (x *ListWebhooksResponse) GetWebhookInfo() []*WebhookInfo { - if x != nil { - return x.WebhookInfo - } - return nil -} - -type WebhookInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The id of the webhook. - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` - // The endpoint of the external service to reach. - Endpoint string `protobuf:"bytes,2,opt,name=endpoint,proto3" json:"endpoint,omitempty"` - // Whether the outgoing requests are authenticated. - IsSecured bool `protobuf:"varint,3,opt,name=is_secured,json=isSecured,proto3" json:"is_secured,omitempty"` -} - -func (x *WebhookInfo) Reset() { - *x = WebhookInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_notification_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *WebhookInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*WebhookInfo) ProtoMessage() {} - -func (x *WebhookInfo) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_notification_proto_msgTypes[10] - 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) -} - -// Deprecated: Use WebhookInfo.ProtoReflect.Descriptor instead. -func (*WebhookInfo) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_notification_proto_rawDescGZIP(), []int{10} -} - -func (x *WebhookInfo) GetId() string { - if x != nil { - return x.Id - } - return "" -} - -func (x *WebhookInfo) GetEndpoint() string { - if x != nil { - return x.Endpoint - } - return "" -} - -func (x *WebhookInfo) GetIsSecured() bool { - if x != nil { - return x.IsSecured - } - return false -} - -var File_ocean_v1alpha_notification_proto protoreflect.FileDescriptor - -var file_ocean_v1alpha_notification_proto_rawDesc = []byte{ - 0x0a, 0x20, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, - 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x12, 0x0d, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x1a, 0x19, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5d, 0x0a, 0x1f, - 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x69, 0x66, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x3a, 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x52, - 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x22, 0xef, 0x01, 0x0a, 0x20, - 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x69, 0x66, - 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x12, 0x3a, 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, - 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4b, 0x65, 0x79, - 0x52, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, - 0x74, 0x78, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x78, 0x69, 0x64, - 0x12, 0x39, 0x0a, 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1a, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x54, 0x78, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, - 0x52, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x40, 0x0a, 0x0d, 0x62, - 0x6c, 0x6f, 0x63, 0x6b, 0x5f, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, - 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x57, 0x0a, - 0x19, 0x55, 0x74, 0x78, 0x6f, 0x73, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3a, 0x0a, 0x0b, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x19, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x0a, 0x61, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x22, 0xbe, 0x01, 0x0a, 0x1a, 0x55, 0x74, 0x78, 0x6f, 0x73, - 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6f, 0x63, 0x65, - 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, - 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4b, 0x65, - 0x79, 0x12, 0x27, 0x0a, 0x04, 0x75, 0x74, 0x78, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x13, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x55, 0x74, 0x78, 0x6f, 0x52, 0x04, 0x75, 0x74, 0x78, 0x6f, 0x12, 0x3b, 0x0a, 0x0a, 0x65, 0x76, - 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, - 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x55, - 0x74, 0x78, 0x6f, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x65, 0x76, - 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x22, 0x87, 0x01, 0x0a, 0x11, 0x41, 0x64, 0x64, 0x57, - 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1a, 0x0a, - 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x12, 0x3e, 0x0a, 0x0a, 0x65, 0x76, 0x65, - 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, - 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x57, 0x65, - 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, - 0x65, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x63, - 0x72, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x63, 0x72, 0x65, - 0x74, 0x22, 0x24, 0x0a, 0x12, 0x41, 0x64, 0x64, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, 0x26, 0x0a, 0x14, 0x52, 0x65, 0x6d, 0x6f, 0x76, - 0x65, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x22, - 0x17, 0x0a, 0x15, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x55, 0x0a, 0x13, 0x4c, 0x69, 0x73, 0x74, - 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, - 0x3e, 0x0a, 0x0a, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0e, 0x32, 0x1f, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x2e, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x45, 0x76, 0x65, 0x6e, 0x74, - 0x54, 0x79, 0x70, 0x65, 0x52, 0x09, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x22, - 0x55, 0x0a, 0x14, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3d, 0x0a, 0x0c, 0x77, 0x65, 0x62, 0x68, 0x6f, - 0x6f, 0x6b, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, - 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x57, 0x65, - 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0b, 0x77, 0x65, 0x62, 0x68, 0x6f, - 0x6f, 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x58, 0x0a, 0x0b, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, - 0x6b, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, - 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x65, 0x6e, 0x64, 0x70, 0x6f, 0x69, 0x6e, - 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x73, 0x65, 0x63, 0x75, 0x72, 0x65, 0x64, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x53, 0x65, 0x63, 0x75, 0x72, 0x65, 0x64, - 0x32, 0x8f, 0x04, 0x0a, 0x13, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7d, 0x0a, 0x18, 0x54, 0x72, 0x61, 0x6e, - 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2e, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, - 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x30, 0x01, 0x12, 0x6b, 0x0a, 0x12, 0x55, 0x74, 0x78, 0x6f, 0x73, - 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x28, 0x2e, - 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x55, 0x74, - 0x78, 0x6f, 0x73, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, - 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x55, 0x74, 0x78, 0x6f, 0x73, 0x4e, 0x6f, 0x74, - 0x69, 0x66, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x30, 0x01, 0x12, 0x53, 0x0a, 0x0a, 0x41, 0x64, 0x64, 0x57, 0x65, 0x62, 0x68, 0x6f, - 0x6f, 0x6b, 0x12, 0x20, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, - 0x68, 0x61, 0x2e, 0x41, 0x64, 0x64, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, - 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x41, 0x64, 0x64, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x5c, 0x0a, 0x0d, 0x52, 0x65, 0x6d, - 0x6f, 0x76, 0x65, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x12, 0x23, 0x2e, 0x6f, 0x63, 0x65, - 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, - 0x65, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x24, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, - 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x52, 0x65, 0x73, - 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x59, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x57, - 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x12, 0x22, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, - 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x57, 0x65, 0x62, 0x68, - 0x6f, 0x6f, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x6f, 0x63, - 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x4c, 0x69, 0x73, 0x74, - 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x00, 0x42, 0xde, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, - 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x42, 0x11, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x61, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x76, 0x75, 0x6c, 0x70, 0x65, 0x6d, - 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, 0x65, 0x73, 0x2f, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2f, 0x61, - 0x70, 0x69, 0x2d, 0x73, 0x70, 0x65, 0x63, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, - 0x2f, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x67, - 0x65, 0x6e, 0x2f, 0x67, 0x6f, 0x2f, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2f, 0x76, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x3b, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0xa2, 0x02, 0x03, 0x4f, 0x58, 0x58, 0xaa, 0x02, 0x0d, 0x4f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x56, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0xca, 0x02, 0x0d, 0x4f, 0x63, 0x65, 0x61, 0x6e, 0x5c, 0x56, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0xe2, 0x02, 0x19, 0x4f, 0x63, 0x65, 0x61, 0x6e, 0x5c, 0x56, - 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4f, 0x63, 0x65, 0x61, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, - 0x70, 0x68, 0x61, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_ocean_v1alpha_notification_proto_rawDescOnce sync.Once - file_ocean_v1alpha_notification_proto_rawDescData = file_ocean_v1alpha_notification_proto_rawDesc -) - -func file_ocean_v1alpha_notification_proto_rawDescGZIP() []byte { - file_ocean_v1alpha_notification_proto_rawDescOnce.Do(func() { - file_ocean_v1alpha_notification_proto_rawDescData = protoimpl.X.CompressGZIP(file_ocean_v1alpha_notification_proto_rawDescData) - }) - return file_ocean_v1alpha_notification_proto_rawDescData -} - -var file_ocean_v1alpha_notification_proto_msgTypes = make([]protoimpl.MessageInfo, 11) -var file_ocean_v1alpha_notification_proto_goTypes = []interface{}{ - (*TransactionNotificationsRequest)(nil), // 0: ocean.v1alpha.TransactionNotificationsRequest - (*TransactionNotificationsResponse)(nil), // 1: ocean.v1alpha.TransactionNotificationsResponse - (*UtxosNotificationsRequest)(nil), // 2: ocean.v1alpha.UtxosNotificationsRequest - (*UtxosNotificationsResponse)(nil), // 3: ocean.v1alpha.UtxosNotificationsResponse - (*AddWebhookRequest)(nil), // 4: ocean.v1alpha.AddWebhookRequest - (*AddWebhookResponse)(nil), // 5: ocean.v1alpha.AddWebhookResponse - (*RemoveWebhookRequest)(nil), // 6: ocean.v1alpha.RemoveWebhookRequest - (*RemoveWebhookResponse)(nil), // 7: ocean.v1alpha.RemoveWebhookResponse - (*ListWebhooksRequest)(nil), // 8: ocean.v1alpha.ListWebhooksRequest - (*ListWebhooksResponse)(nil), // 9: ocean.v1alpha.ListWebhooksResponse - (*WebhookInfo)(nil), // 10: ocean.v1alpha.WebhookInfo - (*AccountKey)(nil), // 11: ocean.v1alpha.AccountKey - (TxEventType)(0), // 12: ocean.v1alpha.TxEventType - (*BlockDetails)(nil), // 13: ocean.v1alpha.BlockDetails - (*Utxo)(nil), // 14: ocean.v1alpha.Utxo - (UtxoEventType)(0), // 15: ocean.v1alpha.UtxoEventType - (WebhookEventType)(0), // 16: ocean.v1alpha.WebhookEventType -} -var file_ocean_v1alpha_notification_proto_depIdxs = []int32{ - 11, // 0: ocean.v1alpha.TransactionNotificationsRequest.account_key:type_name -> ocean.v1alpha.AccountKey - 11, // 1: ocean.v1alpha.TransactionNotificationsResponse.account_key:type_name -> ocean.v1alpha.AccountKey - 12, // 2: ocean.v1alpha.TransactionNotificationsResponse.event_type:type_name -> ocean.v1alpha.TxEventType - 13, // 3: ocean.v1alpha.TransactionNotificationsResponse.block_details:type_name -> ocean.v1alpha.BlockDetails - 11, // 4: ocean.v1alpha.UtxosNotificationsRequest.account_key:type_name -> ocean.v1alpha.AccountKey - 11, // 5: ocean.v1alpha.UtxosNotificationsResponse.account_key:type_name -> ocean.v1alpha.AccountKey - 14, // 6: ocean.v1alpha.UtxosNotificationsResponse.utxo:type_name -> ocean.v1alpha.Utxo - 15, // 7: ocean.v1alpha.UtxosNotificationsResponse.event_type:type_name -> ocean.v1alpha.UtxoEventType - 16, // 8: ocean.v1alpha.AddWebhookRequest.event_type:type_name -> ocean.v1alpha.WebhookEventType - 16, // 9: ocean.v1alpha.ListWebhooksRequest.event_type:type_name -> ocean.v1alpha.WebhookEventType - 10, // 10: ocean.v1alpha.ListWebhooksResponse.webhook_info:type_name -> ocean.v1alpha.WebhookInfo - 0, // 11: ocean.v1alpha.NotificationService.TransactionNotifications:input_type -> ocean.v1alpha.TransactionNotificationsRequest - 2, // 12: ocean.v1alpha.NotificationService.UtxosNotifications:input_type -> ocean.v1alpha.UtxosNotificationsRequest - 4, // 13: ocean.v1alpha.NotificationService.AddWebhook:input_type -> ocean.v1alpha.AddWebhookRequest - 6, // 14: ocean.v1alpha.NotificationService.RemoveWebhook:input_type -> ocean.v1alpha.RemoveWebhookRequest - 8, // 15: ocean.v1alpha.NotificationService.ListWebhooks:input_type -> ocean.v1alpha.ListWebhooksRequest - 1, // 16: ocean.v1alpha.NotificationService.TransactionNotifications:output_type -> ocean.v1alpha.TransactionNotificationsResponse - 3, // 17: ocean.v1alpha.NotificationService.UtxosNotifications:output_type -> ocean.v1alpha.UtxosNotificationsResponse - 5, // 18: ocean.v1alpha.NotificationService.AddWebhook:output_type -> ocean.v1alpha.AddWebhookResponse - 7, // 19: ocean.v1alpha.NotificationService.RemoveWebhook:output_type -> ocean.v1alpha.RemoveWebhookResponse - 9, // 20: ocean.v1alpha.NotificationService.ListWebhooks:output_type -> ocean.v1alpha.ListWebhooksResponse - 16, // [16:21] is the sub-list for method output_type - 11, // [11:16] is the sub-list for method input_type - 11, // [11:11] is the sub-list for extension type_name - 11, // [11:11] is the sub-list for extension extendee - 0, // [0:11] is the sub-list for field type_name -} - -func init() { file_ocean_v1alpha_notification_proto_init() } -func file_ocean_v1alpha_notification_proto_init() { - if File_ocean_v1alpha_notification_proto != nil { - return - } - file_ocean_v1alpha_types_proto_init() - if !protoimpl.UnsafeEnabled { - file_ocean_v1alpha_notification_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransactionNotificationsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ocean_v1alpha_notification_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TransactionNotificationsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ocean_v1alpha_notification_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UtxosNotificationsRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ocean_v1alpha_notification_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UtxosNotificationsResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ocean_v1alpha_notification_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddWebhookRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ocean_v1alpha_notification_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddWebhookResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ocean_v1alpha_notification_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemoveWebhookRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ocean_v1alpha_notification_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemoveWebhookResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ocean_v1alpha_notification_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListWebhooksRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ocean_v1alpha_notification_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ListWebhooksResponse); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ocean_v1alpha_notification_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*WebhookInfo); 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_ocean_v1alpha_notification_proto_rawDesc, - NumEnums: 0, - NumMessages: 11, - NumExtensions: 0, - NumServices: 1, - }, - GoTypes: file_ocean_v1alpha_notification_proto_goTypes, - DependencyIndexes: file_ocean_v1alpha_notification_proto_depIdxs, - MessageInfos: file_ocean_v1alpha_notification_proto_msgTypes, - }.Build() - File_ocean_v1alpha_notification_proto = out.File - file_ocean_v1alpha_notification_proto_rawDesc = nil - file_ocean_v1alpha_notification_proto_goTypes = nil - file_ocean_v1alpha_notification_proto_depIdxs = nil -} diff --git a/api-spec/protobuf/gen/go/ocean/v1alpha/types.pb.go b/api-spec/protobuf/gen/go/ocean/v1alpha/types.pb.go deleted file mode 100644 index f828ed9..0000000 --- a/api-spec/protobuf/gen/go/ocean/v1alpha/types.pb.go +++ /dev/null @@ -1,1121 +0,0 @@ -// Code generated by protoc-gen-go. DO NOT EDIT. -// versions: -// protoc-gen-go v1.27.1 -// protoc (unknown) -// source: ocean/v1alpha/types.proto - -package oceanv1alpha - -import ( - protoreflect "google.golang.org/protobuf/reflect/protoreflect" - protoimpl "google.golang.org/protobuf/runtime/protoimpl" - reflect "reflect" - sync "sync" -) - -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 TxEventType int32 - -const ( - TxEventType_TX_EVENT_TYPE_UNSPECIFIED TxEventType = 0 - // Tx broadcasted. - TxEventType_TX_EVENT_TYPE_BROADCASTED TxEventType = 1 - // Tx unconfirmed. - TxEventType_TX_EVENT_TYPE_UNCONFIRMED TxEventType = 2 - // Tx confirmed. - TxEventType_TX_EVENT_TYPE_CONFIRMED TxEventType = 3 -) - -// Enum value maps for TxEventType. -var ( - TxEventType_name = map[int32]string{ - 0: "TX_EVENT_TYPE_UNSPECIFIED", - 1: "TX_EVENT_TYPE_BROADCASTED", - 2: "TX_EVENT_TYPE_UNCONFIRMED", - 3: "TX_EVENT_TYPE_CONFIRMED", - } - TxEventType_value = map[string]int32{ - "TX_EVENT_TYPE_UNSPECIFIED": 0, - "TX_EVENT_TYPE_BROADCASTED": 1, - "TX_EVENT_TYPE_UNCONFIRMED": 2, - "TX_EVENT_TYPE_CONFIRMED": 3, - } -) - -func (x TxEventType) Enum() *TxEventType { - p := new(TxEventType) - *p = x - return p -} - -func (x TxEventType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (TxEventType) Descriptor() protoreflect.EnumDescriptor { - return file_ocean_v1alpha_types_proto_enumTypes[0].Descriptor() -} - -func (TxEventType) Type() protoreflect.EnumType { - return &file_ocean_v1alpha_types_proto_enumTypes[0] -} - -func (x TxEventType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use TxEventType.Descriptor instead. -func (TxEventType) EnumDescriptor() ([]byte, []int) { - return file_ocean_v1alpha_types_proto_rawDescGZIP(), []int{0} -} - -type UtxoEventType int32 - -const ( - UtxoEventType_UTXO_EVENT_TYPE_UNSPECIFIED UtxoEventType = 0 - UtxoEventType_UTXO_EVENT_TYPE_LOCKED UtxoEventType = 1 - UtxoEventType_UTXO_EVENT_TYPE_UNLOCKED UtxoEventType = 2 - UtxoEventType_UTXO_EVENT_TYPE_SPENT UtxoEventType = 3 - UtxoEventType_UTXO_EVENT_TYPE_NEW UtxoEventType = 4 -) - -// Enum value maps for UtxoEventType. -var ( - UtxoEventType_name = map[int32]string{ - 0: "UTXO_EVENT_TYPE_UNSPECIFIED", - 1: "UTXO_EVENT_TYPE_LOCKED", - 2: "UTXO_EVENT_TYPE_UNLOCKED", - 3: "UTXO_EVENT_TYPE_SPENT", - 4: "UTXO_EVENT_TYPE_NEW", - } - UtxoEventType_value = map[string]int32{ - "UTXO_EVENT_TYPE_UNSPECIFIED": 0, - "UTXO_EVENT_TYPE_LOCKED": 1, - "UTXO_EVENT_TYPE_UNLOCKED": 2, - "UTXO_EVENT_TYPE_SPENT": 3, - "UTXO_EVENT_TYPE_NEW": 4, - } -) - -func (x UtxoEventType) Enum() *UtxoEventType { - p := new(UtxoEventType) - *p = x - return p -} - -func (x UtxoEventType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (UtxoEventType) Descriptor() protoreflect.EnumDescriptor { - return file_ocean_v1alpha_types_proto_enumTypes[1].Descriptor() -} - -func (UtxoEventType) Type() protoreflect.EnumType { - return &file_ocean_v1alpha_types_proto_enumTypes[1] -} - -func (x UtxoEventType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use UtxoEventType.Descriptor instead. -func (UtxoEventType) EnumDescriptor() ([]byte, []int) { - return file_ocean_v1alpha_types_proto_rawDescGZIP(), []int{1} -} - -type WebhookEventType int32 - -const ( - WebhookEventType_WEBHOOK_EVENT_TYPE_UNSPECIFIED WebhookEventType = 0 - // Receive notification about transactions. - WebhookEventType_WEBHOOK_EVENT_TYPE_TRANSACTION WebhookEventType = 1 - // Receive notifications about utxos. - WebhookEventType_WEBHOOK_EVENT_TYPE_UNSPENTS WebhookEventType = 2 -) - -// Enum value maps for WebhookEventType. -var ( - WebhookEventType_name = map[int32]string{ - 0: "WEBHOOK_EVENT_TYPE_UNSPECIFIED", - 1: "WEBHOOK_EVENT_TYPE_TRANSACTION", - 2: "WEBHOOK_EVENT_TYPE_UNSPENTS", - } - WebhookEventType_value = map[string]int32{ - "WEBHOOK_EVENT_TYPE_UNSPECIFIED": 0, - "WEBHOOK_EVENT_TYPE_TRANSACTION": 1, - "WEBHOOK_EVENT_TYPE_UNSPENTS": 2, - } -) - -func (x WebhookEventType) Enum() *WebhookEventType { - p := new(WebhookEventType) - *p = x - return p -} - -func (x WebhookEventType) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (WebhookEventType) Descriptor() protoreflect.EnumDescriptor { - return file_ocean_v1alpha_types_proto_enumTypes[2].Descriptor() -} - -func (WebhookEventType) Type() protoreflect.EnumType { - return &file_ocean_v1alpha_types_proto_enumTypes[2] -} - -func (x WebhookEventType) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use WebhookEventType.Descriptor instead. -func (WebhookEventType) EnumDescriptor() ([]byte, []int) { - return file_ocean_v1alpha_types_proto_rawDescGZIP(), []int{2} -} - -type Template_Format int32 - -const ( - Template_FORMAT_UNSPECIFIED Template_Format = 0 - Template_FORMAT_DESCRIPTOR Template_Format = 1 - Template_FORMAT_MINISCRIPT Template_Format = 2 - Template_FORMAT_IONIO Template_Format = 3 - Template_FORMAT_RAW Template_Format = 4 -) - -// Enum value maps for Template_Format. -var ( - Template_Format_name = map[int32]string{ - 0: "FORMAT_UNSPECIFIED", - 1: "FORMAT_DESCRIPTOR", - 2: "FORMAT_MINISCRIPT", - 3: "FORMAT_IONIO", - 4: "FORMAT_RAW", - } - Template_Format_value = map[string]int32{ - "FORMAT_UNSPECIFIED": 0, - "FORMAT_DESCRIPTOR": 1, - "FORMAT_MINISCRIPT": 2, - "FORMAT_IONIO": 3, - "FORMAT_RAW": 4, - } -) - -func (x Template_Format) Enum() *Template_Format { - p := new(Template_Format) - *p = x - return p -} - -func (x Template_Format) String() string { - return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) -} - -func (Template_Format) Descriptor() protoreflect.EnumDescriptor { - return file_ocean_v1alpha_types_proto_enumTypes[3].Descriptor() -} - -func (Template_Format) Type() protoreflect.EnumType { - return &file_ocean_v1alpha_types_proto_enumTypes[3] -} - -func (x Template_Format) Number() protoreflect.EnumNumber { - return protoreflect.EnumNumber(x) -} - -// Deprecated: Use Template_Format.Descriptor instead. -func (Template_Format) EnumDescriptor() ([]byte, []int) { - return file_ocean_v1alpha_types_proto_rawDescGZIP(), []int{8, 0} -} - -type AccountKey struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Id of the account. - Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` - // Name of the account to be updated. - Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` -} - -func (x *AccountKey) Reset() { - *x = AccountKey{} - if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_types_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AccountKey) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AccountKey) ProtoMessage() {} - -func (x *AccountKey) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_types_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) -} - -// Deprecated: Use AccountKey.ProtoReflect.Descriptor instead. -func (*AccountKey) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_types_proto_rawDescGZIP(), []int{0} -} - -func (x *AccountKey) GetId() uint64 { - if x != nil { - return x.Id - } - return 0 -} - -func (x *AccountKey) GetName() string { - if x != nil { - return x.Name - } - return "" -} - -type AccountInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Account key. - AccountKey *AccountKey `protobuf:"bytes,1,opt,name=account_key,json=accountKey,proto3" json:"account_key,omitempty"` - // Derivation path. - DerivationPath string `protobuf:"bytes,2,opt,name=derivation_path,json=derivationPath,proto3" json:"derivation_path,omitempty"` - // XPub. - Xpub string `protobuf:"bytes,3,opt,name=xpub,proto3" json:"xpub,omitempty"` -} - -func (x *AccountInfo) Reset() { - *x = AccountInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_types_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *AccountInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*AccountInfo) ProtoMessage() {} - -func (x *AccountInfo) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_types_proto_msgTypes[1] - 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) -} - -// Deprecated: Use AccountInfo.ProtoReflect.Descriptor instead. -func (*AccountInfo) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_types_proto_rawDescGZIP(), []int{1} -} - -func (x *AccountInfo) GetAccountKey() *AccountKey { - if x != nil { - return x.AccountKey - } - return nil -} - -func (x *AccountInfo) GetDerivationPath() string { - if x != nil { - return x.DerivationPath - } - return "" -} - -func (x *AccountInfo) GetXpub() string { - if x != nil { - return x.Xpub - } - return "" -} - -type BalanceInfo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // The balance of the wallet (excludes locked utxos) - TotalBalance uint64 `protobuf:"varint,1,opt,name=total_balance,json=totalBalance,proto3" json:"total_balance,omitempty"` - // The confirmed balance of a wallet (includes utxos with 1+ confirmations) - ConfirmedBalance uint64 `protobuf:"varint,2,opt,name=confirmed_balance,json=confirmedBalance,proto3" json:"confirmed_balance,omitempty"` - // The unconfirmed balance of a wallet (includes utxos with no confirmations) - UnconfirmedBalance uint64 `protobuf:"varint,3,opt,name=unconfirmed_balance,json=unconfirmedBalance,proto3" json:"unconfirmed_balance,omitempty"` -} - -func (x *BalanceInfo) Reset() { - *x = BalanceInfo{} - if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_types_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BalanceInfo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BalanceInfo) ProtoMessage() {} - -func (x *BalanceInfo) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_types_proto_msgTypes[2] - 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) -} - -// Deprecated: Use BalanceInfo.ProtoReflect.Descriptor instead. -func (*BalanceInfo) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_types_proto_rawDescGZIP(), []int{2} -} - -func (x *BalanceInfo) GetTotalBalance() uint64 { - if x != nil { - return x.TotalBalance - } - return 0 -} - -func (x *BalanceInfo) GetConfirmedBalance() uint64 { - if x != nil { - return x.ConfirmedBalance - } - return 0 -} - -func (x *BalanceInfo) GetUnconfirmedBalance() uint64 { - if x != nil { - return x.UnconfirmedBalance - } - return 0 -} - -type Input struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Previous output txid. - Txid string `protobuf:"bytes,1,opt,name=txid,proto3" json:"txid,omitempty"` - // Previous tx output index. - Index uint32 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"` -} - -func (x *Input) Reset() { - *x = Input{} - if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_types_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Input) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Input) ProtoMessage() {} - -func (x *Input) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_types_proto_msgTypes[3] - 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) -} - -// Deprecated: Use Input.ProtoReflect.Descriptor instead. -func (*Input) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_types_proto_rawDescGZIP(), []int{3} -} - -func (x *Input) GetTxid() string { - if x != nil { - return x.Txid - } - return "" -} - -func (x *Input) GetIndex() uint32 { - if x != nil { - return x.Index - } - return 0 -} - -type Output struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Asset hash. - Asset string `protobuf:"bytes,1,opt,name=asset,proto3" json:"asset,omitempty"` - // Sent amount. - Amount uint64 `protobuf:"varint,2,opt,name=amount,proto3" json:"amount,omitempty"` - // Address to send funds to. - Address string `protobuf:"bytes,3,opt,name=address,proto3" json:"address,omitempty"` -} - -func (x *Output) Reset() { - *x = Output{} - if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_types_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Output) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Output) ProtoMessage() {} - -func (x *Output) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_types_proto_msgTypes[4] - 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) -} - -// Deprecated: Use Output.ProtoReflect.Descriptor instead. -func (*Output) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_types_proto_rawDescGZIP(), []int{4} -} - -func (x *Output) GetAsset() string { - if x != nil { - return x.Asset - } - return "" -} - -func (x *Output) GetAmount() uint64 { - if x != nil { - return x.Amount - } - return 0 -} - -func (x *Output) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - -type Utxos struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // account key - AccountKey *AccountKey `protobuf:"bytes,1,opt,name=account_key,json=accountKey,proto3" json:"account_key,omitempty"` - // list of utxos - Utxos []*Utxo `protobuf:"bytes,2,rep,name=utxos,proto3" json:"utxos,omitempty"` -} - -func (x *Utxos) Reset() { - *x = Utxos{} - if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_types_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Utxos) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Utxos) ProtoMessage() {} - -func (x *Utxos) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_types_proto_msgTypes[5] - 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) -} - -// Deprecated: Use Utxos.ProtoReflect.Descriptor instead. -func (*Utxos) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_types_proto_rawDescGZIP(), []int{5} -} - -func (x *Utxos) GetAccountKey() *AccountKey { - if x != nil { - return x.AccountKey - } - return nil -} - -func (x *Utxos) GetUtxos() []*Utxo { - if x != nil { - return x.Utxos - } - return nil -} - -type Utxo struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Txid of the Uuxo - Txid string `protobuf:"bytes,1,opt,name=txid,proto3" json:"txid,omitempty"` - // Output index - Index uint32 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"` - // Asset - Asset string `protobuf:"bytes,3,opt,name=asset,proto3" json:"asset,omitempty"` - // Value - Value uint64 `protobuf:"varint,4,opt,name=value,proto3" json:"value,omitempty"` - // Script - Script []byte `protobuf:"bytes,5,opt,name=script,proto3" json:"script,omitempty"` - // Confirmation status - IsConfirmed bool `protobuf:"varint,6,opt,name=is_confirmed,json=isConfirmed,proto3" json:"is_confirmed,omitempty"` - // Whether locked by a coin selection - IsLocked bool `protobuf:"varint,7,opt,name=is_locked,json=isLocked,proto3" json:"is_locked,omitempty"` -} - -func (x *Utxo) Reset() { - *x = Utxo{} - if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_types_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Utxo) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Utxo) ProtoMessage() {} - -func (x *Utxo) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_types_proto_msgTypes[6] - 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) -} - -// Deprecated: Use Utxo.ProtoReflect.Descriptor instead. -func (*Utxo) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_types_proto_rawDescGZIP(), []int{6} -} - -func (x *Utxo) GetTxid() string { - if x != nil { - return x.Txid - } - return "" -} - -func (x *Utxo) GetIndex() uint32 { - if x != nil { - return x.Index - } - return 0 -} - -func (x *Utxo) GetAsset() string { - if x != nil { - return x.Asset - } - return "" -} - -func (x *Utxo) GetValue() uint64 { - if x != nil { - return x.Value - } - return 0 -} - -func (x *Utxo) GetScript() []byte { - if x != nil { - return x.Script - } - return nil -} - -func (x *Utxo) GetIsConfirmed() bool { - if x != nil { - return x.IsConfirmed - } - return false -} - -func (x *Utxo) GetIsLocked() bool { - if x != nil { - return x.IsLocked - } - return false -} - -type BlockDetails struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - // Hash of the block. - Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"` - // Heighth (index) of the block. - Height int32 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` - // Timestamp of the block. - Timestamp int64 `protobuf:"varint,3,opt,name=timestamp,proto3" json:"timestamp,omitempty"` -} - -func (x *BlockDetails) Reset() { - *x = BlockDetails{} - if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_types_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *BlockDetails) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*BlockDetails) ProtoMessage() {} - -func (x *BlockDetails) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_types_proto_msgTypes[7] - 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) -} - -// Deprecated: Use BlockDetails.ProtoReflect.Descriptor instead. -func (*BlockDetails) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_types_proto_rawDescGZIP(), []int{7} -} - -func (x *BlockDetails) GetHash() []byte { - if x != nil { - return x.Hash - } - return nil -} - -func (x *BlockDetails) GetHeight() int32 { - if x != nil { - return x.Height - } - return 0 -} - -func (x *BlockDetails) GetTimestamp() int64 { - if x != nil { - return x.Timestamp - } - return 0 -} - -type Template struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Format Template_Format `protobuf:"varint,1,opt,name=format,proto3,enum=ocean.v1alpha.Template_Format" json:"format,omitempty"` - Value string `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` -} - -func (x *Template) Reset() { - *x = Template{} - if protoimpl.UnsafeEnabled { - mi := &file_ocean_v1alpha_types_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } -} - -func (x *Template) String() string { - return protoimpl.X.MessageStringOf(x) -} - -func (*Template) ProtoMessage() {} - -func (x *Template) ProtoReflect() protoreflect.Message { - mi := &file_ocean_v1alpha_types_proto_msgTypes[8] - 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) -} - -// Deprecated: Use Template.ProtoReflect.Descriptor instead. -func (*Template) Descriptor() ([]byte, []int) { - return file_ocean_v1alpha_types_proto_rawDescGZIP(), []int{8} -} - -func (x *Template) GetFormat() Template_Format { - if x != nil { - return x.Format - } - return Template_FORMAT_UNSPECIFIED -} - -func (x *Template) GetValue() string { - if x != nil { - return x.Value - } - return "" -} - -var File_ocean_v1alpha_types_proto protoreflect.FileDescriptor - -var file_ocean_v1alpha_types_proto_rawDesc = []byte{ - 0x0a, 0x19, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, - 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0d, 0x6f, 0x63, 0x65, - 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x22, 0x30, 0x0a, 0x0a, 0x41, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x86, 0x01, 0x0a, - 0x0b, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x3a, 0x0a, 0x0b, - 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x19, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x0a, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x27, 0x0a, 0x0f, 0x64, 0x65, 0x72, 0x69, - 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x0e, 0x64, 0x65, 0x72, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x61, 0x74, - 0x68, 0x12, 0x12, 0x0a, 0x04, 0x78, 0x70, 0x75, 0x62, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x78, 0x70, 0x75, 0x62, 0x22, 0x90, 0x01, 0x0a, 0x0b, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, - 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x23, 0x0a, 0x0d, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x62, - 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x74, 0x6f, - 0x74, 0x61, 0x6c, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x2b, 0x0a, 0x11, 0x63, 0x6f, - 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x65, 0x64, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x65, 0x64, - 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x2f, 0x0a, 0x13, 0x75, 0x6e, 0x63, 0x6f, 0x6e, - 0x66, 0x69, 0x72, 0x6d, 0x65, 0x64, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x12, 0x75, 0x6e, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x65, - 0x64, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x22, 0x31, 0x0a, 0x05, 0x49, 0x6e, 0x70, 0x75, - 0x74, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x78, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x74, 0x78, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x22, 0x50, 0x0a, 0x06, 0x4f, - 0x75, 0x74, 0x70, 0x75, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x73, 0x73, 0x65, 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, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0x6e, 0x0a, - 0x05, 0x55, 0x74, 0x78, 0x6f, 0x73, 0x12, 0x3a, 0x0a, 0x0b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6f, 0x63, - 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x41, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x4b, 0x65, 0x79, 0x52, 0x0a, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4b, - 0x65, 0x79, 0x12, 0x29, 0x0a, 0x05, 0x75, 0x74, 0x78, 0x6f, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, - 0x0b, 0x32, 0x13, 0x2e, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, - 0x61, 0x2e, 0x55, 0x74, 0x78, 0x6f, 0x52, 0x05, 0x75, 0x74, 0x78, 0x6f, 0x73, 0x22, 0xb4, 0x01, - 0x0a, 0x04, 0x55, 0x74, 0x78, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x78, 0x69, 0x64, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x78, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x69, 0x6e, - 0x64, 0x65, 0x78, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x69, 0x6e, 0x64, 0x65, 0x78, - 0x12, 0x14, 0x0a, 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x05, 0x61, 0x73, 0x73, 0x65, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x12, 0x16, 0x0a, 0x06, - 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73, 0x63, - 0x72, 0x69, 0x70, 0x74, 0x12, 0x21, 0x0a, 0x0c, 0x69, 0x73, 0x5f, 0x63, 0x6f, 0x6e, 0x66, 0x69, - 0x72, 0x6d, 0x65, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b, 0x69, 0x73, 0x43, 0x6f, - 0x6e, 0x66, 0x69, 0x72, 0x6d, 0x65, 0x64, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x73, 0x5f, 0x6c, 0x6f, - 0x63, 0x6b, 0x65, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x4c, 0x6f, - 0x63, 0x6b, 0x65, 0x64, 0x22, 0x58, 0x0a, 0x0c, 0x42, 0x6c, 0x6f, 0x63, 0x6b, 0x44, 0x65, 0x74, - 0x61, 0x69, 0x6c, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x68, 0x61, 0x73, 0x68, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x04, 0x68, 0x61, 0x73, 0x68, 0x12, 0x16, 0x0a, 0x06, 0x68, 0x65, 0x69, 0x67, - 0x68, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, - 0x12, 0x1c, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x03, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, 0xca, - 0x01, 0x0a, 0x08, 0x54, 0x65, 0x6d, 0x70, 0x6c, 0x61, 0x74, 0x65, 0x12, 0x36, 0x0a, 0x06, 0x66, - 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x6f, 0x63, - 0x65, 0x61, 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2e, 0x54, 0x65, 0x6d, 0x70, - 0x6c, 0x61, 0x74, 0x65, 0x2e, 0x46, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x52, 0x06, 0x66, 0x6f, 0x72, - 0x6d, 0x61, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0x70, 0x0a, 0x06, 0x46, 0x6f, 0x72, - 0x6d, 0x61, 0x74, 0x12, 0x16, 0x0a, 0x12, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x55, 0x4e, - 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x46, - 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x44, 0x45, 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x4f, 0x52, - 0x10, 0x01, 0x12, 0x15, 0x0a, 0x11, 0x46, 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x4d, 0x49, 0x4e, - 0x49, 0x53, 0x43, 0x52, 0x49, 0x50, 0x54, 0x10, 0x02, 0x12, 0x10, 0x0a, 0x0c, 0x46, 0x4f, 0x52, - 0x4d, 0x41, 0x54, 0x5f, 0x49, 0x4f, 0x4e, 0x49, 0x4f, 0x10, 0x03, 0x12, 0x0e, 0x0a, 0x0a, 0x46, - 0x4f, 0x52, 0x4d, 0x41, 0x54, 0x5f, 0x52, 0x41, 0x57, 0x10, 0x04, 0x2a, 0x87, 0x01, 0x0a, 0x0b, - 0x54, 0x78, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x19, 0x54, - 0x58, 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, - 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1d, 0x0a, 0x19, 0x54, 0x58, - 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x42, 0x52, 0x4f, 0x41, - 0x44, 0x43, 0x41, 0x53, 0x54, 0x45, 0x44, 0x10, 0x01, 0x12, 0x1d, 0x0a, 0x19, 0x54, 0x58, 0x5f, - 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x43, 0x4f, 0x4e, - 0x46, 0x49, 0x52, 0x4d, 0x45, 0x44, 0x10, 0x02, 0x12, 0x1b, 0x0a, 0x17, 0x54, 0x58, 0x5f, 0x45, - 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x52, - 0x4d, 0x45, 0x44, 0x10, 0x03, 0x2a, 0x9e, 0x01, 0x0a, 0x0d, 0x55, 0x74, 0x78, 0x6f, 0x45, 0x76, - 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1f, 0x0a, 0x1b, 0x55, 0x54, 0x58, 0x4f, 0x5f, - 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, - 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1a, 0x0a, 0x16, 0x55, 0x54, 0x58, 0x4f, - 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4c, 0x4f, 0x43, 0x4b, - 0x45, 0x44, 0x10, 0x01, 0x12, 0x1c, 0x0a, 0x18, 0x55, 0x54, 0x58, 0x4f, 0x5f, 0x45, 0x56, 0x45, - 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x4c, 0x4f, 0x43, 0x4b, 0x45, 0x44, - 0x10, 0x02, 0x12, 0x19, 0x0a, 0x15, 0x55, 0x54, 0x58, 0x4f, 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, - 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x50, 0x45, 0x4e, 0x54, 0x10, 0x03, 0x12, 0x17, 0x0a, - 0x13, 0x55, 0x54, 0x58, 0x4f, 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, - 0x5f, 0x4e, 0x45, 0x57, 0x10, 0x04, 0x2a, 0x7b, 0x0a, 0x10, 0x57, 0x65, 0x62, 0x68, 0x6f, 0x6f, - 0x6b, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x54, 0x79, 0x70, 0x65, 0x12, 0x22, 0x0a, 0x1e, 0x57, 0x45, - 0x42, 0x48, 0x4f, 0x4f, 0x4b, 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, - 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x22, - 0x0a, 0x1e, 0x57, 0x45, 0x42, 0x48, 0x4f, 0x4f, 0x4b, 0x5f, 0x45, 0x56, 0x45, 0x4e, 0x54, 0x5f, - 0x54, 0x59, 0x50, 0x45, 0x5f, 0x54, 0x52, 0x41, 0x4e, 0x53, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, - 0x10, 0x01, 0x12, 0x1f, 0x0a, 0x1b, 0x57, 0x45, 0x42, 0x48, 0x4f, 0x4f, 0x4b, 0x5f, 0x45, 0x56, - 0x45, 0x4e, 0x54, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x4e, 0x54, - 0x53, 0x10, 0x02, 0x42, 0xd7, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x6f, 0x63, 0x65, 0x61, - 0x6e, 0x2e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x42, 0x0a, 0x54, 0x79, 0x70, 0x65, 0x73, - 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x61, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x76, 0x75, 0x6c, 0x70, 0x65, 0x6d, 0x76, 0x65, 0x6e, 0x74, 0x75, 0x72, - 0x65, 0x73, 0x2f, 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2f, 0x61, 0x70, 0x69, 0x2d, 0x73, 0x70, 0x65, - 0x63, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x6f, 0x63, 0x65, 0x61, 0x6e, - 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x67, 0x6f, 0x2f, - 0x6f, 0x63, 0x65, 0x61, 0x6e, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x3b, 0x6f, 0x63, - 0x65, 0x61, 0x6e, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0xa2, 0x02, 0x03, 0x4f, 0x58, 0x58, - 0xaa, 0x02, 0x0d, 0x4f, 0x63, 0x65, 0x61, 0x6e, 0x2e, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0xca, 0x02, 0x0d, 0x4f, 0x63, 0x65, 0x61, 0x6e, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0xe2, 0x02, 0x19, 0x4f, 0x63, 0x65, 0x61, 0x6e, 0x5c, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, - 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0e, 0x4f, - 0x63, 0x65, 0x61, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, -} - -var ( - file_ocean_v1alpha_types_proto_rawDescOnce sync.Once - file_ocean_v1alpha_types_proto_rawDescData = file_ocean_v1alpha_types_proto_rawDesc -) - -func file_ocean_v1alpha_types_proto_rawDescGZIP() []byte { - file_ocean_v1alpha_types_proto_rawDescOnce.Do(func() { - file_ocean_v1alpha_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_ocean_v1alpha_types_proto_rawDescData) - }) - return file_ocean_v1alpha_types_proto_rawDescData -} - -var file_ocean_v1alpha_types_proto_enumTypes = make([]protoimpl.EnumInfo, 4) -var file_ocean_v1alpha_types_proto_msgTypes = make([]protoimpl.MessageInfo, 9) -var file_ocean_v1alpha_types_proto_goTypes = []interface{}{ - (TxEventType)(0), // 0: ocean.v1alpha.TxEventType - (UtxoEventType)(0), // 1: ocean.v1alpha.UtxoEventType - (WebhookEventType)(0), // 2: ocean.v1alpha.WebhookEventType - (Template_Format)(0), // 3: ocean.v1alpha.Template.Format - (*AccountKey)(nil), // 4: ocean.v1alpha.AccountKey - (*AccountInfo)(nil), // 5: ocean.v1alpha.AccountInfo - (*BalanceInfo)(nil), // 6: ocean.v1alpha.BalanceInfo - (*Input)(nil), // 7: ocean.v1alpha.Input - (*Output)(nil), // 8: ocean.v1alpha.Output - (*Utxos)(nil), // 9: ocean.v1alpha.Utxos - (*Utxo)(nil), // 10: ocean.v1alpha.Utxo - (*BlockDetails)(nil), // 11: ocean.v1alpha.BlockDetails - (*Template)(nil), // 12: ocean.v1alpha.Template -} -var file_ocean_v1alpha_types_proto_depIdxs = []int32{ - 4, // 0: ocean.v1alpha.AccountInfo.account_key:type_name -> ocean.v1alpha.AccountKey - 4, // 1: ocean.v1alpha.Utxos.account_key:type_name -> ocean.v1alpha.AccountKey - 10, // 2: ocean.v1alpha.Utxos.utxos:type_name -> ocean.v1alpha.Utxo - 3, // 3: ocean.v1alpha.Template.format:type_name -> ocean.v1alpha.Template.Format - 4, // [4:4] is the sub-list for method output_type - 4, // [4:4] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name -} - -func init() { file_ocean_v1alpha_types_proto_init() } -func file_ocean_v1alpha_types_proto_init() { - if File_ocean_v1alpha_types_proto != nil { - return - } - if !protoimpl.UnsafeEnabled { - file_ocean_v1alpha_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AccountKey); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ocean_v1alpha_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AccountInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ocean_v1alpha_types_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BalanceInfo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ocean_v1alpha_types_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Input); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ocean_v1alpha_types_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Output); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ocean_v1alpha_types_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Utxos); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ocean_v1alpha_types_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Utxo); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ocean_v1alpha_types_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BlockDetails); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_ocean_v1alpha_types_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Template); 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_ocean_v1alpha_types_proto_rawDesc, - NumEnums: 4, - NumMessages: 9, - NumExtensions: 0, - NumServices: 0, - }, - GoTypes: file_ocean_v1alpha_types_proto_goTypes, - DependencyIndexes: file_ocean_v1alpha_types_proto_depIdxs, - EnumInfos: file_ocean_v1alpha_types_proto_enumTypes, - MessageInfos: file_ocean_v1alpha_types_proto_msgTypes, - }.Build() - File_ocean_v1alpha_types_proto = out.File - file_ocean_v1alpha_types_proto_rawDesc = nil - file_ocean_v1alpha_types_proto_goTypes = nil - file_ocean_v1alpha_types_proto_depIdxs = nil -} diff --git a/api-spec/protobuf/gen/python/ocean/v1/account_pb2.py b/api-spec/protobuf/gen/python/ocean/v1/account_pb2.py new file mode 100644 index 0000000..8da6d50 --- /dev/null +++ b/api-spec/protobuf/gen/python/ocean/v1/account_pb2.py @@ -0,0 +1,67 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: ocean/v1/account.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from ocean.v1 import types_pb2 as ocean_dot_v1_dot_types__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x16ocean/v1/account.proto\x12\x08ocean.v1\x1a\x14ocean/v1/types.proto\"/\n\x19\x43reateAccountBIP44Request\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\"x\n\x1a\x43reateAccountBIP44Response\x12!\n\x0c\x61\x63\x63ount_name\x18\x01 \x01(\tR\x0b\x61\x63\x63ountName\x12#\n\raccount_index\x18\x02 \x01(\rR\x0c\x61\x63\x63ountIndex\x12\x12\n\x04xpub\x18\x03 \x01(\tR\x04xpub\"0\n\x1a\x43reateAccountCustomRequest\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\"}\n\x1b\x43reateAccountCustomResponse\x12!\n\x0c\x61\x63\x63ount_name\x18\x01 \x01(\tR\x0b\x61\x63\x63ountName\x12\'\n\x0f\x64\x65rivation_path\x18\x02 \x01(\tR\x0e\x64\x65rivationPath\x12\x12\n\x04xpub\x18\x03 \x01(\tR\x04xpub\"n\n\x19SetAccountTemplateRequest\x12!\n\x0c\x61\x63\x63ount_name\x18\x01 \x01(\tR\x0b\x61\x63\x63ountName\x12.\n\x08template\x18\x02 \x01(\x0b\x32\x12.ocean.v1.TemplateR\x08template\"\x1c\n\x1aSetAccountTemplateResponse\"c\n\x14\x44\x65riveAddressRequest\x12!\n\x0c\x61\x63\x63ount_name\x18\x01 \x01(\tR\x0b\x61\x63\x63ountName\x12(\n\x10num_of_addresses\x18\x02 \x01(\x04R\x0enumOfAddresses\"5\n\x15\x44\x65riveAddressResponse\x12\x1c\n\taddresses\x18\x01 \x03(\tR\taddresses\"i\n\x1a\x44\x65riveChangeAddressRequest\x12!\n\x0c\x61\x63\x63ount_name\x18\x01 \x01(\tR\x0b\x61\x63\x63ountName\x12(\n\x10num_of_addresses\x18\x02 \x01(\x04R\x0enumOfAddresses\";\n\x1b\x44\x65riveChangeAddressResponse\x12\x1c\n\taddresses\x18\x01 \x03(\tR\taddresses\"9\n\x14ListAddressesRequest\x12!\n\x0c\x61\x63\x63ount_name\x18\x01 \x01(\tR\x0b\x61\x63\x63ountName\"5\n\x15ListAddressesResponse\x12\x1c\n\taddresses\x18\x01 \x03(\tR\taddresses\"Q\n\x0e\x42\x61lanceRequest\x12!\n\x0c\x61\x63\x63ount_name\x18\x01 \x01(\tR\x0b\x61\x63\x63ountName\x12\x1c\n\taddresses\x18\x03 \x03(\tR\taddresses\"\xa6\x01\n\x0f\x42\x61lanceResponse\x12@\n\x07\x62\x61lance\x18\x01 \x03(\x0b\x32&.ocean.v1.BalanceResponse.BalanceEntryR\x07\x62\x61lance\x1aQ\n\x0c\x42\x61lanceEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12+\n\x05value\x18\x02 \x01(\x0b\x32\x15.ocean.v1.BalanceInfoR\x05value:\x02\x38\x01\"S\n\x10ListUtxosRequest\x12!\n\x0c\x61\x63\x63ount_name\x18\x01 \x01(\tR\x0b\x61\x63\x63ountName\x12\x1c\n\taddresses\x18\x03 \x03(\tR\taddresses\"\x81\x01\n\x11ListUtxosResponse\x12\x38\n\x0fspendable_utxos\x18\x01 \x01(\x0b\x32\x0f.ocean.v1.UtxosR\x0espendableUtxos\x12\x32\n\x0clocked_utxos\x18\x02 \x01(\x0b\x32\x0f.ocean.v1.UtxosR\x0blockedUtxos\"9\n\x14\x44\x65leteAccountRequest\x12!\n\x0c\x61\x63\x63ount_name\x18\x01 \x01(\tR\x0b\x61\x63\x63ountName\"\x17\n\x15\x44\x65leteAccountResponse2\x96\x06\n\x0e\x41\x63\x63ountService\x12_\n\x12\x43reateAccountBIP44\x12#.ocean.v1.CreateAccountBIP44Request\x1a$.ocean.v1.CreateAccountBIP44Response\x12\x62\n\x13\x43reateAccountCustom\x12$.ocean.v1.CreateAccountCustomRequest\x1a%.ocean.v1.CreateAccountCustomResponse\x12_\n\x12SetAccountTemplate\x12#.ocean.v1.SetAccountTemplateRequest\x1a$.ocean.v1.SetAccountTemplateResponse\x12P\n\rDeriveAddress\x12\x1e.ocean.v1.DeriveAddressRequest\x1a\x1f.ocean.v1.DeriveAddressResponse\x12\x62\n\x13\x44\x65riveChangeAddress\x12$.ocean.v1.DeriveChangeAddressRequest\x1a%.ocean.v1.DeriveChangeAddressResponse\x12P\n\rListAddresses\x12\x1e.ocean.v1.ListAddressesRequest\x1a\x1f.ocean.v1.ListAddressesResponse\x12>\n\x07\x42\x61lance\x12\x18.ocean.v1.BalanceRequest\x1a\x19.ocean.v1.BalanceResponse\x12\x44\n\tListUtxos\x12\x1a.ocean.v1.ListUtxosRequest\x1a\x1b.ocean.v1.ListUtxosResponse\x12P\n\rDeleteAccount\x12\x1e.ocean.v1.DeleteAccountRequest\x1a\x1f.ocean.v1.DeleteAccountResponseB\xa5\x01\n\x0c\x63om.ocean.v1B\x0c\x41\x63\x63ountProtoP\x01ZFgithub.com/vulpemventures/ocean/api-spec/protobuf/gen/ocean/v1;oceanv1\xa2\x02\x03OXX\xaa\x02\x08Ocean.V1\xca\x02\x08Ocean\\V1\xe2\x02\x14Ocean\\V1\\GPBMetadata\xea\x02\tOcean::V1b\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'ocean.v1.account_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\014com.ocean.v1B\014AccountProtoP\001ZFgithub.com/vulpemventures/ocean/api-spec/protobuf/gen/ocean/v1;oceanv1\242\002\003OXX\252\002\010Ocean.V1\312\002\010Ocean\\V1\342\002\024Ocean\\V1\\GPBMetadata\352\002\tOcean::V1' + _BALANCERESPONSE_BALANCEENTRY._options = None + _BALANCERESPONSE_BALANCEENTRY._serialized_options = b'8\001' + _CREATEACCOUNTBIP44REQUEST._serialized_start=58 + _CREATEACCOUNTBIP44REQUEST._serialized_end=105 + _CREATEACCOUNTBIP44RESPONSE._serialized_start=107 + _CREATEACCOUNTBIP44RESPONSE._serialized_end=227 + _CREATEACCOUNTCUSTOMREQUEST._serialized_start=229 + _CREATEACCOUNTCUSTOMREQUEST._serialized_end=277 + _CREATEACCOUNTCUSTOMRESPONSE._serialized_start=279 + _CREATEACCOUNTCUSTOMRESPONSE._serialized_end=404 + _SETACCOUNTTEMPLATEREQUEST._serialized_start=406 + _SETACCOUNTTEMPLATEREQUEST._serialized_end=516 + _SETACCOUNTTEMPLATERESPONSE._serialized_start=518 + _SETACCOUNTTEMPLATERESPONSE._serialized_end=546 + _DERIVEADDRESSREQUEST._serialized_start=548 + _DERIVEADDRESSREQUEST._serialized_end=647 + _DERIVEADDRESSRESPONSE._serialized_start=649 + _DERIVEADDRESSRESPONSE._serialized_end=702 + _DERIVECHANGEADDRESSREQUEST._serialized_start=704 + _DERIVECHANGEADDRESSREQUEST._serialized_end=809 + _DERIVECHANGEADDRESSRESPONSE._serialized_start=811 + _DERIVECHANGEADDRESSRESPONSE._serialized_end=870 + _LISTADDRESSESREQUEST._serialized_start=872 + _LISTADDRESSESREQUEST._serialized_end=929 + _LISTADDRESSESRESPONSE._serialized_start=931 + _LISTADDRESSESRESPONSE._serialized_end=984 + _BALANCEREQUEST._serialized_start=986 + _BALANCEREQUEST._serialized_end=1067 + _BALANCERESPONSE._serialized_start=1070 + _BALANCERESPONSE._serialized_end=1236 + _BALANCERESPONSE_BALANCEENTRY._serialized_start=1155 + _BALANCERESPONSE_BALANCEENTRY._serialized_end=1236 + _LISTUTXOSREQUEST._serialized_start=1238 + _LISTUTXOSREQUEST._serialized_end=1321 + _LISTUTXOSRESPONSE._serialized_start=1324 + _LISTUTXOSRESPONSE._serialized_end=1453 + _DELETEACCOUNTREQUEST._serialized_start=1455 + _DELETEACCOUNTREQUEST._serialized_end=1512 + _DELETEACCOUNTRESPONSE._serialized_start=1514 + _DELETEACCOUNTRESPONSE._serialized_end=1537 + _ACCOUNTSERVICE._serialized_start=1540 + _ACCOUNTSERVICE._serialized_end=2330 +# @@protoc_insertion_point(module_scope) diff --git a/api-spec/protobuf/gen/python/ocean/v1/account_pb2_grpc.py b/api-spec/protobuf/gen/python/ocean/v1/account_pb2_grpc.py new file mode 100644 index 0000000..f9b49a3 --- /dev/null +++ b/api-spec/protobuf/gen/python/ocean/v1/account_pb2_grpc.py @@ -0,0 +1,351 @@ +# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! +"""Client and server classes corresponding to protobuf-defined services.""" +import grpc + +from ocean.v1 import account_pb2 as ocean_dot_v1_dot_account__pb2 + + +class AccountServiceStub(object): + """AccountService is used to manage accounts in HD Wallet. + It supports generating addresses, listing utxos and balances for specific account or + list of addresses and selecting utxos. + """ + + def __init__(self, channel): + """Constructor. + + Args: + channel: A grpc.Channel. + """ + self.CreateAccountBIP44 = channel.unary_unary( + '/ocean.v1.AccountService/CreateAccountBIP44', + request_serializer=ocean_dot_v1_dot_account__pb2.CreateAccountBIP44Request.SerializeToString, + response_deserializer=ocean_dot_v1_dot_account__pb2.CreateAccountBIP44Response.FromString, + ) + self.CreateAccountCustom = channel.unary_unary( + '/ocean.v1.AccountService/CreateAccountCustom', + request_serializer=ocean_dot_v1_dot_account__pb2.CreateAccountCustomRequest.SerializeToString, + response_deserializer=ocean_dot_v1_dot_account__pb2.CreateAccountCustomResponse.FromString, + ) + self.SetAccountTemplate = channel.unary_unary( + '/ocean.v1.AccountService/SetAccountTemplate', + request_serializer=ocean_dot_v1_dot_account__pb2.SetAccountTemplateRequest.SerializeToString, + response_deserializer=ocean_dot_v1_dot_account__pb2.SetAccountTemplateResponse.FromString, + ) + self.DeriveAddress = channel.unary_unary( + '/ocean.v1.AccountService/DeriveAddress', + request_serializer=ocean_dot_v1_dot_account__pb2.DeriveAddressRequest.SerializeToString, + response_deserializer=ocean_dot_v1_dot_account__pb2.DeriveAddressResponse.FromString, + ) + self.DeriveChangeAddress = channel.unary_unary( + '/ocean.v1.AccountService/DeriveChangeAddress', + request_serializer=ocean_dot_v1_dot_account__pb2.DeriveChangeAddressRequest.SerializeToString, + response_deserializer=ocean_dot_v1_dot_account__pb2.DeriveChangeAddressResponse.FromString, + ) + self.ListAddresses = channel.unary_unary( + '/ocean.v1.AccountService/ListAddresses', + request_serializer=ocean_dot_v1_dot_account__pb2.ListAddressesRequest.SerializeToString, + response_deserializer=ocean_dot_v1_dot_account__pb2.ListAddressesResponse.FromString, + ) + self.Balance = channel.unary_unary( + '/ocean.v1.AccountService/Balance', + request_serializer=ocean_dot_v1_dot_account__pb2.BalanceRequest.SerializeToString, + response_deserializer=ocean_dot_v1_dot_account__pb2.BalanceResponse.FromString, + ) + self.ListUtxos = channel.unary_unary( + '/ocean.v1.AccountService/ListUtxos', + request_serializer=ocean_dot_v1_dot_account__pb2.ListUtxosRequest.SerializeToString, + response_deserializer=ocean_dot_v1_dot_account__pb2.ListUtxosResponse.FromString, + ) + self.DeleteAccount = channel.unary_unary( + '/ocean.v1.AccountService/DeleteAccount', + request_serializer=ocean_dot_v1_dot_account__pb2.DeleteAccountRequest.SerializeToString, + response_deserializer=ocean_dot_v1_dot_account__pb2.DeleteAccountResponse.FromString, + ) + + +class AccountServiceServicer(object): + """AccountService is used to manage accounts in HD Wallet. + It supports generating addresses, listing utxos and balances for specific account or + list of addresses and selecting utxos. + """ + + def CreateAccountBIP44(self, request, context): + """CreateAccountBIP44 creates a new BIP44 account. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def CreateAccountCustom(self, request, context): + """CreateAccountCustom creates a new custom account for which loading a template. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def SetAccountTemplate(self, request, context): + """SetAccountTemplate sets the template for the account used to generate new addresses. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def DeriveAddress(self, request, context): + """DeriveAddress generates new address(es) for the account. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def DeriveChangeAddress(self, request, context): + """DeriveChangeAddress generates new change address(es) for the account. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ListAddresses(self, request, context): + """ListAddresses returns all derived addresses for the account. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def Balance(self, request, context): + """Balance returns the balance for the account, or for specific list of + account's addresses. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def ListUtxos(self, request, context): + """ListUtxos returns the utxos for the account, or specific list of + account's addresses. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + def DeleteAccount(self, request, context): + """DeleteAccount deletes an existing account. The operation is allowed only + if the account has zero balance. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + + +def add_AccountServiceServicer_to_server(servicer, server): + rpc_method_handlers = { + 'CreateAccountBIP44': grpc.unary_unary_rpc_method_handler( + servicer.CreateAccountBIP44, + request_deserializer=ocean_dot_v1_dot_account__pb2.CreateAccountBIP44Request.FromString, + response_serializer=ocean_dot_v1_dot_account__pb2.CreateAccountBIP44Response.SerializeToString, + ), + 'CreateAccountCustom': grpc.unary_unary_rpc_method_handler( + servicer.CreateAccountCustom, + request_deserializer=ocean_dot_v1_dot_account__pb2.CreateAccountCustomRequest.FromString, + response_serializer=ocean_dot_v1_dot_account__pb2.CreateAccountCustomResponse.SerializeToString, + ), + 'SetAccountTemplate': grpc.unary_unary_rpc_method_handler( + servicer.SetAccountTemplate, + request_deserializer=ocean_dot_v1_dot_account__pb2.SetAccountTemplateRequest.FromString, + response_serializer=ocean_dot_v1_dot_account__pb2.SetAccountTemplateResponse.SerializeToString, + ), + 'DeriveAddress': grpc.unary_unary_rpc_method_handler( + servicer.DeriveAddress, + request_deserializer=ocean_dot_v1_dot_account__pb2.DeriveAddressRequest.FromString, + response_serializer=ocean_dot_v1_dot_account__pb2.DeriveAddressResponse.SerializeToString, + ), + 'DeriveChangeAddress': grpc.unary_unary_rpc_method_handler( + servicer.DeriveChangeAddress, + request_deserializer=ocean_dot_v1_dot_account__pb2.DeriveChangeAddressRequest.FromString, + response_serializer=ocean_dot_v1_dot_account__pb2.DeriveChangeAddressResponse.SerializeToString, + ), + 'ListAddresses': grpc.unary_unary_rpc_method_handler( + servicer.ListAddresses, + request_deserializer=ocean_dot_v1_dot_account__pb2.ListAddressesRequest.FromString, + response_serializer=ocean_dot_v1_dot_account__pb2.ListAddressesResponse.SerializeToString, + ), + 'Balance': grpc.unary_unary_rpc_method_handler( + servicer.Balance, + request_deserializer=ocean_dot_v1_dot_account__pb2.BalanceRequest.FromString, + response_serializer=ocean_dot_v1_dot_account__pb2.BalanceResponse.SerializeToString, + ), + 'ListUtxos': grpc.unary_unary_rpc_method_handler( + servicer.ListUtxos, + request_deserializer=ocean_dot_v1_dot_account__pb2.ListUtxosRequest.FromString, + response_serializer=ocean_dot_v1_dot_account__pb2.ListUtxosResponse.SerializeToString, + ), + 'DeleteAccount': grpc.unary_unary_rpc_method_handler( + servicer.DeleteAccount, + request_deserializer=ocean_dot_v1_dot_account__pb2.DeleteAccountRequest.FromString, + response_serializer=ocean_dot_v1_dot_account__pb2.DeleteAccountResponse.SerializeToString, + ), + } + generic_handler = grpc.method_handlers_generic_handler( + 'ocean.v1.AccountService', rpc_method_handlers) + server.add_generic_rpc_handlers((generic_handler,)) + + + # This class is part of an EXPERIMENTAL API. +class AccountService(object): + """AccountService is used to manage accounts in HD Wallet. + It supports generating addresses, listing utxos and balances for specific account or + list of addresses and selecting utxos. + """ + + @staticmethod + def CreateAccountBIP44(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/ocean.v1.AccountService/CreateAccountBIP44', + ocean_dot_v1_dot_account__pb2.CreateAccountBIP44Request.SerializeToString, + ocean_dot_v1_dot_account__pb2.CreateAccountBIP44Response.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def CreateAccountCustom(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/ocean.v1.AccountService/CreateAccountCustom', + ocean_dot_v1_dot_account__pb2.CreateAccountCustomRequest.SerializeToString, + ocean_dot_v1_dot_account__pb2.CreateAccountCustomResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def SetAccountTemplate(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/ocean.v1.AccountService/SetAccountTemplate', + ocean_dot_v1_dot_account__pb2.SetAccountTemplateRequest.SerializeToString, + ocean_dot_v1_dot_account__pb2.SetAccountTemplateResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def DeriveAddress(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/ocean.v1.AccountService/DeriveAddress', + ocean_dot_v1_dot_account__pb2.DeriveAddressRequest.SerializeToString, + ocean_dot_v1_dot_account__pb2.DeriveAddressResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def DeriveChangeAddress(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/ocean.v1.AccountService/DeriveChangeAddress', + ocean_dot_v1_dot_account__pb2.DeriveChangeAddressRequest.SerializeToString, + ocean_dot_v1_dot_account__pb2.DeriveChangeAddressResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def ListAddresses(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/ocean.v1.AccountService/ListAddresses', + ocean_dot_v1_dot_account__pb2.ListAddressesRequest.SerializeToString, + ocean_dot_v1_dot_account__pb2.ListAddressesResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def Balance(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/ocean.v1.AccountService/Balance', + ocean_dot_v1_dot_account__pb2.BalanceRequest.SerializeToString, + ocean_dot_v1_dot_account__pb2.BalanceResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def ListUtxos(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/ocean.v1.AccountService/ListUtxos', + ocean_dot_v1_dot_account__pb2.ListUtxosRequest.SerializeToString, + ocean_dot_v1_dot_account__pb2.ListUtxosResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def DeleteAccount(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/ocean.v1.AccountService/DeleteAccount', + ocean_dot_v1_dot_account__pb2.DeleteAccountRequest.SerializeToString, + ocean_dot_v1_dot_account__pb2.DeleteAccountResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/api-spec/protobuf/gen/python/ocean/v1/notification_pb2.py b/api-spec/protobuf/gen/python/ocean/v1/notification_pb2.py new file mode 100644 index 0000000..125683f --- /dev/null +++ b/api-spec/protobuf/gen/python/ocean/v1/notification_pb2.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: ocean/v1/notification.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from ocean.v1 import types_pb2 as ocean_dot_v1_dot_types__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1bocean/v1/notification.proto\x12\x08ocean.v1\x1a\x14ocean/v1/types.proto\"!\n\x1fTransactionNotificationsRequest\"\xce\x01\n TransactionNotificationsResponse\x12#\n\raccount_names\x18\x01 \x03(\tR\x0c\x61\x63\x63ountNames\x12\x12\n\x04txid\x18\x02 \x01(\tR\x04txid\x12\x34\n\nevent_type\x18\x03 \x01(\x0e\x32\x15.ocean.v1.TxEventTypeR\teventType\x12;\n\rblock_details\x18\x04 \x01(\x0b\x32\x16.ocean.v1.BlockDetailsR\x0c\x62lockDetails\"\x1b\n\x19UtxosNotificationsRequest\"z\n\x1aUtxosNotificationsResponse\x12$\n\x05utxos\x18\x01 \x03(\x0b\x32\x0e.ocean.v1.UtxoR\x05utxos\x12\x36\n\nevent_type\x18\x02 \x01(\x0e\x32\x17.ocean.v1.UtxoEventTypeR\teventType\"\x82\x01\n\x11\x41\x64\x64WebhookRequest\x12\x1a\n\x08\x65ndpoint\x18\x01 \x01(\tR\x08\x65ndpoint\x12\x39\n\nevent_type\x18\x02 \x01(\x0e\x32\x1a.ocean.v1.WebhookEventTypeR\teventType\x12\x16\n\x06secret\x18\x03 \x01(\tR\x06secret\"$\n\x12\x41\x64\x64WebhookResponse\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\"&\n\x14RemoveWebhookRequest\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\"\x17\n\x15RemoveWebhookResponse\"P\n\x13ListWebhooksRequest\x12\x39\n\nevent_type\x18\x01 \x01(\x0e\x32\x1a.ocean.v1.WebhookEventTypeR\teventType\"P\n\x14ListWebhooksResponse\x12\x38\n\x0cwebhook_info\x18\x01 \x03(\x0b\x32\x15.ocean.v1.WebhookInfoR\x0bwebhookInfo\"X\n\x0bWebhookInfo\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x1a\n\x08\x65ndpoint\x18\x02 \x01(\tR\x08\x65ndpoint\x12\x1d\n\nis_secured\x18\x03 \x01(\x08R\tisSecured2\xdd\x03\n\x13NotificationService\x12s\n\x18TransactionNotifications\x12).ocean.v1.TransactionNotificationsRequest\x1a*.ocean.v1.TransactionNotificationsResponse0\x01\x12\x61\n\x12UtxosNotifications\x12#.ocean.v1.UtxosNotificationsRequest\x1a$.ocean.v1.UtxosNotificationsResponse0\x01\x12I\n\nAddWebhook\x12\x1b.ocean.v1.AddWebhookRequest\x1a\x1c.ocean.v1.AddWebhookResponse\"\x00\x12R\n\rRemoveWebhook\x12\x1e.ocean.v1.RemoveWebhookRequest\x1a\x1f.ocean.v1.RemoveWebhookResponse\"\x00\x12O\n\x0cListWebhooks\x12\x1d.ocean.v1.ListWebhooksRequest\x1a\x1e.ocean.v1.ListWebhooksResponse\"\x00\x42\xaa\x01\n\x0c\x63om.ocean.v1B\x11NotificationProtoP\x01ZFgithub.com/vulpemventures/ocean/api-spec/protobuf/gen/ocean/v1;oceanv1\xa2\x02\x03OXX\xaa\x02\x08Ocean.V1\xca\x02\x08Ocean\\V1\xe2\x02\x14Ocean\\V1\\GPBMetadata\xea\x02\tOcean::V1b\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'ocean.v1.notification_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\014com.ocean.v1B\021NotificationProtoP\001ZFgithub.com/vulpemventures/ocean/api-spec/protobuf/gen/ocean/v1;oceanv1\242\002\003OXX\252\002\010Ocean.V1\312\002\010Ocean\\V1\342\002\024Ocean\\V1\\GPBMetadata\352\002\tOcean::V1' + _TRANSACTIONNOTIFICATIONSREQUEST._serialized_start=63 + _TRANSACTIONNOTIFICATIONSREQUEST._serialized_end=96 + _TRANSACTIONNOTIFICATIONSRESPONSE._serialized_start=99 + _TRANSACTIONNOTIFICATIONSRESPONSE._serialized_end=305 + _UTXOSNOTIFICATIONSREQUEST._serialized_start=307 + _UTXOSNOTIFICATIONSREQUEST._serialized_end=334 + _UTXOSNOTIFICATIONSRESPONSE._serialized_start=336 + _UTXOSNOTIFICATIONSRESPONSE._serialized_end=458 + _ADDWEBHOOKREQUEST._serialized_start=461 + _ADDWEBHOOKREQUEST._serialized_end=591 + _ADDWEBHOOKRESPONSE._serialized_start=593 + _ADDWEBHOOKRESPONSE._serialized_end=629 + _REMOVEWEBHOOKREQUEST._serialized_start=631 + _REMOVEWEBHOOKREQUEST._serialized_end=669 + _REMOVEWEBHOOKRESPONSE._serialized_start=671 + _REMOVEWEBHOOKRESPONSE._serialized_end=694 + _LISTWEBHOOKSREQUEST._serialized_start=696 + _LISTWEBHOOKSREQUEST._serialized_end=776 + _LISTWEBHOOKSRESPONSE._serialized_start=778 + _LISTWEBHOOKSRESPONSE._serialized_end=858 + _WEBHOOKINFO._serialized_start=860 + _WEBHOOKINFO._serialized_end=948 + _NOTIFICATIONSERVICE._serialized_start=951 + _NOTIFICATIONSERVICE._serialized_end=1428 +# @@protoc_insertion_point(module_scope) diff --git a/api-spec/protobuf/gen/python/ocean/v1alpha/notification_pb2_grpc.py b/api-spec/protobuf/gen/python/ocean/v1/notification_pb2_grpc.py similarity index 63% rename from api-spec/protobuf/gen/python/ocean/v1alpha/notification_pb2_grpc.py rename to api-spec/protobuf/gen/python/ocean/v1/notification_pb2_grpc.py index 54c9687..b46b5c1 100644 --- a/api-spec/protobuf/gen/python/ocean/v1alpha/notification_pb2_grpc.py +++ b/api-spec/protobuf/gen/python/ocean/v1/notification_pb2_grpc.py @@ -2,7 +2,7 @@ """Client and server classes corresponding to protobuf-defined services.""" import grpc -from ocean.v1alpha import notification_pb2 as ocean_dot_v1alpha_dot_notification__pb2 +from ocean.v1 import notification_pb2 as ocean_dot_v1_dot_notification__pb2 class NotificationServiceStub(object): @@ -23,29 +23,29 @@ def __init__(self, channel): channel: A grpc.Channel. """ self.TransactionNotifications = channel.unary_stream( - '/ocean.v1alpha.NotificationService/TransactionNotifications', - request_serializer=ocean_dot_v1alpha_dot_notification__pb2.TransactionNotificationsRequest.SerializeToString, - response_deserializer=ocean_dot_v1alpha_dot_notification__pb2.TransactionNotificationsResponse.FromString, + '/ocean.v1.NotificationService/TransactionNotifications', + request_serializer=ocean_dot_v1_dot_notification__pb2.TransactionNotificationsRequest.SerializeToString, + response_deserializer=ocean_dot_v1_dot_notification__pb2.TransactionNotificationsResponse.FromString, ) self.UtxosNotifications = channel.unary_stream( - '/ocean.v1alpha.NotificationService/UtxosNotifications', - request_serializer=ocean_dot_v1alpha_dot_notification__pb2.UtxosNotificationsRequest.SerializeToString, - response_deserializer=ocean_dot_v1alpha_dot_notification__pb2.UtxosNotificationsResponse.FromString, + '/ocean.v1.NotificationService/UtxosNotifications', + request_serializer=ocean_dot_v1_dot_notification__pb2.UtxosNotificationsRequest.SerializeToString, + response_deserializer=ocean_dot_v1_dot_notification__pb2.UtxosNotificationsResponse.FromString, ) self.AddWebhook = channel.unary_unary( - '/ocean.v1alpha.NotificationService/AddWebhook', - request_serializer=ocean_dot_v1alpha_dot_notification__pb2.AddWebhookRequest.SerializeToString, - response_deserializer=ocean_dot_v1alpha_dot_notification__pb2.AddWebhookResponse.FromString, + '/ocean.v1.NotificationService/AddWebhook', + request_serializer=ocean_dot_v1_dot_notification__pb2.AddWebhookRequest.SerializeToString, + response_deserializer=ocean_dot_v1_dot_notification__pb2.AddWebhookResponse.FromString, ) self.RemoveWebhook = channel.unary_unary( - '/ocean.v1alpha.NotificationService/RemoveWebhook', - request_serializer=ocean_dot_v1alpha_dot_notification__pb2.RemoveWebhookRequest.SerializeToString, - response_deserializer=ocean_dot_v1alpha_dot_notification__pb2.RemoveWebhookResponse.FromString, + '/ocean.v1.NotificationService/RemoveWebhook', + request_serializer=ocean_dot_v1_dot_notification__pb2.RemoveWebhookRequest.SerializeToString, + response_deserializer=ocean_dot_v1_dot_notification__pb2.RemoveWebhookResponse.FromString, ) self.ListWebhooks = channel.unary_unary( - '/ocean.v1alpha.NotificationService/ListWebhooks', - request_serializer=ocean_dot_v1alpha_dot_notification__pb2.ListWebhooksRequest.SerializeToString, - response_deserializer=ocean_dot_v1alpha_dot_notification__pb2.ListWebhooksResponse.FromString, + '/ocean.v1.NotificationService/ListWebhooks', + request_serializer=ocean_dot_v1_dot_notification__pb2.ListWebhooksRequest.SerializeToString, + response_deserializer=ocean_dot_v1_dot_notification__pb2.ListWebhooksResponse.FromString, ) @@ -104,32 +104,32 @@ def add_NotificationServiceServicer_to_server(servicer, server): rpc_method_handlers = { 'TransactionNotifications': grpc.unary_stream_rpc_method_handler( servicer.TransactionNotifications, - request_deserializer=ocean_dot_v1alpha_dot_notification__pb2.TransactionNotificationsRequest.FromString, - response_serializer=ocean_dot_v1alpha_dot_notification__pb2.TransactionNotificationsResponse.SerializeToString, + request_deserializer=ocean_dot_v1_dot_notification__pb2.TransactionNotificationsRequest.FromString, + response_serializer=ocean_dot_v1_dot_notification__pb2.TransactionNotificationsResponse.SerializeToString, ), 'UtxosNotifications': grpc.unary_stream_rpc_method_handler( servicer.UtxosNotifications, - request_deserializer=ocean_dot_v1alpha_dot_notification__pb2.UtxosNotificationsRequest.FromString, - response_serializer=ocean_dot_v1alpha_dot_notification__pb2.UtxosNotificationsResponse.SerializeToString, + request_deserializer=ocean_dot_v1_dot_notification__pb2.UtxosNotificationsRequest.FromString, + response_serializer=ocean_dot_v1_dot_notification__pb2.UtxosNotificationsResponse.SerializeToString, ), 'AddWebhook': grpc.unary_unary_rpc_method_handler( servicer.AddWebhook, - request_deserializer=ocean_dot_v1alpha_dot_notification__pb2.AddWebhookRequest.FromString, - response_serializer=ocean_dot_v1alpha_dot_notification__pb2.AddWebhookResponse.SerializeToString, + request_deserializer=ocean_dot_v1_dot_notification__pb2.AddWebhookRequest.FromString, + response_serializer=ocean_dot_v1_dot_notification__pb2.AddWebhookResponse.SerializeToString, ), 'RemoveWebhook': grpc.unary_unary_rpc_method_handler( servicer.RemoveWebhook, - request_deserializer=ocean_dot_v1alpha_dot_notification__pb2.RemoveWebhookRequest.FromString, - response_serializer=ocean_dot_v1alpha_dot_notification__pb2.RemoveWebhookResponse.SerializeToString, + request_deserializer=ocean_dot_v1_dot_notification__pb2.RemoveWebhookRequest.FromString, + response_serializer=ocean_dot_v1_dot_notification__pb2.RemoveWebhookResponse.SerializeToString, ), 'ListWebhooks': grpc.unary_unary_rpc_method_handler( servicer.ListWebhooks, - request_deserializer=ocean_dot_v1alpha_dot_notification__pb2.ListWebhooksRequest.FromString, - response_serializer=ocean_dot_v1alpha_dot_notification__pb2.ListWebhooksResponse.SerializeToString, + request_deserializer=ocean_dot_v1_dot_notification__pb2.ListWebhooksRequest.FromString, + response_serializer=ocean_dot_v1_dot_notification__pb2.ListWebhooksResponse.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( - 'ocean.v1alpha.NotificationService', rpc_method_handlers) + 'ocean.v1.NotificationService', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) @@ -156,9 +156,9 @@ def TransactionNotifications(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_stream(request, target, '/ocean.v1alpha.NotificationService/TransactionNotifications', - ocean_dot_v1alpha_dot_notification__pb2.TransactionNotificationsRequest.SerializeToString, - ocean_dot_v1alpha_dot_notification__pb2.TransactionNotificationsResponse.FromString, + return grpc.experimental.unary_stream(request, target, '/ocean.v1.NotificationService/TransactionNotifications', + ocean_dot_v1_dot_notification__pb2.TransactionNotificationsRequest.SerializeToString, + ocean_dot_v1_dot_notification__pb2.TransactionNotificationsResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @@ -173,9 +173,9 @@ def UtxosNotifications(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_stream(request, target, '/ocean.v1alpha.NotificationService/UtxosNotifications', - ocean_dot_v1alpha_dot_notification__pb2.UtxosNotificationsRequest.SerializeToString, - ocean_dot_v1alpha_dot_notification__pb2.UtxosNotificationsResponse.FromString, + return grpc.experimental.unary_stream(request, target, '/ocean.v1.NotificationService/UtxosNotifications', + ocean_dot_v1_dot_notification__pb2.UtxosNotificationsRequest.SerializeToString, + ocean_dot_v1_dot_notification__pb2.UtxosNotificationsResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @@ -190,9 +190,9 @@ def AddWebhook(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/ocean.v1alpha.NotificationService/AddWebhook', - ocean_dot_v1alpha_dot_notification__pb2.AddWebhookRequest.SerializeToString, - ocean_dot_v1alpha_dot_notification__pb2.AddWebhookResponse.FromString, + return grpc.experimental.unary_unary(request, target, '/ocean.v1.NotificationService/AddWebhook', + ocean_dot_v1_dot_notification__pb2.AddWebhookRequest.SerializeToString, + ocean_dot_v1_dot_notification__pb2.AddWebhookResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @@ -207,9 +207,9 @@ def RemoveWebhook(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/ocean.v1alpha.NotificationService/RemoveWebhook', - ocean_dot_v1alpha_dot_notification__pb2.RemoveWebhookRequest.SerializeToString, - ocean_dot_v1alpha_dot_notification__pb2.RemoveWebhookResponse.FromString, + return grpc.experimental.unary_unary(request, target, '/ocean.v1.NotificationService/RemoveWebhook', + ocean_dot_v1_dot_notification__pb2.RemoveWebhookRequest.SerializeToString, + ocean_dot_v1_dot_notification__pb2.RemoveWebhookResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @@ -224,8 +224,8 @@ def ListWebhooks(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/ocean.v1alpha.NotificationService/ListWebhooks', - ocean_dot_v1alpha_dot_notification__pb2.ListWebhooksRequest.SerializeToString, - ocean_dot_v1alpha_dot_notification__pb2.ListWebhooksResponse.FromString, + return grpc.experimental.unary_unary(request, target, '/ocean.v1.NotificationService/ListWebhooks', + ocean_dot_v1_dot_notification__pb2.ListWebhooksRequest.SerializeToString, + ocean_dot_v1_dot_notification__pb2.ListWebhooksResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/api-spec/protobuf/gen/python/ocean/v1/transaction_pb2.py b/api-spec/protobuf/gen/python/ocean/v1/transaction_pb2.py new file mode 100644 index 0000000..41ca950 --- /dev/null +++ b/api-spec/protobuf/gen/python/ocean/v1/transaction_pb2.py @@ -0,0 +1,89 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: ocean/v1/transaction.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from ocean.v1 import types_pb2 as ocean_dot_v1_dot_types__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1aocean/v1/transaction.proto\x12\x08ocean.v1\x1a\x14ocean/v1/types.proto\"+\n\x15GetTransactionRequest\x12\x12\n\x04txid\x18\x01 \x01(\tR\x04txid\"l\n\x16GetTransactionResponse\x12\x15\n\x06tx_hex\x18\x01 \x01(\tR\x05txHex\x12;\n\rblock_details\x18\x02 \x01(\x0b\x32\x16.ocean.v1.BlockDetailsR\x0c\x62lockDetails\"\x9a\x02\n\x12SelectUtxosRequest\x12!\n\x0c\x61\x63\x63ount_name\x18\x01 \x01(\tR\x0b\x61\x63\x63ountName\x12!\n\x0ctarget_asset\x18\x02 \x01(\tR\x0btargetAsset\x12#\n\rtarget_amount\x18\x03 \x01(\x04R\x0ctargetAmount\x12\x41\n\x08strategy\x18\x04 \x01(\x0e\x32%.ocean.v1.SelectUtxosRequest.StrategyR\x08strategy\"V\n\x08Strategy\x12\x18\n\x14STRATEGY_UNSPECIFIED\x10\x00\x12\x19\n\x15STRATEGY_BRANCH_BOUND\x10\x01\x12\x15\n\x11STRATEGY_FRAGMENT\x10\x02\"|\n\x13SelectUtxosResponse\x12$\n\x05utxos\x18\x01 \x03(\x0b\x32\x0e.ocean.v1.UtxoR\x05utxos\x12\x16\n\x06\x63hange\x18\x02 \x01(\x04R\x06\x63hange\x12\'\n\x0f\x65xpiration_date\x18\x03 \x01(\x03R\x0e\x65xpirationDate\"\x98\x01\n\x13\x45stimateFeesRequest\x12\'\n\x06inputs\x18\x01 \x03(\x0b\x32\x0f.ocean.v1.InputR\x06inputs\x12*\n\x07outputs\x18\x02 \x03(\x0b\x32\x10.ocean.v1.OutputR\x07outputs\x12,\n\x12millisats_per_byte\x18\x03 \x01(\x04R\x10millisatsPerByte\"5\n\x14\x45stimateFeesResponse\x12\x1d\n\nfee_amount\x18\x01 \x01(\x04R\tfeeAmount\"R\n\x16SignTransactionRequest\x12\x15\n\x06tx_hex\x18\x01 \x01(\tR\x05txHex\x12!\n\x0csighash_type\x18\x02 \x01(\rR\x0bsighashType\"0\n\x17SignTransactionResponse\x12\x15\n\x06tx_hex\x18\x01 \x01(\tR\x05txHex\"4\n\x1b\x42roadcastTransactionRequest\x12\x15\n\x06tx_hex\x18\x01 \x01(\tR\x05txHex\"2\n\x1c\x42roadcastTransactionResponse\x12\x12\n\x04txid\x18\x01 \x01(\tR\x04txid\"h\n\x11\x43reatePsetRequest\x12\'\n\x06inputs\x18\x01 \x03(\x0b\x32\x0f.ocean.v1.InputR\x06inputs\x12*\n\x07outputs\x18\x02 \x03(\x0b\x32\x10.ocean.v1.OutputR\x07outputs\"(\n\x12\x43reatePsetResponse\x12\x12\n\x04pset\x18\x01 \x01(\tR\x04pset\"|\n\x11UpdatePsetRequest\x12\x12\n\x04pset\x18\x01 \x01(\tR\x04pset\x12\'\n\x06inputs\x18\x02 \x03(\x0b\x32\x0f.ocean.v1.InputR\x06inputs\x12*\n\x07outputs\x18\x03 \x03(\x0b\x32\x10.ocean.v1.OutputR\x07outputs\"(\n\x12UpdatePsetResponse\x12\x12\n\x04pset\x18\x01 \x01(\tR\x04pset\"I\n\x10\x42lindPsetRequest\x12\x12\n\x04pset\x18\x01 \x01(\tR\x04pset\x12!\n\x0clast_blinder\x18\x02 \x01(\x08R\x0blastBlinder\"\'\n\x11\x42lindPsetResponse\x12\x12\n\x04pset\x18\x01 \x01(\tR\x04pset\"H\n\x0fSignPsetRequest\x12\x12\n\x04pset\x18\x01 \x01(\tR\x04pset\x12!\n\x0csighash_type\x18\x02 \x01(\rR\x0bsighashType\"&\n\x10SignPsetResponse\x12\x12\n\x04pset\x18\x01 \x01(\tR\x04pset\"\x89\x02\n\x0bMintRequest\x12!\n\x0c\x61\x63\x63ount_name\x18\x01 \x01(\tR\x0b\x61\x63\x63ountName\x12!\n\x0c\x61sset_amount\x18\x02 \x01(\x04R\x0b\x61ssetAmount\x12!\n\x0ctoken_amount\x18\x03 \x01(\x04R\x0btokenAmount\x12\x1d\n\nasset_name\x18\x04 \x01(\tR\tassetName\x12!\n\x0c\x61sset_ticker\x18\x05 \x01(\tR\x0b\x61ssetTicker\x12!\n\x0c\x61sset_domain\x18\x06 \x01(\tR\x0b\x61ssetDomain\x12,\n\x12millisats_per_byte\x18\x07 \x01(\x04R\x10millisatsPerByte\"%\n\x0cMintResponse\x12\x15\n\x06tx_hex\x18\x01 \x01(\tR\x05txHex\"\x8e\x01\n\rRemintRequest\x12!\n\x0c\x61\x63\x63ount_name\x18\x01 \x01(\tR\x0b\x61\x63\x63ountName\x12\x14\n\x05\x61sset\x18\x02 \x01(\tR\x05\x61sset\x12\x16\n\x06\x61mount\x18\x03 \x01(\x04R\x06\x61mount\x12,\n\x12millisats_per_byte\x18\x04 \x01(\x04R\x10millisatsPerByte\"\'\n\x0eRemintResponse\x12\x15\n\x06tx_hex\x18\x01 \x01(\tR\x05txHex\"\x8e\x01\n\x0b\x42urnRequest\x12!\n\x0c\x61\x63\x63ount_name\x18\x01 \x01(\tR\x0b\x61\x63\x63ountName\x12.\n\treceivers\x18\x02 \x03(\x0b\x32\x10.ocean.v1.OutputR\treceivers\x12,\n\x12millisats_per_byte\x18\x03 \x01(\x04R\x10millisatsPerByte\"%\n\x0c\x42urnResponse\x12\x15\n\x06tx_hex\x18\x01 \x01(\tR\x05txHex\"\x92\x01\n\x0fTransferRequest\x12!\n\x0c\x61\x63\x63ount_name\x18\x01 \x01(\tR\x0b\x61\x63\x63ountName\x12.\n\treceivers\x18\x02 \x03(\x0b\x32\x10.ocean.v1.OutputR\treceivers\x12,\n\x12millisats_per_byte\x18\x03 \x01(\x04R\x10millisatsPerByte\")\n\x10TransferResponse\x12\x15\n\x06tx_hex\x18\x01 \x01(\tR\x05txHex\"\x15\n\x13PegInAddressRequest\"\x8a\x01\n\x14PegInAddressResponse\x12!\n\x0c\x61\x63\x63ount_name\x18\x01 \x01(\tR\x0b\x61\x63\x63ountName\x12,\n\x12main_chain_address\x18\x02 \x01(\tR\x10mainChainAddress\x12!\n\x0c\x63laim_script\x18\x03 \x01(\tR\x0b\x63laimScript\"w\n\x11\x43laimPegInRequest\x12\x1d\n\nbitcoin_tx\x18\x01 \x01(\tR\tbitcoinTx\x12 \n\x0ctx_out_proof\x18\x02 \x01(\tR\ntxOutProof\x12!\n\x0c\x63laim_script\x18\x03 \x01(\tR\x0b\x63laimScript\"+\n\x12\x43laimPegInResponse\x12\x15\n\x06tx_hex\x18\x01 \x01(\tR\x05txHex2\xe4\x08\n\x12TransactionService\x12S\n\x0eGetTransaction\x12\x1f.ocean.v1.GetTransactionRequest\x1a .ocean.v1.GetTransactionResponse\x12J\n\x0bSelectUtxos\x12\x1c.ocean.v1.SelectUtxosRequest\x1a\x1d.ocean.v1.SelectUtxosResponse\x12M\n\x0c\x45stimateFees\x12\x1d.ocean.v1.EstimateFeesRequest\x1a\x1e.ocean.v1.EstimateFeesResponse\x12V\n\x0fSignTransaction\x12 .ocean.v1.SignTransactionRequest\x1a!.ocean.v1.SignTransactionResponse\x12\x65\n\x14\x42roadcastTransaction\x12%.ocean.v1.BroadcastTransactionRequest\x1a&.ocean.v1.BroadcastTransactionResponse\x12G\n\nCreatePset\x12\x1b.ocean.v1.CreatePsetRequest\x1a\x1c.ocean.v1.CreatePsetResponse\x12G\n\nUpdatePset\x12\x1b.ocean.v1.UpdatePsetRequest\x1a\x1c.ocean.v1.UpdatePsetResponse\x12\x44\n\tBlindPset\x12\x1a.ocean.v1.BlindPsetRequest\x1a\x1b.ocean.v1.BlindPsetResponse\x12\x41\n\x08SignPset\x12\x19.ocean.v1.SignPsetRequest\x1a\x1a.ocean.v1.SignPsetResponse\x12\x35\n\x04Mint\x12\x15.ocean.v1.MintRequest\x1a\x16.ocean.v1.MintResponse\x12;\n\x06Remint\x12\x17.ocean.v1.RemintRequest\x1a\x18.ocean.v1.RemintResponse\x12\x35\n\x04\x42urn\x12\x15.ocean.v1.BurnRequest\x1a\x16.ocean.v1.BurnResponse\x12\x41\n\x08Transfer\x12\x19.ocean.v1.TransferRequest\x1a\x1a.ocean.v1.TransferResponse\x12M\n\x0cPegInAddress\x12\x1d.ocean.v1.PegInAddressRequest\x1a\x1e.ocean.v1.PegInAddressResponse\x12G\n\nClaimPegIn\x12\x1b.ocean.v1.ClaimPegInRequest\x1a\x1c.ocean.v1.ClaimPegInResponseB\xa9\x01\n\x0c\x63om.ocean.v1B\x10TransactionProtoP\x01ZFgithub.com/vulpemventures/ocean/api-spec/protobuf/gen/ocean/v1;oceanv1\xa2\x02\x03OXX\xaa\x02\x08Ocean.V1\xca\x02\x08Ocean\\V1\xe2\x02\x14Ocean\\V1\\GPBMetadata\xea\x02\tOcean::V1b\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'ocean.v1.transaction_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\014com.ocean.v1B\020TransactionProtoP\001ZFgithub.com/vulpemventures/ocean/api-spec/protobuf/gen/ocean/v1;oceanv1\242\002\003OXX\252\002\010Ocean.V1\312\002\010Ocean\\V1\342\002\024Ocean\\V1\\GPBMetadata\352\002\tOcean::V1' + _GETTRANSACTIONREQUEST._serialized_start=62 + _GETTRANSACTIONREQUEST._serialized_end=105 + _GETTRANSACTIONRESPONSE._serialized_start=107 + _GETTRANSACTIONRESPONSE._serialized_end=215 + _SELECTUTXOSREQUEST._serialized_start=218 + _SELECTUTXOSREQUEST._serialized_end=500 + _SELECTUTXOSREQUEST_STRATEGY._serialized_start=414 + _SELECTUTXOSREQUEST_STRATEGY._serialized_end=500 + _SELECTUTXOSRESPONSE._serialized_start=502 + _SELECTUTXOSRESPONSE._serialized_end=626 + _ESTIMATEFEESREQUEST._serialized_start=629 + _ESTIMATEFEESREQUEST._serialized_end=781 + _ESTIMATEFEESRESPONSE._serialized_start=783 + _ESTIMATEFEESRESPONSE._serialized_end=836 + _SIGNTRANSACTIONREQUEST._serialized_start=838 + _SIGNTRANSACTIONREQUEST._serialized_end=920 + _SIGNTRANSACTIONRESPONSE._serialized_start=922 + _SIGNTRANSACTIONRESPONSE._serialized_end=970 + _BROADCASTTRANSACTIONREQUEST._serialized_start=972 + _BROADCASTTRANSACTIONREQUEST._serialized_end=1024 + _BROADCASTTRANSACTIONRESPONSE._serialized_start=1026 + _BROADCASTTRANSACTIONRESPONSE._serialized_end=1076 + _CREATEPSETREQUEST._serialized_start=1078 + _CREATEPSETREQUEST._serialized_end=1182 + _CREATEPSETRESPONSE._serialized_start=1184 + _CREATEPSETRESPONSE._serialized_end=1224 + _UPDATEPSETREQUEST._serialized_start=1226 + _UPDATEPSETREQUEST._serialized_end=1350 + _UPDATEPSETRESPONSE._serialized_start=1352 + _UPDATEPSETRESPONSE._serialized_end=1392 + _BLINDPSETREQUEST._serialized_start=1394 + _BLINDPSETREQUEST._serialized_end=1467 + _BLINDPSETRESPONSE._serialized_start=1469 + _BLINDPSETRESPONSE._serialized_end=1508 + _SIGNPSETREQUEST._serialized_start=1510 + _SIGNPSETREQUEST._serialized_end=1582 + _SIGNPSETRESPONSE._serialized_start=1584 + _SIGNPSETRESPONSE._serialized_end=1622 + _MINTREQUEST._serialized_start=1625 + _MINTREQUEST._serialized_end=1890 + _MINTRESPONSE._serialized_start=1892 + _MINTRESPONSE._serialized_end=1929 + _REMINTREQUEST._serialized_start=1932 + _REMINTREQUEST._serialized_end=2074 + _REMINTRESPONSE._serialized_start=2076 + _REMINTRESPONSE._serialized_end=2115 + _BURNREQUEST._serialized_start=2118 + _BURNREQUEST._serialized_end=2260 + _BURNRESPONSE._serialized_start=2262 + _BURNRESPONSE._serialized_end=2299 + _TRANSFERREQUEST._serialized_start=2302 + _TRANSFERREQUEST._serialized_end=2448 + _TRANSFERRESPONSE._serialized_start=2450 + _TRANSFERRESPONSE._serialized_end=2491 + _PEGINADDRESSREQUEST._serialized_start=2493 + _PEGINADDRESSREQUEST._serialized_end=2514 + _PEGINADDRESSRESPONSE._serialized_start=2517 + _PEGINADDRESSRESPONSE._serialized_end=2655 + _CLAIMPEGINREQUEST._serialized_start=2657 + _CLAIMPEGINREQUEST._serialized_end=2776 + _CLAIMPEGINRESPONSE._serialized_start=2778 + _CLAIMPEGINRESPONSE._serialized_end=2821 + _TRANSACTIONSERVICE._serialized_start=2824 + _TRANSACTIONSERVICE._serialized_end=3948 +# @@protoc_insertion_point(module_scope) diff --git a/api-spec/protobuf/gen/python/ocean/v1alpha/transaction_pb2_grpc.py b/api-spec/protobuf/gen/python/ocean/v1/transaction_pb2_grpc.py similarity index 60% rename from api-spec/protobuf/gen/python/ocean/v1alpha/transaction_pb2_grpc.py rename to api-spec/protobuf/gen/python/ocean/v1/transaction_pb2_grpc.py index 150ce58..3186121 100644 --- a/api-spec/protobuf/gen/python/ocean/v1alpha/transaction_pb2_grpc.py +++ b/api-spec/protobuf/gen/python/ocean/v1/transaction_pb2_grpc.py @@ -2,7 +2,7 @@ """Client and server classes corresponding to protobuf-defined services.""" import grpc -from ocean.v1alpha import transaction_pb2 as ocean_dot_v1alpha_dot_transaction__pb2 +from ocean.v1 import transaction_pb2 as ocean_dot_v1_dot_transaction__pb2 class TransactionServiceStub(object): @@ -17,79 +17,79 @@ def __init__(self, channel): channel: A grpc.Channel. """ self.GetTransaction = channel.unary_unary( - '/ocean.v1alpha.TransactionService/GetTransaction', - request_serializer=ocean_dot_v1alpha_dot_transaction__pb2.GetTransactionRequest.SerializeToString, - response_deserializer=ocean_dot_v1alpha_dot_transaction__pb2.GetTransactionResponse.FromString, + '/ocean.v1.TransactionService/GetTransaction', + request_serializer=ocean_dot_v1_dot_transaction__pb2.GetTransactionRequest.SerializeToString, + response_deserializer=ocean_dot_v1_dot_transaction__pb2.GetTransactionResponse.FromString, ) self.SelectUtxos = channel.unary_unary( - '/ocean.v1alpha.TransactionService/SelectUtxos', - request_serializer=ocean_dot_v1alpha_dot_transaction__pb2.SelectUtxosRequest.SerializeToString, - response_deserializer=ocean_dot_v1alpha_dot_transaction__pb2.SelectUtxosResponse.FromString, + '/ocean.v1.TransactionService/SelectUtxos', + request_serializer=ocean_dot_v1_dot_transaction__pb2.SelectUtxosRequest.SerializeToString, + response_deserializer=ocean_dot_v1_dot_transaction__pb2.SelectUtxosResponse.FromString, ) self.EstimateFees = channel.unary_unary( - '/ocean.v1alpha.TransactionService/EstimateFees', - request_serializer=ocean_dot_v1alpha_dot_transaction__pb2.EstimateFeesRequest.SerializeToString, - response_deserializer=ocean_dot_v1alpha_dot_transaction__pb2.EstimateFeesResponse.FromString, + '/ocean.v1.TransactionService/EstimateFees', + request_serializer=ocean_dot_v1_dot_transaction__pb2.EstimateFeesRequest.SerializeToString, + response_deserializer=ocean_dot_v1_dot_transaction__pb2.EstimateFeesResponse.FromString, ) self.SignTransaction = channel.unary_unary( - '/ocean.v1alpha.TransactionService/SignTransaction', - request_serializer=ocean_dot_v1alpha_dot_transaction__pb2.SignTransactionRequest.SerializeToString, - response_deserializer=ocean_dot_v1alpha_dot_transaction__pb2.SignTransactionResponse.FromString, + '/ocean.v1.TransactionService/SignTransaction', + request_serializer=ocean_dot_v1_dot_transaction__pb2.SignTransactionRequest.SerializeToString, + response_deserializer=ocean_dot_v1_dot_transaction__pb2.SignTransactionResponse.FromString, ) self.BroadcastTransaction = channel.unary_unary( - '/ocean.v1alpha.TransactionService/BroadcastTransaction', - request_serializer=ocean_dot_v1alpha_dot_transaction__pb2.BroadcastTransactionRequest.SerializeToString, - response_deserializer=ocean_dot_v1alpha_dot_transaction__pb2.BroadcastTransactionResponse.FromString, + '/ocean.v1.TransactionService/BroadcastTransaction', + request_serializer=ocean_dot_v1_dot_transaction__pb2.BroadcastTransactionRequest.SerializeToString, + response_deserializer=ocean_dot_v1_dot_transaction__pb2.BroadcastTransactionResponse.FromString, ) self.CreatePset = channel.unary_unary( - '/ocean.v1alpha.TransactionService/CreatePset', - request_serializer=ocean_dot_v1alpha_dot_transaction__pb2.CreatePsetRequest.SerializeToString, - response_deserializer=ocean_dot_v1alpha_dot_transaction__pb2.CreatePsetResponse.FromString, + '/ocean.v1.TransactionService/CreatePset', + request_serializer=ocean_dot_v1_dot_transaction__pb2.CreatePsetRequest.SerializeToString, + response_deserializer=ocean_dot_v1_dot_transaction__pb2.CreatePsetResponse.FromString, ) self.UpdatePset = channel.unary_unary( - '/ocean.v1alpha.TransactionService/UpdatePset', - request_serializer=ocean_dot_v1alpha_dot_transaction__pb2.UpdatePsetRequest.SerializeToString, - response_deserializer=ocean_dot_v1alpha_dot_transaction__pb2.UpdatePsetResponse.FromString, + '/ocean.v1.TransactionService/UpdatePset', + request_serializer=ocean_dot_v1_dot_transaction__pb2.UpdatePsetRequest.SerializeToString, + response_deserializer=ocean_dot_v1_dot_transaction__pb2.UpdatePsetResponse.FromString, ) self.BlindPset = channel.unary_unary( - '/ocean.v1alpha.TransactionService/BlindPset', - request_serializer=ocean_dot_v1alpha_dot_transaction__pb2.BlindPsetRequest.SerializeToString, - response_deserializer=ocean_dot_v1alpha_dot_transaction__pb2.BlindPsetResponse.FromString, + '/ocean.v1.TransactionService/BlindPset', + request_serializer=ocean_dot_v1_dot_transaction__pb2.BlindPsetRequest.SerializeToString, + response_deserializer=ocean_dot_v1_dot_transaction__pb2.BlindPsetResponse.FromString, ) self.SignPset = channel.unary_unary( - '/ocean.v1alpha.TransactionService/SignPset', - request_serializer=ocean_dot_v1alpha_dot_transaction__pb2.SignPsetRequest.SerializeToString, - response_deserializer=ocean_dot_v1alpha_dot_transaction__pb2.SignPsetResponse.FromString, + '/ocean.v1.TransactionService/SignPset', + request_serializer=ocean_dot_v1_dot_transaction__pb2.SignPsetRequest.SerializeToString, + response_deserializer=ocean_dot_v1_dot_transaction__pb2.SignPsetResponse.FromString, ) self.Mint = channel.unary_unary( - '/ocean.v1alpha.TransactionService/Mint', - request_serializer=ocean_dot_v1alpha_dot_transaction__pb2.MintRequest.SerializeToString, - response_deserializer=ocean_dot_v1alpha_dot_transaction__pb2.MintResponse.FromString, + '/ocean.v1.TransactionService/Mint', + request_serializer=ocean_dot_v1_dot_transaction__pb2.MintRequest.SerializeToString, + response_deserializer=ocean_dot_v1_dot_transaction__pb2.MintResponse.FromString, ) self.Remint = channel.unary_unary( - '/ocean.v1alpha.TransactionService/Remint', - request_serializer=ocean_dot_v1alpha_dot_transaction__pb2.RemintRequest.SerializeToString, - response_deserializer=ocean_dot_v1alpha_dot_transaction__pb2.RemintResponse.FromString, + '/ocean.v1.TransactionService/Remint', + request_serializer=ocean_dot_v1_dot_transaction__pb2.RemintRequest.SerializeToString, + response_deserializer=ocean_dot_v1_dot_transaction__pb2.RemintResponse.FromString, ) self.Burn = channel.unary_unary( - '/ocean.v1alpha.TransactionService/Burn', - request_serializer=ocean_dot_v1alpha_dot_transaction__pb2.BurnRequest.SerializeToString, - response_deserializer=ocean_dot_v1alpha_dot_transaction__pb2.BurnResponse.FromString, + '/ocean.v1.TransactionService/Burn', + request_serializer=ocean_dot_v1_dot_transaction__pb2.BurnRequest.SerializeToString, + response_deserializer=ocean_dot_v1_dot_transaction__pb2.BurnResponse.FromString, ) self.Transfer = channel.unary_unary( - '/ocean.v1alpha.TransactionService/Transfer', - request_serializer=ocean_dot_v1alpha_dot_transaction__pb2.TransferRequest.SerializeToString, - response_deserializer=ocean_dot_v1alpha_dot_transaction__pb2.TransferResponse.FromString, + '/ocean.v1.TransactionService/Transfer', + request_serializer=ocean_dot_v1_dot_transaction__pb2.TransferRequest.SerializeToString, + response_deserializer=ocean_dot_v1_dot_transaction__pb2.TransferResponse.FromString, ) self.PegInAddress = channel.unary_unary( - '/ocean.v1alpha.TransactionService/PegInAddress', - request_serializer=ocean_dot_v1alpha_dot_transaction__pb2.PegInAddressRequest.SerializeToString, - response_deserializer=ocean_dot_v1alpha_dot_transaction__pb2.PegInAddressResponse.FromString, + '/ocean.v1.TransactionService/PegInAddress', + request_serializer=ocean_dot_v1_dot_transaction__pb2.PegInAddressRequest.SerializeToString, + response_deserializer=ocean_dot_v1_dot_transaction__pb2.PegInAddressResponse.FromString, ) self.ClaimPegIn = channel.unary_unary( - '/ocean.v1alpha.TransactionService/ClaimPegIn', - request_serializer=ocean_dot_v1alpha_dot_transaction__pb2.ClaimPegInRequest.SerializeToString, - response_deserializer=ocean_dot_v1alpha_dot_transaction__pb2.ClaimPegInResponse.FromString, + '/ocean.v1.TransactionService/ClaimPegIn', + request_serializer=ocean_dot_v1_dot_transaction__pb2.ClaimPegInRequest.SerializeToString, + response_deserializer=ocean_dot_v1_dot_transaction__pb2.ClaimPegInResponse.FromString, ) @@ -216,82 +216,82 @@ def add_TransactionServiceServicer_to_server(servicer, server): rpc_method_handlers = { 'GetTransaction': grpc.unary_unary_rpc_method_handler( servicer.GetTransaction, - request_deserializer=ocean_dot_v1alpha_dot_transaction__pb2.GetTransactionRequest.FromString, - response_serializer=ocean_dot_v1alpha_dot_transaction__pb2.GetTransactionResponse.SerializeToString, + request_deserializer=ocean_dot_v1_dot_transaction__pb2.GetTransactionRequest.FromString, + response_serializer=ocean_dot_v1_dot_transaction__pb2.GetTransactionResponse.SerializeToString, ), 'SelectUtxos': grpc.unary_unary_rpc_method_handler( servicer.SelectUtxos, - request_deserializer=ocean_dot_v1alpha_dot_transaction__pb2.SelectUtxosRequest.FromString, - response_serializer=ocean_dot_v1alpha_dot_transaction__pb2.SelectUtxosResponse.SerializeToString, + request_deserializer=ocean_dot_v1_dot_transaction__pb2.SelectUtxosRequest.FromString, + response_serializer=ocean_dot_v1_dot_transaction__pb2.SelectUtxosResponse.SerializeToString, ), 'EstimateFees': grpc.unary_unary_rpc_method_handler( servicer.EstimateFees, - request_deserializer=ocean_dot_v1alpha_dot_transaction__pb2.EstimateFeesRequest.FromString, - response_serializer=ocean_dot_v1alpha_dot_transaction__pb2.EstimateFeesResponse.SerializeToString, + request_deserializer=ocean_dot_v1_dot_transaction__pb2.EstimateFeesRequest.FromString, + response_serializer=ocean_dot_v1_dot_transaction__pb2.EstimateFeesResponse.SerializeToString, ), 'SignTransaction': grpc.unary_unary_rpc_method_handler( servicer.SignTransaction, - request_deserializer=ocean_dot_v1alpha_dot_transaction__pb2.SignTransactionRequest.FromString, - response_serializer=ocean_dot_v1alpha_dot_transaction__pb2.SignTransactionResponse.SerializeToString, + request_deserializer=ocean_dot_v1_dot_transaction__pb2.SignTransactionRequest.FromString, + response_serializer=ocean_dot_v1_dot_transaction__pb2.SignTransactionResponse.SerializeToString, ), 'BroadcastTransaction': grpc.unary_unary_rpc_method_handler( servicer.BroadcastTransaction, - request_deserializer=ocean_dot_v1alpha_dot_transaction__pb2.BroadcastTransactionRequest.FromString, - response_serializer=ocean_dot_v1alpha_dot_transaction__pb2.BroadcastTransactionResponse.SerializeToString, + request_deserializer=ocean_dot_v1_dot_transaction__pb2.BroadcastTransactionRequest.FromString, + response_serializer=ocean_dot_v1_dot_transaction__pb2.BroadcastTransactionResponse.SerializeToString, ), 'CreatePset': grpc.unary_unary_rpc_method_handler( servicer.CreatePset, - request_deserializer=ocean_dot_v1alpha_dot_transaction__pb2.CreatePsetRequest.FromString, - response_serializer=ocean_dot_v1alpha_dot_transaction__pb2.CreatePsetResponse.SerializeToString, + request_deserializer=ocean_dot_v1_dot_transaction__pb2.CreatePsetRequest.FromString, + response_serializer=ocean_dot_v1_dot_transaction__pb2.CreatePsetResponse.SerializeToString, ), 'UpdatePset': grpc.unary_unary_rpc_method_handler( servicer.UpdatePset, - request_deserializer=ocean_dot_v1alpha_dot_transaction__pb2.UpdatePsetRequest.FromString, - response_serializer=ocean_dot_v1alpha_dot_transaction__pb2.UpdatePsetResponse.SerializeToString, + request_deserializer=ocean_dot_v1_dot_transaction__pb2.UpdatePsetRequest.FromString, + response_serializer=ocean_dot_v1_dot_transaction__pb2.UpdatePsetResponse.SerializeToString, ), 'BlindPset': grpc.unary_unary_rpc_method_handler( servicer.BlindPset, - request_deserializer=ocean_dot_v1alpha_dot_transaction__pb2.BlindPsetRequest.FromString, - response_serializer=ocean_dot_v1alpha_dot_transaction__pb2.BlindPsetResponse.SerializeToString, + request_deserializer=ocean_dot_v1_dot_transaction__pb2.BlindPsetRequest.FromString, + response_serializer=ocean_dot_v1_dot_transaction__pb2.BlindPsetResponse.SerializeToString, ), 'SignPset': grpc.unary_unary_rpc_method_handler( servicer.SignPset, - request_deserializer=ocean_dot_v1alpha_dot_transaction__pb2.SignPsetRequest.FromString, - response_serializer=ocean_dot_v1alpha_dot_transaction__pb2.SignPsetResponse.SerializeToString, + request_deserializer=ocean_dot_v1_dot_transaction__pb2.SignPsetRequest.FromString, + response_serializer=ocean_dot_v1_dot_transaction__pb2.SignPsetResponse.SerializeToString, ), 'Mint': grpc.unary_unary_rpc_method_handler( servicer.Mint, - request_deserializer=ocean_dot_v1alpha_dot_transaction__pb2.MintRequest.FromString, - response_serializer=ocean_dot_v1alpha_dot_transaction__pb2.MintResponse.SerializeToString, + request_deserializer=ocean_dot_v1_dot_transaction__pb2.MintRequest.FromString, + response_serializer=ocean_dot_v1_dot_transaction__pb2.MintResponse.SerializeToString, ), 'Remint': grpc.unary_unary_rpc_method_handler( servicer.Remint, - request_deserializer=ocean_dot_v1alpha_dot_transaction__pb2.RemintRequest.FromString, - response_serializer=ocean_dot_v1alpha_dot_transaction__pb2.RemintResponse.SerializeToString, + request_deserializer=ocean_dot_v1_dot_transaction__pb2.RemintRequest.FromString, + response_serializer=ocean_dot_v1_dot_transaction__pb2.RemintResponse.SerializeToString, ), 'Burn': grpc.unary_unary_rpc_method_handler( servicer.Burn, - request_deserializer=ocean_dot_v1alpha_dot_transaction__pb2.BurnRequest.FromString, - response_serializer=ocean_dot_v1alpha_dot_transaction__pb2.BurnResponse.SerializeToString, + request_deserializer=ocean_dot_v1_dot_transaction__pb2.BurnRequest.FromString, + response_serializer=ocean_dot_v1_dot_transaction__pb2.BurnResponse.SerializeToString, ), 'Transfer': grpc.unary_unary_rpc_method_handler( servicer.Transfer, - request_deserializer=ocean_dot_v1alpha_dot_transaction__pb2.TransferRequest.FromString, - response_serializer=ocean_dot_v1alpha_dot_transaction__pb2.TransferResponse.SerializeToString, + request_deserializer=ocean_dot_v1_dot_transaction__pb2.TransferRequest.FromString, + response_serializer=ocean_dot_v1_dot_transaction__pb2.TransferResponse.SerializeToString, ), 'PegInAddress': grpc.unary_unary_rpc_method_handler( servicer.PegInAddress, - request_deserializer=ocean_dot_v1alpha_dot_transaction__pb2.PegInAddressRequest.FromString, - response_serializer=ocean_dot_v1alpha_dot_transaction__pb2.PegInAddressResponse.SerializeToString, + request_deserializer=ocean_dot_v1_dot_transaction__pb2.PegInAddressRequest.FromString, + response_serializer=ocean_dot_v1_dot_transaction__pb2.PegInAddressResponse.SerializeToString, ), 'ClaimPegIn': grpc.unary_unary_rpc_method_handler( servicer.ClaimPegIn, - request_deserializer=ocean_dot_v1alpha_dot_transaction__pb2.ClaimPegInRequest.FromString, - response_serializer=ocean_dot_v1alpha_dot_transaction__pb2.ClaimPegInResponse.SerializeToString, + request_deserializer=ocean_dot_v1_dot_transaction__pb2.ClaimPegInRequest.FromString, + response_serializer=ocean_dot_v1_dot_transaction__pb2.ClaimPegInResponse.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( - 'ocean.v1alpha.TransactionService', rpc_method_handlers) + 'ocean.v1.TransactionService', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) @@ -312,9 +312,9 @@ def GetTransaction(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/ocean.v1alpha.TransactionService/GetTransaction', - ocean_dot_v1alpha_dot_transaction__pb2.GetTransactionRequest.SerializeToString, - ocean_dot_v1alpha_dot_transaction__pb2.GetTransactionResponse.FromString, + return grpc.experimental.unary_unary(request, target, '/ocean.v1.TransactionService/GetTransaction', + ocean_dot_v1_dot_transaction__pb2.GetTransactionRequest.SerializeToString, + ocean_dot_v1_dot_transaction__pb2.GetTransactionResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @@ -329,9 +329,9 @@ def SelectUtxos(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/ocean.v1alpha.TransactionService/SelectUtxos', - ocean_dot_v1alpha_dot_transaction__pb2.SelectUtxosRequest.SerializeToString, - ocean_dot_v1alpha_dot_transaction__pb2.SelectUtxosResponse.FromString, + return grpc.experimental.unary_unary(request, target, '/ocean.v1.TransactionService/SelectUtxos', + ocean_dot_v1_dot_transaction__pb2.SelectUtxosRequest.SerializeToString, + ocean_dot_v1_dot_transaction__pb2.SelectUtxosResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @@ -346,9 +346,9 @@ def EstimateFees(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/ocean.v1alpha.TransactionService/EstimateFees', - ocean_dot_v1alpha_dot_transaction__pb2.EstimateFeesRequest.SerializeToString, - ocean_dot_v1alpha_dot_transaction__pb2.EstimateFeesResponse.FromString, + return grpc.experimental.unary_unary(request, target, '/ocean.v1.TransactionService/EstimateFees', + ocean_dot_v1_dot_transaction__pb2.EstimateFeesRequest.SerializeToString, + ocean_dot_v1_dot_transaction__pb2.EstimateFeesResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @@ -363,9 +363,9 @@ def SignTransaction(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/ocean.v1alpha.TransactionService/SignTransaction', - ocean_dot_v1alpha_dot_transaction__pb2.SignTransactionRequest.SerializeToString, - ocean_dot_v1alpha_dot_transaction__pb2.SignTransactionResponse.FromString, + return grpc.experimental.unary_unary(request, target, '/ocean.v1.TransactionService/SignTransaction', + ocean_dot_v1_dot_transaction__pb2.SignTransactionRequest.SerializeToString, + ocean_dot_v1_dot_transaction__pb2.SignTransactionResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @@ -380,9 +380,9 @@ def BroadcastTransaction(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/ocean.v1alpha.TransactionService/BroadcastTransaction', - ocean_dot_v1alpha_dot_transaction__pb2.BroadcastTransactionRequest.SerializeToString, - ocean_dot_v1alpha_dot_transaction__pb2.BroadcastTransactionResponse.FromString, + return grpc.experimental.unary_unary(request, target, '/ocean.v1.TransactionService/BroadcastTransaction', + ocean_dot_v1_dot_transaction__pb2.BroadcastTransactionRequest.SerializeToString, + ocean_dot_v1_dot_transaction__pb2.BroadcastTransactionResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @@ -397,9 +397,9 @@ def CreatePset(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/ocean.v1alpha.TransactionService/CreatePset', - ocean_dot_v1alpha_dot_transaction__pb2.CreatePsetRequest.SerializeToString, - ocean_dot_v1alpha_dot_transaction__pb2.CreatePsetResponse.FromString, + return grpc.experimental.unary_unary(request, target, '/ocean.v1.TransactionService/CreatePset', + ocean_dot_v1_dot_transaction__pb2.CreatePsetRequest.SerializeToString, + ocean_dot_v1_dot_transaction__pb2.CreatePsetResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @@ -414,9 +414,9 @@ def UpdatePset(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/ocean.v1alpha.TransactionService/UpdatePset', - ocean_dot_v1alpha_dot_transaction__pb2.UpdatePsetRequest.SerializeToString, - ocean_dot_v1alpha_dot_transaction__pb2.UpdatePsetResponse.FromString, + return grpc.experimental.unary_unary(request, target, '/ocean.v1.TransactionService/UpdatePset', + ocean_dot_v1_dot_transaction__pb2.UpdatePsetRequest.SerializeToString, + ocean_dot_v1_dot_transaction__pb2.UpdatePsetResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @@ -431,9 +431,9 @@ def BlindPset(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/ocean.v1alpha.TransactionService/BlindPset', - ocean_dot_v1alpha_dot_transaction__pb2.BlindPsetRequest.SerializeToString, - ocean_dot_v1alpha_dot_transaction__pb2.BlindPsetResponse.FromString, + return grpc.experimental.unary_unary(request, target, '/ocean.v1.TransactionService/BlindPset', + ocean_dot_v1_dot_transaction__pb2.BlindPsetRequest.SerializeToString, + ocean_dot_v1_dot_transaction__pb2.BlindPsetResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @@ -448,9 +448,9 @@ def SignPset(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/ocean.v1alpha.TransactionService/SignPset', - ocean_dot_v1alpha_dot_transaction__pb2.SignPsetRequest.SerializeToString, - ocean_dot_v1alpha_dot_transaction__pb2.SignPsetResponse.FromString, + return grpc.experimental.unary_unary(request, target, '/ocean.v1.TransactionService/SignPset', + ocean_dot_v1_dot_transaction__pb2.SignPsetRequest.SerializeToString, + ocean_dot_v1_dot_transaction__pb2.SignPsetResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @@ -465,9 +465,9 @@ def Mint(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/ocean.v1alpha.TransactionService/Mint', - ocean_dot_v1alpha_dot_transaction__pb2.MintRequest.SerializeToString, - ocean_dot_v1alpha_dot_transaction__pb2.MintResponse.FromString, + return grpc.experimental.unary_unary(request, target, '/ocean.v1.TransactionService/Mint', + ocean_dot_v1_dot_transaction__pb2.MintRequest.SerializeToString, + ocean_dot_v1_dot_transaction__pb2.MintResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @@ -482,9 +482,9 @@ def Remint(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/ocean.v1alpha.TransactionService/Remint', - ocean_dot_v1alpha_dot_transaction__pb2.RemintRequest.SerializeToString, - ocean_dot_v1alpha_dot_transaction__pb2.RemintResponse.FromString, + return grpc.experimental.unary_unary(request, target, '/ocean.v1.TransactionService/Remint', + ocean_dot_v1_dot_transaction__pb2.RemintRequest.SerializeToString, + ocean_dot_v1_dot_transaction__pb2.RemintResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @@ -499,9 +499,9 @@ def Burn(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/ocean.v1alpha.TransactionService/Burn', - ocean_dot_v1alpha_dot_transaction__pb2.BurnRequest.SerializeToString, - ocean_dot_v1alpha_dot_transaction__pb2.BurnResponse.FromString, + return grpc.experimental.unary_unary(request, target, '/ocean.v1.TransactionService/Burn', + ocean_dot_v1_dot_transaction__pb2.BurnRequest.SerializeToString, + ocean_dot_v1_dot_transaction__pb2.BurnResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @@ -516,9 +516,9 @@ def Transfer(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/ocean.v1alpha.TransactionService/Transfer', - ocean_dot_v1alpha_dot_transaction__pb2.TransferRequest.SerializeToString, - ocean_dot_v1alpha_dot_transaction__pb2.TransferResponse.FromString, + return grpc.experimental.unary_unary(request, target, '/ocean.v1.TransactionService/Transfer', + ocean_dot_v1_dot_transaction__pb2.TransferRequest.SerializeToString, + ocean_dot_v1_dot_transaction__pb2.TransferResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @@ -533,9 +533,9 @@ def PegInAddress(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/ocean.v1alpha.TransactionService/PegInAddress', - ocean_dot_v1alpha_dot_transaction__pb2.PegInAddressRequest.SerializeToString, - ocean_dot_v1alpha_dot_transaction__pb2.PegInAddressResponse.FromString, + return grpc.experimental.unary_unary(request, target, '/ocean.v1.TransactionService/PegInAddress', + ocean_dot_v1_dot_transaction__pb2.PegInAddressRequest.SerializeToString, + ocean_dot_v1_dot_transaction__pb2.PegInAddressResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @@ -550,8 +550,8 @@ def ClaimPegIn(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/ocean.v1alpha.TransactionService/ClaimPegIn', - ocean_dot_v1alpha_dot_transaction__pb2.ClaimPegInRequest.SerializeToString, - ocean_dot_v1alpha_dot_transaction__pb2.ClaimPegInResponse.FromString, + return grpc.experimental.unary_unary(request, target, '/ocean.v1.TransactionService/ClaimPegIn', + ocean_dot_v1_dot_transaction__pb2.ClaimPegInRequest.SerializeToString, + ocean_dot_v1_dot_transaction__pb2.ClaimPegInResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/api-spec/protobuf/gen/python/ocean/v1/types_pb2.py b/api-spec/protobuf/gen/python/ocean/v1/types_pb2.py new file mode 100644 index 0000000..20322a7 --- /dev/null +++ b/api-spec/protobuf/gen/python/ocean/v1/types_pb2.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: ocean/v1/types.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x14ocean/v1/types.proto\x12\x08ocean.v1\"Q\n\tBuildInfo\x12\x18\n\x07version\x18\x01 \x01(\tR\x07version\x12\x16\n\x06\x63ommit\x18\x02 \x01(\tR\x06\x63ommit\x12\x12\n\x04\x64\x61te\x18\x03 \x01(\tR\x04\x64\x61te\"t\n\x0b\x41\x63\x63ountInfo\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\x12\x14\n\x05index\x18\x02 \x01(\rR\x05index\x12\'\n\x0f\x64\x65rivation_path\x18\x03 \x01(\tR\x0e\x64\x65rivationPath\x12\x12\n\x04xpub\x18\x04 \x01(\tR\x04xpub\"\xb7\x01\n\x0b\x42\x61lanceInfo\x12+\n\x11\x63onfirmed_balance\x18\x01 \x01(\x04R\x10\x63onfirmedBalance\x12/\n\x13unconfirmed_balance\x18\x02 \x01(\x04R\x12unconfirmedBalance\x12%\n\x0elocked_balance\x18\x03 \x01(\x04R\rlockedBalance\x12#\n\rtotal_balance\x18\x04 \x01(\x04R\x0ctotalBalance\"1\n\x05Input\x12\x12\n\x04txid\x18\x01 \x01(\tR\x04txid\x12\x14\n\x05index\x18\x02 \x01(\rR\x05index\"P\n\x06Output\x12\x14\n\x05\x61sset\x18\x01 \x01(\tR\x05\x61sset\x12\x16\n\x06\x61mount\x18\x02 \x01(\x04R\x06\x61mount\x12\x18\n\x07\x61\x64\x64ress\x18\x03 \x01(\tR\x07\x61\x64\x64ress\"P\n\x05Utxos\x12!\n\x0c\x61\x63\x63ount_name\x18\x01 \x01(\tR\x0b\x61\x63\x63ountName\x12$\n\x05utxos\x18\x02 \x03(\x0b\x32\x0e.ocean.v1.UtxoR\x05utxos\"W\n\nUtxoStatus\x12\x12\n\x04txid\x18\x01 \x01(\tR\x04txid\x12\x35\n\nblock_info\x18\x02 \x01(\x0b\x32\x16.ocean.v1.BlockDetailsR\tblockInfo\"\xdb\x02\n\x04Utxo\x12\x12\n\x04txid\x18\x01 \x01(\tR\x04txid\x12\x14\n\x05index\x18\x02 \x01(\rR\x05index\x12\x14\n\x05\x61sset\x18\x03 \x01(\tR\x05\x61sset\x12\x14\n\x05value\x18\x04 \x01(\x04R\x05value\x12\x16\n\x06script\x18\x05 \x01(\x0cR\x06script\x12#\n\rasset_blinder\x18\x06 \x01(\x0cR\x0c\x61ssetBlinder\x12#\n\rvalue_blinder\x18\x07 \x01(\x0cR\x0cvalueBlinder\x12!\n\x0c\x61\x63\x63ount_name\x18\x08 \x01(\tR\x0b\x61\x63\x63ountName\x12\x37\n\x0cspent_status\x18\t \x01(\x0b\x32\x14.ocean.v1.UtxoStatusR\x0bspentStatus\x12?\n\x10\x63onfirmed_status\x18\n \x01(\x0b\x32\x14.ocean.v1.UtxoStatusR\x0f\x63onfirmedStatus\"X\n\x0c\x42lockDetails\x12\x12\n\x04hash\x18\x01 \x01(\tR\x04hash\x12\x16\n\x06height\x18\x02 \x01(\x04R\x06height\x12\x1c\n\ttimestamp\x18\x03 \x01(\x03R\ttimestamp\"\xc5\x01\n\x08Template\x12\x31\n\x06\x66ormat\x18\x01 \x01(\x0e\x32\x19.ocean.v1.Template.FormatR\x06\x66ormat\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value\"p\n\x06\x46ormat\x12\x16\n\x12\x46ORMAT_UNSPECIFIED\x10\x00\x12\x15\n\x11\x46ORMAT_DESCRIPTOR\x10\x01\x12\x15\n\x11\x46ORMAT_MINISCRIPT\x10\x02\x12\x10\n\x0c\x46ORMAT_IONIO\x10\x03\x12\x0e\n\nFORMAT_RAW\x10\x04*\x87\x01\n\x0bTxEventType\x12\x1d\n\x19TX_EVENT_TYPE_UNSPECIFIED\x10\x00\x12\x1d\n\x19TX_EVENT_TYPE_BROADCASTED\x10\x01\x12\x1d\n\x19TX_EVENT_TYPE_UNCONFIRMED\x10\x02\x12\x1b\n\x17TX_EVENT_TYPE_CONFIRMED\x10\x03*\xbd\x01\n\rUtxoEventType\x12\x1f\n\x1bUTXO_EVENT_TYPE_UNSPECIFIED\x10\x00\x12\x17\n\x13UTXO_EVENT_TYPE_NEW\x10\x01\x12\x1d\n\x19UTXO_EVENT_TYPE_CONFIRMED\x10\x02\x12\x1a\n\x16UTXO_EVENT_TYPE_LOCKED\x10\x03\x12\x1c\n\x18UTXO_EVENT_TYPE_UNLOCKED\x10\x04\x12\x19\n\x15UTXO_EVENT_TYPE_SPENT\x10\x05*w\n\x10WebhookEventType\x12\"\n\x1eWEBHOOK_EVENT_TYPE_UNSPECIFIED\x10\x00\x12\"\n\x1eWEBHOOK_EVENT_TYPE_TRANSACTION\x10\x01\x12\x1b\n\x17WEBHOOK_EVENT_TYPE_UTXO\x10\x02\x42\xa3\x01\n\x0c\x63om.ocean.v1B\nTypesProtoP\x01ZFgithub.com/vulpemventures/ocean/api-spec/protobuf/gen/ocean/v1;oceanv1\xa2\x02\x03OXX\xaa\x02\x08Ocean.V1\xca\x02\x08Ocean\\V1\xe2\x02\x14Ocean\\V1\\GPBMetadata\xea\x02\tOcean::V1b\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'ocean.v1.types_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\014com.ocean.v1B\nTypesProtoP\001ZFgithub.com/vulpemventures/ocean/api-spec/protobuf/gen/ocean/v1;oceanv1\242\002\003OXX\252\002\010Ocean.V1\312\002\010Ocean\\V1\342\002\024Ocean\\V1\\GPBMetadata\352\002\tOcean::V1' + _TXEVENTTYPE._serialized_start=1366 + _TXEVENTTYPE._serialized_end=1501 + _UTXOEVENTTYPE._serialized_start=1504 + _UTXOEVENTTYPE._serialized_end=1693 + _WEBHOOKEVENTTYPE._serialized_start=1695 + _WEBHOOKEVENTTYPE._serialized_end=1814 + _BUILDINFO._serialized_start=34 + _BUILDINFO._serialized_end=115 + _ACCOUNTINFO._serialized_start=117 + _ACCOUNTINFO._serialized_end=233 + _BALANCEINFO._serialized_start=236 + _BALANCEINFO._serialized_end=419 + _INPUT._serialized_start=421 + _INPUT._serialized_end=470 + _OUTPUT._serialized_start=472 + _OUTPUT._serialized_end=552 + _UTXOS._serialized_start=554 + _UTXOS._serialized_end=634 + _UTXOSTATUS._serialized_start=636 + _UTXOSTATUS._serialized_end=723 + _UTXO._serialized_start=726 + _UTXO._serialized_end=1073 + _BLOCKDETAILS._serialized_start=1075 + _BLOCKDETAILS._serialized_end=1163 + _TEMPLATE._serialized_start=1166 + _TEMPLATE._serialized_end=1363 + _TEMPLATE_FORMAT._serialized_start=1251 + _TEMPLATE_FORMAT._serialized_end=1363 +# @@protoc_insertion_point(module_scope) diff --git a/api-spec/protobuf/gen/python/ocean/v1alpha/types_pb2_grpc.py b/api-spec/protobuf/gen/python/ocean/v1/types_pb2_grpc.py similarity index 100% rename from api-spec/protobuf/gen/python/ocean/v1alpha/types_pb2_grpc.py rename to api-spec/protobuf/gen/python/ocean/v1/types_pb2_grpc.py diff --git a/api-spec/protobuf/gen/python/ocean/v1/wallet_pb2.py b/api-spec/protobuf/gen/python/ocean/v1/wallet_pb2.py new file mode 100644 index 0000000..0e1d21d --- /dev/null +++ b/api-spec/protobuf/gen/python/ocean/v1/wallet_pb2.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- +# Generated by the protocol buffer compiler. DO NOT EDIT! +# source: ocean/v1/wallet.proto +"""Generated protocol buffer code.""" +from google.protobuf.internal import builder as _builder +from google.protobuf import descriptor as _descriptor +from google.protobuf import descriptor_pool as _descriptor_pool +from google.protobuf import symbol_database as _symbol_database +# @@protoc_insertion_point(imports) + +_sym_db = _symbol_database.Default() + + +from ocean.v1 import types_pb2 as ocean_dot_v1_dot_types__pb2 + + +DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x15ocean/v1/wallet.proto\x12\x08ocean.v1\x1a\x14ocean/v1/types.proto\"\x10\n\x0eGenSeedRequest\"-\n\x0fGenSeedResponse\x12\x1a\n\x08mnemonic\x18\x01 \x01(\tR\x08mnemonic\"M\n\x13\x43reateWalletRequest\x12\x1a\n\x08mnemonic\x18\x01 \x01(\tR\x08mnemonic\x12\x1a\n\x08password\x18\x03 \x01(\tR\x08password\"\x16\n\x14\x43reateWalletResponse\"+\n\rUnlockRequest\x12\x1a\n\x08password\x18\x01 \x01(\tR\x08password\"\x10\n\x0eUnlockResponse\"\r\n\x0bLockRequest\"\x0e\n\x0cLockResponse\"e\n\x15\x43hangePasswordRequest\x12)\n\x10\x63urrent_password\x18\x01 \x01(\tR\x0f\x63urrentPassword\x12!\n\x0cnew_password\x18\x02 \x01(\tR\x0bnewPassword\"\x18\n\x16\x43hangePasswordResponse\"~\n\x14RestoreWalletRequest\x12\x1a\n\x08mnemonic\x18\x01 \x01(\tR\x08mnemonic\x12\x1a\n\x08password\x18\x02 \x01(\tR\x08password\x12.\n\x13\x62irthday_block_hash\x18\x03 \x01(\tR\x11\x62irthdayBlockHash\"\x17\n\x15RestoreWalletResponse\"\x0f\n\rStatusRequest\"f\n\x0eStatusResponse\x12 \n\x0binitialized\x18\x01 \x01(\x08R\x0binitialized\x12\x16\n\x06synced\x18\x02 \x01(\x08R\x06synced\x12\x1a\n\x08unlocked\x18\x03 \x01(\x08R\x08unlocked\"\x10\n\x0eGetInfoRequest\"\xec\x03\n\x0fGetInfoResponse\x12;\n\x07network\x18\x01 \x01(\x0e\x32!.ocean.v1.GetInfoResponse.NetworkR\x07network\x12!\n\x0cnative_asset\x18\x02 \x01(\tR\x0bnativeAsset\x12\x1b\n\troot_path\x18\x03 \x01(\tR\x08rootPath\x12.\n\x13master_blinding_key\x18\x04 \x01(\tR\x11masterBlindingKey\x12.\n\x13\x62irthday_block_hash\x18\x05 \x01(\tR\x11\x62irthdayBlockHash\x12\x32\n\x15\x62irthday_block_height\x18\x06 \x01(\rR\x13\x62irthdayBlockHeight\x12\x31\n\x08\x61\x63\x63ounts\x18\x07 \x03(\x0b\x32\x15.ocean.v1.AccountInfoR\x08\x61\x63\x63ounts\x12\x32\n\nbuild_info\x18\x08 \x01(\x0b\x32\x13.ocean.v1.BuildInfoR\tbuildInfo\"a\n\x07Network\x12\x17\n\x13NETWORK_UNSPECIFIED\x10\x00\x12\x13\n\x0fNETWORK_MAINNET\x10\x01\x12\x13\n\x0fNETWORK_TESTNET\x10\x02\x12\x13\n\x0fNETWORK_REGTEST\x10\x03\x32\xb6\x04\n\rWalletService\x12>\n\x07GenSeed\x12\x18.ocean.v1.GenSeedRequest\x1a\x19.ocean.v1.GenSeedResponse\x12M\n\x0c\x43reateWallet\x12\x1d.ocean.v1.CreateWalletRequest\x1a\x1e.ocean.v1.CreateWalletResponse\x12;\n\x06Unlock\x12\x17.ocean.v1.UnlockRequest\x1a\x18.ocean.v1.UnlockResponse\x12\x35\n\x04Lock\x12\x15.ocean.v1.LockRequest\x1a\x16.ocean.v1.LockResponse\x12S\n\x0e\x43hangePassword\x12\x1f.ocean.v1.ChangePasswordRequest\x1a .ocean.v1.ChangePasswordResponse\x12P\n\rRestoreWallet\x12\x1e.ocean.v1.RestoreWalletRequest\x1a\x1f.ocean.v1.RestoreWalletResponse\x12;\n\x06Status\x12\x17.ocean.v1.StatusRequest\x1a\x18.ocean.v1.StatusResponse\x12>\n\x07GetInfo\x12\x18.ocean.v1.GetInfoRequest\x1a\x19.ocean.v1.GetInfoResponseB\xa4\x01\n\x0c\x63om.ocean.v1B\x0bWalletProtoP\x01ZFgithub.com/vulpemventures/ocean/api-spec/protobuf/gen/ocean/v1;oceanv1\xa2\x02\x03OXX\xaa\x02\x08Ocean.V1\xca\x02\x08Ocean\\V1\xe2\x02\x14Ocean\\V1\\GPBMetadata\xea\x02\tOcean::V1b\x06proto3') + +_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, globals()) +_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'ocean.v1.wallet_pb2', globals()) +if _descriptor._USE_C_DESCRIPTORS == False: + + DESCRIPTOR._options = None + DESCRIPTOR._serialized_options = b'\n\014com.ocean.v1B\013WalletProtoP\001ZFgithub.com/vulpemventures/ocean/api-spec/protobuf/gen/ocean/v1;oceanv1\242\002\003OXX\252\002\010Ocean.V1\312\002\010Ocean\\V1\342\002\024Ocean\\V1\\GPBMetadata\352\002\tOcean::V1' + _GENSEEDREQUEST._serialized_start=57 + _GENSEEDREQUEST._serialized_end=73 + _GENSEEDRESPONSE._serialized_start=75 + _GENSEEDRESPONSE._serialized_end=120 + _CREATEWALLETREQUEST._serialized_start=122 + _CREATEWALLETREQUEST._serialized_end=199 + _CREATEWALLETRESPONSE._serialized_start=201 + _CREATEWALLETRESPONSE._serialized_end=223 + _UNLOCKREQUEST._serialized_start=225 + _UNLOCKREQUEST._serialized_end=268 + _UNLOCKRESPONSE._serialized_start=270 + _UNLOCKRESPONSE._serialized_end=286 + _LOCKREQUEST._serialized_start=288 + _LOCKREQUEST._serialized_end=301 + _LOCKRESPONSE._serialized_start=303 + _LOCKRESPONSE._serialized_end=317 + _CHANGEPASSWORDREQUEST._serialized_start=319 + _CHANGEPASSWORDREQUEST._serialized_end=420 + _CHANGEPASSWORDRESPONSE._serialized_start=422 + _CHANGEPASSWORDRESPONSE._serialized_end=446 + _RESTOREWALLETREQUEST._serialized_start=448 + _RESTOREWALLETREQUEST._serialized_end=574 + _RESTOREWALLETRESPONSE._serialized_start=576 + _RESTOREWALLETRESPONSE._serialized_end=599 + _STATUSREQUEST._serialized_start=601 + _STATUSREQUEST._serialized_end=616 + _STATUSRESPONSE._serialized_start=618 + _STATUSRESPONSE._serialized_end=720 + _GETINFOREQUEST._serialized_start=722 + _GETINFOREQUEST._serialized_end=738 + _GETINFORESPONSE._serialized_start=741 + _GETINFORESPONSE._serialized_end=1233 + _GETINFORESPONSE_NETWORK._serialized_start=1136 + _GETINFORESPONSE_NETWORK._serialized_end=1233 + _WALLETSERVICE._serialized_start=1236 + _WALLETSERVICE._serialized_end=1802 +# @@protoc_insertion_point(module_scope) diff --git a/api-spec/protobuf/gen/python/ocean/v1alpha/wallet_pb2_grpc.py b/api-spec/protobuf/gen/python/ocean/v1/wallet_pb2_grpc.py similarity index 59% rename from api-spec/protobuf/gen/python/ocean/v1alpha/wallet_pb2_grpc.py rename to api-spec/protobuf/gen/python/ocean/v1/wallet_pb2_grpc.py index 5b80d96..34869fc 100644 --- a/api-spec/protobuf/gen/python/ocean/v1alpha/wallet_pb2_grpc.py +++ b/api-spec/protobuf/gen/python/ocean/v1/wallet_pb2_grpc.py @@ -2,7 +2,7 @@ """Client and server classes corresponding to protobuf-defined services.""" import grpc -from ocean.v1alpha import wallet_pb2 as ocean_dot_v1alpha_dot_wallet__pb2 +from ocean.v1 import wallet_pb2 as ocean_dot_v1_dot_wallet__pb2 class WalletServiceStub(object): @@ -21,39 +21,44 @@ def __init__(self, channel): channel: A grpc.Channel. """ self.GenSeed = channel.unary_unary( - '/ocean.v1alpha.WalletService/GenSeed', - request_serializer=ocean_dot_v1alpha_dot_wallet__pb2.GenSeedRequest.SerializeToString, - response_deserializer=ocean_dot_v1alpha_dot_wallet__pb2.GenSeedResponse.FromString, + '/ocean.v1.WalletService/GenSeed', + request_serializer=ocean_dot_v1_dot_wallet__pb2.GenSeedRequest.SerializeToString, + response_deserializer=ocean_dot_v1_dot_wallet__pb2.GenSeedResponse.FromString, ) self.CreateWallet = channel.unary_unary( - '/ocean.v1alpha.WalletService/CreateWallet', - request_serializer=ocean_dot_v1alpha_dot_wallet__pb2.CreateWalletRequest.SerializeToString, - response_deserializer=ocean_dot_v1alpha_dot_wallet__pb2.CreateWalletResponse.FromString, + '/ocean.v1.WalletService/CreateWallet', + request_serializer=ocean_dot_v1_dot_wallet__pb2.CreateWalletRequest.SerializeToString, + response_deserializer=ocean_dot_v1_dot_wallet__pb2.CreateWalletResponse.FromString, ) self.Unlock = channel.unary_unary( - '/ocean.v1alpha.WalletService/Unlock', - request_serializer=ocean_dot_v1alpha_dot_wallet__pb2.UnlockRequest.SerializeToString, - response_deserializer=ocean_dot_v1alpha_dot_wallet__pb2.UnlockResponse.FromString, + '/ocean.v1.WalletService/Unlock', + request_serializer=ocean_dot_v1_dot_wallet__pb2.UnlockRequest.SerializeToString, + response_deserializer=ocean_dot_v1_dot_wallet__pb2.UnlockResponse.FromString, + ) + self.Lock = channel.unary_unary( + '/ocean.v1.WalletService/Lock', + request_serializer=ocean_dot_v1_dot_wallet__pb2.LockRequest.SerializeToString, + response_deserializer=ocean_dot_v1_dot_wallet__pb2.LockResponse.FromString, ) self.ChangePassword = channel.unary_unary( - '/ocean.v1alpha.WalletService/ChangePassword', - request_serializer=ocean_dot_v1alpha_dot_wallet__pb2.ChangePasswordRequest.SerializeToString, - response_deserializer=ocean_dot_v1alpha_dot_wallet__pb2.ChangePasswordResponse.FromString, + '/ocean.v1.WalletService/ChangePassword', + request_serializer=ocean_dot_v1_dot_wallet__pb2.ChangePasswordRequest.SerializeToString, + response_deserializer=ocean_dot_v1_dot_wallet__pb2.ChangePasswordResponse.FromString, ) self.RestoreWallet = channel.unary_unary( - '/ocean.v1alpha.WalletService/RestoreWallet', - request_serializer=ocean_dot_v1alpha_dot_wallet__pb2.RestoreWalletRequest.SerializeToString, - response_deserializer=ocean_dot_v1alpha_dot_wallet__pb2.RestoreWalletResponse.FromString, + '/ocean.v1.WalletService/RestoreWallet', + request_serializer=ocean_dot_v1_dot_wallet__pb2.RestoreWalletRequest.SerializeToString, + response_deserializer=ocean_dot_v1_dot_wallet__pb2.RestoreWalletResponse.FromString, ) self.Status = channel.unary_unary( - '/ocean.v1alpha.WalletService/Status', - request_serializer=ocean_dot_v1alpha_dot_wallet__pb2.StatusRequest.SerializeToString, - response_deserializer=ocean_dot_v1alpha_dot_wallet__pb2.StatusResponse.FromString, + '/ocean.v1.WalletService/Status', + request_serializer=ocean_dot_v1_dot_wallet__pb2.StatusRequest.SerializeToString, + response_deserializer=ocean_dot_v1_dot_wallet__pb2.StatusResponse.FromString, ) self.GetInfo = channel.unary_unary( - '/ocean.v1alpha.WalletService/GetInfo', - request_serializer=ocean_dot_v1alpha_dot_wallet__pb2.GetInfoRequest.SerializeToString, - response_deserializer=ocean_dot_v1alpha_dot_wallet__pb2.GetInfoResponse.FromString, + '/ocean.v1.WalletService/GetInfo', + request_serializer=ocean_dot_v1_dot_wallet__pb2.GetInfoRequest.SerializeToString, + response_deserializer=ocean_dot_v1_dot_wallet__pb2.GetInfoResponse.FromString, ) @@ -89,6 +94,13 @@ def Unlock(self, request, context): context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') + def Lock(self, request, context): + """Lock locks the HD wallet. + """ + context.set_code(grpc.StatusCode.UNIMPLEMENTED) + context.set_details('Method not implemented!') + raise NotImplementedError('Method not implemented!') + def ChangePassword(self, request, context): """ChangePassword changes the password used to encrypt/decrypt the HD seeds. It requires the wallet to be locked. @@ -124,42 +136,47 @@ def add_WalletServiceServicer_to_server(servicer, server): rpc_method_handlers = { 'GenSeed': grpc.unary_unary_rpc_method_handler( servicer.GenSeed, - request_deserializer=ocean_dot_v1alpha_dot_wallet__pb2.GenSeedRequest.FromString, - response_serializer=ocean_dot_v1alpha_dot_wallet__pb2.GenSeedResponse.SerializeToString, + request_deserializer=ocean_dot_v1_dot_wallet__pb2.GenSeedRequest.FromString, + response_serializer=ocean_dot_v1_dot_wallet__pb2.GenSeedResponse.SerializeToString, ), 'CreateWallet': grpc.unary_unary_rpc_method_handler( servicer.CreateWallet, - request_deserializer=ocean_dot_v1alpha_dot_wallet__pb2.CreateWalletRequest.FromString, - response_serializer=ocean_dot_v1alpha_dot_wallet__pb2.CreateWalletResponse.SerializeToString, + request_deserializer=ocean_dot_v1_dot_wallet__pb2.CreateWalletRequest.FromString, + response_serializer=ocean_dot_v1_dot_wallet__pb2.CreateWalletResponse.SerializeToString, ), 'Unlock': grpc.unary_unary_rpc_method_handler( servicer.Unlock, - request_deserializer=ocean_dot_v1alpha_dot_wallet__pb2.UnlockRequest.FromString, - response_serializer=ocean_dot_v1alpha_dot_wallet__pb2.UnlockResponse.SerializeToString, + request_deserializer=ocean_dot_v1_dot_wallet__pb2.UnlockRequest.FromString, + response_serializer=ocean_dot_v1_dot_wallet__pb2.UnlockResponse.SerializeToString, + ), + 'Lock': grpc.unary_unary_rpc_method_handler( + servicer.Lock, + request_deserializer=ocean_dot_v1_dot_wallet__pb2.LockRequest.FromString, + response_serializer=ocean_dot_v1_dot_wallet__pb2.LockResponse.SerializeToString, ), 'ChangePassword': grpc.unary_unary_rpc_method_handler( servicer.ChangePassword, - request_deserializer=ocean_dot_v1alpha_dot_wallet__pb2.ChangePasswordRequest.FromString, - response_serializer=ocean_dot_v1alpha_dot_wallet__pb2.ChangePasswordResponse.SerializeToString, + request_deserializer=ocean_dot_v1_dot_wallet__pb2.ChangePasswordRequest.FromString, + response_serializer=ocean_dot_v1_dot_wallet__pb2.ChangePasswordResponse.SerializeToString, ), 'RestoreWallet': grpc.unary_unary_rpc_method_handler( servicer.RestoreWallet, - request_deserializer=ocean_dot_v1alpha_dot_wallet__pb2.RestoreWalletRequest.FromString, - response_serializer=ocean_dot_v1alpha_dot_wallet__pb2.RestoreWalletResponse.SerializeToString, + request_deserializer=ocean_dot_v1_dot_wallet__pb2.RestoreWalletRequest.FromString, + response_serializer=ocean_dot_v1_dot_wallet__pb2.RestoreWalletResponse.SerializeToString, ), 'Status': grpc.unary_unary_rpc_method_handler( servicer.Status, - request_deserializer=ocean_dot_v1alpha_dot_wallet__pb2.StatusRequest.FromString, - response_serializer=ocean_dot_v1alpha_dot_wallet__pb2.StatusResponse.SerializeToString, + request_deserializer=ocean_dot_v1_dot_wallet__pb2.StatusRequest.FromString, + response_serializer=ocean_dot_v1_dot_wallet__pb2.StatusResponse.SerializeToString, ), 'GetInfo': grpc.unary_unary_rpc_method_handler( servicer.GetInfo, - request_deserializer=ocean_dot_v1alpha_dot_wallet__pb2.GetInfoRequest.FromString, - response_serializer=ocean_dot_v1alpha_dot_wallet__pb2.GetInfoResponse.SerializeToString, + request_deserializer=ocean_dot_v1_dot_wallet__pb2.GetInfoRequest.FromString, + response_serializer=ocean_dot_v1_dot_wallet__pb2.GetInfoResponse.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( - 'ocean.v1alpha.WalletService', rpc_method_handlers) + 'ocean.v1.WalletService', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) @@ -184,9 +201,9 @@ def GenSeed(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/ocean.v1alpha.WalletService/GenSeed', - ocean_dot_v1alpha_dot_wallet__pb2.GenSeedRequest.SerializeToString, - ocean_dot_v1alpha_dot_wallet__pb2.GenSeedResponse.FromString, + return grpc.experimental.unary_unary(request, target, '/ocean.v1.WalletService/GenSeed', + ocean_dot_v1_dot_wallet__pb2.GenSeedRequest.SerializeToString, + ocean_dot_v1_dot_wallet__pb2.GenSeedResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @@ -201,9 +218,9 @@ def CreateWallet(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/ocean.v1alpha.WalletService/CreateWallet', - ocean_dot_v1alpha_dot_wallet__pb2.CreateWalletRequest.SerializeToString, - ocean_dot_v1alpha_dot_wallet__pb2.CreateWalletResponse.FromString, + return grpc.experimental.unary_unary(request, target, '/ocean.v1.WalletService/CreateWallet', + ocean_dot_v1_dot_wallet__pb2.CreateWalletRequest.SerializeToString, + ocean_dot_v1_dot_wallet__pb2.CreateWalletResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @@ -218,9 +235,26 @@ def Unlock(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/ocean.v1alpha.WalletService/Unlock', - ocean_dot_v1alpha_dot_wallet__pb2.UnlockRequest.SerializeToString, - ocean_dot_v1alpha_dot_wallet__pb2.UnlockResponse.FromString, + return grpc.experimental.unary_unary(request, target, '/ocean.v1.WalletService/Unlock', + ocean_dot_v1_dot_wallet__pb2.UnlockRequest.SerializeToString, + ocean_dot_v1_dot_wallet__pb2.UnlockResponse.FromString, + options, channel_credentials, + insecure, call_credentials, compression, wait_for_ready, timeout, metadata) + + @staticmethod + def Lock(request, + target, + options=(), + channel_credentials=None, + call_credentials=None, + insecure=False, + compression=None, + wait_for_ready=None, + timeout=None, + metadata=None): + return grpc.experimental.unary_unary(request, target, '/ocean.v1.WalletService/Lock', + ocean_dot_v1_dot_wallet__pb2.LockRequest.SerializeToString, + ocean_dot_v1_dot_wallet__pb2.LockResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @@ -235,9 +269,9 @@ def ChangePassword(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/ocean.v1alpha.WalletService/ChangePassword', - ocean_dot_v1alpha_dot_wallet__pb2.ChangePasswordRequest.SerializeToString, - ocean_dot_v1alpha_dot_wallet__pb2.ChangePasswordResponse.FromString, + return grpc.experimental.unary_unary(request, target, '/ocean.v1.WalletService/ChangePassword', + ocean_dot_v1_dot_wallet__pb2.ChangePasswordRequest.SerializeToString, + ocean_dot_v1_dot_wallet__pb2.ChangePasswordResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @@ -252,9 +286,9 @@ def RestoreWallet(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/ocean.v1alpha.WalletService/RestoreWallet', - ocean_dot_v1alpha_dot_wallet__pb2.RestoreWalletRequest.SerializeToString, - ocean_dot_v1alpha_dot_wallet__pb2.RestoreWalletResponse.FromString, + return grpc.experimental.unary_unary(request, target, '/ocean.v1.WalletService/RestoreWallet', + ocean_dot_v1_dot_wallet__pb2.RestoreWalletRequest.SerializeToString, + ocean_dot_v1_dot_wallet__pb2.RestoreWalletResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @@ -269,9 +303,9 @@ def Status(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/ocean.v1alpha.WalletService/Status', - ocean_dot_v1alpha_dot_wallet__pb2.StatusRequest.SerializeToString, - ocean_dot_v1alpha_dot_wallet__pb2.StatusResponse.FromString, + return grpc.experimental.unary_unary(request, target, '/ocean.v1.WalletService/Status', + ocean_dot_v1_dot_wallet__pb2.StatusRequest.SerializeToString, + ocean_dot_v1_dot_wallet__pb2.StatusResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @@ -286,8 +320,8 @@ def GetInfo(request, wait_for_ready=None, timeout=None, metadata=None): - return grpc.experimental.unary_unary(request, target, '/ocean.v1alpha.WalletService/GetInfo', - ocean_dot_v1alpha_dot_wallet__pb2.GetInfoRequest.SerializeToString, - ocean_dot_v1alpha_dot_wallet__pb2.GetInfoResponse.FromString, + return grpc.experimental.unary_unary(request, target, '/ocean.v1.WalletService/GetInfo', + ocean_dot_v1_dot_wallet__pb2.GetInfoRequest.SerializeToString, + ocean_dot_v1_dot_wallet__pb2.GetInfoResponse.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/api-spec/protobuf/gen/python/ocean/v1alpha/account_pb2.py b/api-spec/protobuf/gen/python/ocean/v1alpha/account_pb2.py deleted file mode 100644 index 0d0593c..0000000 --- a/api-spec/protobuf/gen/python/ocean/v1alpha/account_pb2.py +++ /dev/null @@ -1,182 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: ocean/v1alpha/account.proto -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from ocean.v1alpha import types_pb2 as ocean_dot_v1alpha_dot_types__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1bocean/v1alpha/account.proto\x12\rocean.v1alpha\x1a\x19ocean/v1alpha/types.proto\"*\n\x14\x43reateAccountRequest\x12\x12\n\x04name\x18\x01 \x01(\tR\x04name\"P\n\x15\x43reateAccountResponse\x12#\n\raccount_index\x18\x01 \x01(\x04R\x0c\x61\x63\x63ountIndex\x12\x12\n\x04xpub\x18\x02 \x01(\tR\x04xpub\"\x8c\x01\n\x19SetAccountTemplateRequest\x12:\n\x0b\x61\x63\x63ount_key\x18\x01 \x01(\x0b\x32\x19.ocean.v1alpha.AccountKeyR\naccountKey\x12\x33\n\x08template\x18\x02 \x01(\x0b\x32\x17.ocean.v1alpha.TemplateR\x08template\"\x1c\n\x1aSetAccountTemplateResponse\"|\n\x14\x44\x65riveAddressRequest\x12:\n\x0b\x61\x63\x63ount_key\x18\x01 \x01(\x0b\x32\x19.ocean.v1alpha.AccountKeyR\naccountKey\x12(\n\x10num_of_addresses\x18\x02 \x01(\x04R\x0enumOfAddresses\"5\n\x15\x44\x65riveAddressResponse\x12\x1c\n\taddresses\x18\x01 \x03(\tR\taddresses\"\x82\x01\n\x1a\x44\x65riveChangeAddressRequest\x12:\n\x0b\x61\x63\x63ount_key\x18\x01 \x01(\x0b\x32\x19.ocean.v1alpha.AccountKeyR\naccountKey\x12(\n\x10num_of_addresses\x18\x02 \x01(\x04R\x0enumOfAddresses\";\n\x1b\x44\x65riveChangeAddressResponse\x12\x1c\n\taddresses\x18\x01 \x03(\tR\taddresses\"R\n\x14ListAddressesRequest\x12:\n\x0b\x61\x63\x63ount_key\x18\x01 \x01(\x0b\x32\x19.ocean.v1alpha.AccountKeyR\naccountKey\"5\n\x15ListAddressesResponse\x12\x1c\n\taddresses\x18\x01 \x03(\tR\taddresses\"j\n\x0e\x42\x61lanceRequest\x12:\n\x0b\x61\x63\x63ount_key\x18\x01 \x01(\x0b\x32\x19.ocean.v1alpha.AccountKeyR\naccountKey\x12\x1c\n\taddresses\x18\x03 \x03(\tR\taddresses\"\xb0\x01\n\x0f\x42\x61lanceResponse\x12\x45\n\x07\x62\x61lance\x18\x01 \x03(\x0b\x32+.ocean.v1alpha.BalanceResponse.BalanceEntryR\x07\x62\x61lance\x1aV\n\x0c\x42\x61lanceEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x30\n\x05value\x18\x02 \x01(\x0b\x32\x1a.ocean.v1alpha.BalanceInfoR\x05value:\x02\x38\x01\"l\n\x10ListUtxosRequest\x12:\n\x0b\x61\x63\x63ount_key\x18\x01 \x01(\x0b\x32\x19.ocean.v1alpha.AccountKeyR\naccountKey\x12\x1c\n\taddresses\x18\x03 \x03(\tR\taddresses\"\x8b\x01\n\x11ListUtxosResponse\x12=\n\x0fspendable_utxos\x18\x01 \x01(\x0b\x32\x14.ocean.v1alpha.UtxosR\x0espendableUtxos\x12\x37\n\x0clocked_utxos\x18\x02 \x01(\x0b\x32\x14.ocean.v1alpha.UtxosR\x0blockedUtxos2\x97\x05\n\x0e\x41\x63\x63ountService\x12Z\n\rCreateAccount\x12#.ocean.v1alpha.CreateAccountRequest\x1a$.ocean.v1alpha.CreateAccountResponse\x12i\n\x12SetAccountTemplate\x12(.ocean.v1alpha.SetAccountTemplateRequest\x1a).ocean.v1alpha.SetAccountTemplateResponse\x12Z\n\rDeriveAddress\x12#.ocean.v1alpha.DeriveAddressRequest\x1a$.ocean.v1alpha.DeriveAddressResponse\x12l\n\x13\x44\x65riveChangeAddress\x12).ocean.v1alpha.DeriveChangeAddressRequest\x1a*.ocean.v1alpha.DeriveChangeAddressResponse\x12Z\n\rListAddresses\x12#.ocean.v1alpha.ListAddressesRequest\x1a$.ocean.v1alpha.ListAddressesResponse\x12H\n\x07\x42\x61lance\x12\x1d.ocean.v1alpha.BalanceRequest\x1a\x1e.ocean.v1alpha.BalanceResponse\x12N\n\tListUtxos\x12\x1f.ocean.v1alpha.ListUtxosRequest\x1a .ocean.v1alpha.ListUtxosResponseB\xd9\x01\n\x11\x63om.ocean.v1alphaB\x0c\x41\x63\x63ountProtoP\x01Zagithub.com/vulpemventures/ocean/api-spec/protobuf/ocean/v1alpha/gen/go/ocean/v1alpha;oceanv1alpha\xa2\x02\x03OXX\xaa\x02\rOcean.V1alpha\xca\x02\rOcean\\V1alpha\xe2\x02\x19Ocean\\V1alpha\\GPBMetadata\xea\x02\x0eOcean::V1alphab\x06proto3') - - - -_CREATEACCOUNTREQUEST = DESCRIPTOR.message_types_by_name['CreateAccountRequest'] -_CREATEACCOUNTRESPONSE = DESCRIPTOR.message_types_by_name['CreateAccountResponse'] -_SETACCOUNTTEMPLATEREQUEST = DESCRIPTOR.message_types_by_name['SetAccountTemplateRequest'] -_SETACCOUNTTEMPLATERESPONSE = DESCRIPTOR.message_types_by_name['SetAccountTemplateResponse'] -_DERIVEADDRESSREQUEST = DESCRIPTOR.message_types_by_name['DeriveAddressRequest'] -_DERIVEADDRESSRESPONSE = DESCRIPTOR.message_types_by_name['DeriveAddressResponse'] -_DERIVECHANGEADDRESSREQUEST = DESCRIPTOR.message_types_by_name['DeriveChangeAddressRequest'] -_DERIVECHANGEADDRESSRESPONSE = DESCRIPTOR.message_types_by_name['DeriveChangeAddressResponse'] -_LISTADDRESSESREQUEST = DESCRIPTOR.message_types_by_name['ListAddressesRequest'] -_LISTADDRESSESRESPONSE = DESCRIPTOR.message_types_by_name['ListAddressesResponse'] -_BALANCEREQUEST = DESCRIPTOR.message_types_by_name['BalanceRequest'] -_BALANCERESPONSE = DESCRIPTOR.message_types_by_name['BalanceResponse'] -_BALANCERESPONSE_BALANCEENTRY = _BALANCERESPONSE.nested_types_by_name['BalanceEntry'] -_LISTUTXOSREQUEST = DESCRIPTOR.message_types_by_name['ListUtxosRequest'] -_LISTUTXOSRESPONSE = DESCRIPTOR.message_types_by_name['ListUtxosResponse'] -CreateAccountRequest = _reflection.GeneratedProtocolMessageType('CreateAccountRequest', (_message.Message,), { - 'DESCRIPTOR' : _CREATEACCOUNTREQUEST, - '__module__' : 'ocean.v1alpha.account_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.CreateAccountRequest) - }) -_sym_db.RegisterMessage(CreateAccountRequest) - -CreateAccountResponse = _reflection.GeneratedProtocolMessageType('CreateAccountResponse', (_message.Message,), { - 'DESCRIPTOR' : _CREATEACCOUNTRESPONSE, - '__module__' : 'ocean.v1alpha.account_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.CreateAccountResponse) - }) -_sym_db.RegisterMessage(CreateAccountResponse) - -SetAccountTemplateRequest = _reflection.GeneratedProtocolMessageType('SetAccountTemplateRequest', (_message.Message,), { - 'DESCRIPTOR' : _SETACCOUNTTEMPLATEREQUEST, - '__module__' : 'ocean.v1alpha.account_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.SetAccountTemplateRequest) - }) -_sym_db.RegisterMessage(SetAccountTemplateRequest) - -SetAccountTemplateResponse = _reflection.GeneratedProtocolMessageType('SetAccountTemplateResponse', (_message.Message,), { - 'DESCRIPTOR' : _SETACCOUNTTEMPLATERESPONSE, - '__module__' : 'ocean.v1alpha.account_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.SetAccountTemplateResponse) - }) -_sym_db.RegisterMessage(SetAccountTemplateResponse) - -DeriveAddressRequest = _reflection.GeneratedProtocolMessageType('DeriveAddressRequest', (_message.Message,), { - 'DESCRIPTOR' : _DERIVEADDRESSREQUEST, - '__module__' : 'ocean.v1alpha.account_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.DeriveAddressRequest) - }) -_sym_db.RegisterMessage(DeriveAddressRequest) - -DeriveAddressResponse = _reflection.GeneratedProtocolMessageType('DeriveAddressResponse', (_message.Message,), { - 'DESCRIPTOR' : _DERIVEADDRESSRESPONSE, - '__module__' : 'ocean.v1alpha.account_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.DeriveAddressResponse) - }) -_sym_db.RegisterMessage(DeriveAddressResponse) - -DeriveChangeAddressRequest = _reflection.GeneratedProtocolMessageType('DeriveChangeAddressRequest', (_message.Message,), { - 'DESCRIPTOR' : _DERIVECHANGEADDRESSREQUEST, - '__module__' : 'ocean.v1alpha.account_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.DeriveChangeAddressRequest) - }) -_sym_db.RegisterMessage(DeriveChangeAddressRequest) - -DeriveChangeAddressResponse = _reflection.GeneratedProtocolMessageType('DeriveChangeAddressResponse', (_message.Message,), { - 'DESCRIPTOR' : _DERIVECHANGEADDRESSRESPONSE, - '__module__' : 'ocean.v1alpha.account_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.DeriveChangeAddressResponse) - }) -_sym_db.RegisterMessage(DeriveChangeAddressResponse) - -ListAddressesRequest = _reflection.GeneratedProtocolMessageType('ListAddressesRequest', (_message.Message,), { - 'DESCRIPTOR' : _LISTADDRESSESREQUEST, - '__module__' : 'ocean.v1alpha.account_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.ListAddressesRequest) - }) -_sym_db.RegisterMessage(ListAddressesRequest) - -ListAddressesResponse = _reflection.GeneratedProtocolMessageType('ListAddressesResponse', (_message.Message,), { - 'DESCRIPTOR' : _LISTADDRESSESRESPONSE, - '__module__' : 'ocean.v1alpha.account_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.ListAddressesResponse) - }) -_sym_db.RegisterMessage(ListAddressesResponse) - -BalanceRequest = _reflection.GeneratedProtocolMessageType('BalanceRequest', (_message.Message,), { - 'DESCRIPTOR' : _BALANCEREQUEST, - '__module__' : 'ocean.v1alpha.account_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.BalanceRequest) - }) -_sym_db.RegisterMessage(BalanceRequest) - -BalanceResponse = _reflection.GeneratedProtocolMessageType('BalanceResponse', (_message.Message,), { - - 'BalanceEntry' : _reflection.GeneratedProtocolMessageType('BalanceEntry', (_message.Message,), { - 'DESCRIPTOR' : _BALANCERESPONSE_BALANCEENTRY, - '__module__' : 'ocean.v1alpha.account_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.BalanceResponse.BalanceEntry) - }) - , - 'DESCRIPTOR' : _BALANCERESPONSE, - '__module__' : 'ocean.v1alpha.account_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.BalanceResponse) - }) -_sym_db.RegisterMessage(BalanceResponse) -_sym_db.RegisterMessage(BalanceResponse.BalanceEntry) - -ListUtxosRequest = _reflection.GeneratedProtocolMessageType('ListUtxosRequest', (_message.Message,), { - 'DESCRIPTOR' : _LISTUTXOSREQUEST, - '__module__' : 'ocean.v1alpha.account_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.ListUtxosRequest) - }) -_sym_db.RegisterMessage(ListUtxosRequest) - -ListUtxosResponse = _reflection.GeneratedProtocolMessageType('ListUtxosResponse', (_message.Message,), { - 'DESCRIPTOR' : _LISTUTXOSRESPONSE, - '__module__' : 'ocean.v1alpha.account_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.ListUtxosResponse) - }) -_sym_db.RegisterMessage(ListUtxosResponse) - -_ACCOUNTSERVICE = DESCRIPTOR.services_by_name['AccountService'] -if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'\n\021com.ocean.v1alphaB\014AccountProtoP\001Zagithub.com/vulpemventures/ocean/api-spec/protobuf/ocean/v1alpha/gen/go/ocean/v1alpha;oceanv1alpha\242\002\003OXX\252\002\rOcean.V1alpha\312\002\rOcean\\V1alpha\342\002\031Ocean\\V1alpha\\GPBMetadata\352\002\016Ocean::V1alpha' - _BALANCERESPONSE_BALANCEENTRY._options = None - _BALANCERESPONSE_BALANCEENTRY._serialized_options = b'8\001' - _CREATEACCOUNTREQUEST._serialized_start=73 - _CREATEACCOUNTREQUEST._serialized_end=115 - _CREATEACCOUNTRESPONSE._serialized_start=117 - _CREATEACCOUNTRESPONSE._serialized_end=197 - _SETACCOUNTTEMPLATEREQUEST._serialized_start=200 - _SETACCOUNTTEMPLATEREQUEST._serialized_end=340 - _SETACCOUNTTEMPLATERESPONSE._serialized_start=342 - _SETACCOUNTTEMPLATERESPONSE._serialized_end=370 - _DERIVEADDRESSREQUEST._serialized_start=372 - _DERIVEADDRESSREQUEST._serialized_end=496 - _DERIVEADDRESSRESPONSE._serialized_start=498 - _DERIVEADDRESSRESPONSE._serialized_end=551 - _DERIVECHANGEADDRESSREQUEST._serialized_start=554 - _DERIVECHANGEADDRESSREQUEST._serialized_end=684 - _DERIVECHANGEADDRESSRESPONSE._serialized_start=686 - _DERIVECHANGEADDRESSRESPONSE._serialized_end=745 - _LISTADDRESSESREQUEST._serialized_start=747 - _LISTADDRESSESREQUEST._serialized_end=829 - _LISTADDRESSESRESPONSE._serialized_start=831 - _LISTADDRESSESRESPONSE._serialized_end=884 - _BALANCEREQUEST._serialized_start=886 - _BALANCEREQUEST._serialized_end=992 - _BALANCERESPONSE._serialized_start=995 - _BALANCERESPONSE._serialized_end=1171 - _BALANCERESPONSE_BALANCEENTRY._serialized_start=1085 - _BALANCERESPONSE_BALANCEENTRY._serialized_end=1171 - _LISTUTXOSREQUEST._serialized_start=1173 - _LISTUTXOSREQUEST._serialized_end=1281 - _LISTUTXOSRESPONSE._serialized_start=1284 - _LISTUTXOSRESPONSE._serialized_end=1423 - _ACCOUNTSERVICE._serialized_start=1426 - _ACCOUNTSERVICE._serialized_end=2089 -# @@protoc_insertion_point(module_scope) diff --git a/api-spec/protobuf/gen/python/ocean/v1alpha/account_pb2_grpc.py b/api-spec/protobuf/gen/python/ocean/v1alpha/account_pb2_grpc.py deleted file mode 100644 index 7678f1c..0000000 --- a/api-spec/protobuf/gen/python/ocean/v1alpha/account_pb2_grpc.py +++ /dev/null @@ -1,282 +0,0 @@ -# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! -"""Client and server classes corresponding to protobuf-defined services.""" -import grpc - -from ocean.v1alpha import account_pb2 as ocean_dot_v1alpha_dot_account__pb2 - - -class AccountServiceStub(object): - """AccountService is used to manage accounts in HD Wallet. - It supports generating addresses, listing utxos and balances for specific account or - list of addresses and selecting utxos. - """ - - def __init__(self, channel): - """Constructor. - - Args: - channel: A grpc.Channel. - """ - self.CreateAccount = channel.unary_unary( - '/ocean.v1alpha.AccountService/CreateAccount', - request_serializer=ocean_dot_v1alpha_dot_account__pb2.CreateAccountRequest.SerializeToString, - response_deserializer=ocean_dot_v1alpha_dot_account__pb2.CreateAccountResponse.FromString, - ) - self.SetAccountTemplate = channel.unary_unary( - '/ocean.v1alpha.AccountService/SetAccountTemplate', - request_serializer=ocean_dot_v1alpha_dot_account__pb2.SetAccountTemplateRequest.SerializeToString, - response_deserializer=ocean_dot_v1alpha_dot_account__pb2.SetAccountTemplateResponse.FromString, - ) - self.DeriveAddress = channel.unary_unary( - '/ocean.v1alpha.AccountService/DeriveAddress', - request_serializer=ocean_dot_v1alpha_dot_account__pb2.DeriveAddressRequest.SerializeToString, - response_deserializer=ocean_dot_v1alpha_dot_account__pb2.DeriveAddressResponse.FromString, - ) - self.DeriveChangeAddress = channel.unary_unary( - '/ocean.v1alpha.AccountService/DeriveChangeAddress', - request_serializer=ocean_dot_v1alpha_dot_account__pb2.DeriveChangeAddressRequest.SerializeToString, - response_deserializer=ocean_dot_v1alpha_dot_account__pb2.DeriveChangeAddressResponse.FromString, - ) - self.ListAddresses = channel.unary_unary( - '/ocean.v1alpha.AccountService/ListAddresses', - request_serializer=ocean_dot_v1alpha_dot_account__pb2.ListAddressesRequest.SerializeToString, - response_deserializer=ocean_dot_v1alpha_dot_account__pb2.ListAddressesResponse.FromString, - ) - self.Balance = channel.unary_unary( - '/ocean.v1alpha.AccountService/Balance', - request_serializer=ocean_dot_v1alpha_dot_account__pb2.BalanceRequest.SerializeToString, - response_deserializer=ocean_dot_v1alpha_dot_account__pb2.BalanceResponse.FromString, - ) - self.ListUtxos = channel.unary_unary( - '/ocean.v1alpha.AccountService/ListUtxos', - request_serializer=ocean_dot_v1alpha_dot_account__pb2.ListUtxosRequest.SerializeToString, - response_deserializer=ocean_dot_v1alpha_dot_account__pb2.ListUtxosResponse.FromString, - ) - - -class AccountServiceServicer(object): - """AccountService is used to manage accounts in HD Wallet. - It supports generating addresses, listing utxos and balances for specific account or - list of addresses and selecting utxos. - """ - - def CreateAccount(self, request, context): - """CreateAccount creates a new account. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def SetAccountTemplate(self, request, context): - """SetAccountTemplate sets the template for the account used to generate new addresses. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def DeriveAddress(self, request, context): - """DeriveAddress generates new address(es) for the account. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def DeriveChangeAddress(self, request, context): - """DeriveChangeAddress generates new change address(es) for the account. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ListAddresses(self, request, context): - """ListAddresses returns all derived addresses for the account. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def Balance(self, request, context): - """Balance returns the balance for the account, or for specific list of - account's addresses. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - def ListUtxos(self, request, context): - """ListUtxos returns the utxos for the account, or specific list of - account's addresses. - """ - context.set_code(grpc.StatusCode.UNIMPLEMENTED) - context.set_details('Method not implemented!') - raise NotImplementedError('Method not implemented!') - - -def add_AccountServiceServicer_to_server(servicer, server): - rpc_method_handlers = { - 'CreateAccount': grpc.unary_unary_rpc_method_handler( - servicer.CreateAccount, - request_deserializer=ocean_dot_v1alpha_dot_account__pb2.CreateAccountRequest.FromString, - response_serializer=ocean_dot_v1alpha_dot_account__pb2.CreateAccountResponse.SerializeToString, - ), - 'SetAccountTemplate': grpc.unary_unary_rpc_method_handler( - servicer.SetAccountTemplate, - request_deserializer=ocean_dot_v1alpha_dot_account__pb2.SetAccountTemplateRequest.FromString, - response_serializer=ocean_dot_v1alpha_dot_account__pb2.SetAccountTemplateResponse.SerializeToString, - ), - 'DeriveAddress': grpc.unary_unary_rpc_method_handler( - servicer.DeriveAddress, - request_deserializer=ocean_dot_v1alpha_dot_account__pb2.DeriveAddressRequest.FromString, - response_serializer=ocean_dot_v1alpha_dot_account__pb2.DeriveAddressResponse.SerializeToString, - ), - 'DeriveChangeAddress': grpc.unary_unary_rpc_method_handler( - servicer.DeriveChangeAddress, - request_deserializer=ocean_dot_v1alpha_dot_account__pb2.DeriveChangeAddressRequest.FromString, - response_serializer=ocean_dot_v1alpha_dot_account__pb2.DeriveChangeAddressResponse.SerializeToString, - ), - 'ListAddresses': grpc.unary_unary_rpc_method_handler( - servicer.ListAddresses, - request_deserializer=ocean_dot_v1alpha_dot_account__pb2.ListAddressesRequest.FromString, - response_serializer=ocean_dot_v1alpha_dot_account__pb2.ListAddressesResponse.SerializeToString, - ), - 'Balance': grpc.unary_unary_rpc_method_handler( - servicer.Balance, - request_deserializer=ocean_dot_v1alpha_dot_account__pb2.BalanceRequest.FromString, - response_serializer=ocean_dot_v1alpha_dot_account__pb2.BalanceResponse.SerializeToString, - ), - 'ListUtxos': grpc.unary_unary_rpc_method_handler( - servicer.ListUtxos, - request_deserializer=ocean_dot_v1alpha_dot_account__pb2.ListUtxosRequest.FromString, - response_serializer=ocean_dot_v1alpha_dot_account__pb2.ListUtxosResponse.SerializeToString, - ), - } - generic_handler = grpc.method_handlers_generic_handler( - 'ocean.v1alpha.AccountService', rpc_method_handlers) - server.add_generic_rpc_handlers((generic_handler,)) - - - # This class is part of an EXPERIMENTAL API. -class AccountService(object): - """AccountService is used to manage accounts in HD Wallet. - It supports generating addresses, listing utxos and balances for specific account or - list of addresses and selecting utxos. - """ - - @staticmethod - def CreateAccount(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/ocean.v1alpha.AccountService/CreateAccount', - ocean_dot_v1alpha_dot_account__pb2.CreateAccountRequest.SerializeToString, - ocean_dot_v1alpha_dot_account__pb2.CreateAccountResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def SetAccountTemplate(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/ocean.v1alpha.AccountService/SetAccountTemplate', - ocean_dot_v1alpha_dot_account__pb2.SetAccountTemplateRequest.SerializeToString, - ocean_dot_v1alpha_dot_account__pb2.SetAccountTemplateResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def DeriveAddress(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/ocean.v1alpha.AccountService/DeriveAddress', - ocean_dot_v1alpha_dot_account__pb2.DeriveAddressRequest.SerializeToString, - ocean_dot_v1alpha_dot_account__pb2.DeriveAddressResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def DeriveChangeAddress(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/ocean.v1alpha.AccountService/DeriveChangeAddress', - ocean_dot_v1alpha_dot_account__pb2.DeriveChangeAddressRequest.SerializeToString, - ocean_dot_v1alpha_dot_account__pb2.DeriveChangeAddressResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def ListAddresses(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/ocean.v1alpha.AccountService/ListAddresses', - ocean_dot_v1alpha_dot_account__pb2.ListAddressesRequest.SerializeToString, - ocean_dot_v1alpha_dot_account__pb2.ListAddressesResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def Balance(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/ocean.v1alpha.AccountService/Balance', - ocean_dot_v1alpha_dot_account__pb2.BalanceRequest.SerializeToString, - ocean_dot_v1alpha_dot_account__pb2.BalanceResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) - - @staticmethod - def ListUtxos(request, - target, - options=(), - channel_credentials=None, - call_credentials=None, - insecure=False, - compression=None, - wait_for_ready=None, - timeout=None, - metadata=None): - return grpc.experimental.unary_unary(request, target, '/ocean.v1alpha.AccountService/ListUtxos', - ocean_dot_v1alpha_dot_account__pb2.ListUtxosRequest.SerializeToString, - ocean_dot_v1alpha_dot_account__pb2.ListUtxosResponse.FromString, - options, channel_credentials, - insecure, call_credentials, compression, wait_for_ready, timeout, metadata) diff --git a/api-spec/protobuf/gen/python/ocean/v1alpha/notification_pb2.py b/api-spec/protobuf/gen/python/ocean/v1alpha/notification_pb2.py deleted file mode 100644 index f6bd9e9..0000000 --- a/api-spec/protobuf/gen/python/ocean/v1alpha/notification_pb2.py +++ /dev/null @@ -1,139 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: ocean/v1alpha/notification.proto -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from ocean.v1alpha import types_pb2 as ocean_dot_v1alpha_dot_types__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n ocean/v1alpha/notification.proto\x12\rocean.v1alpha\x1a\x19ocean/v1alpha/types.proto\"]\n\x1fTransactionNotificationsRequest\x12:\n\x0b\x61\x63\x63ount_key\x18\x01 \x01(\x0b\x32\x19.ocean.v1alpha.AccountKeyR\naccountKey\"\xef\x01\n TransactionNotificationsResponse\x12:\n\x0b\x61\x63\x63ount_key\x18\x01 \x01(\x0b\x32\x19.ocean.v1alpha.AccountKeyR\naccountKey\x12\x12\n\x04txid\x18\x02 \x01(\tR\x04txid\x12\x39\n\nevent_type\x18\x03 \x01(\x0e\x32\x1a.ocean.v1alpha.TxEventTypeR\teventType\x12@\n\rblock_details\x18\x04 \x01(\x0b\x32\x1b.ocean.v1alpha.BlockDetailsR\x0c\x62lockDetails\"W\n\x19UtxosNotificationsRequest\x12:\n\x0b\x61\x63\x63ount_key\x18\x01 \x01(\x0b\x32\x19.ocean.v1alpha.AccountKeyR\naccountKey\"\xbe\x01\n\x1aUtxosNotificationsResponse\x12:\n\x0b\x61\x63\x63ount_key\x18\x01 \x01(\x0b\x32\x19.ocean.v1alpha.AccountKeyR\naccountKey\x12\'\n\x04utxo\x18\x02 \x01(\x0b\x32\x13.ocean.v1alpha.UtxoR\x04utxo\x12;\n\nevent_type\x18\x03 \x01(\x0e\x32\x1c.ocean.v1alpha.UtxoEventTypeR\teventType\"\x87\x01\n\x11\x41\x64\x64WebhookRequest\x12\x1a\n\x08\x65ndpoint\x18\x01 \x01(\tR\x08\x65ndpoint\x12>\n\nevent_type\x18\x02 \x01(\x0e\x32\x1f.ocean.v1alpha.WebhookEventTypeR\teventType\x12\x16\n\x06secret\x18\x03 \x01(\tR\x06secret\"$\n\x12\x41\x64\x64WebhookResponse\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\"&\n\x14RemoveWebhookRequest\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\"\x17\n\x15RemoveWebhookResponse\"U\n\x13ListWebhooksRequest\x12>\n\nevent_type\x18\x01 \x01(\x0e\x32\x1f.ocean.v1alpha.WebhookEventTypeR\teventType\"U\n\x14ListWebhooksResponse\x12=\n\x0cwebhook_info\x18\x01 \x03(\x0b\x32\x1a.ocean.v1alpha.WebhookInfoR\x0bwebhookInfo\"X\n\x0bWebhookInfo\x12\x0e\n\x02id\x18\x01 \x01(\tR\x02id\x12\x1a\n\x08\x65ndpoint\x18\x02 \x01(\tR\x08\x65ndpoint\x12\x1d\n\nis_secured\x18\x03 \x01(\x08R\tisSecured2\x8f\x04\n\x13NotificationService\x12}\n\x18TransactionNotifications\x12..ocean.v1alpha.TransactionNotificationsRequest\x1a/.ocean.v1alpha.TransactionNotificationsResponse0\x01\x12k\n\x12UtxosNotifications\x12(.ocean.v1alpha.UtxosNotificationsRequest\x1a).ocean.v1alpha.UtxosNotificationsResponse0\x01\x12S\n\nAddWebhook\x12 .ocean.v1alpha.AddWebhookRequest\x1a!.ocean.v1alpha.AddWebhookResponse\"\x00\x12\\\n\rRemoveWebhook\x12#.ocean.v1alpha.RemoveWebhookRequest\x1a$.ocean.v1alpha.RemoveWebhookResponse\"\x00\x12Y\n\x0cListWebhooks\x12\".ocean.v1alpha.ListWebhooksRequest\x1a#.ocean.v1alpha.ListWebhooksResponse\"\x00\x42\xde\x01\n\x11\x63om.ocean.v1alphaB\x11NotificationProtoP\x01Zagithub.com/vulpemventures/ocean/api-spec/protobuf/ocean/v1alpha/gen/go/ocean/v1alpha;oceanv1alpha\xa2\x02\x03OXX\xaa\x02\rOcean.V1alpha\xca\x02\rOcean\\V1alpha\xe2\x02\x19Ocean\\V1alpha\\GPBMetadata\xea\x02\x0eOcean::V1alphab\x06proto3') - - - -_TRANSACTIONNOTIFICATIONSREQUEST = DESCRIPTOR.message_types_by_name['TransactionNotificationsRequest'] -_TRANSACTIONNOTIFICATIONSRESPONSE = DESCRIPTOR.message_types_by_name['TransactionNotificationsResponse'] -_UTXOSNOTIFICATIONSREQUEST = DESCRIPTOR.message_types_by_name['UtxosNotificationsRequest'] -_UTXOSNOTIFICATIONSRESPONSE = DESCRIPTOR.message_types_by_name['UtxosNotificationsResponse'] -_ADDWEBHOOKREQUEST = DESCRIPTOR.message_types_by_name['AddWebhookRequest'] -_ADDWEBHOOKRESPONSE = DESCRIPTOR.message_types_by_name['AddWebhookResponse'] -_REMOVEWEBHOOKREQUEST = DESCRIPTOR.message_types_by_name['RemoveWebhookRequest'] -_REMOVEWEBHOOKRESPONSE = DESCRIPTOR.message_types_by_name['RemoveWebhookResponse'] -_LISTWEBHOOKSREQUEST = DESCRIPTOR.message_types_by_name['ListWebhooksRequest'] -_LISTWEBHOOKSRESPONSE = DESCRIPTOR.message_types_by_name['ListWebhooksResponse'] -_WEBHOOKINFO = DESCRIPTOR.message_types_by_name['WebhookInfo'] -TransactionNotificationsRequest = _reflection.GeneratedProtocolMessageType('TransactionNotificationsRequest', (_message.Message,), { - 'DESCRIPTOR' : _TRANSACTIONNOTIFICATIONSREQUEST, - '__module__' : 'ocean.v1alpha.notification_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.TransactionNotificationsRequest) - }) -_sym_db.RegisterMessage(TransactionNotificationsRequest) - -TransactionNotificationsResponse = _reflection.GeneratedProtocolMessageType('TransactionNotificationsResponse', (_message.Message,), { - 'DESCRIPTOR' : _TRANSACTIONNOTIFICATIONSRESPONSE, - '__module__' : 'ocean.v1alpha.notification_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.TransactionNotificationsResponse) - }) -_sym_db.RegisterMessage(TransactionNotificationsResponse) - -UtxosNotificationsRequest = _reflection.GeneratedProtocolMessageType('UtxosNotificationsRequest', (_message.Message,), { - 'DESCRIPTOR' : _UTXOSNOTIFICATIONSREQUEST, - '__module__' : 'ocean.v1alpha.notification_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.UtxosNotificationsRequest) - }) -_sym_db.RegisterMessage(UtxosNotificationsRequest) - -UtxosNotificationsResponse = _reflection.GeneratedProtocolMessageType('UtxosNotificationsResponse', (_message.Message,), { - 'DESCRIPTOR' : _UTXOSNOTIFICATIONSRESPONSE, - '__module__' : 'ocean.v1alpha.notification_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.UtxosNotificationsResponse) - }) -_sym_db.RegisterMessage(UtxosNotificationsResponse) - -AddWebhookRequest = _reflection.GeneratedProtocolMessageType('AddWebhookRequest', (_message.Message,), { - 'DESCRIPTOR' : _ADDWEBHOOKREQUEST, - '__module__' : 'ocean.v1alpha.notification_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.AddWebhookRequest) - }) -_sym_db.RegisterMessage(AddWebhookRequest) - -AddWebhookResponse = _reflection.GeneratedProtocolMessageType('AddWebhookResponse', (_message.Message,), { - 'DESCRIPTOR' : _ADDWEBHOOKRESPONSE, - '__module__' : 'ocean.v1alpha.notification_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.AddWebhookResponse) - }) -_sym_db.RegisterMessage(AddWebhookResponse) - -RemoveWebhookRequest = _reflection.GeneratedProtocolMessageType('RemoveWebhookRequest', (_message.Message,), { - 'DESCRIPTOR' : _REMOVEWEBHOOKREQUEST, - '__module__' : 'ocean.v1alpha.notification_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.RemoveWebhookRequest) - }) -_sym_db.RegisterMessage(RemoveWebhookRequest) - -RemoveWebhookResponse = _reflection.GeneratedProtocolMessageType('RemoveWebhookResponse', (_message.Message,), { - 'DESCRIPTOR' : _REMOVEWEBHOOKRESPONSE, - '__module__' : 'ocean.v1alpha.notification_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.RemoveWebhookResponse) - }) -_sym_db.RegisterMessage(RemoveWebhookResponse) - -ListWebhooksRequest = _reflection.GeneratedProtocolMessageType('ListWebhooksRequest', (_message.Message,), { - 'DESCRIPTOR' : _LISTWEBHOOKSREQUEST, - '__module__' : 'ocean.v1alpha.notification_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.ListWebhooksRequest) - }) -_sym_db.RegisterMessage(ListWebhooksRequest) - -ListWebhooksResponse = _reflection.GeneratedProtocolMessageType('ListWebhooksResponse', (_message.Message,), { - 'DESCRIPTOR' : _LISTWEBHOOKSRESPONSE, - '__module__' : 'ocean.v1alpha.notification_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.ListWebhooksResponse) - }) -_sym_db.RegisterMessage(ListWebhooksResponse) - -WebhookInfo = _reflection.GeneratedProtocolMessageType('WebhookInfo', (_message.Message,), { - 'DESCRIPTOR' : _WEBHOOKINFO, - '__module__' : 'ocean.v1alpha.notification_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.WebhookInfo) - }) -_sym_db.RegisterMessage(WebhookInfo) - -_NOTIFICATIONSERVICE = DESCRIPTOR.services_by_name['NotificationService'] -if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'\n\021com.ocean.v1alphaB\021NotificationProtoP\001Zagithub.com/vulpemventures/ocean/api-spec/protobuf/ocean/v1alpha/gen/go/ocean/v1alpha;oceanv1alpha\242\002\003OXX\252\002\rOcean.V1alpha\312\002\rOcean\\V1alpha\342\002\031Ocean\\V1alpha\\GPBMetadata\352\002\016Ocean::V1alpha' - _TRANSACTIONNOTIFICATIONSREQUEST._serialized_start=78 - _TRANSACTIONNOTIFICATIONSREQUEST._serialized_end=171 - _TRANSACTIONNOTIFICATIONSRESPONSE._serialized_start=174 - _TRANSACTIONNOTIFICATIONSRESPONSE._serialized_end=413 - _UTXOSNOTIFICATIONSREQUEST._serialized_start=415 - _UTXOSNOTIFICATIONSREQUEST._serialized_end=502 - _UTXOSNOTIFICATIONSRESPONSE._serialized_start=505 - _UTXOSNOTIFICATIONSRESPONSE._serialized_end=695 - _ADDWEBHOOKREQUEST._serialized_start=698 - _ADDWEBHOOKREQUEST._serialized_end=833 - _ADDWEBHOOKRESPONSE._serialized_start=835 - _ADDWEBHOOKRESPONSE._serialized_end=871 - _REMOVEWEBHOOKREQUEST._serialized_start=873 - _REMOVEWEBHOOKREQUEST._serialized_end=911 - _REMOVEWEBHOOKRESPONSE._serialized_start=913 - _REMOVEWEBHOOKRESPONSE._serialized_end=936 - _LISTWEBHOOKSREQUEST._serialized_start=938 - _LISTWEBHOOKSREQUEST._serialized_end=1023 - _LISTWEBHOOKSRESPONSE._serialized_start=1025 - _LISTWEBHOOKSRESPONSE._serialized_end=1110 - _WEBHOOKINFO._serialized_start=1112 - _WEBHOOKINFO._serialized_end=1200 - _NOTIFICATIONSERVICE._serialized_start=1203 - _NOTIFICATIONSERVICE._serialized_end=1730 -# @@protoc_insertion_point(module_scope) diff --git a/api-spec/protobuf/gen/python/ocean/v1alpha/transaction_pb2.py b/api-spec/protobuf/gen/python/ocean/v1alpha/transaction_pb2.py deleted file mode 100644 index 4420d13..0000000 --- a/api-spec/protobuf/gen/python/ocean/v1alpha/transaction_pb2.py +++ /dev/null @@ -1,332 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: ocean/v1alpha/transaction.proto -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from ocean.v1alpha import types_pb2 as ocean_dot_v1alpha_dot_types__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1focean/v1alpha/transaction.proto\x12\rocean.v1alpha\x1a\x19ocean/v1alpha/types.proto\"+\n\x15GetTransactionRequest\x12\x12\n\x04txid\x18\x01 \x01(\tR\x04txid\"q\n\x16GetTransactionResponse\x12\x15\n\x06tx_hex\x18\x01 \x01(\tR\x05txHex\x12@\n\rblock_details\x18\x02 \x01(\x0b\x32\x1b.ocean.v1alpha.BlockDetailsR\x0c\x62lockDetails\"\xb8\x02\n\x12SelectUtxosRequest\x12:\n\x0b\x61\x63\x63ount_key\x18\x01 \x01(\x0b\x32\x19.ocean.v1alpha.AccountKeyR\naccountKey\x12!\n\x0ctarget_asset\x18\x02 \x01(\tR\x0btargetAsset\x12#\n\rtarget_amount\x18\x03 \x01(\x04R\x0ctargetAmount\x12\x46\n\x08strategy\x18\x04 \x01(\x0e\x32*.ocean.v1alpha.SelectUtxosRequest.StrategyR\x08strategy\"V\n\x08Strategy\x12\x18\n\x14STRATEGY_UNSPECIFIED\x10\x00\x12\x19\n\x15STRATEGY_BRANCH_BOUND\x10\x01\x12\x15\n\x11STRATEGY_FRAGMENT\x10\x02\"Y\n\x13SelectUtxosResponse\x12*\n\x05utxos\x18\x01 \x01(\x0b\x32\x14.ocean.v1alpha.UtxosR\x05utxos\x12\x16\n\x06\x63hange\x18\x02 \x01(\x04R\x06\x63hange\"t\n\x13\x45stimateFeesRequest\x12,\n\x06inputs\x18\x01 \x03(\x0b\x32\x14.ocean.v1alpha.InputR\x06inputs\x12/\n\x07outputs\x18\x02 \x03(\x0b\x32\x15.ocean.v1alpha.OutputR\x07outputs\"5\n\x14\x45stimateFeesResponse\x12\x1d\n\nfee_amount\x18\x01 \x01(\x04R\tfeeAmount\"/\n\x16SignTransactionRequest\x12\x15\n\x06tx_hex\x18\x01 \x01(\tR\x05txHex\"0\n\x17SignTransactionResponse\x12\x15\n\x06tx_hex\x18\x01 \x01(\tR\x05txHex\"4\n\x1b\x42roadcastTransactionRequest\x12\x15\n\x06tx_hex\x18\x01 \x01(\tR\x05txHex\"2\n\x1c\x42roadcastTransactionResponse\x12\x12\n\x04txid\x18\x01 \x01(\tR\x04txid\"r\n\x11\x43reatePsetRequest\x12,\n\x06inputs\x18\x01 \x03(\x0b\x32\x14.ocean.v1alpha.InputR\x06inputs\x12/\n\x07outputs\x18\x02 \x03(\x0b\x32\x15.ocean.v1alpha.OutputR\x07outputs\"(\n\x12\x43reatePsetResponse\x12\x12\n\x04pset\x18\x01 \x01(\tR\x04pset\"\x86\x01\n\x11UpdatePsetRequest\x12\x12\n\x04pset\x18\x01 \x01(\tR\x04pset\x12,\n\x06inputs\x18\x02 \x03(\x0b\x32\x14.ocean.v1alpha.InputR\x06inputs\x12/\n\x07outputs\x18\x03 \x03(\x0b\x32\x15.ocean.v1alpha.OutputR\x07outputs\"(\n\x12UpdatePsetResponse\x12\x12\n\x04pset\x18\x01 \x01(\tR\x04pset\"I\n\x10\x42lindPsetRequest\x12\x12\n\x04pset\x18\x01 \x01(\tR\x04pset\x12!\n\x0clast_blinder\x18\x02 \x01(\x08R\x0blastBlinder\"\'\n\x11\x42lindPsetResponse\x12\x12\n\x04pset\x18\x01 \x01(\tR\x04pset\"%\n\x0fSignPsetRequest\x12\x12\n\x04pset\x18\x01 \x01(\tR\x04pset\"&\n\x10SignPsetResponse\x12\x12\n\x04pset\x18\x01 \x01(\tR\x04pset\"\xf4\x01\n\x0bMintRequest\x12:\n\x0b\x61\x63\x63ount_key\x18\x01 \x01(\x0b\x32\x19.ocean.v1alpha.AccountKeyR\naccountKey\x12!\n\x0c\x61sset_amount\x18\x02 \x01(\x04R\x0b\x61ssetAmount\x12!\n\x0ctoken_amount\x18\x03 \x01(\x04R\x0btokenAmount\x12\x1d\n\nasset_name\x18\x04 \x01(\tR\tassetName\x12!\n\x0c\x61sset_ticker\x18\x05 \x01(\tR\x0b\x61ssetTicker\x12!\n\x0c\x61sset_domain\x18\x06 \x01(\tR\x0b\x61ssetDomain\"%\n\x0cMintResponse\x12\x15\n\x06tx_hex\x18\x01 \x01(\tR\x05txHex\"y\n\rRemintRequest\x12:\n\x0b\x61\x63\x63ount_key\x18\x01 \x01(\x0b\x32\x19.ocean.v1alpha.AccountKeyR\naccountKey\x12\x14\n\x05\x61sset\x18\x02 \x01(\tR\x05\x61sset\x12\x16\n\x06\x61mount\x18\x03 \x01(\x04R\x06\x61mount\"\'\n\x0eRemintResponse\x12\x15\n\x06tx_hex\x18\x01 \x01(\tR\x05txHex\"~\n\x0b\x42urnRequest\x12:\n\x0b\x61\x63\x63ount_key\x18\x01 \x01(\x0b\x32\x19.ocean.v1alpha.AccountKeyR\naccountKey\x12\x33\n\treceivers\x18\x02 \x03(\x0b\x32\x15.ocean.v1alpha.OutputR\treceivers\"%\n\x0c\x42urnResponse\x12\x15\n\x06tx_hex\x18\x01 \x01(\tR\x05txHex\"\x82\x01\n\x0fTransferRequest\x12:\n\x0b\x61\x63\x63ount_key\x18\x01 \x01(\x0b\x32\x19.ocean.v1alpha.AccountKeyR\naccountKey\x12\x33\n\treceivers\x18\x02 \x03(\x0b\x32\x15.ocean.v1alpha.OutputR\treceivers\")\n\x10TransferResponse\x12\x15\n\x06tx_hex\x18\x01 \x01(\tR\x05txHex\"\x15\n\x13PegInAddressRequest\"\xa3\x01\n\x14PegInAddressResponse\x12:\n\x0b\x61\x63\x63ount_key\x18\x01 \x01(\x0b\x32\x19.ocean.v1alpha.AccountKeyR\naccountKey\x12,\n\x12main_chain_address\x18\x02 \x01(\tR\x10mainChainAddress\x12!\n\x0c\x63laim_script\x18\x03 \x01(\tR\x0b\x63laimScript\"w\n\x11\x43laimPegInRequest\x12\x1d\n\nbitcoin_tx\x18\x01 \x01(\tR\tbitcoinTx\x12 \n\x0ctx_out_proof\x18\x02 \x01(\tR\ntxOutProof\x12!\n\x0c\x63laim_script\x18\x03 \x01(\tR\x0b\x63laimScript\"+\n\x12\x43laimPegInResponse\x12\x15\n\x06tx_hex\x18\x01 \x01(\tR\x05txHex2\xfa\t\n\x12TransactionService\x12]\n\x0eGetTransaction\x12$.ocean.v1alpha.GetTransactionRequest\x1a%.ocean.v1alpha.GetTransactionResponse\x12T\n\x0bSelectUtxos\x12!.ocean.v1alpha.SelectUtxosRequest\x1a\".ocean.v1alpha.SelectUtxosResponse\x12W\n\x0c\x45stimateFees\x12\".ocean.v1alpha.EstimateFeesRequest\x1a#.ocean.v1alpha.EstimateFeesResponse\x12`\n\x0fSignTransaction\x12%.ocean.v1alpha.SignTransactionRequest\x1a&.ocean.v1alpha.SignTransactionResponse\x12o\n\x14\x42roadcastTransaction\x12*.ocean.v1alpha.BroadcastTransactionRequest\x1a+.ocean.v1alpha.BroadcastTransactionResponse\x12Q\n\nCreatePset\x12 .ocean.v1alpha.CreatePsetRequest\x1a!.ocean.v1alpha.CreatePsetResponse\x12Q\n\nUpdatePset\x12 .ocean.v1alpha.UpdatePsetRequest\x1a!.ocean.v1alpha.UpdatePsetResponse\x12N\n\tBlindPset\x12\x1f.ocean.v1alpha.BlindPsetRequest\x1a .ocean.v1alpha.BlindPsetResponse\x12K\n\x08SignPset\x12\x1e.ocean.v1alpha.SignPsetRequest\x1a\x1f.ocean.v1alpha.SignPsetResponse\x12?\n\x04Mint\x12\x1a.ocean.v1alpha.MintRequest\x1a\x1b.ocean.v1alpha.MintResponse\x12\x45\n\x06Remint\x12\x1c.ocean.v1alpha.RemintRequest\x1a\x1d.ocean.v1alpha.RemintResponse\x12?\n\x04\x42urn\x12\x1a.ocean.v1alpha.BurnRequest\x1a\x1b.ocean.v1alpha.BurnResponse\x12K\n\x08Transfer\x12\x1e.ocean.v1alpha.TransferRequest\x1a\x1f.ocean.v1alpha.TransferResponse\x12W\n\x0cPegInAddress\x12\".ocean.v1alpha.PegInAddressRequest\x1a#.ocean.v1alpha.PegInAddressResponse\x12Q\n\nClaimPegIn\x12 .ocean.v1alpha.ClaimPegInRequest\x1a!.ocean.v1alpha.ClaimPegInResponseB\xdd\x01\n\x11\x63om.ocean.v1alphaB\x10TransactionProtoP\x01Zagithub.com/vulpemventures/ocean/api-spec/protobuf/ocean/v1alpha/gen/go/ocean/v1alpha;oceanv1alpha\xa2\x02\x03OXX\xaa\x02\rOcean.V1alpha\xca\x02\rOcean\\V1alpha\xe2\x02\x19Ocean\\V1alpha\\GPBMetadata\xea\x02\x0eOcean::V1alphab\x06proto3') - - - -_GETTRANSACTIONREQUEST = DESCRIPTOR.message_types_by_name['GetTransactionRequest'] -_GETTRANSACTIONRESPONSE = DESCRIPTOR.message_types_by_name['GetTransactionResponse'] -_SELECTUTXOSREQUEST = DESCRIPTOR.message_types_by_name['SelectUtxosRequest'] -_SELECTUTXOSRESPONSE = DESCRIPTOR.message_types_by_name['SelectUtxosResponse'] -_ESTIMATEFEESREQUEST = DESCRIPTOR.message_types_by_name['EstimateFeesRequest'] -_ESTIMATEFEESRESPONSE = DESCRIPTOR.message_types_by_name['EstimateFeesResponse'] -_SIGNTRANSACTIONREQUEST = DESCRIPTOR.message_types_by_name['SignTransactionRequest'] -_SIGNTRANSACTIONRESPONSE = DESCRIPTOR.message_types_by_name['SignTransactionResponse'] -_BROADCASTTRANSACTIONREQUEST = DESCRIPTOR.message_types_by_name['BroadcastTransactionRequest'] -_BROADCASTTRANSACTIONRESPONSE = DESCRIPTOR.message_types_by_name['BroadcastTransactionResponse'] -_CREATEPSETREQUEST = DESCRIPTOR.message_types_by_name['CreatePsetRequest'] -_CREATEPSETRESPONSE = DESCRIPTOR.message_types_by_name['CreatePsetResponse'] -_UPDATEPSETREQUEST = DESCRIPTOR.message_types_by_name['UpdatePsetRequest'] -_UPDATEPSETRESPONSE = DESCRIPTOR.message_types_by_name['UpdatePsetResponse'] -_BLINDPSETREQUEST = DESCRIPTOR.message_types_by_name['BlindPsetRequest'] -_BLINDPSETRESPONSE = DESCRIPTOR.message_types_by_name['BlindPsetResponse'] -_SIGNPSETREQUEST = DESCRIPTOR.message_types_by_name['SignPsetRequest'] -_SIGNPSETRESPONSE = DESCRIPTOR.message_types_by_name['SignPsetResponse'] -_MINTREQUEST = DESCRIPTOR.message_types_by_name['MintRequest'] -_MINTRESPONSE = DESCRIPTOR.message_types_by_name['MintResponse'] -_REMINTREQUEST = DESCRIPTOR.message_types_by_name['RemintRequest'] -_REMINTRESPONSE = DESCRIPTOR.message_types_by_name['RemintResponse'] -_BURNREQUEST = DESCRIPTOR.message_types_by_name['BurnRequest'] -_BURNRESPONSE = DESCRIPTOR.message_types_by_name['BurnResponse'] -_TRANSFERREQUEST = DESCRIPTOR.message_types_by_name['TransferRequest'] -_TRANSFERRESPONSE = DESCRIPTOR.message_types_by_name['TransferResponse'] -_PEGINADDRESSREQUEST = DESCRIPTOR.message_types_by_name['PegInAddressRequest'] -_PEGINADDRESSRESPONSE = DESCRIPTOR.message_types_by_name['PegInAddressResponse'] -_CLAIMPEGINREQUEST = DESCRIPTOR.message_types_by_name['ClaimPegInRequest'] -_CLAIMPEGINRESPONSE = DESCRIPTOR.message_types_by_name['ClaimPegInResponse'] -_SELECTUTXOSREQUEST_STRATEGY = _SELECTUTXOSREQUEST.enum_types_by_name['Strategy'] -GetTransactionRequest = _reflection.GeneratedProtocolMessageType('GetTransactionRequest', (_message.Message,), { - 'DESCRIPTOR' : _GETTRANSACTIONREQUEST, - '__module__' : 'ocean.v1alpha.transaction_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.GetTransactionRequest) - }) -_sym_db.RegisterMessage(GetTransactionRequest) - -GetTransactionResponse = _reflection.GeneratedProtocolMessageType('GetTransactionResponse', (_message.Message,), { - 'DESCRIPTOR' : _GETTRANSACTIONRESPONSE, - '__module__' : 'ocean.v1alpha.transaction_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.GetTransactionResponse) - }) -_sym_db.RegisterMessage(GetTransactionResponse) - -SelectUtxosRequest = _reflection.GeneratedProtocolMessageType('SelectUtxosRequest', (_message.Message,), { - 'DESCRIPTOR' : _SELECTUTXOSREQUEST, - '__module__' : 'ocean.v1alpha.transaction_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.SelectUtxosRequest) - }) -_sym_db.RegisterMessage(SelectUtxosRequest) - -SelectUtxosResponse = _reflection.GeneratedProtocolMessageType('SelectUtxosResponse', (_message.Message,), { - 'DESCRIPTOR' : _SELECTUTXOSRESPONSE, - '__module__' : 'ocean.v1alpha.transaction_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.SelectUtxosResponse) - }) -_sym_db.RegisterMessage(SelectUtxosResponse) - -EstimateFeesRequest = _reflection.GeneratedProtocolMessageType('EstimateFeesRequest', (_message.Message,), { - 'DESCRIPTOR' : _ESTIMATEFEESREQUEST, - '__module__' : 'ocean.v1alpha.transaction_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.EstimateFeesRequest) - }) -_sym_db.RegisterMessage(EstimateFeesRequest) - -EstimateFeesResponse = _reflection.GeneratedProtocolMessageType('EstimateFeesResponse', (_message.Message,), { - 'DESCRIPTOR' : _ESTIMATEFEESRESPONSE, - '__module__' : 'ocean.v1alpha.transaction_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.EstimateFeesResponse) - }) -_sym_db.RegisterMessage(EstimateFeesResponse) - -SignTransactionRequest = _reflection.GeneratedProtocolMessageType('SignTransactionRequest', (_message.Message,), { - 'DESCRIPTOR' : _SIGNTRANSACTIONREQUEST, - '__module__' : 'ocean.v1alpha.transaction_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.SignTransactionRequest) - }) -_sym_db.RegisterMessage(SignTransactionRequest) - -SignTransactionResponse = _reflection.GeneratedProtocolMessageType('SignTransactionResponse', (_message.Message,), { - 'DESCRIPTOR' : _SIGNTRANSACTIONRESPONSE, - '__module__' : 'ocean.v1alpha.transaction_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.SignTransactionResponse) - }) -_sym_db.RegisterMessage(SignTransactionResponse) - -BroadcastTransactionRequest = _reflection.GeneratedProtocolMessageType('BroadcastTransactionRequest', (_message.Message,), { - 'DESCRIPTOR' : _BROADCASTTRANSACTIONREQUEST, - '__module__' : 'ocean.v1alpha.transaction_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.BroadcastTransactionRequest) - }) -_sym_db.RegisterMessage(BroadcastTransactionRequest) - -BroadcastTransactionResponse = _reflection.GeneratedProtocolMessageType('BroadcastTransactionResponse', (_message.Message,), { - 'DESCRIPTOR' : _BROADCASTTRANSACTIONRESPONSE, - '__module__' : 'ocean.v1alpha.transaction_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.BroadcastTransactionResponse) - }) -_sym_db.RegisterMessage(BroadcastTransactionResponse) - -CreatePsetRequest = _reflection.GeneratedProtocolMessageType('CreatePsetRequest', (_message.Message,), { - 'DESCRIPTOR' : _CREATEPSETREQUEST, - '__module__' : 'ocean.v1alpha.transaction_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.CreatePsetRequest) - }) -_sym_db.RegisterMessage(CreatePsetRequest) - -CreatePsetResponse = _reflection.GeneratedProtocolMessageType('CreatePsetResponse', (_message.Message,), { - 'DESCRIPTOR' : _CREATEPSETRESPONSE, - '__module__' : 'ocean.v1alpha.transaction_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.CreatePsetResponse) - }) -_sym_db.RegisterMessage(CreatePsetResponse) - -UpdatePsetRequest = _reflection.GeneratedProtocolMessageType('UpdatePsetRequest', (_message.Message,), { - 'DESCRIPTOR' : _UPDATEPSETREQUEST, - '__module__' : 'ocean.v1alpha.transaction_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.UpdatePsetRequest) - }) -_sym_db.RegisterMessage(UpdatePsetRequest) - -UpdatePsetResponse = _reflection.GeneratedProtocolMessageType('UpdatePsetResponse', (_message.Message,), { - 'DESCRIPTOR' : _UPDATEPSETRESPONSE, - '__module__' : 'ocean.v1alpha.transaction_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.UpdatePsetResponse) - }) -_sym_db.RegisterMessage(UpdatePsetResponse) - -BlindPsetRequest = _reflection.GeneratedProtocolMessageType('BlindPsetRequest', (_message.Message,), { - 'DESCRIPTOR' : _BLINDPSETREQUEST, - '__module__' : 'ocean.v1alpha.transaction_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.BlindPsetRequest) - }) -_sym_db.RegisterMessage(BlindPsetRequest) - -BlindPsetResponse = _reflection.GeneratedProtocolMessageType('BlindPsetResponse', (_message.Message,), { - 'DESCRIPTOR' : _BLINDPSETRESPONSE, - '__module__' : 'ocean.v1alpha.transaction_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.BlindPsetResponse) - }) -_sym_db.RegisterMessage(BlindPsetResponse) - -SignPsetRequest = _reflection.GeneratedProtocolMessageType('SignPsetRequest', (_message.Message,), { - 'DESCRIPTOR' : _SIGNPSETREQUEST, - '__module__' : 'ocean.v1alpha.transaction_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.SignPsetRequest) - }) -_sym_db.RegisterMessage(SignPsetRequest) - -SignPsetResponse = _reflection.GeneratedProtocolMessageType('SignPsetResponse', (_message.Message,), { - 'DESCRIPTOR' : _SIGNPSETRESPONSE, - '__module__' : 'ocean.v1alpha.transaction_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.SignPsetResponse) - }) -_sym_db.RegisterMessage(SignPsetResponse) - -MintRequest = _reflection.GeneratedProtocolMessageType('MintRequest', (_message.Message,), { - 'DESCRIPTOR' : _MINTREQUEST, - '__module__' : 'ocean.v1alpha.transaction_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.MintRequest) - }) -_sym_db.RegisterMessage(MintRequest) - -MintResponse = _reflection.GeneratedProtocolMessageType('MintResponse', (_message.Message,), { - 'DESCRIPTOR' : _MINTRESPONSE, - '__module__' : 'ocean.v1alpha.transaction_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.MintResponse) - }) -_sym_db.RegisterMessage(MintResponse) - -RemintRequest = _reflection.GeneratedProtocolMessageType('RemintRequest', (_message.Message,), { - 'DESCRIPTOR' : _REMINTREQUEST, - '__module__' : 'ocean.v1alpha.transaction_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.RemintRequest) - }) -_sym_db.RegisterMessage(RemintRequest) - -RemintResponse = _reflection.GeneratedProtocolMessageType('RemintResponse', (_message.Message,), { - 'DESCRIPTOR' : _REMINTRESPONSE, - '__module__' : 'ocean.v1alpha.transaction_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.RemintResponse) - }) -_sym_db.RegisterMessage(RemintResponse) - -BurnRequest = _reflection.GeneratedProtocolMessageType('BurnRequest', (_message.Message,), { - 'DESCRIPTOR' : _BURNREQUEST, - '__module__' : 'ocean.v1alpha.transaction_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.BurnRequest) - }) -_sym_db.RegisterMessage(BurnRequest) - -BurnResponse = _reflection.GeneratedProtocolMessageType('BurnResponse', (_message.Message,), { - 'DESCRIPTOR' : _BURNRESPONSE, - '__module__' : 'ocean.v1alpha.transaction_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.BurnResponse) - }) -_sym_db.RegisterMessage(BurnResponse) - -TransferRequest = _reflection.GeneratedProtocolMessageType('TransferRequest', (_message.Message,), { - 'DESCRIPTOR' : _TRANSFERREQUEST, - '__module__' : 'ocean.v1alpha.transaction_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.TransferRequest) - }) -_sym_db.RegisterMessage(TransferRequest) - -TransferResponse = _reflection.GeneratedProtocolMessageType('TransferResponse', (_message.Message,), { - 'DESCRIPTOR' : _TRANSFERRESPONSE, - '__module__' : 'ocean.v1alpha.transaction_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.TransferResponse) - }) -_sym_db.RegisterMessage(TransferResponse) - -PegInAddressRequest = _reflection.GeneratedProtocolMessageType('PegInAddressRequest', (_message.Message,), { - 'DESCRIPTOR' : _PEGINADDRESSREQUEST, - '__module__' : 'ocean.v1alpha.transaction_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.PegInAddressRequest) - }) -_sym_db.RegisterMessage(PegInAddressRequest) - -PegInAddressResponse = _reflection.GeneratedProtocolMessageType('PegInAddressResponse', (_message.Message,), { - 'DESCRIPTOR' : _PEGINADDRESSRESPONSE, - '__module__' : 'ocean.v1alpha.transaction_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.PegInAddressResponse) - }) -_sym_db.RegisterMessage(PegInAddressResponse) - -ClaimPegInRequest = _reflection.GeneratedProtocolMessageType('ClaimPegInRequest', (_message.Message,), { - 'DESCRIPTOR' : _CLAIMPEGINREQUEST, - '__module__' : 'ocean.v1alpha.transaction_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.ClaimPegInRequest) - }) -_sym_db.RegisterMessage(ClaimPegInRequest) - -ClaimPegInResponse = _reflection.GeneratedProtocolMessageType('ClaimPegInResponse', (_message.Message,), { - 'DESCRIPTOR' : _CLAIMPEGINRESPONSE, - '__module__' : 'ocean.v1alpha.transaction_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.ClaimPegInResponse) - }) -_sym_db.RegisterMessage(ClaimPegInResponse) - -_TRANSACTIONSERVICE = DESCRIPTOR.services_by_name['TransactionService'] -if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'\n\021com.ocean.v1alphaB\020TransactionProtoP\001Zagithub.com/vulpemventures/ocean/api-spec/protobuf/ocean/v1alpha/gen/go/ocean/v1alpha;oceanv1alpha\242\002\003OXX\252\002\rOcean.V1alpha\312\002\rOcean\\V1alpha\342\002\031Ocean\\V1alpha\\GPBMetadata\352\002\016Ocean::V1alpha' - _GETTRANSACTIONREQUEST._serialized_start=77 - _GETTRANSACTIONREQUEST._serialized_end=120 - _GETTRANSACTIONRESPONSE._serialized_start=122 - _GETTRANSACTIONRESPONSE._serialized_end=235 - _SELECTUTXOSREQUEST._serialized_start=238 - _SELECTUTXOSREQUEST._serialized_end=550 - _SELECTUTXOSREQUEST_STRATEGY._serialized_start=464 - _SELECTUTXOSREQUEST_STRATEGY._serialized_end=550 - _SELECTUTXOSRESPONSE._serialized_start=552 - _SELECTUTXOSRESPONSE._serialized_end=641 - _ESTIMATEFEESREQUEST._serialized_start=643 - _ESTIMATEFEESREQUEST._serialized_end=759 - _ESTIMATEFEESRESPONSE._serialized_start=761 - _ESTIMATEFEESRESPONSE._serialized_end=814 - _SIGNTRANSACTIONREQUEST._serialized_start=816 - _SIGNTRANSACTIONREQUEST._serialized_end=863 - _SIGNTRANSACTIONRESPONSE._serialized_start=865 - _SIGNTRANSACTIONRESPONSE._serialized_end=913 - _BROADCASTTRANSACTIONREQUEST._serialized_start=915 - _BROADCASTTRANSACTIONREQUEST._serialized_end=967 - _BROADCASTTRANSACTIONRESPONSE._serialized_start=969 - _BROADCASTTRANSACTIONRESPONSE._serialized_end=1019 - _CREATEPSETREQUEST._serialized_start=1021 - _CREATEPSETREQUEST._serialized_end=1135 - _CREATEPSETRESPONSE._serialized_start=1137 - _CREATEPSETRESPONSE._serialized_end=1177 - _UPDATEPSETREQUEST._serialized_start=1180 - _UPDATEPSETREQUEST._serialized_end=1314 - _UPDATEPSETRESPONSE._serialized_start=1316 - _UPDATEPSETRESPONSE._serialized_end=1356 - _BLINDPSETREQUEST._serialized_start=1358 - _BLINDPSETREQUEST._serialized_end=1431 - _BLINDPSETRESPONSE._serialized_start=1433 - _BLINDPSETRESPONSE._serialized_end=1472 - _SIGNPSETREQUEST._serialized_start=1474 - _SIGNPSETREQUEST._serialized_end=1511 - _SIGNPSETRESPONSE._serialized_start=1513 - _SIGNPSETRESPONSE._serialized_end=1551 - _MINTREQUEST._serialized_start=1554 - _MINTREQUEST._serialized_end=1798 - _MINTRESPONSE._serialized_start=1800 - _MINTRESPONSE._serialized_end=1837 - _REMINTREQUEST._serialized_start=1839 - _REMINTREQUEST._serialized_end=1960 - _REMINTRESPONSE._serialized_start=1962 - _REMINTRESPONSE._serialized_end=2001 - _BURNREQUEST._serialized_start=2003 - _BURNREQUEST._serialized_end=2129 - _BURNRESPONSE._serialized_start=2131 - _BURNRESPONSE._serialized_end=2168 - _TRANSFERREQUEST._serialized_start=2171 - _TRANSFERREQUEST._serialized_end=2301 - _TRANSFERRESPONSE._serialized_start=2303 - _TRANSFERRESPONSE._serialized_end=2344 - _PEGINADDRESSREQUEST._serialized_start=2346 - _PEGINADDRESSREQUEST._serialized_end=2367 - _PEGINADDRESSRESPONSE._serialized_start=2370 - _PEGINADDRESSRESPONSE._serialized_end=2533 - _CLAIMPEGINREQUEST._serialized_start=2535 - _CLAIMPEGINREQUEST._serialized_end=2654 - _CLAIMPEGINRESPONSE._serialized_start=2656 - _CLAIMPEGINRESPONSE._serialized_end=2699 - _TRANSACTIONSERVICE._serialized_start=2702 - _TRANSACTIONSERVICE._serialized_end=3976 -# @@protoc_insertion_point(module_scope) diff --git a/api-spec/protobuf/gen/python/ocean/v1alpha/types_pb2.py b/api-spec/protobuf/gen/python/ocean/v1alpha/types_pb2.py deleted file mode 100644 index 80e58fb..0000000 --- a/api-spec/protobuf/gen/python/ocean/v1alpha/types_pb2.py +++ /dev/null @@ -1,143 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: ocean/v1alpha/types.proto -"""Generated protocol buffer code.""" -from google.protobuf.internal import enum_type_wrapper -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x19ocean/v1alpha/types.proto\x12\rocean.v1alpha\"0\n\nAccountKey\x12\x0e\n\x02id\x18\x01 \x01(\x04R\x02id\x12\x12\n\x04name\x18\x02 \x01(\tR\x04name\"\x86\x01\n\x0b\x41\x63\x63ountInfo\x12:\n\x0b\x61\x63\x63ount_key\x18\x01 \x01(\x0b\x32\x19.ocean.v1alpha.AccountKeyR\naccountKey\x12\'\n\x0f\x64\x65rivation_path\x18\x02 \x01(\tR\x0e\x64\x65rivationPath\x12\x12\n\x04xpub\x18\x03 \x01(\tR\x04xpub\"\x90\x01\n\x0b\x42\x61lanceInfo\x12#\n\rtotal_balance\x18\x01 \x01(\x04R\x0ctotalBalance\x12+\n\x11\x63onfirmed_balance\x18\x02 \x01(\x04R\x10\x63onfirmedBalance\x12/\n\x13unconfirmed_balance\x18\x03 \x01(\x04R\x12unconfirmedBalance\"1\n\x05Input\x12\x12\n\x04txid\x18\x01 \x01(\tR\x04txid\x12\x14\n\x05index\x18\x02 \x01(\rR\x05index\"P\n\x06Output\x12\x14\n\x05\x61sset\x18\x01 \x01(\tR\x05\x61sset\x12\x16\n\x06\x61mount\x18\x02 \x01(\x04R\x06\x61mount\x12\x18\n\x07\x61\x64\x64ress\x18\x03 \x01(\tR\x07\x61\x64\x64ress\"n\n\x05Utxos\x12:\n\x0b\x61\x63\x63ount_key\x18\x01 \x01(\x0b\x32\x19.ocean.v1alpha.AccountKeyR\naccountKey\x12)\n\x05utxos\x18\x02 \x03(\x0b\x32\x13.ocean.v1alpha.UtxoR\x05utxos\"\xb4\x01\n\x04Utxo\x12\x12\n\x04txid\x18\x01 \x01(\tR\x04txid\x12\x14\n\x05index\x18\x02 \x01(\rR\x05index\x12\x14\n\x05\x61sset\x18\x03 \x01(\tR\x05\x61sset\x12\x14\n\x05value\x18\x04 \x01(\x04R\x05value\x12\x16\n\x06script\x18\x05 \x01(\x0cR\x06script\x12!\n\x0cis_confirmed\x18\x06 \x01(\x08R\x0bisConfirmed\x12\x1b\n\tis_locked\x18\x07 \x01(\x08R\x08isLocked\"X\n\x0c\x42lockDetails\x12\x12\n\x04hash\x18\x01 \x01(\x0cR\x04hash\x12\x16\n\x06height\x18\x02 \x01(\x05R\x06height\x12\x1c\n\ttimestamp\x18\x03 \x01(\x03R\ttimestamp\"\xca\x01\n\x08Template\x12\x36\n\x06\x66ormat\x18\x01 \x01(\x0e\x32\x1e.ocean.v1alpha.Template.FormatR\x06\x66ormat\x12\x14\n\x05value\x18\x02 \x01(\tR\x05value\"p\n\x06\x46ormat\x12\x16\n\x12\x46ORMAT_UNSPECIFIED\x10\x00\x12\x15\n\x11\x46ORMAT_DESCRIPTOR\x10\x01\x12\x15\n\x11\x46ORMAT_MINISCRIPT\x10\x02\x12\x10\n\x0c\x46ORMAT_IONIO\x10\x03\x12\x0e\n\nFORMAT_RAW\x10\x04*\x87\x01\n\x0bTxEventType\x12\x1d\n\x19TX_EVENT_TYPE_UNSPECIFIED\x10\x00\x12\x1d\n\x19TX_EVENT_TYPE_BROADCASTED\x10\x01\x12\x1d\n\x19TX_EVENT_TYPE_UNCONFIRMED\x10\x02\x12\x1b\n\x17TX_EVENT_TYPE_CONFIRMED\x10\x03*\x9e\x01\n\rUtxoEventType\x12\x1f\n\x1bUTXO_EVENT_TYPE_UNSPECIFIED\x10\x00\x12\x1a\n\x16UTXO_EVENT_TYPE_LOCKED\x10\x01\x12\x1c\n\x18UTXO_EVENT_TYPE_UNLOCKED\x10\x02\x12\x19\n\x15UTXO_EVENT_TYPE_SPENT\x10\x03\x12\x17\n\x13UTXO_EVENT_TYPE_NEW\x10\x04*{\n\x10WebhookEventType\x12\"\n\x1eWEBHOOK_EVENT_TYPE_UNSPECIFIED\x10\x00\x12\"\n\x1eWEBHOOK_EVENT_TYPE_TRANSACTION\x10\x01\x12\x1f\n\x1bWEBHOOK_EVENT_TYPE_UNSPENTS\x10\x02\x42\xd7\x01\n\x11\x63om.ocean.v1alphaB\nTypesProtoP\x01Zagithub.com/vulpemventures/ocean/api-spec/protobuf/ocean/v1alpha/gen/go/ocean/v1alpha;oceanv1alpha\xa2\x02\x03OXX\xaa\x02\rOcean.V1alpha\xca\x02\rOcean\\V1alpha\xe2\x02\x19Ocean\\V1alpha\\GPBMetadata\xea\x02\x0eOcean::V1alphab\x06proto3') - -_TXEVENTTYPE = DESCRIPTOR.enum_types_by_name['TxEventType'] -TxEventType = enum_type_wrapper.EnumTypeWrapper(_TXEVENTTYPE) -_UTXOEVENTTYPE = DESCRIPTOR.enum_types_by_name['UtxoEventType'] -UtxoEventType = enum_type_wrapper.EnumTypeWrapper(_UTXOEVENTTYPE) -_WEBHOOKEVENTTYPE = DESCRIPTOR.enum_types_by_name['WebhookEventType'] -WebhookEventType = enum_type_wrapper.EnumTypeWrapper(_WEBHOOKEVENTTYPE) -TX_EVENT_TYPE_UNSPECIFIED = 0 -TX_EVENT_TYPE_BROADCASTED = 1 -TX_EVENT_TYPE_UNCONFIRMED = 2 -TX_EVENT_TYPE_CONFIRMED = 3 -UTXO_EVENT_TYPE_UNSPECIFIED = 0 -UTXO_EVENT_TYPE_LOCKED = 1 -UTXO_EVENT_TYPE_UNLOCKED = 2 -UTXO_EVENT_TYPE_SPENT = 3 -UTXO_EVENT_TYPE_NEW = 4 -WEBHOOK_EVENT_TYPE_UNSPECIFIED = 0 -WEBHOOK_EVENT_TYPE_TRANSACTION = 1 -WEBHOOK_EVENT_TYPE_UNSPENTS = 2 - - -_ACCOUNTKEY = DESCRIPTOR.message_types_by_name['AccountKey'] -_ACCOUNTINFO = DESCRIPTOR.message_types_by_name['AccountInfo'] -_BALANCEINFO = DESCRIPTOR.message_types_by_name['BalanceInfo'] -_INPUT = DESCRIPTOR.message_types_by_name['Input'] -_OUTPUT = DESCRIPTOR.message_types_by_name['Output'] -_UTXOS = DESCRIPTOR.message_types_by_name['Utxos'] -_UTXO = DESCRIPTOR.message_types_by_name['Utxo'] -_BLOCKDETAILS = DESCRIPTOR.message_types_by_name['BlockDetails'] -_TEMPLATE = DESCRIPTOR.message_types_by_name['Template'] -_TEMPLATE_FORMAT = _TEMPLATE.enum_types_by_name['Format'] -AccountKey = _reflection.GeneratedProtocolMessageType('AccountKey', (_message.Message,), { - 'DESCRIPTOR' : _ACCOUNTKEY, - '__module__' : 'ocean.v1alpha.types_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.AccountKey) - }) -_sym_db.RegisterMessage(AccountKey) - -AccountInfo = _reflection.GeneratedProtocolMessageType('AccountInfo', (_message.Message,), { - 'DESCRIPTOR' : _ACCOUNTINFO, - '__module__' : 'ocean.v1alpha.types_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.AccountInfo) - }) -_sym_db.RegisterMessage(AccountInfo) - -BalanceInfo = _reflection.GeneratedProtocolMessageType('BalanceInfo', (_message.Message,), { - 'DESCRIPTOR' : _BALANCEINFO, - '__module__' : 'ocean.v1alpha.types_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.BalanceInfo) - }) -_sym_db.RegisterMessage(BalanceInfo) - -Input = _reflection.GeneratedProtocolMessageType('Input', (_message.Message,), { - 'DESCRIPTOR' : _INPUT, - '__module__' : 'ocean.v1alpha.types_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.Input) - }) -_sym_db.RegisterMessage(Input) - -Output = _reflection.GeneratedProtocolMessageType('Output', (_message.Message,), { - 'DESCRIPTOR' : _OUTPUT, - '__module__' : 'ocean.v1alpha.types_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.Output) - }) -_sym_db.RegisterMessage(Output) - -Utxos = _reflection.GeneratedProtocolMessageType('Utxos', (_message.Message,), { - 'DESCRIPTOR' : _UTXOS, - '__module__' : 'ocean.v1alpha.types_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.Utxos) - }) -_sym_db.RegisterMessage(Utxos) - -Utxo = _reflection.GeneratedProtocolMessageType('Utxo', (_message.Message,), { - 'DESCRIPTOR' : _UTXO, - '__module__' : 'ocean.v1alpha.types_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.Utxo) - }) -_sym_db.RegisterMessage(Utxo) - -BlockDetails = _reflection.GeneratedProtocolMessageType('BlockDetails', (_message.Message,), { - 'DESCRIPTOR' : _BLOCKDETAILS, - '__module__' : 'ocean.v1alpha.types_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.BlockDetails) - }) -_sym_db.RegisterMessage(BlockDetails) - -Template = _reflection.GeneratedProtocolMessageType('Template', (_message.Message,), { - 'DESCRIPTOR' : _TEMPLATE, - '__module__' : 'ocean.v1alpha.types_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.Template) - }) -_sym_db.RegisterMessage(Template) - -if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'\n\021com.ocean.v1alphaB\nTypesProtoP\001Zagithub.com/vulpemventures/ocean/api-spec/protobuf/ocean/v1alpha/gen/go/ocean/v1alpha;oceanv1alpha\242\002\003OXX\252\002\rOcean.V1alpha\312\002\rOcean\\V1alpha\342\002\031Ocean\\V1alpha\\GPBMetadata\352\002\016Ocean::V1alpha' - _TXEVENTTYPE._serialized_start=1102 - _TXEVENTTYPE._serialized_end=1237 - _UTXOEVENTTYPE._serialized_start=1240 - _UTXOEVENTTYPE._serialized_end=1398 - _WEBHOOKEVENTTYPE._serialized_start=1400 - _WEBHOOKEVENTTYPE._serialized_end=1523 - _ACCOUNTKEY._serialized_start=44 - _ACCOUNTKEY._serialized_end=92 - _ACCOUNTINFO._serialized_start=95 - _ACCOUNTINFO._serialized_end=229 - _BALANCEINFO._serialized_start=232 - _BALANCEINFO._serialized_end=376 - _INPUT._serialized_start=378 - _INPUT._serialized_end=427 - _OUTPUT._serialized_start=429 - _OUTPUT._serialized_end=509 - _UTXOS._serialized_start=511 - _UTXOS._serialized_end=621 - _UTXO._serialized_start=624 - _UTXO._serialized_end=804 - _BLOCKDETAILS._serialized_start=806 - _BLOCKDETAILS._serialized_end=894 - _TEMPLATE._serialized_start=897 - _TEMPLATE._serialized_end=1099 - _TEMPLATE_FORMAT._serialized_start=987 - _TEMPLATE_FORMAT._serialized_end=1099 -# @@protoc_insertion_point(module_scope) diff --git a/api-spec/protobuf/gen/python/ocean/v1alpha/wallet_pb2.py b/api-spec/protobuf/gen/python/ocean/v1alpha/wallet_pb2.py deleted file mode 100644 index a31a336..0000000 --- a/api-spec/protobuf/gen/python/ocean/v1alpha/wallet_pb2.py +++ /dev/null @@ -1,172 +0,0 @@ -# -*- coding: utf-8 -*- -# Generated by the protocol buffer compiler. DO NOT EDIT! -# source: ocean/v1alpha/wallet.proto -"""Generated protocol buffer code.""" -from google.protobuf import descriptor as _descriptor -from google.protobuf import descriptor_pool as _descriptor_pool -from google.protobuf import message as _message -from google.protobuf import reflection as _reflection -from google.protobuf import symbol_database as _symbol_database -# @@protoc_insertion_point(imports) - -_sym_db = _symbol_database.Default() - - -from ocean.v1alpha import types_pb2 as ocean_dot_v1alpha_dot_types__pb2 - - -DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x1aocean/v1alpha/wallet.proto\x12\rocean.v1alpha\x1a\x19ocean/v1alpha/types.proto\"\x10\n\x0eGenSeedRequest\"-\n\x0fGenSeedResponse\x12\x1a\n\x08mnemonic\x18\x01 \x01(\tR\x08mnemonic\"M\n\x13\x43reateWalletRequest\x12\x1a\n\x08mnemonic\x18\x01 \x01(\tR\x08mnemonic\x12\x1a\n\x08password\x18\x03 \x01(\tR\x08password\"\x16\n\x14\x43reateWalletResponse\"+\n\rUnlockRequest\x12\x1a\n\x08password\x18\x01 \x01(\tR\x08password\"\x10\n\x0eUnlockResponse\"e\n\x15\x43hangePasswordRequest\x12)\n\x10\x63urrent_password\x18\x01 \x01(\tR\x0f\x63urrentPassword\x12!\n\x0cnew_password\x18\x02 \x01(\tR\x0bnewPassword\"\x18\n\x16\x43hangePasswordResponse\"N\n\x14RestoreWalletRequest\x12\x1a\n\x08mnemonic\x18\x01 \x01(\tR\x08mnemonic\x12\x1a\n\x08password\x18\x03 \x01(\tR\x08password\"\x17\n\x15RestoreWalletResponse\"\x0f\n\rStatusRequest\"f\n\x0eStatusResponse\x12 \n\x0binitialized\x18\x01 \x01(\x08R\x0binitialized\x12\x16\n\x06synced\x18\x02 \x01(\x08R\x06synced\x12\x1a\n\x08unlocked\x18\x03 \x01(\x08R\x08unlocked\"\x10\n\x0eGetInfoRequest\"\xde\x02\n\x0fGetInfoResponse\x12@\n\x07network\x18\x01 \x01(\x0e\x32&.ocean.v1alpha.GetInfoResponse.NetworkR\x07network\x12!\n\x0cnative_asset\x18\x02 \x01(\tR\x0bnativeAsset\x12\x1b\n\troot_path\x18\x03 \x01(\tR\x08rootPath\x12.\n\x13master_blinding_key\x18\x04 \x01(\tR\x11masterBlindingKey\x12\x36\n\x08\x61\x63\x63ounts\x18\x05 \x03(\x0b\x32\x1a.ocean.v1alpha.AccountInfoR\x08\x61\x63\x63ounts\"a\n\x07Network\x12\x17\n\x13NETWORK_UNSPECIFIED\x10\x00\x12\x13\n\x0fNETWORK_MAINNET\x10\x01\x12\x13\n\x0fNETWORK_TESTNET\x10\x02\x12\x13\n\x0fNETWORK_REGTEST\x10\x03\x32\xc5\x04\n\rWalletService\x12H\n\x07GenSeed\x12\x1d.ocean.v1alpha.GenSeedRequest\x1a\x1e.ocean.v1alpha.GenSeedResponse\x12W\n\x0c\x43reateWallet\x12\".ocean.v1alpha.CreateWalletRequest\x1a#.ocean.v1alpha.CreateWalletResponse\x12\x45\n\x06Unlock\x12\x1c.ocean.v1alpha.UnlockRequest\x1a\x1d.ocean.v1alpha.UnlockResponse\x12]\n\x0e\x43hangePassword\x12$.ocean.v1alpha.ChangePasswordRequest\x1a%.ocean.v1alpha.ChangePasswordResponse\x12Z\n\rRestoreWallet\x12#.ocean.v1alpha.RestoreWalletRequest\x1a$.ocean.v1alpha.RestoreWalletResponse\x12\x45\n\x06Status\x12\x1c.ocean.v1alpha.StatusRequest\x1a\x1d.ocean.v1alpha.StatusResponse\x12H\n\x07GetInfo\x12\x1d.ocean.v1alpha.GetInfoRequest\x1a\x1e.ocean.v1alpha.GetInfoResponseB\xd8\x01\n\x11\x63om.ocean.v1alphaB\x0bWalletProtoP\x01Zagithub.com/vulpemventures/ocean/api-spec/protobuf/ocean/v1alpha/gen/go/ocean/v1alpha;oceanv1alpha\xa2\x02\x03OXX\xaa\x02\rOcean.V1alpha\xca\x02\rOcean\\V1alpha\xe2\x02\x19Ocean\\V1alpha\\GPBMetadata\xea\x02\x0eOcean::V1alphab\x06proto3') - - - -_GENSEEDREQUEST = DESCRIPTOR.message_types_by_name['GenSeedRequest'] -_GENSEEDRESPONSE = DESCRIPTOR.message_types_by_name['GenSeedResponse'] -_CREATEWALLETREQUEST = DESCRIPTOR.message_types_by_name['CreateWalletRequest'] -_CREATEWALLETRESPONSE = DESCRIPTOR.message_types_by_name['CreateWalletResponse'] -_UNLOCKREQUEST = DESCRIPTOR.message_types_by_name['UnlockRequest'] -_UNLOCKRESPONSE = DESCRIPTOR.message_types_by_name['UnlockResponse'] -_CHANGEPASSWORDREQUEST = DESCRIPTOR.message_types_by_name['ChangePasswordRequest'] -_CHANGEPASSWORDRESPONSE = DESCRIPTOR.message_types_by_name['ChangePasswordResponse'] -_RESTOREWALLETREQUEST = DESCRIPTOR.message_types_by_name['RestoreWalletRequest'] -_RESTOREWALLETRESPONSE = DESCRIPTOR.message_types_by_name['RestoreWalletResponse'] -_STATUSREQUEST = DESCRIPTOR.message_types_by_name['StatusRequest'] -_STATUSRESPONSE = DESCRIPTOR.message_types_by_name['StatusResponse'] -_GETINFOREQUEST = DESCRIPTOR.message_types_by_name['GetInfoRequest'] -_GETINFORESPONSE = DESCRIPTOR.message_types_by_name['GetInfoResponse'] -_GETINFORESPONSE_NETWORK = _GETINFORESPONSE.enum_types_by_name['Network'] -GenSeedRequest = _reflection.GeneratedProtocolMessageType('GenSeedRequest', (_message.Message,), { - 'DESCRIPTOR' : _GENSEEDREQUEST, - '__module__' : 'ocean.v1alpha.wallet_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.GenSeedRequest) - }) -_sym_db.RegisterMessage(GenSeedRequest) - -GenSeedResponse = _reflection.GeneratedProtocolMessageType('GenSeedResponse', (_message.Message,), { - 'DESCRIPTOR' : _GENSEEDRESPONSE, - '__module__' : 'ocean.v1alpha.wallet_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.GenSeedResponse) - }) -_sym_db.RegisterMessage(GenSeedResponse) - -CreateWalletRequest = _reflection.GeneratedProtocolMessageType('CreateWalletRequest', (_message.Message,), { - 'DESCRIPTOR' : _CREATEWALLETREQUEST, - '__module__' : 'ocean.v1alpha.wallet_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.CreateWalletRequest) - }) -_sym_db.RegisterMessage(CreateWalletRequest) - -CreateWalletResponse = _reflection.GeneratedProtocolMessageType('CreateWalletResponse', (_message.Message,), { - 'DESCRIPTOR' : _CREATEWALLETRESPONSE, - '__module__' : 'ocean.v1alpha.wallet_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.CreateWalletResponse) - }) -_sym_db.RegisterMessage(CreateWalletResponse) - -UnlockRequest = _reflection.GeneratedProtocolMessageType('UnlockRequest', (_message.Message,), { - 'DESCRIPTOR' : _UNLOCKREQUEST, - '__module__' : 'ocean.v1alpha.wallet_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.UnlockRequest) - }) -_sym_db.RegisterMessage(UnlockRequest) - -UnlockResponse = _reflection.GeneratedProtocolMessageType('UnlockResponse', (_message.Message,), { - 'DESCRIPTOR' : _UNLOCKRESPONSE, - '__module__' : 'ocean.v1alpha.wallet_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.UnlockResponse) - }) -_sym_db.RegisterMessage(UnlockResponse) - -ChangePasswordRequest = _reflection.GeneratedProtocolMessageType('ChangePasswordRequest', (_message.Message,), { - 'DESCRIPTOR' : _CHANGEPASSWORDREQUEST, - '__module__' : 'ocean.v1alpha.wallet_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.ChangePasswordRequest) - }) -_sym_db.RegisterMessage(ChangePasswordRequest) - -ChangePasswordResponse = _reflection.GeneratedProtocolMessageType('ChangePasswordResponse', (_message.Message,), { - 'DESCRIPTOR' : _CHANGEPASSWORDRESPONSE, - '__module__' : 'ocean.v1alpha.wallet_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.ChangePasswordResponse) - }) -_sym_db.RegisterMessage(ChangePasswordResponse) - -RestoreWalletRequest = _reflection.GeneratedProtocolMessageType('RestoreWalletRequest', (_message.Message,), { - 'DESCRIPTOR' : _RESTOREWALLETREQUEST, - '__module__' : 'ocean.v1alpha.wallet_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.RestoreWalletRequest) - }) -_sym_db.RegisterMessage(RestoreWalletRequest) - -RestoreWalletResponse = _reflection.GeneratedProtocolMessageType('RestoreWalletResponse', (_message.Message,), { - 'DESCRIPTOR' : _RESTOREWALLETRESPONSE, - '__module__' : 'ocean.v1alpha.wallet_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.RestoreWalletResponse) - }) -_sym_db.RegisterMessage(RestoreWalletResponse) - -StatusRequest = _reflection.GeneratedProtocolMessageType('StatusRequest', (_message.Message,), { - 'DESCRIPTOR' : _STATUSREQUEST, - '__module__' : 'ocean.v1alpha.wallet_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.StatusRequest) - }) -_sym_db.RegisterMessage(StatusRequest) - -StatusResponse = _reflection.GeneratedProtocolMessageType('StatusResponse', (_message.Message,), { - 'DESCRIPTOR' : _STATUSRESPONSE, - '__module__' : 'ocean.v1alpha.wallet_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.StatusResponse) - }) -_sym_db.RegisterMessage(StatusResponse) - -GetInfoRequest = _reflection.GeneratedProtocolMessageType('GetInfoRequest', (_message.Message,), { - 'DESCRIPTOR' : _GETINFOREQUEST, - '__module__' : 'ocean.v1alpha.wallet_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.GetInfoRequest) - }) -_sym_db.RegisterMessage(GetInfoRequest) - -GetInfoResponse = _reflection.GeneratedProtocolMessageType('GetInfoResponse', (_message.Message,), { - 'DESCRIPTOR' : _GETINFORESPONSE, - '__module__' : 'ocean.v1alpha.wallet_pb2' - # @@protoc_insertion_point(class_scope:ocean.v1alpha.GetInfoResponse) - }) -_sym_db.RegisterMessage(GetInfoResponse) - -_WALLETSERVICE = DESCRIPTOR.services_by_name['WalletService'] -if _descriptor._USE_C_DESCRIPTORS == False: - - DESCRIPTOR._options = None - DESCRIPTOR._serialized_options = b'\n\021com.ocean.v1alphaB\013WalletProtoP\001Zagithub.com/vulpemventures/ocean/api-spec/protobuf/ocean/v1alpha/gen/go/ocean/v1alpha;oceanv1alpha\242\002\003OXX\252\002\rOcean.V1alpha\312\002\rOcean\\V1alpha\342\002\031Ocean\\V1alpha\\GPBMetadata\352\002\016Ocean::V1alpha' - _GENSEEDREQUEST._serialized_start=72 - _GENSEEDREQUEST._serialized_end=88 - _GENSEEDRESPONSE._serialized_start=90 - _GENSEEDRESPONSE._serialized_end=135 - _CREATEWALLETREQUEST._serialized_start=137 - _CREATEWALLETREQUEST._serialized_end=214 - _CREATEWALLETRESPONSE._serialized_start=216 - _CREATEWALLETRESPONSE._serialized_end=238 - _UNLOCKREQUEST._serialized_start=240 - _UNLOCKREQUEST._serialized_end=283 - _UNLOCKRESPONSE._serialized_start=285 - _UNLOCKRESPONSE._serialized_end=301 - _CHANGEPASSWORDREQUEST._serialized_start=303 - _CHANGEPASSWORDREQUEST._serialized_end=404 - _CHANGEPASSWORDRESPONSE._serialized_start=406 - _CHANGEPASSWORDRESPONSE._serialized_end=430 - _RESTOREWALLETREQUEST._serialized_start=432 - _RESTOREWALLETREQUEST._serialized_end=510 - _RESTOREWALLETRESPONSE._serialized_start=512 - _RESTOREWALLETRESPONSE._serialized_end=535 - _STATUSREQUEST._serialized_start=537 - _STATUSREQUEST._serialized_end=552 - _STATUSRESPONSE._serialized_start=554 - _STATUSRESPONSE._serialized_end=656 - _GETINFOREQUEST._serialized_start=658 - _GETINFOREQUEST._serialized_end=674 - _GETINFORESPONSE._serialized_start=677 - _GETINFORESPONSE._serialized_end=1027 - _GETINFORESPONSE_NETWORK._serialized_start=930 - _GETINFORESPONSE_NETWORK._serialized_end=1027 - _WALLETSERVICE._serialized_start=1030 - _WALLETSERVICE._serialized_end=1611 -# @@protoc_insertion_point(module_scope) diff --git a/api-spec/protobuf/ocean/v1alpha/account.proto b/api-spec/protobuf/ocean/v1/account.proto similarity index 63% rename from api-spec/protobuf/ocean/v1alpha/account.proto rename to api-spec/protobuf/ocean/v1/account.proto index 56f5c33..1a1e378 100644 --- a/api-spec/protobuf/ocean/v1alpha/account.proto +++ b/api-spec/protobuf/ocean/v1/account.proto @@ -1,15 +1,18 @@ syntax = "proto3"; -package ocean.v1alpha; +package ocean.v1; -import "ocean/v1alpha/types.proto"; +import "ocean/v1/types.proto"; // AccountService is used to manage accounts in HD Wallet. // It supports generating addresses, listing utxos and balances for specific account or // list of addresses and selecting utxos. service AccountService { - // CreateAccount creates a new account. - rpc CreateAccount(CreateAccountRequest) returns (CreateAccountResponse); + // CreateAccountBIP44 creates a new BIP44 account. + rpc CreateAccountBIP44(CreateAccountBIP44Request) returns (CreateAccountBIP44Response); + + // CreateAccountCustom creates a new custom account for which loading a template. + rpc CreateAccountCustom(CreateAccountCustomRequest) returns (CreateAccountCustomResponse); // SetAccountTemplate sets the template for the account used to generate new addresses. rpc SetAccountTemplate(SetAccountTemplateRequest) returns (SetAccountTemplateResponse); @@ -30,30 +33,49 @@ service AccountService { // ListUtxos returns the utxos for the account, or specific list of // account's addresses. rpc ListUtxos(ListUtxosRequest) returns (ListUtxosResponse); + + // DeleteAccount deletes an existing account. The operation is allowed only + // if the account has zero balance. + rpc DeleteAccount(DeleteAccountRequest) returns (DeleteAccountResponse); +} + +message CreateAccountBIP44Request{ + // Name of the account. + string name = 1; +} +message CreateAccountBIP44Response{ + // Account name. + string account_name = 1; + // Account index. + uint32 account_index = 2; + // Xpub. + string xpub = 3; } -message CreateAccountRequest{ +message CreateAccountCustomRequest{ // Name of the account. string name = 1; } -message CreateAccountResponse{ - // Index assigned to the new account. - uint64 account_index = 1; - // Xpub of the new account. - string xpub = 2; +message CreateAccountCustomResponse{ + // Account name. + string account_name = 1; + // The custom derivation path of the new account. + string derivation_path = 2; + // Xpub. + string xpub = 3; } message SetAccountTemplateRequest { - // Account key. - AccountKey account_key = 1; + // Account name. + string account_name = 1; // Output descriptor template. Template template = 2; } message SetAccountTemplateResponse {} message DeriveAddressRequest{ - // Account key. - AccountKey account_key = 1; + // Account name. + string account_name = 1; // The number of addresses to generate. uint64 num_of_addresses = 2; } @@ -62,8 +84,8 @@ message DeriveAddressResponse{ } message DeriveChangeAddressRequest{ - // Account key. - AccountKey account_key = 1; + // Account name. + string account_name = 1; // The number of addresses to generate. uint64 num_of_addresses = 2; } @@ -72,16 +94,16 @@ message DeriveChangeAddressResponse{ } message ListAddressesRequest { - // Account key. - AccountKey account_key = 1; + // Account name. + string account_name = 1; } message ListAddressesResponse { repeated string addresses = 1; } message BalanceRequest{ - // Account key. - AccountKey account_key = 1; + // Account name. + string account_name = 1; // Addresses for which calculating balance. If not specified, the cumulative // balance is returned. repeated string addresses = 3; @@ -93,8 +115,8 @@ message BalanceResponse{ } message ListUtxosRequest{ - // Account key. - AccountKey account_key = 1; + // Account name. + string account_name = 1; // List of account's addresses for which listing utxos. If not specified, // the list of all utxos owned by the account is returned. repeated string addresses = 3; @@ -104,4 +126,10 @@ message ListUtxosResponse{ Utxos spendable_utxos = 1; // List of currently locked utxos. Utxos locked_utxos = 2; -} \ No newline at end of file +} + +message DeleteAccountRequest{ + // Account name. + string account_name = 1; +} +message DeleteAccountResponse{} \ No newline at end of file diff --git a/api-spec/protobuf/ocean/v1alpha/notification.proto b/api-spec/protobuf/ocean/v1/notification.proto similarity index 79% rename from api-spec/protobuf/ocean/v1alpha/notification.proto rename to api-spec/protobuf/ocean/v1/notification.proto index 1220603..1a39c40 100644 --- a/api-spec/protobuf/ocean/v1alpha/notification.proto +++ b/api-spec/protobuf/ocean/v1/notification.proto @@ -1,8 +1,8 @@ syntax = "proto3"; -package ocean.v1alpha; +package ocean.v1; -import "ocean/v1alpha/types.proto"; +import "ocean/v1/types.proto"; // NotificationService is used to get notification about wallet events, like a // transaction that get confirmed, or the release of the lock for an utxo. @@ -33,14 +33,10 @@ service NotificationService { rpc ListWebhooks(ListWebhooksRequest) returns(ListWebhooksResponse){} } -message TransactionNotificationsRequest{ - // The wallet account for which getting notified. If not specified, - // notifications for all accounts' txs are sent. - AccountKey account_key = 1; -} +message TransactionNotificationsRequest{} message TransactionNotificationsResponse{ - // Account key. - AccountKey account_key = 1; + // Account names. + repeated string account_names = 1; // Txid of transaction. string txid = 2; // Tx event type. @@ -49,18 +45,12 @@ message TransactionNotificationsResponse{ BlockDetails block_details = 4; } -message UtxosNotificationsRequest{ - // The wallet account for which getting notified. If not specified, - // notifications for all accounts' utxos are sent. - AccountKey account_key = 1; -} +message UtxosNotificationsRequest{} message UtxosNotificationsResponse{ - // Account key. - AccountKey account_key = 1; - // The unspent output. - Utxo utxo = 2; - // The event regarding the utxo. - UtxoEventType event_type = 3; + // List of utxos for which occured the event. + repeated Utxo utxos = 1; + // The event's type occured for the utxos. + UtxoEventType event_type = 2; } message AddWebhookRequest { diff --git a/api-spec/protobuf/ocean/v1alpha/transaction.proto b/api-spec/protobuf/ocean/v1/transaction.proto similarity index 85% rename from api-spec/protobuf/ocean/v1alpha/transaction.proto rename to api-spec/protobuf/ocean/v1/transaction.proto index d58b913..6745480 100644 --- a/api-spec/protobuf/ocean/v1alpha/transaction.proto +++ b/api-spec/protobuf/ocean/v1/transaction.proto @@ -1,8 +1,8 @@ syntax = "proto3"; -package ocean.v1alpha; +package ocean.v1; -import "ocean/v1alpha/types.proto"; +import "ocean/v1/types.proto"; /* TransactionService is used to craft and sign various kind's of transactions. @@ -74,8 +74,8 @@ message GetTransactionResponse{ } message SelectUtxosRequest{ - // Account key. - AccountKey account_key = 1; + // Account name. + string account_name = 1; // Asset hash of the utxos to select. string target_asset = 2; // Target amount to cover. @@ -90,13 +90,18 @@ message SelectUtxosRequest{ } message SelectUtxosResponse{ // List of selected utxos. - Utxos utxos = 1; + repeated Utxo utxos = 1; + // Eventual change amount if utxos cumulative sum exceeds the target amount. uint64 change = 2; + // Expiration date for the selected utxo, which are temporary locked to + // prevent double spending them. + int64 expiration_date = 3; } message EstimateFeesRequest{ repeated Input inputs = 1; repeated Output outputs = 2; + uint64 millisats_per_byte = 3; } message EstimateFeesResponse{ uint64 fee_amount = 1; @@ -105,6 +110,8 @@ message EstimateFeesResponse{ message SignTransactionRequest{ // Raw transaction to sign. string tx_hex = 1; + // The sighash type. SIGHASH_ALL is used if not defined. + uint32 sighash_type = 2; } message SignTransactionResponse{ // Raw signed transaction. @@ -157,6 +164,9 @@ message BlindPsetResponse{ message SignPsetRequest{ // The partial transaction to sign in base64 format. string pset = 1; + // The sighash type. If not specified, SIGHASH_ALL is used for any input + // to sign that doesn't already have one set. + uint32 sighash_type = 2; } message SignPsetResponse{ // Signed partial transaction in base64 format. @@ -164,8 +174,8 @@ message SignPsetResponse{ } message MintRequest{ - // Account key. - AccountKey account_key = 1; + // Account name. + string account_name = 1; // Asset amount to mint. uint64 asset_amount = 2; // Token amount to mint. @@ -176,6 +186,8 @@ message MintRequest{ string asset_ticker = 5; // Domain of the asset. string asset_domain = 6; + // mSats/byte fee ratio. + uint64 millisats_per_byte = 7; } message MintResponse{ // Signed tx in hex format. @@ -183,12 +195,14 @@ message MintResponse{ } message RemintRequest{ - // Account key. - AccountKey account_key = 1; + // Account name. + string account_name = 1; // Hash of the asset to remint. string asset = 2; // Amount to remint. uint64 amount = 3; + // mSats/byte fee ratio. + uint64 millisats_per_byte = 4; } message RemintResponse{ // Signed tx in hex format. @@ -196,11 +210,13 @@ message RemintResponse{ } message BurnRequest{ - // Account key. - AccountKey account_key = 1; + // Account name. + string account_name = 1; // Receivers contains a list of asset-amount to burn and their addresses are // ignored and replaced with OP_RETURN output scripts. repeated Output receivers = 2; + // mSats/byte fee ratio. + uint64 millisats_per_byte = 3; } message BurnResponse{ // Signed tx in hex format. @@ -208,10 +224,12 @@ message BurnResponse{ } message TransferRequest{ - // Account key. - AccountKey account_key = 1; + // Account name. + string account_name = 1; // Receivers are the receivers of the funds. repeated Output receivers = 2; + // mSats/byte fee ratio. + uint64 millisats_per_byte = 3; } message TransferResponse{ // Signed tx in hex format. @@ -220,8 +238,8 @@ message TransferResponse{ message PegInAddressRequest{} message PegInAddressResponse{ - // Account key. - AccountKey account_key = 1; + // Account name. + string account_name = 1; // Main-chain deposit address to send bitcoin to. string main_chain_address = 2; // Claim script committed to by the main-chain address. diff --git a/api-spec/protobuf/ocean/v1/types.proto b/api-spec/protobuf/ocean/v1/types.proto new file mode 100644 index 0000000..1196202 --- /dev/null +++ b/api-spec/protobuf/ocean/v1/types.proto @@ -0,0 +1,132 @@ +syntax = "proto3"; + +package ocean.v1; + +message BuildInfo { + // Number of the version. + string version = 1; + // Hash of the commit. + string commit = 2; + // Date of the commit. + string date = 3; +} + +message AccountInfo { + // Account name. + string name = 1; + // Account index. + uint32 index = 2; + // Derivation path. + string derivation_path = 3; + // XPub. + string xpub = 4; +} + +message BalanceInfo { + // Balance of utxos with 1+ confirmations. + uint64 confirmed_balance = 1; + // Balance of utxos with no confirmations. + uint64 unconfirmed_balance = 2; + // Balance of locked utxos. + uint64 locked_balance = 3; + // Total balance. + uint64 total_balance = 4; +} + +message Input { + // Previous output txid. + string txid = 1; + // Previous tx output index. + uint32 index = 2; +} +message Output { + // Asset hash. + string asset = 1; + // Sent amount. + uint64 amount = 2; + // Address to send funds to. + string address = 3; +} + +message Utxos { + // Account name. + string account_name = 1; + // List of utxos. + repeated Utxo utxos = 2; +} + +message UtxoStatus { + string txid = 1; + BlockDetails block_info = 2; +} + +message Utxo { + // Txid of the uxo. + string txid = 1; + // Output index. + uint32 index = 2; + // Asset. + string asset = 3; + // Value. + uint64 value = 4; + // Script. + bytes script = 5; + // Asset blinder for confidential utxo. + bytes asset_blinder = 6; + // Value blinder for confidential utxo. + bytes value_blinder = 7; + // Name of the account owning the utxo. + string account_name = 8; + // Info about utxo's spent status. + UtxoStatus spent_status = 9; + // Info about utxo's confirmation status. + UtxoStatus confirmed_status = 10; +} + +message BlockDetails { + // Hash of the block. + string hash = 1; + // Heighth (index) of the block. + uint64 height = 2; + // Timestamp of the block. + int64 timestamp = 3; +} + +message Template { + enum Format { + FORMAT_UNSPECIFIED = 0; + FORMAT_DESCRIPTOR = 1; + FORMAT_MINISCRIPT = 2; + FORMAT_IONIO = 3; + FORMAT_RAW = 4; + } + Format format = 1; + string value = 2; +} + +enum TxEventType { + TX_EVENT_TYPE_UNSPECIFIED = 0; + // Tx broadcasted. + TX_EVENT_TYPE_BROADCASTED = 1; + // Tx unconfirmed. + TX_EVENT_TYPE_UNCONFIRMED = 2; + // Tx confirmed. + TX_EVENT_TYPE_CONFIRMED = 3; +} + +enum UtxoEventType { + UTXO_EVENT_TYPE_UNSPECIFIED = 0; + UTXO_EVENT_TYPE_NEW = 1; + UTXO_EVENT_TYPE_CONFIRMED = 2; + UTXO_EVENT_TYPE_LOCKED = 3; + UTXO_EVENT_TYPE_UNLOCKED = 4; + UTXO_EVENT_TYPE_SPENT = 5; +} + +enum WebhookEventType { + WEBHOOK_EVENT_TYPE_UNSPECIFIED = 0; + // Receive notification about transactions. + WEBHOOK_EVENT_TYPE_TRANSACTION = 1; + // Receive notifications about utxos. + WEBHOOK_EVENT_TYPE_UTXO = 2; +} diff --git a/api-spec/protobuf/ocean/v1alpha/wallet.proto b/api-spec/protobuf/ocean/v1/wallet.proto similarity index 81% rename from api-spec/protobuf/ocean/v1alpha/wallet.proto rename to api-spec/protobuf/ocean/v1/wallet.proto index 4ef1b26..b2567db 100644 --- a/api-spec/protobuf/ocean/v1alpha/wallet.proto +++ b/api-spec/protobuf/ocean/v1/wallet.proto @@ -1,8 +1,8 @@ syntax = "proto3"; -package ocean.v1alpha; +package ocean.v1; -import "ocean/v1alpha/types.proto"; +import "ocean/v1/types.proto"; // WalletService is used to create, or restore an HD Wallet. // It stores signing and blinding seeds used for signing and blinding of @@ -22,6 +22,9 @@ service WalletService { // Unlock tries to unlock the HD Wallet using the given password. rpc Unlock(UnlockRequest) returns (UnlockResponse); + // Lock locks the HD wallet. + rpc Lock(LockRequest) returns (LockResponse); + // ChangePassword changes the password used to encrypt/decrypt the HD seeds. // It requires the wallet to be locked. rpc ChangePassword(ChangePasswordRequest) returns (ChangePasswordResponse); @@ -59,6 +62,9 @@ message UnlockRequest{ } message UnlockResponse{} +message LockRequest{} +message LockResponse{} + message ChangePasswordRequest{ // The current password used to encrypt the walley. string current_password = 1; @@ -72,9 +78,13 @@ message RestoreWalletRequest{ // The mnemonic from where deriving signing and blinding key pairs. string mnemonic = 1; - // The password to decrypt HD wallet. After restoration, the wallet is locked and - // the same password is required to unlock it. - string password = 3; + // The password to decrypt HD wallet. After restoration, the wallet is locked + // and the same password is required to unlock it. + string password = 2; + // The hash of the block at original wallet creation time. This will be the + // starting block for the wallet rescan. + // If not given, will rescan from genesis block. + string birthday_block_hash = 3; } message RestoreWalletResponse{} @@ -106,6 +116,12 @@ message GetInfoResponse{ // The master blinding key derived from the blinding seed from where derive // blidning key pairs. string master_blinding_key = 4; + // The hash of the block at wallet creation time. + string birthday_block_hash = 5; + // The height of the block at wallet creation time. + uint32 birthday_block_height = 6; // List containing info about the wallet accounts. - repeated AccountInfo accounts = 5; + repeated AccountInfo accounts = 7; + // Info about the current version of the ocean wallet. + BuildInfo build_info = 8; } \ No newline at end of file diff --git a/api-spec/protobuf/ocean/v1alpha/types.proto b/api-spec/protobuf/ocean/v1alpha/types.proto deleted file mode 100644 index 7b1c9fb..0000000 --- a/api-spec/protobuf/ocean/v1alpha/types.proto +++ /dev/null @@ -1,114 +0,0 @@ -syntax = "proto3"; - -package ocean.v1alpha; - -message AccountKey{ - // Id of the account. - uint64 id = 1; - // Name of the account to be updated. - string name = 2; -} - -message AccountInfo { - // Account key. - AccountKey account_key = 1; - // Derivation path. - string derivation_path = 2; - // XPub. - string xpub = 3; -} - -message BalanceInfo { - // The balance of the wallet (excludes locked utxos) - uint64 total_balance = 1; - // The confirmed balance of a wallet (includes utxos with 1+ confirmations) - uint64 confirmed_balance = 2; - // The unconfirmed balance of a wallet (includes utxos with no confirmations) - uint64 unconfirmed_balance = 3; -} - -message Input { - // Previous output txid. - string txid = 1; - // Previous tx output index. - uint32 index = 2; -} -message Output { - // Asset hash. - string asset = 1; - // Sent amount. - uint64 amount = 2; - // Address to send funds to. - string address = 3; -} - -message Utxos { - // account key - AccountKey account_key = 1; - // list of utxos - repeated Utxo utxos = 2; -} - -message Utxo { - // Txid of the Uuxo - string txid = 1; - // Output index - uint32 index = 2; - // Asset - string asset = 3; - // Value - uint64 value = 4; - // Script - bytes script = 5; - // Confirmation status - bool is_confirmed = 6; - // Whether locked by a coin selection - bool is_locked = 7; -} - -message BlockDetails { - // Hash of the block. - bytes hash = 1; - // Heighth (index) of the block. - int32 height = 2; - // Timestamp of the block. - int64 timestamp = 3; -} - -message Template { - enum Format { - FORMAT_UNSPECIFIED = 0; - FORMAT_DESCRIPTOR = 1; - FORMAT_MINISCRIPT = 2; - FORMAT_IONIO = 3; - FORMAT_RAW = 4; - } - Format format = 1; - string value = 2; -} - -enum TxEventType { - TX_EVENT_TYPE_UNSPECIFIED = 0; - // Tx broadcasted. - TX_EVENT_TYPE_BROADCASTED = 1; - // Tx unconfirmed. - TX_EVENT_TYPE_UNCONFIRMED = 2; - // Tx confirmed. - TX_EVENT_TYPE_CONFIRMED = 3; -} - -enum UtxoEventType { - UTXO_EVENT_TYPE_UNSPECIFIED = 0; - UTXO_EVENT_TYPE_LOCKED = 1; - UTXO_EVENT_TYPE_UNLOCKED = 2; - UTXO_EVENT_TYPE_SPENT = 3; - UTXO_EVENT_TYPE_NEW = 4; -} - -enum WebhookEventType { - WEBHOOK_EVENT_TYPE_UNSPECIFIED = 0; - // Receive notification about transactions. - WEBHOOK_EVENT_TYPE_TRANSACTION = 1; - // Receive notifications about utxos. - WEBHOOK_EVENT_TYPE_UNSPENTS = 2; -} diff --git a/buf.gen.yaml b/buf.gen.yaml index 4389267..443fad6 100644 --- a/buf.gen.yaml +++ b/buf.gen.yaml @@ -2,7 +2,7 @@ version: v1 managed: enabled: true go_package_prefix: - default: github.com/vulpemventures/ocean/api-spec/protobuf/ocean/v1alpha/gen/go + default: github.com/vulpemventures/ocean/api-spec/protobuf/gen plugins: # Golang - remote: buf.build/protocolbuffers/plugins/go diff --git a/cmd/ocean/account.go b/cmd/ocean/account.go new file mode 100644 index 0000000..c6e435b --- /dev/null +++ b/cmd/ocean/account.go @@ -0,0 +1,247 @@ +package main + +import ( + "context" + "fmt" + + "github.com/spf13/cobra" + pb "github.com/vulpemventures/ocean/api-spec/protobuf/gen/go/ocean/v1" + "google.golang.org/protobuf/reflect/protoreflect" +) + +var ( + accountName string + numOfAddresses uint64 + changeAddresses bool + + accountCreateCmd = &cobra.Command{ + Use: "create", + Short: "create new wallet account", + Long: "this command lets you create a new wallet account uniquely " + + "identified by your choosen name", + RunE: accountCreate, + } + accountDeriveAddressesCmd = &cobra.Command{ + Use: "derive", + Short: "derive new account address", + Long: "this command lets you derive new addresses for the given wallet " + + "account", + RunE: accountDeriveAddresses, + } + accountBalanceCmd = &cobra.Command{ + Use: "balance", + Short: "get account balance", + Long: "this command returns info about the balance of the given account " + + "(confirmed unconfirmed and locked)", + RunE: accountBalance, + } + accountListAddressesCmd = &cobra.Command{ + Use: "addresses", + Short: "list account derived addresses", + Long: "this command returns the list of all receiving address derived " + + "for the given account so far", + RunE: accountListAddresses, + } + accountListUtxosCmd = &cobra.Command{ + Use: "utxos", + Short: "list account utxos", + Long: "this command returns the list of all utxos owned by the derived " + + "addresses of the given account", + RunE: accountListUtxos, + } + accountDeleteCmd = &cobra.Command{ + Use: "delete", + Short: "delete account", + Long: "this command lets you delete an existing account. " + + "The wallet will loose track of every derived address and utxo history", + RunE: accountDelete, + } + accountCmd = &cobra.Command{ + Use: "account", + Short: "interact with ocean account interface", + Long: "this command lets you create new or delete existing wallet " + + "accounts, derive or list account addresses, and get info like owned " + + "utxos or account balance", + } +) + +func init() { + accountDeriveAddressesCmd.Flags().Uint64VarP( + &numOfAddresses, "num-addresses", "n", 0, "number of addresses to derive", + ) + accountDeriveAddressesCmd.Flags().BoolVarP( + &changeAddresses, "change", "c", false, + "whether derive change (internal) addresses", + ) + + accountCmd.PersistentFlags().StringVar(&accountName, "account-name", "", "account name") + accountCmd.MarkPersistentFlagRequired("account-name") + + accountCmd.AddCommand( + accountCreateCmd, accountDeriveAddressesCmd, accountBalanceCmd, + accountListAddressesCmd, accountListUtxosCmd, accountDeleteCmd, + ) +} + +func accountCreate(cmd *cobra.Command, _ []string) error { + client, cleanup, err := getAccountClient() + if err != nil { + return err + } + defer cleanup() + + reply, err := client.CreateAccountBIP44( + context.Background(), &pb.CreateAccountBIP44Request{ + Name: accountName, + }, + ) + if err != nil { + printErr(err) + return nil + } + + jsonReply, err := jsonResponse(reply) + if err != nil { + printErr(err) + return nil + } + + fmt.Println(jsonReply) + return nil +} + +func accountDeriveAddresses(cmd *cobra.Command, _ []string) error { + client, cleanup, err := getAccountClient() + if err != nil { + return err + } + defer cleanup() + + ctx := context.Background() + var reply protoreflect.ProtoMessage + if !changeAddresses { + reply, err = client.DeriveAddress(ctx, &pb.DeriveAddressRequest{ + AccountName: accountName, + NumOfAddresses: numOfAddresses, + }) + } else { + reply, err = client.DeriveChangeAddress(ctx, &pb.DeriveChangeAddressRequest{ + AccountName: accountName, + NumOfAddresses: numOfAddresses, + }) + } + if err != nil { + printErr(err) + return nil + } + + jsonReply, err := jsonResponse(reply) + if err != nil { + printErr(err) + return nil + } + + fmt.Println(jsonReply) + return nil +} + +func accountBalance(cmd *cobra.Command, _ []string) error { + client, cleanup, err := getAccountClient() + if err != nil { + return err + } + defer cleanup() + + reply, err := client.Balance( + context.Background(), &pb.BalanceRequest{ + AccountName: accountName, + }, + ) + if err != nil { + printErr(err) + return nil + } + + jsonReply, err := jsonResponse(reply) + if err != nil { + printErr(err) + return nil + } + + fmt.Println(jsonReply) + return nil +} + +func accountListAddresses(cmd *cobra.Command, _ []string) error { + client, cleanup, err := getAccountClient() + if err != nil { + return err + } + defer cleanup() + + reply, err := client.ListAddresses( + context.Background(), &pb.ListAddressesRequest{ + AccountName: accountName, + }, + ) + if err != nil { + printErr(err) + return nil + } + + jsonReply, err := jsonResponse(reply) + if err != nil { + printErr(err) + return nil + } + + fmt.Println(jsonReply) + return nil +} + +func accountListUtxos(cmd *cobra.Command, _ []string) error { + client, cleanup, err := getAccountClient() + if err != nil { + return err + } + defer cleanup() + + reply, err := client.ListUtxos( + context.Background(), &pb.ListUtxosRequest{ + AccountName: accountName, + }, + ) + if err != nil { + printErr(err) + return nil + } + + jsonReply, err := jsonResponse(reply) + if err != nil { + printErr(err) + return nil + } + + fmt.Println(jsonReply) + return nil +} + +func accountDelete(cmd *cobra.Command, _ []string) error { + client, cleanup, err := getAccountClient() + if err != nil { + return err + } + defer cleanup() + + if _, err := client.DeleteAccount( + context.Background(), &pb.DeleteAccountRequest{ + AccountName: accountName, + }, + ); err != nil { + printErr(err) + return nil + } + + fmt.Println("account deleted") + return nil +} diff --git a/cmd/ocean/config.go b/cmd/ocean/config.go new file mode 100644 index 0000000..78dbd41 --- /dev/null +++ b/cmd/ocean/config.go @@ -0,0 +1,117 @@ +package main + +import ( + "encoding/json" + "fmt" + "strconv" + + "github.com/spf13/cobra" +) + +var ( + rpcServer string + noTLS bool + tlsCertPath string + + configSetCmd = &cobra.Command{ + Use: "set", + Short: "edit single CLI config entry", + Long: "this command lets you customize a single configuration entry of " + + "the ocean wallet CLI", + Args: cobra.ExactArgs(2), + RunE: configSet, + } + configInitCmd = &cobra.Command{ + Use: "init", + Short: "edit multiple CLI config entry", + Long: "this command lets you customize multiple configuration entres of " + + "the ocean wallet CLI", + RunE: configInit, + } + configCmd = &cobra.Command{ + Use: "config", + Short: "print or edit CLI configuration", + Long: "this command lets you show or customize the configuration of " + + "the ocean wallet CLI", + RunE: configPrint, + } +) + +func init() { + configInitCmd.Flags().StringVar( + &rpcServer, "rpcserver", initialState["rpcserver"], + "address of the ocean wallet to connect to", + ) + configInitCmd.Flags().BoolVar( + &noTLS, "no-tls", false, + "this must be set if the ocean wallet has TLS disabled", + ) + configInitCmd.Flags().StringVar( + &tlsCertPath, "tls-cert-path", initialState["tls_cert_path"], + "the path of the TLS certificate file to use to connect to the ocean "+ + "wallet if it has TLS enabled", + ) + configCmd.AddCommand(configSetCmd, configInitCmd) +} + +func configSet(cmd *cobra.Command, args []string) error { + key := args[0] + value := args[1] + + // Prevent setting anything that is not part of the state. + if _, ok := initialState[key]; !ok { + return nil + } + + partialState := map[string]string{key: value} + if key == "no_tls" { + partialState["tls_cert_path"] = "" + if val, _ := strconv.ParseBool(value); !val { + partialState["tls_cert_path"] = initialState["tls_cert_path"] + } + } + if key == "tls_cert_path" { + partialState["no_tls"] = "true" + if len(value) > 0 { + partialState["no_tls"] = "true" + value = cleanAndExpandPath(value) + } + } + if err := setState(partialState); err != nil { + return err + } + + fmt.Printf("%s %s has been set\n", key, value) + + return nil +} + +func configInit(cmd *cobra.Command, args []string) error { + if _, err := getState(); err != nil { + return err + } + + if err := setState(map[string]string{ + "rpcserver": rpcServer, + "no_tls": strconv.FormatBool(noTLS), + "tls_cert_path": tlsCertPath, + }); err != nil { + return err + } + + fmt.Println("CLI has been configured") + + return nil +} + +func configPrint(_ *cobra.Command, _ []string) error { + state, err := getState() + if err != nil { + return err + } + + buf, _ := json.MarshalIndent(state, "", " ") + fmt.Println(string(buf)) + + return nil +} diff --git a/cmd/ocean/main.go b/cmd/ocean/main.go new file mode 100644 index 0000000..9a6a468 --- /dev/null +++ b/cmd/ocean/main.go @@ -0,0 +1,47 @@ +package main + +import ( + "fmt" + "os" + "path/filepath" + "strconv" + + "github.com/btcsuite/btcd/btcutil" + "github.com/spf13/cobra" +) + +var ( + version = "dev" + commit = "none" + date = "unknown" + + walletDatadir = btcutil.AppDataDir("ocean-wallet", false) + initialState = map[string]string{ + "rpcserver": "localhost:18000", + "no_tls": strconv.FormatBool(false), + "tls_cert_path": filepath.Join(walletDatadir, "tls", "cert.pem"), + } + + rootCmd = &cobra.Command{ + Use: "ocean", + Short: "CLI for ocean wallet", + Long: "This CLI lets you interact with a running ocean wallet daemon", + PersistentPreRun: func(_ *cobra.Command, _ []string) { + if _, err := os.Stat(datadir); os.IsNotExist(err) { + os.Mkdir(datadir, os.ModeDir|0755) + } + }, + Version: formatVersion(), + } +) + +func init() { + rootCmd.AddCommand(configCmd, walletCmd, accountCmd, txCmd) +} + +func main() { + if err := rootCmd.Execute(); err != nil { + fmt.Fprintln(os.Stderr, err) + os.Exit(1) + } +} diff --git a/cmd/ocean/transaction.go b/cmd/ocean/transaction.go new file mode 100644 index 0000000..ea3c195 --- /dev/null +++ b/cmd/ocean/transaction.go @@ -0,0 +1,171 @@ +package main + +import ( + "context" + "encoding/json" + "fmt" + "math" + + "github.com/spf13/cobra" + pb "github.com/vulpemventures/ocean/api-spec/protobuf/gen/go/ocean/v1" +) + +var ( + satsPerByte float32 + txReceiversJSON []string + txNoBroadcast bool + + txTransferCmd = &cobra.Command{ + Use: "transfer", + Short: "send funds to other recevivers", + Long: "this command lets you send your funds to the given receivers " + + "({asset, amount, addrres})", + RunE: txTransfer, + } + txBroadcastCmd = &cobra.Command{ + Use: "broadcast", + Short: "send a transaction over the network to be included in a block", + Long: "this command lets you publish a final signed transaction " + + "(in hex format) through the network to be included in a future block", + RunE: txBroadcast, + } + txCmd = &cobra.Command{ + Use: "transaction", + Short: "interact with ocean transaction interface", + Long: "this command lets you send your funds, or use them to mint, " + + "remint or burn new assets, or even to peg main-chain BTC to the " + + "Liquid side-chain and unlock LBTC funds", + } +) + +func init() { + txTransferCmd.Flags().StringArrayVar( + &txReceiversJSON, "receivers", nil, + "JSON string list of receivers as "+ + "{\"address\": \"
\", \"amount\": , \"asset\": \"\"}", + ) + txTransferCmd.Flags().BoolVar(&txNoBroadcast, "no-broadcast", false, "use this flag to not broadcast the transaction and get the tx hex instead of its hash") + + txCmd.PersistentFlags().StringVar( + &accountName, "account-name", "", "name of the account's funds to use", + ) + txCmd.PersistentFlags().Float32Var( + &satsPerByte, "sats-per-byte", 0.1, "sats/byte ratio to use for network fees", + ) + + txCmd.AddCommand(txTransferCmd, txBroadcastCmd) +} + +func txTransfer(_ *cobra.Command, _ []string) error { + client, cleanup, err := getTransactionClient() + if err != nil { + return err + } + defer cleanup() + + ctx := context.Background() + receivers := make(outputs, 0, len(txReceiversJSON)) + for _, r := range txReceiversJSON { + receiver := output{} + if err := json.Unmarshal([]byte(r), &receiver); err != nil { + printErr(err) + return nil + } + receivers = append(receivers, receiver) + } + + reply, err := client.Transfer(ctx, &pb.TransferRequest{ + AccountName: accountName, + MillisatsPerByte: uint64(satsPerByte * 1000), + Receivers: receivers.proto(), + }) + if err != nil { + printErr(err) + return nil + } + + if txNoBroadcast { + jsonReply, err := jsonResponse(reply) + if err != nil { + printErr(err) + return nil + } + + fmt.Println(jsonReply) + return nil + } + + bReply, err := client.BroadcastTransaction( + ctx, &pb.BroadcastTransactionRequest{ + TxHex: reply.GetTxHex(), + }, + ) + if err != nil { + printErr(err) + return nil + } + + jsonReply, err := jsonResponse(bReply) + if err != nil { + printErr(err) + return nil + } + + fmt.Println(jsonReply) + return nil +} + +func txBroadcast(_ *cobra.Command, args []string) error { + if len(args) == 0 { + printErr(fmt.Errorf("missing tx hex")) + return nil + } + + client, cleanup, err := getTransactionClient() + if err != nil { + return err + } + defer cleanup() + + reply, err := client.BroadcastTransaction( + context.Background(), &pb.BroadcastTransactionRequest{ + TxHex: args[0], + }) + if err != nil { + printErr(err) + return nil + } + + jsonReply, err := jsonResponse(reply) + if err != nil { + printErr(err) + return nil + } + + fmt.Println(jsonReply) + return nil +} + +type output struct { + Address string `json:"address"` + Amount float64 `json:"amount"` + Asset string `json:"asset"` +} + +func (o output) proto() *pb.Output { + return &pb.Output{ + Address: o.Address, + Amount: uint64(o.Amount * math.Pow10(8)), + Asset: o.Asset, + } +} + +type outputs []output + +func (o outputs) proto() []*pb.Output { + outs := make([]*pb.Output, 0, len(o)) + for _, out := range o { + outs = append(outs, out.proto()) + } + return outs +} diff --git a/cmd/ocean/util.go b/cmd/ocean/util.go new file mode 100644 index 0000000..0fff279 --- /dev/null +++ b/cmd/ocean/util.go @@ -0,0 +1,179 @@ +package main + +import ( + "encoding/json" + "fmt" + "io/ioutil" + "os" + "os/user" + "path/filepath" + "strconv" + "strings" + + pb "github.com/vulpemventures/ocean/api-spec/protobuf/gen/go/ocean/v1" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" + "google.golang.org/grpc/status" + "google.golang.org/protobuf/encoding/protojson" + "google.golang.org/protobuf/proto" +) + +var ( + maxMsgRecvSize = grpc.MaxCallRecvMsgSize(1 * 1024 * 1024 * 200) + colorRed = string("\033[31m") +) + +func getWalletClient() (pb.WalletServiceClient, func(), error) { + conn, err := getClientConn() + if err != nil { + return nil, nil, err + } + + cleanup := func() { conn.Close() } + return pb.NewWalletServiceClient(conn), cleanup, nil +} + +func getAccountClient() (pb.AccountServiceClient, func(), error) { + conn, err := getClientConn() + if err != nil { + return nil, nil, err + } + + cleanup := func() { conn.Close() } + return pb.NewAccountServiceClient(conn), cleanup, nil +} + +func getTransactionClient() (pb.TransactionServiceClient, func(), error) { + conn, err := getClientConn() + if err != nil { + return nil, nil, err + } + + cleanup := func() { conn.Close() } + return pb.NewTransactionServiceClient(conn), cleanup, nil +} + +func getClientConn() (*grpc.ClientConn, error) { + state, err := getState() + if err != nil { + return nil, err + } + address, ok := state["rpcserver"] + if !ok { + return nil, fmt.Errorf("set rpcserver with `config set rpcserver`") + } + + opts := []grpc.DialOption{grpc.WithDefaultCallOptions(maxMsgRecvSize)} + + noTLS, _ := strconv.ParseBool(state["no_tls"]) + if noTLS { + opts = append(opts, grpc.WithInsecure()) + } else { + certPath, ok := state["tls_cert_path"] + if !ok { + return nil, fmt.Errorf( + "missing TLS certificate filepath. Try " + + "'ocean config set tls_cert_path path/to/tls/certificate'", + ) + } + + tlsCreds, err := credentials.NewClientTLSFromFile(certPath, "") + if err != nil { + return nil, fmt.Errorf("failed to load TLS certificate: %s", err) + } + opts = append(opts, grpc.WithTransportCredentials(tlsCreds)) + } + + conn, err := grpc.Dial(address, opts...) + if err != nil { + return nil, fmt.Errorf("failed to connect to ocean daemon: %v", err) + } + return conn, nil +} + +func getState() (map[string]string, error) { + file, err := ioutil.ReadFile(statePath) + if err != nil { + if !os.IsNotExist(err) { + return nil, err + } + if err := writeState(initialState); err != nil { + return nil, err + } + return initialState, nil + } + + data := map[string]string{} + json.Unmarshal(file, &data) + return data, nil +} + +func setState(partialState map[string]string) error { + state, err := getState() + if err != nil { + return err + } + + for key, value := range partialState { + state[key] = value + } + return writeState(state) +} + +func writeState(state map[string]string) error { + buf, _ := json.MarshalIndent(state, "", " ") + if err := ioutil.WriteFile(statePath, buf, 0755); err != nil { + return fmt.Errorf("writing to file: %w", err) + } + + return nil +} + +func cleanAndExpandPath(path string) string { + if path == "" { + return "" + } + + // Expand initial ~ to OS specific home directory. + if strings.HasPrefix(path, "~") { + var homeDir string + u, err := user.Current() + if err == nil { + homeDir = u.HomeDir + } else { + homeDir = os.Getenv("HOME") + } + + path = strings.Replace(path, "~", homeDir, 1) + } + + // NOTE: The os.ExpandEnv doesn't work with Windows-style %VARIABLE%, + // but the variables can still be expanded via POSIX-style $VARIABLE. + return filepath.Clean(os.ExpandEnv(path)) +} + +func jsonResponse(msg proto.Message) (string, error) { + buf, err := protojson.MarshalOptions{Multiline: true, EmitUnpopulated: true}.Marshal(msg) + if err != nil { + return "", fmt.Errorf("failed to marshal proto message: %s", err) + } + return string(buf), nil +} + +func printErr(err error) { + s := status.Convert(err) + msg := fmt.Sprintf("%s%s", colorRed, capitalize(s.Message())) + fmt.Fprintln(os.Stderr, msg) +} + +func capitalize(s string) string { + ss := strings.ToUpper(s[0:1]) + ss += s[1:] + return ss +} + +func formatVersion() string { + return fmt.Sprintf( + "\nVersion: %s\nCommit: %s\nDate: %s", version, commit, date, + ) +} diff --git a/cmd/ocean/wallet.go b/cmd/ocean/wallet.go new file mode 100644 index 0000000..ac7c655 --- /dev/null +++ b/cmd/ocean/wallet.go @@ -0,0 +1,268 @@ +package main + +import ( + "context" + "fmt" + "path/filepath" + + "github.com/btcsuite/btcd/btcutil" + "github.com/spf13/cobra" + pb "github.com/vulpemventures/ocean/api-spec/protobuf/gen/go/ocean/v1" +) + +var ( + datadir = btcutil.AppDataDir("ocean-cli", false) + statePath = filepath.Join(datadir, "state.json") + + mnemonic string + password string + oldPassword string + newPassword string + + walletGenSeedCmd = &cobra.Command{ + Use: "genseed", + Short: "generate a random mnemonic", + Long: "this command lets you generate a new random mnemonic to " + + "initialize a new wallet from scratch", + RunE: walletGenSeed, + } + walletCreateCmd = &cobra.Command{ + Use: "create", + Short: "initialize with a brand new wallet", + Long: "this command lets you initialize a new ocean wallet from scratch " + + "with the given mnemonic (or let me create one for you), " + + "encrypted with your choosen password", + RunE: walletCreate, + } + walletUnlockCmd = &cobra.Command{ + Use: "unlock", + Short: "unlock the wallet", + Long: "this command lets you unlock the ocean wallet with your password", + RunE: walletUnlock, + } + walletLockCmd = &cobra.Command{ + Use: "lock", + Short: "lock the wallet", + Long: "this command lets you lock the ocean wallet", + RunE: walletLock, + } + walletChangePwdCmd = &cobra.Command{ + Use: "changepassword", + Short: "change the wallet password", + Long: "this command lets you change the encryption password of the wallet", + RunE: walletChangePwd, + } + walletInfoCmd = &cobra.Command{ + Use: "info", + Short: "get info about wallet and accounts", + Long: "this command returns info about the wallet (network, root path " + + "and master blinding key) and its accounts (key, xpub and derivation path)", + RunE: walletInfo, + } + walletStatusCmd = &cobra.Command{ + Use: "status", + Short: "get wallet status", + Long: "this command returns info about the status of the wallet, like " + + "if it's initialized, in sync or unlocked", + RunE: walletStatus, + } + walletCmd = &cobra.Command{ + Use: "wallet", + Short: "interact with ocean wallet interface", + Long: "this command lets you initialize, unlock or change the password " + + "of wallet, as long as retrieving info about its status", + } +) + +func init() { + walletCreateCmd.Flags().StringVar( + &mnemonic, "mnemonic", "", "space separated word list as wallet seed", + ) + walletCreateCmd.Flags().StringVar(&password, "password", "", "encryption password") + walletCreateCmd.MarkFlagRequired("password") + + walletUnlockCmd.Flags().StringVar(&password, "password", "", "encryption password") + walletUnlockCmd.MarkFlagRequired("password") + + walletChangePwdCmd.Flags().StringVar(&oldPassword, "old-password", "", "current password") + walletChangePwdCmd.Flags().StringVar(&newPassword, "new-password", "", "new password") + walletChangePwdCmd.MarkFlagRequired("old-password") + walletChangePwdCmd.MarkFlagRequired("new-password") + + walletCmd.AddCommand( + walletGenSeedCmd, walletCreateCmd, walletUnlockCmd, walletLockCmd, + walletChangePwdCmd, walletInfoCmd, walletStatusCmd, + ) +} + +func walletGenSeed(cmd *cobra.Command, args []string) error { + client, cleanup, err := getWalletClient() + if err != nil { + return err + } + defer cleanup() + + reply, err := client.GenSeed(context.Background(), &pb.GenSeedRequest{}) + if err != nil { + printErr(err) + return nil + } + + jsonReply, err := jsonResponse(reply) + if err != nil { + printErr(err) + return nil + } + + fmt.Println(jsonReply) + return nil +} + +func walletCreate(cmd *cobra.Command, args []string) error { + client, cleanup, err := getWalletClient() + if err != nil { + return err + } + defer cleanup() + + mnemonicToGenerate := len(mnemonic) == 0 + if mnemonicToGenerate { + reply, err := client.GenSeed(context.Background(), &pb.GenSeedRequest{}) + if err != nil { + printErr(err) + return nil + } + mnemonic = reply.GetMnemonic() + } + + if _, err := client.CreateWallet( + context.Background(), &pb.CreateWalletRequest{ + Mnemonic: mnemonic, + Password: password, + }, + ); err != nil { + printErr(err) + return nil + } + + if mnemonicToGenerate { + reply := &pb.GenSeedResponse{Mnemonic: mnemonic} + jsonReply, err := jsonResponse(reply) + if err != nil { + printErr(err) + return nil + } + + fmt.Println(jsonReply) + return nil + } + + fmt.Println("") + fmt.Println("wallet initialized") + return nil +} + +func walletUnlock(cmd *cobra.Command, args []string) error { + client, cleanup, err := getWalletClient() + if err != nil { + return err + } + defer cleanup() + + if _, err := client.Unlock( + context.Background(), &pb.UnlockRequest{ + Password: password, + }, + ); err != nil { + printErr(err) + return nil + } + + fmt.Println("wallet unlocked") + return nil +} + +func walletLock(cmd *cobra.Command, args []string) error { + client, cleanup, err := getWalletClient() + if err != nil { + return err + } + defer cleanup() + + if _, err := client.Lock( + context.Background(), &pb.LockRequest{}, + ); err != nil { + printErr(err) + return nil + } + + fmt.Println("wallet locked") + return nil +} + +func walletChangePwd(cmd *cobra.Command, args []string) error { + client, cleanup, err := getWalletClient() + if err != nil { + return err + } + defer cleanup() + + if _, err := client.ChangePassword( + context.Background(), &pb.ChangePasswordRequest{ + CurrentPassword: oldPassword, + NewPassword: newPassword, + }, + ); err != nil { + printErr(err) + return nil + } + + fmt.Println("wallet password updated") + return nil +} + +func walletInfo(cmd *cobra.Command, args []string) error { + client, cleanup, err := getWalletClient() + if err != nil { + return err + } + defer cleanup() + + reply, err := client.GetInfo(context.Background(), &pb.GetInfoRequest{}) + if err != nil { + printErr(err) + return nil + } + + jsonReply, err := jsonResponse(reply) + if err != nil { + printErr(err) + return nil + } + + fmt.Println(jsonReply) + return nil +} + +func walletStatus(cmd *cobra.Command, args []string) error { + client, cleanup, err := getWalletClient() + if err != nil { + return err + } + defer cleanup() + + reply, err := client.Status(context.Background(), &pb.StatusRequest{}) + if err != nil { + printErr(err) + return nil + } + + jsonReply, err := jsonResponse(reply) + if err != nil { + printErr(err) + return nil + } + + fmt.Println(jsonReply) + return nil +} diff --git a/cmd/oceand/main.go b/cmd/oceand/main.go new file mode 100644 index 0000000..a2661d3 --- /dev/null +++ b/cmd/oceand/main.go @@ -0,0 +1,114 @@ +package main + +import ( + "os" + "os/signal" + "path/filepath" + "syscall" + "time" + + _ "net/http/pprof" // #nosec + + log "github.com/sirupsen/logrus" + appconfig "github.com/vulpemventures/ocean/internal/app-config" + "github.com/vulpemventures/ocean/internal/config" + neutrino_scanner "github.com/vulpemventures/ocean/internal/infrastructure/blockchain-scanner/neutrino" + "github.com/vulpemventures/ocean/internal/interfaces" + grpc_interface "github.com/vulpemventures/ocean/internal/interfaces/grpc" + "github.com/vulpemventures/ocean/pkg/profiler" +) + +var ( + // Build info. + version string + commit string + date string + + // Config from env vars. + dbType = config.GetString(config.DatabaseTypeKey) + bcScannerType = config.GetString(config.BlockchainScannerTypeKey) + logLevel = config.GetInt(config.LogLevelKey) + datadir = config.GetDatadir() + port = config.GetInt(config.PortKey) + profilerPort = config.GetInt(config.ProfilerPortKey) + network = config.GetNetwork() + noTLS = config.GetBool(config.NoTLSKey) + noProfiler = config.GetBool(config.NoProfilerKey) + dbDir = filepath.Join(datadir, config.DbLocation) + tlsDir = filepath.Join(datadir, config.TLSLocation) + scannerDir = filepath.Join(datadir, config.ScannerLocation) + profilerDir = filepath.Join(datadir, config.ProfilerLocation) + filtersDir = filepath.Join(scannerDir, "filters") + blockHeadersDir = filepath.Join(scannerDir, "headers") + esploraUrl = config.GetString(config.EsploraUrlKey) + tlsExtraIPs = config.GetStringSlice(config.TLSExtraIPKey) + tlsExtraDomains = config.GetStringSlice(config.TLSExtraDomainKey) + statsInterval = time.Duration(config.GetInt(config.StatsIntervalKey)) * time.Second + nodePeers = config.GetStringSlice(config.NodePeersKey) + utxoExpiryDuration = time.Duration(config.GetInt(config.UtxoExpiryDurationKey)) + rootPath = config.GetRootPath() +) + +func main() { + log.SetLevel(log.Level(logLevel)) + + if profilerEnabled := !noProfiler; profilerEnabled { + profilerSvc, err := profiler.NewService(profiler.ServiceOpts{ + Port: profilerPort, + StatsInterval: statsInterval, + Datadir: profilerDir, + }) + if err != nil { + log.WithError(err).Fatal("profiler: error while starting") + } + + profilerSvc.Start() + defer profilerSvc.Stop() + } + + net := network.Name + if net == "regtest" { + net = "nigiri" + } + + bcScannerConfig := neutrino_scanner.NodeServiceArgs{ + Network: net, + FiltersDatadir: filtersDir, + BlockHeadersDatadir: blockHeadersDir, + Peers: nodePeers, + EsploraUrl: esploraUrl, + } + serviceCfg := grpc_interface.ServiceConfig{ + Port: port, + NoTLS: noTLS, + TLSLocation: tlsDir, + ExtraIPs: tlsExtraIPs, + ExtraDomains: tlsExtraDomains, + } + appCfg := &appconfig.AppConfig{ + Version: version, + Commit: commit, + Date: date, + RootPath: rootPath, + Network: network, + UtxoExpiryDuration: utxoExpiryDuration * time.Second, + RepoManagerType: dbType, + BlockchainScannerType: bcScannerType, + RepoManagerConfig: dbDir, + BlockchainScannerConfig: bcScannerConfig, + } + + serviceManager, err := interfaces.NewGrpcServiceManager(serviceCfg, appCfg) + if err != nil { + log.WithError(err).Fatal("service: error while initializing") + } + + if err := serviceManager.Service.Start(); err != nil { + log.WithError(err).Fatal("service: error while starting") + } + defer serviceManager.Service.Stop() + + sigChan := make(chan os.Signal, 1) + signal.Notify(sigChan, syscall.SIGTERM, syscall.SIGINT) + <-sigChan +} diff --git a/go.mod b/go.mod index 6901d83..9be3331 100644 --- a/go.mod +++ b/go.mod @@ -3,14 +3,73 @@ module github.com/vulpemventures/ocean go 1.17 require ( + github.com/btcsuite/btcd v0.23.1 + github.com/btcsuite/btcd/btcec/v2 v2.2.0 + github.com/btcsuite/btcd/btcutil v1.1.0 + github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 + github.com/dgraph-io/badger/v3 v3.2103.2 + github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 + github.com/prometheus/client_golang v1.12.1 + github.com/sirupsen/logrus v1.8.1 + github.com/spf13/cobra v0.0.5 + github.com/spf13/viper v1.10.1 + github.com/stretchr/testify v1.7.2 + github.com/timshannon/badgerhold/v4 v4.0.2 + github.com/vulpemventures/go-bip39 v1.0.2 + github.com/vulpemventures/go-elements v0.4.0-rc.1 + github.com/vulpemventures/neutrino-elements v0.1.2-rc.0 + golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e + golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 google.golang.org/grpc v1.43.0 google.golang.org/protobuf v1.27.1 ) require ( - github.com/golang/protobuf v1.5.0 // indirect - golang.org/x/net v0.0.0-20200822124328-c89045814202 // indirect - golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd // indirect - golang.org/x/text v0.3.0 // indirect - google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 // indirect + github.com/aead/siphash v1.0.1 // indirect + github.com/beorn7/perks v1.0.1 // indirect + github.com/btcsuite/btcd/btcutil/psbt v1.1.4 // indirect + github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f // indirect + github.com/cespare/xxhash v1.1.0 // indirect + github.com/cespare/xxhash/v2 v2.1.2 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/decred/dcrd/crypto/blake256 v1.0.0 // indirect + github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect + github.com/dgraph-io/ristretto v0.1.0 // indirect + github.com/dustin/go-humanize v1.0.0 // indirect + github.com/fsnotify/fsnotify v1.5.1 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/golang/glog v0.0.0-20210429001901-424d2337a529 // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect + github.com/golang/protobuf v1.5.2 // indirect + github.com/golang/snappy v0.0.4 // indirect + github.com/google/flatbuffers v2.0.0+incompatible // indirect + github.com/hashicorp/hcl v1.0.0 // indirect + github.com/inconshreveable/mousetrap v1.0.0 // indirect + github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23 // indirect + github.com/klauspost/compress v1.13.1 // indirect + github.com/magiconair/properties v1.8.5 // indirect + github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect + github.com/mitchellh/mapstructure v1.4.3 // indirect + github.com/pelletier/go-toml v1.9.4 // indirect + github.com/pkg/errors v0.9.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/prometheus/client_model v0.2.0 // indirect + github.com/prometheus/common v0.32.1 // indirect + github.com/prometheus/procfs v0.7.3 // indirect + github.com/spf13/afero v1.6.0 // indirect + github.com/spf13/cast v1.4.1 // indirect + github.com/spf13/jwalterweatherman v1.1.0 // indirect + github.com/spf13/pflag v1.0.5 // indirect + github.com/stretchr/objx v0.1.1 // indirect + github.com/subosito/gotenv v1.2.0 // indirect + github.com/tyler-smith/go-bip39 v1.1.0 // indirect + github.com/vulpemventures/fastsha256 v0.0.0-20160815193821-637e65642941 // indirect + github.com/vulpemventures/go-secp256k1-zkp v1.1.5 // indirect + go.opencensus.io v0.23.0 // indirect + golang.org/x/sys v0.0.0-20220608164250-635b8c9b7f68 // indirect + golang.org/x/text v0.3.7 // indirect + google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa // indirect + gopkg.in/ini.v1 v1.66.2 // indirect + gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 2f02874..0302af9 100644 --- a/go.sum +++ b/go.sum @@ -1,29 +1,204 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= +cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= +cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= +cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= +cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= +cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= +cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= +cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= +cloud.google.com/go v0.94.1/go.mod h1:qAlAugsXlC+JWO+Bke5vCtc9ONxjQT3drlTTnAplMW4= +cloud.google.com/go v0.97.0/go.mod h1:GF7l59pYBVlXQIBLx3a761cZ41F9bBH3JUlihCt2Udc= +cloud.google.com/go v0.99.0/go.mod h1:w0Xx2nLzqWJPuozYQX+hFfCSI8WioryfRDzkoI/Y2ZA= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/firestore v1.6.1/go.mod h1:asNXNOzBdyVQmEU+ggO8UPodTkEVFW5Qx+rwHnAz+EY= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= +github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/aead/siphash v1.0.1 h1:FwHfE/T45KPKYuuSAKyyvE+oPWcaQ+CUmFW0bPlM+kg= +github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= +github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= +github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190717042225-c3de453c63f4/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= +github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk541a8SKzHPHnH3zbiI+7dagKZ0cgpgrD7Fyho= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-metrics v0.3.10/go.mod h1:4O98XIr/9W0sxpJ8UaYkvjk10Iff7SnFrb4QAOwNTFc= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/beorn7/perks v1.0.0/go.mod h1:KWe93zE9D1o94FZ5RNwFwVgaQK1VOXiVxmqh+CedLV8= +github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= +github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/btcsuite/btcd v0.20.1-beta/go.mod h1:wVuoA8VJLEcwgqHBwHmzLRazpKxTv13Px/pDuV7OomQ= +github.com/btcsuite/btcd v0.22.0-beta.0.20220111032746-97732e52810c/go.mod h1:tjmYdS6MLJ5/s0Fj4DbLgSbDHbEqLJrtnHecBFkdz5M= +github.com/btcsuite/btcd v0.23.1 h1:IB8cVQcC2X5mHbnfirLG5IZnkWYNTPlLZVrxUYSotbE= +github.com/btcsuite/btcd v0.23.1/go.mod h1:0QJIIN1wwIXF/3G/m87gIwGniDMDQqjVn4SZgnFpsYY= +github.com/btcsuite/btcd/btcec/v2 v2.1.0/go.mod h1:2VzYrv4Gm4apmbVVsSq5bqf1Ec8v56E48Vt0Y/umPgA= +github.com/btcsuite/btcd/btcec/v2 v2.1.3/go.mod h1:ctjw4H1kknNJmRN4iP1R7bTQ+v3GJkZBd6mui8ZsAZE= +github.com/btcsuite/btcd/btcec/v2 v2.2.0 h1:fzn1qaOt32TuLjFlkzYSsBC35Q3KUjT1SwPxiMSCF5k= +github.com/btcsuite/btcd/btcec/v2 v2.2.0/go.mod h1:U7MHm051Al6XmscBQ0BoNydpOTsFAn707034b5nY8zU= +github.com/btcsuite/btcd/btcutil v1.0.0/go.mod h1:Uoxwv0pqYWhD//tfTiipkxNfdhG9UrLwaeswfjfdF0A= +github.com/btcsuite/btcd/btcutil v1.1.0 h1:MO4klnGY+EWJdoWF12Wkuf4AWDBPMpZNeN/jRLrklUU= +github.com/btcsuite/btcd/btcutil v1.1.0/go.mod h1:5OapHB7A2hBBWLm48mmw4MOHNJCcUBTwmWH/0Jn8VHE= +github.com/btcsuite/btcd/btcutil/psbt v1.1.4 h1:Edx4AfBn+YPam2KP5AobDitulGp4r1Oibm8oruzkMdI= +github.com/btcsuite/btcd/btcutil/psbt v1.1.4/go.mod h1:9AyU6EQVJ9Iw9zPyNT1lcdHd6cnEZdno5wLu5FY74os= +github.com/btcsuite/btcd/chaincfg/chainhash v1.0.0/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= +github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= +github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtydOrQY2mwhPclbT2snogU7SQQc= +github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f h1:bAs4lUbRJpnnkd9VhRV3jjAVU7DJVjMaK+IsvSeZvFo= +github.com/btcsuite/btclog v0.0.0-20170628155309-84c8d2346e9f/go.mod h1:TdznJufoqS23FtqVCzL0ZqgP5MqXbb4fg/WgDys70nA= +github.com/btcsuite/btcutil v0.0.0-20190425235716-9e5f4b9a998d/go.mod h1:+5NJ2+qvTyV9exUAL/rxXi3DcLg2Ts+ymUAY5y4NvMg= +github.com/btcsuite/go-socks v0.0.0-20170105172521-4720035b7bfd/go.mod h1:HHNXQzUsZCxOoE+CPiyCTO6x34Zs86zZUiwtpXoGdtg= +github.com/btcsuite/goleveldb v0.0.0-20160330041536-7834afc9e8cd/go.mod h1:F+uVaaLLH7j4eDXPRvw78tMflu7Ie2bzYOH4Y8rRKBY= +github.com/btcsuite/goleveldb v1.0.0/go.mod h1:QiK9vBlgftBg6rWQIj6wFzbPfRjiykIEhBH4obrXJ/I= +github.com/btcsuite/snappy-go v0.0.0-20151229074030-0bdef8d06723/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= +github.com/btcsuite/snappy-go v1.0.0/go.mod h1:8woku9dyThutzjeg+3xrA5iCpBRH8XEEg3lh6TiUghc= +github.com/btcsuite/websocket v0.0.0-20150119174127-31079b680792/go.mod h1:ghJtEyQwv5/p4Mg4C0fgbePVuGr935/5ddU9Z3TmDRY= +github.com/btcsuite/winsvc v1.0.0/go.mod h1:jsenWakMcC0zFBFurPLEAyrnc/teJEM1O46fmI40EZs= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/census-instrumentation/opencensus-proto v0.3.0/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= +github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= +github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= github.com/cncf/udpa/go v0.0.0-20210930031921-04548b0d99d4/go.mod h1:6pvJx4me5XPnfI9Z40ddWsdw2W/uZgQLFXToKeRcDiI= +github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210805033703-aa0b78936158/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/cncf/xds/go v0.0.0-20211130200136-a8f946100490/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= +github.com/coreos/go-etcd v2.0.0+incompatible/go.mod h1:Jez6KQU2B/sWsbdaef3ED8NzMklzPG4d5KIOhIy30Tk= +github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= +github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/decred/dcrd/crypto/blake256 v1.0.0 h1:/8DMNYp9SGi5f0w7uCm6d6M4OU2rGFK09Y2A4Xv7EE0= +github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 h1:YLtO71vCjJRCBcrPMtQ9nqBsqpA1m5sE92cU+pd5Mcc= +github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= +github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= +github.com/dgraph-io/badger/v3 v3.2103.1/go.mod h1:dULbq6ehJ5K0cGW/1TQ9iSfUk0gbSiToDWmWmTsJ53E= +github.com/dgraph-io/badger/v3 v3.2103.2 h1:dpyM5eCJAtQCBcMCZcT4UBZchuTJgCywerHHgmxfxM8= +github.com/dgraph-io/badger/v3 v3.2103.2/go.mod h1:RHo4/GmYcKKh5Lxu63wLEMHJ70Pac2JqZRYGhlyAo2M= +github.com/dgraph-io/ristretto v0.1.0 h1:Jv3CGQHp9OjuMBSne1485aDpUkTKEcUqF+jm/LuerPI= +github.com/dgraph-io/ristretto v0.1.0/go.mod h1:fux0lOrBhrVCJd3lcTHsIJhq1T2rokOu6v9Vcb3Q9ug= +github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2 h1:tdlZCpZ/P9DhczCTSixgIKmwPv6+wP5DGjqLYw5SUiA= +github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= +github.com/dustin/go-humanize v1.0.0 h1:VSnTsYCnlFHaM2/igO1h6X3HA71jcobQuxemgkq4zYo= +github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.mod h1:AFq3mo9L8Lqqiid3OhADV3RfLJnjiw63cSpi+fDTRC0= +github.com/envoyproxy/go-control-plane v0.10.1/go.mod h1:AY7fTTXNdv/aJ2O5jwpxAPOWUZ7hQAEvzN5Pf27BkQQ= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/envoyproxy/protoc-gen-validate v0.6.2/go.mod h1:2t7qjJNvHPx8IjnBOzl9E9/baC+qXE/TeeyBRzgJDws= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI= +github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/kit v0.9.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-kit/log v0.1.0/go.mod h1:zbhenjAZHb184qTLMA9ZjW7ThYL0H2mk7Q6pNt4vbaY= +github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-logfmt/logfmt v0.5.0/go.mod h1:wCYkCAKZfumFQihp8CzCvQ3paCTfi41vtzG1KdI/P7A= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/glog v0.0.0-20210429001901-424d2337a529 h1:2voWjNECnrZRbfwXxHB1/j8wa6xdKn85B5NzgVL/pTU= +github.com/golang/glog v0.0.0-20210429001901-424d2337a529/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= +github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= @@ -32,73 +207,717 @@ github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvq github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= -github.com/golang/protobuf v1.5.0 h1:LUVKkCeviFUMKqHa4tXIIij/lbhnMbP7Fn5wKdKkRh4= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/snappy v0.0.4 h1:yAGX7huGHXlcLOEtBnF4w7FQwA26wojNCwOYAEhLjQM= +github.com/golang/snappy v0.0.4/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/flatbuffers v1.12.0/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= +github.com/google/flatbuffers v1.12.1/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= +github.com/google/flatbuffers v2.0.0+incompatible h1:dicJ2oXwypfwUGnB2/TYWYEKiuk9eYQlQO/AnOHl5mI= +github.com/google/flatbuffers v2.0.0+incompatible/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= +github.com/googleapis/gax-go/v2 v2.1.1/go.mod h1:hddJymUZASv3XPyGkUpKj8pPO47Rmb0eJc8R6ouapiM= +github.com/gorilla/mux v1.8.0/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= +github.com/gorilla/websocket v1.4.2/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= +github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 h1:+9834+KizmvFV7pXQGSXQTsaWhq2GjuNUt0aUU0YBYw= +github.com/grpc-ecosystem/go-grpc-middleware v1.3.0/go.mod h1:z0ButlSOZa5vEBq9m2m2hlwIgKw+rp3sdCBRoJY+30Y= github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/hashicorp/consul/api v1.12.0/go.mod h1:6pVBMo0ebnYdt2S3H87XhekM/HHrUoTD2XXb/VrZVy0= +github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= +github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-hclog v1.0.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= +github.com/hashicorp/go-retryablehttp v0.5.3/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= +github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.4/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.4/go.mod h1:mtBihi+LeNXGtG8L9dX59gAEa12BDtBQSp4v/YAJqrc= +github.com/hashicorp/memberlist v0.3.0/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= +github.com/hashicorp/serf v0.9.6/go.mod h1:TXZNMjZQijwlDvp+r0b63xZ45H7JmCmgg4gpTwn9UV4= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jpillora/backoff v1.0.0/go.mod h1:J/6gKK9jxlEcS3zixgDgUAsiuZ7yrSoa/FX5e0EB2j4= +github.com/jrick/logrotate v1.0.0/go.mod h1:LNinyqDIJnpAur+b8yyulnQw/wDuN1+BYKlTRt3OuAQ= +github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= +github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23 h1:FOOIBWrEkLgmlgGfMuZT83xIwfPDxEI2OHu6xUmJMFE= +github.com/kkdai/bstream v0.0.0-20161212061736-f391b8402d23/go.mod h1:J+Gs4SYgM6CZQHDETBtE9HaSEkGmuNXF86RwHhHUvq4= +github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= +github.com/klauspost/compress v1.13.1 h1:wXr2uRxZTJXHLly6qhJabee5JqIhTRoLBhDOA74hDEQ= +github.com/klauspost/compress v1.13.1/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= +github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= +github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/lyft/protoc-gen-star v0.5.3/go.mod h1:V0xaHgaf5oCCqmcxYcWiDfTiKsZsRc87/1qhoTACD8w= +github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls= +github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= +github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= +github.com/miekg/dns v1.1.41/go.mod h1:p6aan82bvRIyn+zDIv9xYNUpwa73JcSh9BKwknJysuI= +github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.4.3 h1:OVowDSCllw/YjdLkam3/sm7wEtOy59d8ndGgCcyj8cs= +github.com/mitchellh/mapstructure v1.4.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= +github.com/onsi/gomega v1.4.1/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= +github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/opentracing/opentracing-go v1.1.0/go.mod h1:UkNAQd3GIcIGf0SeVgPpRdFStlNbqXla1AfSYxPUl2o= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pascaldekloe/goe v0.1.0/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pelletier/go-toml v1.9.4 h1:tjENF6MfZAg8e4ZmZTeWaWiT2vXtsoO6+iuOjFhECwM= +github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= +github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= +github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= +github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= +github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= +github.com/prometheus/client_golang v1.11.0/go.mod h1:Z6t4BnS23TR94PD6BsDNk8yVqroYurpAkEiz0P2BEV0= +github.com/prometheus/client_golang v1.12.1 h1:ZiaPsmm9uiBeaSMRznKsCDNtPCS0T3JVDGF+06gjBzk= +github.com/prometheus/client_golang v1.12.1/go.mod h1:3Z9XVyYiZYEO+YQWt3RD2R3jrbd179Rt297l4aS6nDY= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/client_model v0.2.0 h1:uq5h0d+GuxiXLJLNABMgp2qUWDPiLvgCzz2dUR+/W/M= +github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= +github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= +github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= +github.com/prometheus/common v0.26.0/go.mod h1:M7rCNAaPfAosfx8veZJCuw84e35h3Cfd9VFqTh1DIvc= +github.com/prometheus/common v0.32.1 h1:hWIdL3N2HoUx3B8j3YN9mWor0qhY/NlEKZEaXxuIRh4= +github.com/prometheus/common v0.32.1/go.mod h1:vu+V0TpY+O6vW9J44gczi3Ap/oXXR10b+M/gUGO4Hls= +github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= +github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= +github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= +github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= +github.com/prometheus/procfs v0.7.3 h1:4jVXhlkAyzOScmCkXBTOLRLTz8EeU+eyjrwB/EPq0VU= +github.com/prometheus/procfs v0.7.3/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1xBZuNvfVA= github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sagikazarmark/crypt v0.4.0/go.mod h1:ALv2SRj7GxYV4HO9elxH9nS6M9gW+xDNxqmyJ6RfDFM= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= +github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.6.0/go.mod h1:7uNnSEd1DgxDLC74fIahvMZmmYsHGZGEOFrfsX/uA88= +github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= +github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= +github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= +github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY= +github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= +github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cast v1.4.1 h1:s0hze+J0196ZfEMTs80N7UlFt0BDuQ7Q+JDnHiMWKdA= +github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v0.0.5 h1:f0B+LkLX6DtmRH1isoNA9VTtNUK9K8xYd28JNNfOv/s= +github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= +github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= +github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DMA2s= +github.com/spf13/viper v1.10.1 h1:nuJZuYpG7gTj/XqiUwg8bA0cp1+M2mC3J4g5luUYBKk= +github.com/spf13/viper v1.10.1/go.mod h1:IGlFPqhNAPKRxohIzWpI5QEy4kuI7tcl5WvR+8qy1rU= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/objx v0.1.1 h1:2vfRuCMp5sSVIDSqO8oNnWJq7mPa6KVP3iPIwFBuy8A= +github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.2 h1:4jaiDzPyXQvSd7D0EjG45355tLlV3VOECpq10pLC+8s= +github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= +github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= +github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +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/timshannon/badgerhold/v3 v3.0.0-20210909134927-2b6764d68c1e h1:zWSVsQaifg0cVH9VvR+cMguV7exK6U+SoW8YD1cZpR4= +github.com/timshannon/badgerhold/v3 v3.0.0-20210909134927-2b6764d68c1e/go.mod h1:/Seq5xGNo8jLhSbDX3jdbeZrp4yFIpQ6/7n4TjziEWs= +github.com/timshannon/badgerhold/v4 v4.0.2 h1:83OLY/NFnEaMnHEPd84bYtkLipVkjTsMbzQRYbk47g4= +github.com/timshannon/badgerhold/v4 v4.0.2/go.mod h1:rh6RyXLQFsvrvcKondPQQFZnNovpRzu+gS0FlLxYuHY= +github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqriFuLhtthL60Sar/7RFoluCcXsuvEwTV5KM= +github.com/tyler-smith/go-bip39 v1.1.0 h1:5eUemwrMargf3BSLRRCalXT93Ns6pQJIjYQN2nyfOP8= +github.com/tyler-smith/go-bip39 v1.1.0/go.mod h1:gUYDtqQw1JS3ZJ8UWVcGTGqqr6YIN3CWg+kkNaLt55U= +github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= +github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/XcUArI= +github.com/vulpemventures/fastsha256 v0.0.0-20160815193821-637e65642941 h1:CTcw80hz/Sw8hqlKX5ZYvBUF5gAHSHwdjXxRf/cjDcI= +github.com/vulpemventures/fastsha256 v0.0.0-20160815193821-637e65642941/go.mod h1:GXBJykxW2kUcktGdsgyay7uwwWvkljASfljNcT0mbh8= +github.com/vulpemventures/go-bip39 v1.0.2 h1:+BgKOVo04okKf1wA4Fhv8ccvql+qFyzVUdVJKkb48r0= +github.com/vulpemventures/go-bip39 v1.0.2/go.mod h1:mjFmuv9D6BtANI6iscMmbHhmBOwjMCFfny3mxHnuDrk= +github.com/vulpemventures/go-elements v0.4.0-rc.0/go.mod h1:S7wy2QnrC2ElCZOscYMU2PYnnXRmuBQYfLMQGMVBqMg= +github.com/vulpemventures/go-elements v0.4.0-rc.1 h1:Cgt2pwSHLNiP5JuaXgG6aXhgH/yfG15At1nTTFTxJOU= +github.com/vulpemventures/go-elements v0.4.0-rc.1/go.mod h1:S7wy2QnrC2ElCZOscYMU2PYnnXRmuBQYfLMQGMVBqMg= +github.com/vulpemventures/go-secp256k1-zkp v1.1.5 h1:oG1kO8ibVQ1wOvYcnFyuI+2YqnEZluXdRwkOPJlHBQM= +github.com/vulpemventures/go-secp256k1-zkp v1.1.5/go.mod h1:zo7CpgkuPgoe7fAV+inyxsI9IhGmcoFgyD8nqZaPSOM= +github.com/vulpemventures/neutrino-elements v0.1.2-rc.0 h1:sZNENsnZnmprxS1xQtvC0UhHhS/aejO3NJUsCFqgEjo= +github.com/vulpemventures/neutrino-elements v0.1.2-rc.0/go.mod h1:2H86ekBLbkOrxm7k8dEC5fRERn7EcBsQMLIMObIKBCE= +github.com/xordataexchange/crypt v0.0.3-0.20170626215501-b2862e3d0a77/go.mod h1:aYKd//L2LvnjZzWKhF00oedf4jCCReLcmhLdhm1A27Q= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +go.etcd.io/etcd/api/v3 v3.5.1/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= +go.etcd.io/etcd/client/pkg/v3 v3.5.1/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= +go.etcd.io/etcd/client/v2 v2.305.1/go.mod h1:pMEacxZW7o8pg4CrFE7pquyCJJzZvkvdD2RibOCCCGs= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opencensus.io v0.23.0 h1:gqCw0LfLxScz8irSi8exQc7fyQ0fKQU/qnC/X8+V/1M= +go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.uber.org/atomic v1.4.0/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= +go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= +golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e h1:T8NU3HyQ8ClP4SEE+KbFlg6n0NhuTsN4MyznaarGsZM= +golang.org/x/crypto v0.0.0-20220525230936-793ad666bf5e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/exp v0.0.0-20220426173459-3bcf042a4bf5/go.mod h1:lgLbSvA5ygNOMpwM/9anMpWVlVJ7Z+cHWq/eFuinpGE= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.5.0/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= +golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= +golang.org/x/mod v0.6.0-dev.0.20211013180041-c96bc1413d57/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= +golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/net v0.0.0-20200822124328-c89045814202 h1:VvcQYSHwXgi7W+TpUR6A9g6Up98WAHf3f/ulnJ62IyA= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210410081132-afb366fc7cd1/go.mod h1:9tjilg8BloeKEkVJvy7fQ90B1CfIiPueXVOjqfkSzI8= +golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210525063256-abc453219eb5/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 h1:CIJ76btIcR3eFI5EgSo6k1qKw9KJexJuRLI9G7Hp5wE= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20211005180243-6b3c2da341f1/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884= +golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200106162015-b016eb3dc98e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200615200032-f1bc736245b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200814200057-3d37ad5750ed/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210303074136-134d130e1a04/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603081109-ebe580a85c40/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210816183151-1e6c022a8912/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210908233432-aa78b53d3365/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220608164250-635b8c9b7f68 h1:z8Hj/bl9cOV2grsOpEaQFUaly0JWN3i97mo3jXKJNp0= +golang.org/x/sys v0.0.0-20220608164250-635b8c9b7f68/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.8-0.20211029000441-d6a9af8af023/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= +google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= +google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= +google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= +google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= +google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= +google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= +google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= +google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= +google.golang.org/api v0.55.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= +google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= +google.golang.org/api v0.57.0/go.mod h1:dVPlbZyBo2/OjBpmvNdpn2GRm6rPy75jyU7bmhdrMgI= +google.golang.org/api v0.59.0/go.mod h1:sT2boj7M9YJxZzgeZqXogmhfmRWDtPzT31xkieUbuZU= +google.golang.org/api v0.61.0/go.mod h1:xQRti5UdCmoCEqFxcz93fTl338AVqDgyaDRuOZ3hg9I= +google.golang.org/api v0.63.0/go.mod h1:gs4ij2ffTRXwuzzgJl/56BdwJaA194ijkfn++9tDuPo= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200423170343-7949de9c1215/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= -google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 h1:+kGHl1aib/qcwaRi1CbqBZ1rk19r85MNUf8HaBghugY= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= +google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= +google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= +google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210831024726-fe130286e0e2/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210903162649-d08c68adba83/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210909211513-a8c4777a87af/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211008145708-270636b82663/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211028162531-8db9c33dc351/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa h1:I0YcKz0I7OAhddo7ya8kMnvprhcWM045PmkBdMO9zN0= +google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= +google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc v1.40.1/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= google.golang.org/grpc v1.43.0 h1:Eeu7bZtDZ2DpRCsLhUlcrLnvYaMK1Gz86a+hMVvELmM= google.golang.org/grpc v1.43.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -107,13 +926,42 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/ini.v1 v1.66.2 h1:XfR1dOYubytKy4Shzc2LHrrGhU0lDCfDGG1yLPmpgsI= +gopkg.in/ini.v1 v1.66.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.5/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/internal/app-config/config.go b/internal/app-config/config.go new file mode 100644 index 0000000..b5fd0b7 --- /dev/null +++ b/internal/app-config/config.go @@ -0,0 +1,254 @@ +package appconfig + +import ( + "fmt" + "strings" + "time" + + log "github.com/sirupsen/logrus" + "github.com/vulpemventures/go-elements/network" + "github.com/vulpemventures/ocean/internal/core/application" + "github.com/vulpemventures/ocean/internal/core/ports" + neutrino_scanner "github.com/vulpemventures/ocean/internal/infrastructure/blockchain-scanner/neutrino" + dbbadger "github.com/vulpemventures/ocean/internal/infrastructure/storage/db/badger" + "github.com/vulpemventures/ocean/internal/infrastructure/storage/db/inmemory" + wallet "github.com/vulpemventures/ocean/pkg/single-key-wallet" +) + +var ( + supportedRepoManagers = supportedType{ + "badger": {}, + "inmemory": {}, + } + supportedBcScanners = supportedType{ + "neutrino": {}, + } +) + +type supportedType map[string]struct{} + +func (t supportedType) String() string { + types := make([]string, 0, len(t)) + for tt := range t { + types = append(types, tt) + } + return strings.Join(types, " | ") +} + +// AppConfig is the struct holding all configuration options for +// every application service (wallet, account, transaction and notification). +// This data structure acts also as a factory of the mentioned application +// services and the portable services used by them. +// Public config args: +// * RootPath - (optional) Wallet root HD path (defaults to m/84'/0'). +// * Network - (required) The Liquid network (mainnet, testnet, regtest). +// * UtxoExpiryDuration - (required) The duration in seconds for the app service to wait until unlocking one or more previously locked utxo. +// * RepoManagerType - (required) One of the supported repository manager types. +// * BlockchainScannerType - (required) One of the supported blockchain scanner types. +// * RepoManagerConfig - (optional) Custom config args for the repository manager based on its type. +// * BlockchainScannerConfig - (optional) Custom config args for the blockchain scanner based on its type. +type AppConfig struct { + Version string + Commit string + Date string + + RootPath string + Network *network.Network + UtxoExpiryDuration time.Duration + + RepoManagerType string + BlockchainScannerType string + RepoManagerConfig interface{} + BlockchainScannerConfig interface{} + + rm ports.RepoManager + bcs ports.BlockchainScanner + walletSvc *application.WalletService + accountSvc *application.AccountService + txSvc *application.TransactionService + notifySvc *application.NotificationService +} + +func (c *AppConfig) Validate() error { + if c.Network == nil { + return fmt.Errorf("missing network") + } + if c.UtxoExpiryDuration == 0 { + return fmt.Errorf("missing utxo expiry duration") + } + if len(c.RepoManagerType) == 0 { + return fmt.Errorf("missing repo manager type") + } + if _, ok := supportedRepoManagers[c.RepoManagerType]; !ok { + return fmt.Errorf( + "repo manager type not supported, must be one of: %s", + supportedRepoManagers, + ) + } + if len(c.BlockchainScannerType) == 0 { + return fmt.Errorf("missing blockchain scanner type") + } + if _, ok := supportedBcScanners[c.BlockchainScannerType]; !ok { + return fmt.Errorf( + "blockchain scanner type not supported, must be one of: %s", + supportedBcScanners, + ) + } + if _, err := c.repoManager(); err != nil { + return err + } + if _, err := c.bcScanner(); err != nil { + return err + } + if c.RootPath == "" { + return fmt.Errorf("missing root path") + } + if _, err := wallet.ParseRootDerivationPath(c.RootPath); err != nil { + return err + } + + return nil +} + +func (c *AppConfig) RepoManager() ports.RepoManager { + return c.rm +} + +func (c *AppConfig) BlockchainScanner() ports.BlockchainScanner { + return c.bcs +} + +func (c *AppConfig) WalletService() *application.WalletService { + return c.walletService() +} + +func (c *AppConfig) AccountService() *application.AccountService { + return c.accountService() +} + +func (c *AppConfig) TransactionService() *application.TransactionService { + return c.transactionService() +} + +func (c *AppConfig) NotificationService() *application.NotificationService { + return c.notificationService() +} + +func (c *AppConfig) repoManager() (ports.RepoManager, error) { + if c.rm != nil { + return c.rm, nil + } + + switch c.RepoManagerType { + case "inmemory": + c.rm = inmemory.NewRepoManager() + return c.rm, nil + case "badger": + if c.RepoManagerConfig == nil { + return nil, fmt.Errorf("missing repo manager config args") + } + datadir, ok := c.RepoManagerConfig.(string) + if !ok { + return nil, fmt.Errorf("invalid repo manager config type, must be string") + } + rm, err := dbbadger.NewRepoManager(datadir, log.New()) + if err != nil { + return nil, err + } + c.rm = rm + return c.rm, nil + default: + return nil, fmt.Errorf("unknown repo manager type") + } +} + +func (c *AppConfig) bcScanner() (ports.BlockchainScanner, error) { + if c.bcs != nil { + return c.bcs, nil + } + + switch c.BlockchainScannerType { + case "neutrino": + if c.BlockchainScannerConfig == nil { + return nil, fmt.Errorf("missing blockchain scanner config args") + } + args, ok := c.BlockchainScannerConfig.(neutrino_scanner.NodeServiceArgs) + if !ok { + return nil, fmt.Errorf( + "invalid blockchain scanner config type, must be " + + "neutrino_scanner.NodeServiceArgs", + ) + } + bcs, err := neutrino_scanner.NewNeutrinoScanner(args) + if err != nil { + return nil, err + } + c.bcs = bcs + return c.bcs, nil + default: + return nil, fmt.Errorf("unknown blockchain scanner type") + } +} + +func (c *AppConfig) walletService() *application.WalletService { + if c.walletSvc != nil { + return c.walletSvc + } + + rm, _ := c.repoManager() + bcs, _ := c.bcScanner() + c.walletSvc = application.NewWalletService( + rm, bcs, c.RootPath, c.Network, c.buildInfo(), + ) + return c.walletSvc +} + +func (c *AppConfig) accountService() *application.AccountService { + if c.accountSvc != nil { + return c.accountSvc + } + + rm, _ := c.repoManager() + bcs, _ := c.bcScanner() + c.accountSvc = application.NewAccountService(rm, bcs) + return c.accountSvc +} + +func (c *AppConfig) transactionService() *application.TransactionService { + if c.txSvc != nil { + return c.txSvc + } + + rm, _ := c.repoManager() + bcs, _ := c.bcScanner() + c.txSvc = application.NewTransactionService( + rm, bcs, c.Network, c.RootPath, c.UtxoExpiryDuration, + ) + return c.txSvc +} + +func (c *AppConfig) notificationService() *application.NotificationService { + if c.notifySvc != nil { + return c.notifySvc + } + + rm, _ := c.repoManager() + c.notifySvc = application.NewNotificationService(rm) + return c.notifySvc +} + +func (c *AppConfig) buildInfo() application.BuildInfo { + version := "dev" + if c.Version != "" { + version = c.Version + } + commit := "none" + if c.Commit != "" { + commit = c.Commit + } + date := "unknown" + if c.Date != "" { + date = c.Date + } + return application.BuildInfo{version, commit, date} +} diff --git a/internal/config/config.go b/internal/config/config.go new file mode 100644 index 0000000..36ad1de --- /dev/null +++ b/internal/config/config.go @@ -0,0 +1,287 @@ +package config + +import ( + "encoding/hex" + "fmt" + "log" + "os" + "path/filepath" + + "github.com/btcsuite/btcd/btcutil" + "github.com/spf13/viper" + "github.com/vulpemventures/go-elements/network" +) + +const ( + // DatadirKey is the key to customize the ocean datadir. + DatadirKey = "DATADIR" + // DatabaseTypeKey is the key to customize the type of database to use. + DatabaseTypeKey = "DATABASE_TYPE" + // BlockchainScannerTypeKey is the key to customize the type of blockchain + // scanner to use. + BlockchainScannerTypeKey = "BLOCKCHAIN_SCANNER_TYPE" + // PortKey is the key to customize the port where the wallet will be listening to. + PortKey = "PORT" + // ProfilerPortKey is the key to customize the port where the profiler will + // be listening to. + ProfilerPortKey = "PROFILER_PORT" + // NetworkKey is the key to customize the Liquid network. + NetworkKey = "NETWORK" + // NativeAssetKey is the key to customize the native LBTC asset of the Liquid + // network. Should be used only for testing purposes. + NativeAssetKey = "NATIVE_ASSET" + // LogLevelKey is the key to customize the log level to catch more specific + // or more high level logs. + LogLevelKey = "LOG_LEVEL" + // TLSExtraIPKey is the key to bind one or more public IPs to the TLS key pair. + // Should be used only when enabling TLS. + TLSExtraIPKey = "TLS_EXTRA_IP" + // TLSExtraDomainKey is the key to bind one or more public dns domains to the + // TLS key pair. Should be used only when enabling TLS. + TLSExtraDomainKey = "TLS_EXTRA_DOMAIN" + // NoTLSKey is the key to disable TLS encryption. + NoTLSKey = "NO_TLS" + // NoProfilerKey is the key to disable Prometheus profiling. + NoProfilerKey = "NO_PROFILER" + // StatsIntervalKey is the key to customize the interval for the profiled to + // gather profiling stats. + StatsIntervalKey = "STATS_INTERVAL" + // NodePeersKey is the key to customize the list of peers the embedded SPV + // node will connect to when started + NodePeersKey = "NODE_PEERS" + // UtxoExpiryDurationKey is the key to customize the waiting time for one or + // more previously locked utxos to be unlocked if not yet spent. + UtxoExpiryDurationKey = "UTXO_EXPIRY_DURATION_IN_SECONDS" + // RootPathKey is the key to use a custom root path for the wallet, + // instead of the default m/84'/[1776|1]' (depending on network). + RootPathKey = "ROOT_PATH" + // EsploraUrlKey is the key for the esplora block esplorer consumed by the + // neutrino blockchain scanner + EsploraUrlKey = "ESPLORA_URL" + + // DbLocation is the folder inside the datadir containing db files. + DbLocation = "db" + // TLSLocation is the folder inside the datadir containing TLS key and + // certificate. + TLSLocation = "tls" + // ScannerLocation is the folder inside the datadir containing blockchain + // scanner files. + ScannerLocation = "blockchain" + // ProfilerLocation is the folder inside the datadir containing profiler + // stats files. + ProfilerLocation = "stats" +) + +var ( + vip *viper.Viper + + defaultDatadir = btcutil.AppDataDir("ocean-wallet", false) + defaultDbType = "badger" + defaultBcScannerType = "neutrino" + defaultPort = 18000 + defaultLogLevel = 4 + defaultNetwork = network.Liquid.Name + defaultProfilerPort = 18001 + defaultStatsInterval = 600 // 10 minutes + defaultUtxoExpiryDuration = 360 // 6 minutes (3 blocks) + defaultEsploraUrl = "https://blockstream.info/liquid/api" + + supportedNetworks = map[string]*network.Network{ + network.Liquid.Name: &network.Liquid, + network.Testnet.Name: &network.Testnet, + network.Regtest.Name: &network.Regtest, + } + supportedDbs = map[string]struct{}{ + "badger": {}, + "inmemory": {}, + } + supportedBcScanners = map[string]struct{}{ + "neutrino": {}, + } + coinTypeByNetwork = map[string]int{ + network.Liquid.Name: 1776, + network.Testnet.Name: 1, + network.Regtest.Name: 1, + } +) + +func init() { + vip = viper.New() + vip.SetEnvPrefix("OCEAN") + vip.AutomaticEnv() + + vip.SetDefault(DatadirKey, defaultDatadir) + vip.SetDefault(DatabaseTypeKey, defaultDbType) + vip.SetDefault(BlockchainScannerTypeKey, defaultBcScannerType) + vip.SetDefault(PortKey, defaultPort) + vip.SetDefault(NetworkKey, defaultNetwork) + vip.SetDefault(LogLevelKey, defaultLogLevel) + vip.SetDefault(NoTLSKey, false) + vip.SetDefault(NoProfilerKey, false) + vip.SetDefault(ProfilerPortKey, defaultProfilerPort) + vip.SetDefault(StatsIntervalKey, defaultStatsInterval) + vip.SetDefault(UtxoExpiryDurationKey, defaultUtxoExpiryDuration) + vip.SetDefault(EsploraUrlKey, defaultEsploraUrl) + + if err := validate(); err != nil { + log.Fatalf("invalid config: %s", err) + } + + if err := initDatadir(); err != nil { + log.Fatalf("config: error while creating datadir: %s", err) + } +} + +func validate() error { + datadir := GetString(DatadirKey) + if len(datadir) <= 0 { + return fmt.Errorf("datadir must not be null") + } + + net := GetString(NetworkKey) + if len(net) == 0 { + return fmt.Errorf("network must not be null") + } + if _, ok := supportedNetworks[net]; !ok { + nets := make([]string, 0, len(supportedNetworks)) + for net := range supportedNetworks { + nets = append(nets, net) + } + return fmt.Errorf("unknown network, must be one of: %v", nets) + } + + if net == network.Regtest.Name { + if asset := GetString(NativeAssetKey); len(asset) > 0 { + buf, err := hex.DecodeString(asset) + if err != nil { + return fmt.Errorf("invalid native asset string format, must be hex") + } + if len(buf) != 32 { + return fmt.Errorf( + "invalid native asset length, must be exactly 32 bytes in hex " + + "string format", + ) + } + } + } + + dbType := GetString(DatabaseTypeKey) + if _, ok := supportedDbs[dbType]; !ok { + dbTypes := make([]string, 0, len(supportedDbs)) + for t := range supportedDbs { + dbTypes = append(dbTypes, t) + } + return fmt.Errorf("unsupported database type, must be one of %v", dbTypes) + } + + bcScannerType := GetString(BlockchainScannerTypeKey) + if _, ok := supportedBcScanners[bcScannerType]; !ok { + bcScannerTypes := make([]string, 0, len(supportedBcScanners)) + for t := range supportedBcScanners { + bcScannerTypes = append(bcScannerTypes, t) + } + return fmt.Errorf( + "unsupported blockchain scanner type, must be one of %v", bcScannerTypes, + ) + } + + port := GetInt(PortKey) + noProfiler := GetBool(NoProfilerKey) + if !noProfiler { + profilerPort := GetInt(ProfilerPortKey) + if port == profilerPort { + return fmt.Errorf("port and profiler port must not be equal") + } + } + + nodePeers := GetStringSlice(NodePeersKey) + if len(nodePeers) == 0 { + return fmt.Errorf("node peers list must not be empty") + } + + return nil +} + +func GetDatadir() string { + return filepath.Join(GetString(DatadirKey), GetString(NetworkKey)) +} + +func GetNetwork() *network.Network { + net := supportedNetworks[GetString(NetworkKey)] + + if net.Name == network.Regtest.Name { + if nativeAsset := GetString(NativeAssetKey); nativeAsset != "" { + net.AssetID = nativeAsset + } + } + + return net +} + +func GetRootPath() string { + rootPath := GetString(RootPathKey) + if rootPath != "" { + return rootPath + } + + coinType := coinTypeByNetwork[GetString(NetworkKey)] + return fmt.Sprintf("m/84'/%d'", coinType) +} + +func GetString(key string) string { + return vip.GetString(key) +} + +func GetInt(key string) int { + return vip.GetInt(key) +} + +func GetBool(key string) bool { + return vip.GetBool(key) +} + +func GetStringSlice(key string) []string { + return vip.GetStringSlice(key) +} + +func Set(key string, val interface{}) { + vip.Set(key, val) +} + +func Unset(key string) { + vip.Set(key, nil) +} + +func IsSet(key string) bool { + return vip.IsSet(key) +} + +func initDatadir() error { + datadir := GetDatadir() + if err := makeDirectoryIfNotExists(filepath.Join(datadir, DbLocation)); err != nil { + return err + } + + noProfiler := GetBool(NoProfilerKey) + if !noProfiler { + if err := makeDirectoryIfNotExists(filepath.Join(datadir, ProfilerLocation)); err != nil { + return err + } + } + + noTls := GetBool(NoTLSKey) + if noTls { + return nil + } + if err := makeDirectoryIfNotExists(filepath.Join(datadir, TLSLocation)); err != nil { + return err + } + return nil +} + +func makeDirectoryIfNotExists(path string) error { + if _, err := os.Stat(path); os.IsNotExist(err) { + return os.MkdirAll(path, os.ModeDir|0755) + } + return nil +} diff --git a/internal/core/application/account_service.go b/internal/core/application/account_service.go new file mode 100644 index 0000000..88c39c7 --- /dev/null +++ b/internal/core/application/account_service.go @@ -0,0 +1,354 @@ +package application + +import ( + "context" + "fmt" + "time" + + log "github.com/sirupsen/logrus" + "github.com/vulpemventures/ocean/internal/core/domain" + "github.com/vulpemventures/ocean/internal/core/ports" +) + +// AccountService is responsible for operations related to wallet accounts: +// * Create a new account. +// * Derive addresses for an existing account. +// * List derived addresses for an existing account. +// * Get balance of an existing account. +// * List utxos of an existing account. +// * Delete an existing account. +// +// The service registers 3 handlers related to the following wallet events: +// * domain.WalletAccountCreated - whenever an account is created, the service initializes a dedicated blockchain scanner and starts listening for its reports. +// * domain.WalletAccountAddressesDerived - whenever one or more addresses are derived for an account, they are added to the list of those watched by the account's scanner. +// * domain.WalletAccountDeleted - whenever an account is deleted, the relative scanner is stopped and removed. +// +// The service guarantees to be always listening to notifications coming from +// each of its blockchain scanners in order to keep updated the utxo set of the +// relative accounts, ie. at startup it takes care of initializing a scanner +// for any existing account in case the wallet is already initialized and was +// just restarted. +type AccountService struct { + repoManager ports.RepoManager + bcScanner ports.BlockchainScanner + + log func(format string, a ...interface{}) + warn func(err error, format string, a ...interface{}) +} + +func NewAccountService( + repoManager ports.RepoManager, bcScanner ports.BlockchainScanner, +) *AccountService { + logFn := func(format string, a ...interface{}) { + format = fmt.Sprintf("account service: %s", format) + log.Debugf(format, a...) + } + warnFn := func(err error, format string, a ...interface{}) { + format = fmt.Sprintf("account service: %s", format) + log.WithError(err).Warnf(format, a...) + } + + svc := &AccountService{repoManager, bcScanner, logFn, warnFn} + svc.registerHandlerForWalletEvents() + + w, _ := repoManager.WalletRepository().GetWallet(context.Background()) + if w == nil { + return svc + } + + for accountName := range w.AccountKeysByName { + accountKey := w.AccountKeysByName[accountName] + account := w.AccountsByKey[accountKey] + addressesInfo, _ := w.AllDerivedAddressesForAccount(accountName) + if len(addressesInfo) > 0 { + svc.log("start watching addresses for account %s", accountName) + bcScanner.WatchForAccount(accountName, account.BirthdayBlock, addressesInfo) + } + go svc.listenToUtxoChannel(accountName, bcScanner.GetUtxoChannel(accountName)) + go svc.listenToTxChannel(accountName, bcScanner.GetTxChannel(accountName)) + } + + return svc +} + +func (as *AccountService) CreateAccountBIP44( + ctx context.Context, accountName string, +) (*AccountInfo, error) { + _, birthdayBlockHeight, err := as.bcScanner.GetLatestBlock() + if err != nil { + return nil, err + } + accountInfo, err := as.repoManager.WalletRepository().CreateAccount( + ctx, accountName, birthdayBlockHeight, + ) + if err != nil { + return nil, err + } + return (*AccountInfo)(accountInfo), nil +} + +func (as *AccountService) DeriveAddressForAccount( + ctx context.Context, accountName string, numOfAddresses uint64, +) (AddressesInfo, error) { + if numOfAddresses == 0 { + numOfAddresses = 1 + } + + addressesInfo, err := as.repoManager.WalletRepository(). + DeriveNextExternalAddressesForAccount(ctx, accountName, numOfAddresses) + if err != nil { + return nil, err + } + return AddressesInfo(addressesInfo), nil +} + +func (as *AccountService) DeriveChangeAddressForAccount( + ctx context.Context, accountName string, numOfAddresses uint64, +) (AddressesInfo, error) { + if numOfAddresses == 0 { + numOfAddresses = 1 + } + + addressesInfo, err := as.repoManager.WalletRepository(). + DeriveNextInternalAddressesForAccount(ctx, accountName, numOfAddresses) + if err != nil { + return nil, err + } + return AddressesInfo(addressesInfo), nil +} + +func (as *AccountService) ListAddressesForAccount( + ctx context.Context, accountName string, +) (AddressesInfo, error) { + w, err := as.repoManager.WalletRepository().GetWallet(ctx) + if err != nil { + return nil, err + } + + addressesInfo, err := w.AllDerivedExternalAddressesForAccount(accountName) + if err != nil { + return nil, err + } + return AddressesInfo(addressesInfo), nil +} + +func (as *AccountService) GetBalanceForAccount( + ctx context.Context, accountName string, +) (BalanceInfo, error) { + w, err := as.repoManager.WalletRepository().GetWallet(ctx) + if err != nil { + return nil, err + } + + account, err := w.GetAccount(accountName) + if err != nil { + return nil, err + } + + return as.repoManager.UtxoRepository().GetBalanceForAccount( + ctx, account.Info.Key.Name, + ) +} + +func (as *AccountService) ListUtxosForAccount( + ctx context.Context, accountName string, +) (*UtxoInfo, error) { + w, err := as.repoManager.WalletRepository().GetWallet(ctx) + if err != nil { + return nil, err + } + + account, err := w.GetAccount(accountName) + if err != nil { + return nil, err + } + + spendableUtxos, err := as.repoManager.UtxoRepository().GetSpendableUtxosForAccount( + ctx, account.Info.Key.Name, + ) + if err != nil { + return nil, err + } + + lockedUtxos, err := as.repoManager.UtxoRepository().GetLockedUtxosForAccount( + ctx, account.Info.Key.Name, + ) + if err != nil { + return nil, err + } + + return &UtxoInfo{spendableUtxos, lockedUtxos}, nil +} + +func (as *AccountService) DeleteAccount( + ctx context.Context, accountName string, +) (err error) { + balance, err := as.GetBalanceForAccount(ctx, accountName) + if err != nil { + return + } + if len(balance) > 0 { + err = fmt.Errorf( + "account %s must have zero balance to be deleted", accountName, + ) + return + } + + defer func() { + if err == nil { + if err := as.repoManager.UtxoRepository().DeleteUtxosForAccount( + ctx, accountName, + ); err != nil { + as.warn( + err, "account service: error while deleting utxos for account %s", + accountName, + ) + } + } + }() + + err = as.repoManager.WalletRepository().DeleteAccount(ctx, accountName) + return +} + +func (as *AccountService) registerHandlerForWalletEvents() { + as.repoManager.RegisterHandlerForWalletEvent( + domain.WalletAccountCreated, func(event domain.WalletEvent) { + as.bcScanner.WatchForAccount( + event.AccountName, event.AccountBirthdayBlock, event.AccountAddresses, + ) + chUtxos := as.bcScanner.GetUtxoChannel(event.AccountName) + chTxs := as.bcScanner.GetTxChannel(event.AccountName) + go as.listenToUtxoChannel(event.AccountName, chUtxos) + go as.listenToTxChannel(event.AccountName, chTxs) + }, + ) + as.repoManager.RegisterHandlerForWalletEvent( + domain.WalletAccountAddressesDerived, func(event domain.WalletEvent) { + as.bcScanner.WatchForAccount( + event.AccountName, event.AccountBirthdayBlock, event.AccountAddresses, + ) + }, + ) + as.repoManager.RegisterHandlerForWalletEvent( + domain.WalletAccountDeleted, func(event domain.WalletEvent) { + as.bcScanner.StopWatchForAccount(event.AccountName) + }, + ) +} + +func (as *AccountService) listenToUtxoChannel( + accountName string, chUtxos chan []*domain.Utxo, +) { + as.log("start listening to utxo channel for account %s", accountName) + + for utxos := range chUtxos { + time.Sleep(time.Millisecond) + + as.log( + "received %d utxo(s) from channel for account %s", + len(utxos), accountName, + ) + + utxoKeys := make([]domain.UtxoKey, 0, len(utxos)) + for _, u := range utxos { + utxoKeys = append(utxoKeys, u.Key()) + } + if utxos[0].IsSpent() { + count, err := as.repoManager.UtxoRepository().SpendUtxos( + context.Background(), utxoKeys, utxos[0].SpentStatus, + ) + if err != nil { + as.warn( + err, "error while updating utxos status to spent for account %s", + accountName, + ) + } + if count > 0 { + as.log("spent %d utxos for account %s", count, accountName) + } + continue + } + + if utxos[0].IsConfirmed() { + count, err := as.repoManager.UtxoRepository().ConfirmUtxos( + context.Background(), utxoKeys, utxos[0].ConfirmedStatus, + ) + if err != nil { + as.warn( + err, "error while updating utxos status to spent for account %s", + accountName, + ) + } + if count > 0 { + as.log( + "account service: spent %d utxos for account %s", count, accountName, + ) + continue + } + } + + count, err := as.repoManager.UtxoRepository().AddUtxos( + context.Background(), utxos, + ) + if err != nil { + as.warn(err, "error while adding new utxos for account %s", accountName) + } + if count > 0 { + as.log("added %d utxos for account %s", count, accountName) + } + } +} + +func (as *AccountService) listenToTxChannel( + accountName string, chTxs chan *domain.Transaction, +) { + as.log("start listening to tx channel for account %s", accountName) + + ctx := context.Background() + txRepo := as.repoManager.TransactionRepository() + for tx := range chTxs { + time.Sleep(time.Millisecond) + + as.log("received new tx %s from channel", tx.TxID) + + gotTx, _ := txRepo.GetTransaction(ctx, tx.TxID) + if gotTx == nil { + if _, err := txRepo.AddTransaction(ctx, tx); err != nil { + as.warn( + err, "error while adding new transaction %s for account %s", + tx.TxID, accountName, + ) + continue + } + as.log("added new transaction %s for account %s", tx.TxID, accountName) + continue + } + if !gotTx.IsConfirmed() && tx.IsConfirmed() { + if _, err := txRepo.ConfirmTransaction( + ctx, tx.TxID, tx.BlockHash, tx.BlockHeight, + ); err != nil { + as.warn( + err, "error while confirming transaction %s for account %s", + tx.TxID, accountName, + ) + } + as.log("confirmed transaction %s for account %s", tx.TxID, accountName) + } + + if !gotTx.HasAccounts(tx) { + if err := txRepo.UpdateTransaction( + ctx, tx.TxID, func(t *domain.Transaction) (*domain.Transaction, error) { + for _, account := range tx.GetAccounts() { + t.AddAccount(account) + } + return t, nil + }, + ); err != nil { + as.warn(err, "error while updating accounts to transaction %s", tx.TxID) + continue + } + as.log("updated accounts for transaction %s", tx.TxID) + } + } +} diff --git a/internal/core/application/account_service_test.go b/internal/core/application/account_service_test.go new file mode 100644 index 0000000..fe23595 --- /dev/null +++ b/internal/core/application/account_service_test.go @@ -0,0 +1,102 @@ +package application_test + +import ( + "encoding/hex" + "testing" + + "github.com/stretchr/testify/require" + "github.com/vulpemventures/ocean/internal/core/application" + "github.com/vulpemventures/ocean/internal/core/domain" + "github.com/vulpemventures/ocean/internal/core/ports" + dbbadger "github.com/vulpemventures/ocean/internal/infrastructure/storage/db/badger" +) + +func TestAccountService(t *testing.T) { + mockedBcScanner := newMockedBcScanner() + mockedBcScanner.On("GetLatestBlock").Return(birthdayBlockHash, birthdayBlockHeight, nil) + repoManager, err := newRepoManagerForAccountService() + require.NoError(t, err) + require.NotNil(t, repoManager) + + svc := application.NewAccountService(repoManager, mockedBcScanner) + + addresses, err := svc.DeriveAddressForAccount(ctx, accountName, 0) + require.Error(t, err) + require.Nil(t, addresses) + + accountInfo, err := svc.CreateAccountBIP44(ctx, accountName) + require.NoError(t, err) + require.NotNil(t, accountInfo) + require.Equal(t, accountName, accountInfo.Key.Name) + require.NotEmpty(t, accountInfo.DerivationPath) + require.NotEmpty(t, accountInfo.Xpub) + + addresses, err = svc.ListAddressesForAccount(ctx, accountName) + require.NoError(t, err) + require.Empty(t, addresses) + + addresses, err = svc.DeriveAddressForAccount(ctx, accountName, 2) + require.NoError(t, err) + require.Len(t, addresses, 2) + + changeAddresses, err := svc.DeriveChangeAddressForAccount(ctx, accountName, 0) + require.NoError(t, err) + require.Len(t, changeAddresses, 1) + + addresses, err = svc.ListAddressesForAccount(ctx, accountName) + require.NoError(t, err) + require.Len(t, addresses, 2) + + utxos, err := svc.ListUtxosForAccount(ctx, accountName) + require.NoError(t, err) + require.NotNil(t, utxos) + require.NotEmpty(t, utxos.Spendable) + require.Empty(t, utxos.Locked) + + balance, err := svc.GetBalanceForAccount(ctx, accountName) + require.NoError(t, err) + require.NotNil(t, balance) + + // Cannot delete an account with non-zero balance. + err = svc.DeleteAccount(ctx, accountName) + require.Error(t, err) + + // Simulate withdrawing all funds by spending every spendable utxo coming + // from ListUtxosForAccount. + status := domain.UtxoStatus{hex.EncodeToString(make([]byte, 32)), 1, 0, ""} + _, err = repoManager.UtxoRepository().SpendUtxos(ctx, utxos.Spendable.Keys(), status) + require.NoError(t, err) + + // Now deleting the account should work without errors. + err = svc.DeleteAccount(ctx, accountName) + require.NoError(t, err) +} + +func newRepoManagerForAccountService() (ports.RepoManager, error) { + rm, err := dbbadger.NewRepoManager("", nil) + if err != nil { + return nil, err + } + + wallet, err := domain.NewWallet( + mnemonic, password, rootPath, regtest.Name, birthdayBlockHeight, nil, + ) + if err != nil { + return nil, err + } + + if err := rm.WalletRepository().CreateWallet(ctx, wallet); err != nil { + return nil, err + } + + if err := rm.WalletRepository().UpdateWallet( + ctx, func(w *domain.Wallet) (*domain.Wallet, error) { + w.Unlock(password) + return w, nil + }, + ); err != nil { + return nil, err + } + + return rm, nil +} diff --git a/internal/core/application/mocks_test.go b/internal/core/application/mocks_test.go new file mode 100644 index 0000000..08f6f22 --- /dev/null +++ b/internal/core/application/mocks_test.go @@ -0,0 +1,259 @@ +package application_test + +import ( + "crypto/rand" + "encoding/hex" + "math/big" + "strings" + "sync" + + "github.com/stretchr/testify/mock" + "github.com/vulpemventures/go-elements/address" + "github.com/vulpemventures/ocean/internal/core/application" + "github.com/vulpemventures/ocean/internal/core/domain" +) + +// ports.BlockchainScanner +type mockBcScanner struct { + mock.Mock + chTxs chan *domain.Transaction + chUtxos chan []*domain.Utxo +} + +func newMockedBcScanner() *mockBcScanner { + return &mockBcScanner{ + chTxs: make(chan *domain.Transaction), + chUtxos: make(chan []*domain.Utxo), + } +} + +func (m *mockBcScanner) Start() {} +func (m *mockBcScanner) Stop() {} +func (m *mockBcScanner) WatchForAccount( + accountName string, staringBlock uint32, addrInfo []domain.AddressInfo, +) { + addresses := application.AddressesInfo(addrInfo).Addresses() + if len(addresses) > 0 { + utxos := randomUtxos(accountName, addresses) + m.chUtxos <- utxos + + for _, u := range utxos { + tx := randomTx(accountName, u.TxID) + m.chTxs <- tx + } + } +} + +func (m *mockBcScanner) StopWatchForAccount(accountName string) { + close(m.chTxs) + close(m.chUtxos) +} + +func (m *mockBcScanner) GetUtxoChannel(accountName string) chan []*domain.Utxo { + return m.chUtxos +} + +func (m *mockBcScanner) GetTxChannel(accountName string) chan *domain.Transaction { + return m.chTxs +} + +func (m *mockBcScanner) GetLatestBlock() ([]byte, uint32, error) { + args := m.Called() + var res []byte + if a := args.Get(0); a != nil { + res = a.([]byte) + } + var res1 uint32 + if a := args.Get(1); a != nil { + res1 = a.(uint32) + } + return res, res1, args.Error(2) +} + +func (m *mockBcScanner) GetBlockHash(height uint32) ([]byte, error) { + args := m.Called(height) + var res []byte + if a := args.Get(0); a != nil { + res = a.([]byte) + } + return res, args.Error(1) +} + +func (m *mockBcScanner) GetBlockHeight(hash []byte) (uint32, error) { + args := m.Called(hash) + var res uint32 + if a := args.Get(0); a != nil { + res = a.(uint32) + } + return res, args.Error(1) +} + +func (m *mockBcScanner) GetUtxos(utxoKeys []domain.UtxoKey) ([]*domain.Utxo, error) { + args := m.Called(utxoKeys) + var res []*domain.Utxo + if a := args.Get(0); a != nil { + res = a.([]*domain.Utxo) + } + return res, args.Error(1) +} + +func (m *mockBcScanner) BroadcastTransaction(txHex string) (string, error) { + args := m.Called(txHex) + var res string + if a := args.Get(0); a != nil { + res = a.(string) + } + return res, args.Error(1) +} + +// domain.MnemonicStore +type inMemoryMnemonicStore struct { + mnemonic []string + lock *sync.RWMutex +} + +func newInMemoryMnemonicStore() domain.IMnemonicStore { + return &inMemoryMnemonicStore{ + lock: &sync.RWMutex{}, + } +} + +func (s *inMemoryMnemonicStore) Set(mnemonic string) { + s.lock.Lock() + defer s.lock.Unlock() + + s.mnemonic = strings.Split(mnemonic, " ") +} + +func (s *inMemoryMnemonicStore) Unset() { + s.lock.Lock() + defer s.lock.Unlock() + + s.mnemonic = nil +} + +func (s *inMemoryMnemonicStore) IsSet() bool { + s.lock.RLock() + defer s.lock.RUnlock() + + return len(s.mnemonic) > 0 +} + +func (s *inMemoryMnemonicStore) Get() []string { + s.lock.RLock() + defer s.lock.RUnlock() + + return s.mnemonic +} + +// domain.MnemonicCypher +type mockMnemonicCypher struct { + mock.Mock +} + +func (m *mockMnemonicCypher) Encrypt( + mnemonic, password []byte, +) ([]byte, error) { + args := m.Called(mnemonic, password) + + var res []byte + if a := args.Get(0); a != nil { + res = a.([]byte) + } + return res, args.Error(1) +} + +func (m *mockMnemonicCypher) Decrypt( + encryptedMnemonic, password []byte, +) ([]byte, error) { + args := m.Called(encryptedMnemonic, password) + + var res []byte + if a := args.Get(0); a != nil { + res = a.([]byte) + } + return res, args.Error(1) +} + +func randomUtxos(accountName string, addresses []string) []*domain.Utxo { + utxos := make([]*domain.Utxo, 0, len(addresses)) + for _, addr := range addresses { + utxos = append(utxos, randomUtxo(accountName, addr)) + } + return utxos +} + +func randomUtxo(accountName, addr string) *domain.Utxo { + script, _ := address.ToOutputScript(addr) + nonce := append([]byte{3}, randomBytes(32)...) + return &domain.Utxo{ + UtxoKey: domain.UtxoKey{ + TxID: randomHex(32), + VOut: randomVout(), + }, + Value: randomValue(), + Asset: randomHex(32), + ValueCommitment: randomValueCommitment(), + AssetCommitment: randomAssetCommitment(), + ValueBlinder: randomBytes(32), + AssetBlinder: randomBytes(32), + Script: script, + Nonce: nonce, + AccountName: accountName, + ConfirmedStatus: domain.UtxoStatus{ + BlockHeight: uint64(randomIntInRange(1, 10000)), + }, + } +} + +func randomTx(txid, accountName string) *domain.Transaction { + return &domain.Transaction{ + TxHex: randomHex(200), + TxID: txid, + BlockHash: randomHex(32), + BlockHeight: uint64(randomIntInRange(1, 10000)), + Accounts: map[string]struct{}{ + accountName: {}, + }, + } +} + +func randomValueCommitment() []byte { + return append([]byte{9}, randomBytes(32)...) +} + +func randomAssetCommitment() []byte { + return append([]byte{10}, randomBytes(32)...) +} + +func randomHex(len int) string { + return hex.EncodeToString(randomBytes(len)) +} + +func randomVout() uint32 { + return uint32(randomIntInRange(0, 15)) +} + +func randomValue() uint64 { + return uint64(randomIntInRange(1000000, 10000000000)) +} + +func randomBytes(len int) []byte { + b := make([]byte, len) + rand.Read(b) + return b +} + +func randomIntInRange(min, max int) int { + n, _ := rand.Int(rand.Reader, big.NewInt(int64(max))) + return int(int(n.Int64())) + min +} + +func b2h(buf []byte) string { + return hex.EncodeToString(buf) +} + +func h2b(str string) []byte { + buf, _ := hex.DecodeString(str) + return buf +} diff --git a/internal/core/application/notification_service.go b/internal/core/application/notification_service.go new file mode 100644 index 0000000..f9d9825 --- /dev/null +++ b/internal/core/application/notification_service.go @@ -0,0 +1,34 @@ +package application + +import ( + "context" + + "github.com/vulpemventures/ocean/internal/core/domain" + "github.com/vulpemventures/ocean/internal/core/ports" +) + +// Notification service has the very simple task of making the event channels +// of the used domain.TransactionRepository and domain.UtxoRepository +// accessible by external clients so that they can get real-time updates on the +// status of the internal wallet. +type NotificationService struct { + repoManager ports.RepoManager +} + +func NewNotificationService( + repoManager ports.RepoManager, +) *NotificationService { + return &NotificationService{repoManager} +} + +func (ns *NotificationService) GetTxChannel( + ctx context.Context, +) (chan domain.TransactionEvent, error) { + return ns.repoManager.TransactionRepository().GetEventChannel(), nil +} + +func (ns *NotificationService) GetUtxoChannel( + ctx context.Context, +) (chan domain.UtxoEvent, error) { + return ns.repoManager.UtxoRepository().GetEventChannel(), nil +} diff --git a/internal/core/application/notification_service_test.go b/internal/core/application/notification_service_test.go new file mode 100644 index 0000000..d96392d --- /dev/null +++ b/internal/core/application/notification_service_test.go @@ -0,0 +1,144 @@ +package application_test + +import ( + "encoding/hex" + "testing" + "time" + + "github.com/stretchr/testify/require" + "github.com/vulpemventures/ocean/internal/core/application" + "github.com/vulpemventures/ocean/internal/core/domain" + "github.com/vulpemventures/ocean/internal/core/ports" + dbbadger "github.com/vulpemventures/ocean/internal/infrastructure/storage/db/badger" +) + +var ( + testAddresses = []string{ + "el1qqfttsemg4sapwrfmmccyztj4wa8gpn5yfetkda4z5uy5e2jysgrszmj0xa8tzftde78kvtl26dtxw6q6gcuawte5xeyvkunws", + "el1qqfdqyz747wqdtwvf39243a54dkmktexvk6j4ra4h8jkjsp325k54ec35duzlafwpch0h3pp8qt6yhruuwqs9sxf8ukvvuzcxj", + "el1qqtlphq32x4zpknyfd3hc64cvxymes8stjr7ecxhqjgaxtp9xu9xy0j5d7su2jlasfzv3kg4gnwkyysyk2qy6wumht9qk05r5e", + } +) + +func TestNotificationService(t *testing.T) { + testGetUtxoChannel(t) + + testGetTxChannel(t) +} + +func testGetUtxoChannel(t *testing.T) { + repoManager, err := newRepoManagerForNotificationService() + require.NoError(t, err) + require.NotNil(t, repoManager) + + svc := application.NewNotificationService(repoManager) + + chEvents, err := svc.GetUtxoChannel(ctx) + require.NoError(t, err) + require.NotNil(t, chEvents) + + go listenToUtxoEvents(t, chEvents) + + utxos := randomUtxos(accountName, testAddresses) + repoManager.UtxoRepository().AddUtxos(ctx, utxos) + + time.Sleep(time.Second) + + keys := application.Utxos(utxos).Keys() + repoManager.UtxoRepository().LockUtxos(ctx, keys, time.Now().Unix()) + + time.Sleep(time.Second) + + repoManager.UtxoRepository().UnlockUtxos(ctx, keys) + + time.Sleep(time.Second) + + status := domain.UtxoStatus{hex.EncodeToString(make([]byte, 32)), 1, 0, ""} + repoManager.UtxoRepository().SpendUtxos(ctx, keys, status) + + time.Sleep(time.Second) + + repoManager.UtxoRepository().DeleteUtxosForAccount(ctx, accountName) +} + +func testGetTxChannel(t *testing.T) { + repoManager, err := newRepoManagerForNotificationService() + require.NoError(t, err) + require.NotNil(t, repoManager) + + svc := application.NewNotificationService(repoManager) + + chEvents, err := svc.GetTxChannel(ctx) + require.NoError(t, err) + require.NotNil(t, chEvents) + + go listenToTxEvents(t, chEvents) + + txid := randomHex(32) + tx := randomTx(txid, accountName) + tx.BlockHash = "" + tx.BlockHeight = 0 + repoManager.TransactionRepository().AddTransaction(ctx, tx) + + time.Sleep(time.Second) + + blockHash := randomHex(32) + blockHeight := uint64(randomIntInRange(1, 300)) + repoManager.TransactionRepository().ConfirmTransaction( + ctx, txid, blockHash, blockHeight, + ) + + repoManager.TransactionRepository().UpdateTransaction( + ctx, txid, func(t *domain.Transaction) (*domain.Transaction, error) { + t.AddAccount("test2") + return t, nil + }, + ) +} + +func listenToUtxoEvents(t *testing.T, chEvents chan domain.UtxoEvent) { + for event := range chEvents { + time.Sleep(time.Millisecond) + t.Logf("received event: %+v\n", event) + } +} + +func listenToTxEvents(t *testing.T, chEvents chan domain.TransactionEvent) { + for event := range chEvents { + time.Sleep(time.Millisecond) + t.Logf( + "received event: {EventType: %s, Transaction: {TxID: %s, Accounts: %v, Confirmed: %t}}\n", + event.EventType, event.Transaction.TxID, event.Transaction.GetAccounts(), event.Transaction.IsConfirmed(), + ) + } +} + +func newRepoManagerForNotificationService() (ports.RepoManager, error) { + rm, err := dbbadger.NewRepoManager("", nil) + if err != nil { + return nil, err + } + + wallet, err := domain.NewWallet( + mnemonic, password, rootPath, regtest.Name, birthdayBlockHeight, nil, + ) + if err != nil { + return nil, err + } + + if err := rm.WalletRepository().CreateWallet(ctx, wallet); err != nil { + return nil, err + } + + if err := rm.WalletRepository().UpdateWallet( + ctx, func(w *domain.Wallet) (*domain.Wallet, error) { + w.Unlock(password) + w.CreateAccount(accountName, 0) + return w, nil + }, + ); err != nil { + return nil, err + } + + return rm, nil +} diff --git a/internal/core/application/transaction_service.go b/internal/core/application/transaction_service.go new file mode 100644 index 0000000..e4b07b1 --- /dev/null +++ b/internal/core/application/transaction_service.go @@ -0,0 +1,883 @@ +package application + +import ( + "context" + "encoding/hex" + "fmt" + "math" + "time" + + "github.com/btcsuite/btcd/txscript" + log "github.com/sirupsen/logrus" + "github.com/vulpemventures/go-elements/elementsutil" + "github.com/vulpemventures/go-elements/network" + "github.com/vulpemventures/go-elements/psetv2" + "github.com/vulpemventures/go-elements/transaction" + "github.com/vulpemventures/ocean/internal/core/domain" + "github.com/vulpemventures/ocean/internal/core/ports" + wallet "github.com/vulpemventures/ocean/pkg/single-key-wallet" +) + +var ( + ErrForbiddenUnlockedInputs = fmt.Errorf( + "the utxos used within 'external' transactions must be coming from a " + + "wallet's coin selection so that they can be temporary locked and " + + "prevent to accidentally double spending them", + ) +) + +// TransactionService is responsible for operations related to one or more +// accounts: +// * Get info about a wallet-related transaction. +// * Select a subset of the utxos of an existing account to cover a target amount. The selected utxos will be temporary locked to prevent double spending them. +// * Estimate the fee amount for a transation composed by X inputs and Y outputs. It is required that the inputs owned by the wallet are locked utxos. +// * Sign a raw transaction (in hex format). It is required that the inputs of the tx owned by the wallet are locked utxos. +// * Broadcast a raw transaction (in hex format). It is required that the inputs of the tx owned by the wallet are locked utxos. +// * Create a partial transaction (v2) given a list of inputs and outputs. It is required that the inputs of the tx owned by the wallet are locked utxos. +// * Add inputs or outputs to partial transaction (v2). It is required that the inputs of the tx owned by the wallet are locked utxos. +// * Blind a partial transaction (v2) either as non-last or last blinder. It is required that the inputs of the tx owned by the wallet are locked utxos. +// * Sign a partial transaction (v2). It is required that the inputs of the tx owned by the wallet are locked utxos. +// * Craft a finalized transaction to transfer some funds from an existing account to somewhere else, given a list of outputs. +// +// The service registers 1 handler for the following utxo event: +// * domain.UtxoLocked - whenever one or more utxos are locked, the service spawns a so-called unlocker, a goroutine wating for X seconds before unlocking them if necessary. The operation is just skipped if the utxos have been spent meanwhile. +// +// The service guarantees that any locked utxo is eventually unlocked ASAP +// after the waiting time expires. +// Therefore, at startup, it makes sure to unlock any still-locked utxo that +// can be unlocked, and to spawn the required numnber of unlockers for those +// whose waiting time didn't expire yet. +type TransactionService struct { + repoManager ports.RepoManager + bcScanner ports.BlockchainScanner + network *network.Network + rootPath string + utxoExpiryDuration time.Duration + + log func(format string, a ...interface{}) +} + +func NewTransactionService( + repoManager ports.RepoManager, bcScanner ports.BlockchainScanner, + net *network.Network, rootPath string, utxoExpiryDuration time.Duration, +) *TransactionService { + logFn := func(format string, a ...interface{}) { + format = fmt.Sprintf("transaction service: %s", format) + log.Debugf(format, a...) + } + svc := &TransactionService{ + repoManager, bcScanner, net, rootPath, utxoExpiryDuration, logFn, + } + svc.registerHandlerForUtxoEvents() + + ctx := context.Background() + w, _ := repoManager.WalletRepository().GetWallet(ctx) + if w == nil { + return svc + } + + for accountName := range w.AccountKeysByName { + utxos, _ := repoManager.UtxoRepository().GetLockedUtxosForAccount( + ctx, accountName, + ) + if len(utxos) > 0 { + utxosToUnlock := make([]domain.UtxoKey, 0, len(utxos)) + utxosToSpawnUnlocker := make([]domain.UtxoKey, 0, len(utxos)) + for _, u := range utxos { + if u.CanUnlock() { + utxosToUnlock = append(utxosToUnlock, u.Key()) + } else { + utxosToSpawnUnlocker = append(utxosToSpawnUnlocker, u.Key()) + } + } + + if len(utxosToUnlock) > 0 { + count, _ := repoManager.UtxoRepository().UnlockUtxos(ctx, utxosToUnlock) + svc.log( + "unlocked %d utxo(s) for account %s (%s)", + count, accountName, UtxoKeys(utxosToUnlock), + ) + } + if len(utxosToSpawnUnlocker) > 0 { + svc.spawnUtxoUnlocker(utxosToSpawnUnlocker) + } + } + } + + return svc +} + +func (ts *TransactionService) GetTransactionInfo( + ctx context.Context, txid string, +) (*TransactionInfo, error) { + tx, err := ts.repoManager.TransactionRepository().GetTransaction(ctx, txid) + if err != nil { + return nil, err + } + return (*TransactionInfo)(tx), nil +} + +func (ts *TransactionService) SelectUtxos( + ctx context.Context, accountName, targetAsset string, targetAmount uint64, + coinSelectionStrategy int, +) (Utxos, uint64, int64, error) { + if _, err := ts.getAccount(ctx, accountName); err != nil { + return nil, 0, -1, err + } + + utxos, err := ts.repoManager.UtxoRepository().GetSpendableUtxosForAccount( + ctx, accountName, + ) + if err != nil { + return nil, 0, -1, err + } + + coinSelector := DefaultCoinSelector + if factory, ok := coinSelectorByType[coinSelectionStrategy]; ok { + coinSelector = factory() + } + + utxos, change, err := coinSelector.SelectUtxos(utxos, targetAmount, targetAsset) + if err != nil { + return nil, 0, -1, err + } + now := time.Now().Unix() + keys := Utxos(utxos).Keys() + count, err := ts.repoManager.UtxoRepository().LockUtxos( + ctx, keys, now, + ) + if err != nil { + return nil, 0, -1, err + } + if count > 0 { + ts.log( + "locked %d utxo(s) for account %s (%s)", + count, accountName, UtxoKeys(keys), + ) + } + + expirationDate := time.Now().Add(ts.utxoExpiryDuration).Unix() + return utxos, change, expirationDate, nil +} + +func (ts *TransactionService) EstimateFees( + ctx context.Context, ins Inputs, outs Outputs, millisatsPerByte uint64, +) (uint64, error) { + if _, err := ts.getWallet(ctx); err != nil { + return 0, err + } + + walletInputs, err := ts.getLockedInputs(ctx, ins) + if err != nil { + return 0, err + } + externalInputs, err := ts.getExternalInputs(walletInputs, ins) + if err != nil { + return 0, err + } + + if millisatsPerByte == 0 { + millisatsPerByte = MinMillisatsPerByte + } + + inputs := append(walletInputs, externalInputs...) + return wallet.EstimateFees( + inputs, outs.toWalletOutputs(), millisatsPerByte, + ), nil +} + +func (ts *TransactionService) SignTransaction( + ctx context.Context, txHex string, sighashType uint32, +) (string, error) { + w, err := ts.getWallet(ctx) + if err != nil { + return "", err + } + + inputs, err := ts.findLockedInputs(ctx, txHex) + if err != nil { + return "", err + } + + return w.SignTransaction(wallet.SignTransactionArgs{ + TxHex: txHex, + InputsToSign: inputs, + SigHashType: txscript.SigHashType(sighashType), + }) +} + +func (ts *TransactionService) BroadcastTransaction( + ctx context.Context, txHex string, +) (string, error) { + keys := utxoKeysFromRawTx(txHex) + utxos, err := ts.repoManager.UtxoRepository().GetUtxosByKey(ctx, keys) + if err != nil { + return "", err + } + if len(utxos) > 0 { + for _, u := range utxos { + if !u.IsLocked() { + return "", fmt.Errorf( + "cannot broadcast transaction containing unlocked utxos", + ) + } + } + } + + return ts.bcScanner.BroadcastTransaction(txHex) +} + +func (ts *TransactionService) CreatePset( + ctx context.Context, inputs Inputs, outputs Outputs, +) (string, error) { + w, err := ts.getWallet(ctx) + if err != nil { + return "", err + } + + walletInputs, err := ts.getLockedInputs(ctx, inputs) + if err != nil { + return "", err + } + + return w.CreatePset(wallet.CreatePsetArgs{ + Inputs: walletInputs, + Outputs: outputs.toWalletOutputs(), + }) +} + +func (ts *TransactionService) UpdatePset( + ctx context.Context, ptx string, inputs Inputs, outputs Outputs, +) (string, error) { + w, err := ts.getWallet(ctx) + if err != nil { + return "", err + } + + walletInputs, err := ts.getLockedInputs(ctx, inputs) + if err != nil { + return "", err + } + + return w.UpdatePset(wallet.UpdatePsetArgs{ + PsetBase64: ptx, + Inputs: walletInputs, + Outputs: outputs.toWalletOutputs(), + }) +} + +func (ts *TransactionService) BlindPset( + ctx context.Context, ptx string, extraBlindingKeys map[string][]byte, + lastBlinder bool, +) (string, error) { + w, err := ts.getWallet(ctx) + if err != nil { + return "", err + } + + walletInputs, err := ts.findLockedInputs(ctx, ptx) + if err != nil { + return "", err + } + + return w.BlindPsetWithOwnedInputs( + wallet.BlindPsetWithOwnedInputsArgs{ + PsetBase64: ptx, + OwnedInputsByIndex: walletInputs, + ExtraBlindingKeys: extraBlindingKeys, + LastBlinder: lastBlinder, + }, + ) +} + +func (ts *TransactionService) SignPset( + ctx context.Context, ptx string, sighashType uint32, +) (string, error) { + w, err := ts.getWallet(ctx) + if err != nil { + return "", err + } + + walletInputs, err := ts.findLockedInputs(ctx, ptx) + if err != nil { + return "", err + } + derivationPaths := make(map[string]string) + for _, in := range walletInputs { + script := hex.EncodeToString(in.Script) + derivationPaths[script] = in.DerivationPath + } + + return w.SignPset(wallet.SignPsetArgs{ + PsetBase64: ptx, + DerivationPathMap: derivationPaths, + SigHashType: txscript.SigHashType(sighashType), + }) +} + +func (ts *TransactionService) Transfer( + ctx context.Context, accountName string, outputs Outputs, + millisatsPerByte uint64, +) (string, error) { + w, err := ts.getWallet(ctx) + if err != nil { + return "", err + } + account, err := ts.getAccount(ctx, accountName) + if err != nil { + return "", err + } + + utxoRepo := ts.repoManager.UtxoRepository() + walletRepo := ts.repoManager.WalletRepository() + + utxos, err := utxoRepo.GetSpendableUtxosForAccount( + ctx, accountName, + ) + if err != nil { + return "", err + } + if len(utxos) == 0 { + return "", fmt.Errorf("no utxos found for account %s", accountName) + } + + changeByAsset := make(map[string]uint64) + selectedUtxos := make([]*domain.Utxo, 0) + for targetAsset, targetAmount := range outputs.totalAmountByAsset() { + utxos, change, err := DefaultCoinSelector.SelectUtxos(utxos, targetAmount, targetAsset) + if err != nil { + return "", err + } + changeByAsset[targetAsset] = change + selectedUtxos = append(selectedUtxos, utxos...) + } + + inputs := make([]wallet.Input, 0, len(utxos)) + inputsByIndex := make(map[uint32]wallet.Input) + for i, u := range selectedUtxos { + input := wallet.Input{ + TxID: u.TxID, + TxIndex: u.VOut, + Value: u.Value, + Asset: u.Asset, + Script: u.Script, + ValueBlinder: u.ValueBlinder, + AssetBlinder: u.AssetBlinder, + ValueCommitment: u.ValueCommitment, + AssetCommitment: u.AssetCommitment, + Nonce: u.Nonce, + } + inputs = append(inputs, input) + inputsByIndex[uint32(i)] = input + } + + changeOutputs := make([]wallet.Output, 0) + if len(changeByAsset) > 0 { + addressesInfo, err := walletRepo.DeriveNextInternalAddressesForAccount( + ctx, accountName, uint64(len(changeByAsset)), + ) + if err != nil { + return "", err + } + + i := 0 + for asset, amount := range changeByAsset { + changeOutputs = append(changeOutputs, wallet.Output{ + Asset: asset, + Amount: amount, + Address: addressesInfo[i].Address, + }) + i++ + } + } + + outs := outputs.toWalletOutputs() + feeAmount := wallet.EstimateFees( + inputs, append(outs, changeOutputs...), millisatsPerByte, + ) + + // If feeAmount is lower than the lbtc change, it's enough to deduct it + // from the change amount. + if feeAmount < changeByAsset[ts.network.AssetID] { + for i, out := range changeOutputs { + if out.Asset == ts.network.AssetID { + changeOutputs[i].Amount -= feeAmount + break + } + } + } + // If feeAmount is exactly the lbtc change, it's enough to remove the + // change output. + if feeAmount == changeByAsset[ts.network.AssetID] { + var outIndex int + for i, out := range changeOutputs { + if out.Asset == ts.network.AssetID { + outIndex = i + break + } + } + changeOutputs = append( + changeOutputs[:outIndex], changeOutputs[outIndex+1:]..., + ) + } + // If feeAmount is greater than the lbtc change, another coin-selection round + // is required. + if feeAmount > changeByAsset[ts.network.AssetID] { + targetAsset := ts.network.AssetID + targetAmount := wallet.DummyFeeAmount + if feeAmount > targetAmount { + targetAmount = roundUpAmount(feeAmount) + } + + // Coin-selection must be done over remaining utxos. + remainingUtxos := getRemainingUtxos(utxos, selectedUtxos) + selectedUtxos, change, err := DefaultCoinSelector.SelectUtxos( + remainingUtxos, targetAmount, targetAsset, + ) + if err != nil { + return "", err + } + + for _, u := range selectedUtxos { + input := wallet.Input{ + TxID: u.TxID, + TxIndex: u.VOut, + Value: u.Value, + Asset: u.Asset, + Script: u.Script, + ValueBlinder: u.ValueBlinder, + AssetBlinder: u.AssetBlinder, + ValueCommitment: u.ValueCommitment, + AssetCommitment: u.AssetCommitment, + Nonce: u.Nonce, + } + inputs = append(inputs, input) + inputsByIndex[uint32(len(inputs))] = input + } + + if change > 0 { + // For the eventual change amount, it might be necessary to add a lbtc + // change output to the list if it's still not in the list. + if _, ok := changeByAsset[targetAsset]; !ok { + addrInfo, err := walletRepo.DeriveNextInternalAddressesForAccount( + ctx, accountName, 1, + ) + if err != nil { + return "", err + } + changeOutputs = append(changeOutputs, wallet.Output{ + Amount: change, + Asset: targetAsset, + Address: addrInfo[0].Address, + }) + } + + // Now that we have all inputs and outputs, estimate the real fee amount. + feeAmount = wallet.EstimateFees( + inputs, append(outs, changeOutputs...), millisatsPerByte, + ) + + // Update the change amount by adding the delta + // delta = targetAmount - feeAmount. + for i, out := range changeOutputs { + if out.Asset == targetAsset { + // This way the delta is subtracted in case it's negative. + changeOutputs[i].Amount = uint64(int(out.Amount) + int(targetAmount) - int(feeAmount)) + break + } + } + } + } + + outs = append(outs, changeOutputs...) + outs = append(outs, wallet.Output{ + Asset: ts.network.AssetID, + Amount: feeAmount, + }) + + ptx, err := w.CreatePset(wallet.CreatePsetArgs{ + Inputs: inputs, + Outputs: outs, + }) + if err != nil { + return "", err + } + + blindedPtx, err := w.BlindPsetWithOwnedInputs( + wallet.BlindPsetWithOwnedInputsArgs{ + PsetBase64: ptx, + OwnedInputsByIndex: inputsByIndex, + LastBlinder: true, + }, + ) + if err != nil { + return "", err + } + + signedPtx, err := w.SignPset(wallet.SignPsetArgs{ + PsetBase64: blindedPtx, + DerivationPathMap: account.DerivationPathByScript, + }) + if err != nil { + return "", err + } + + txHex, _, err := wallet.FinalizeAndExtractTransaction(wallet.FinalizeAndExtractTransactionArgs{ + PsetBase64: signedPtx, + }) + if err != nil { + return "", err + } + + keys := Utxos(selectedUtxos).Keys() + now := time.Now().Unix() + count, err := ts.repoManager.UtxoRepository().LockUtxos(ctx, keys, now) + if err != nil { + return "", err + } + if count > 0 { + ts.log( + "locked %d utxo(s) for account %s (%s) ", + count, accountName, UtxoKeys(keys), + ) + } + + return txHex, nil +} + +func (ts *TransactionService) registerHandlerForUtxoEvents() { + ts.repoManager.RegisterHandlerForUtxoEvent( + domain.UtxoLocked, func(event domain.UtxoEvent) { + keys := UtxosInfo(event.Utxos).Keys() + ts.spawnUtxoUnlocker(keys) + }, + ) +} + +// spawnUtxoUnlocker groups the locked utxos identified by the given keys by their +// locking timestamps, and then creates a goroutine for each group in order to unlock +// the utxos if they are still locked when their expiration time comes. +func (ts *TransactionService) spawnUtxoUnlocker(utxoKeys []domain.UtxoKey) { + ctx := context.Background() + utxos, _ := ts.repoManager.UtxoRepository().GetUtxosByKey(ctx, utxoKeys) + + utxosByLockTimestamp := make(map[int64][]domain.UtxoKey) + for _, u := range utxos { + utxosByLockTimestamp[u.LockTimestamp] = append( + utxosByLockTimestamp[u.LockTimestamp], u.Key(), + ) + } + + for timestamp := range utxosByLockTimestamp { + keys := utxosByLockTimestamp[timestamp] + unlockTime := ts.utxoExpiryDuration - time.Since(time.Unix(timestamp, 0)) + t := time.NewTicker(unlockTime) + go func() { + ts.log("spawning unlocker for utxo(s) %s", UtxoKeys(keys)) + ts.log(fmt.Sprintf( + "utxo(s) will be eventually unlocked in ~%.0f seconds", + math.Round(unlockTime.Seconds()/10)*10, + )) + + for range t.C { + utxos, _ := ts.repoManager.UtxoRepository().GetUtxosByKey(ctx, keys) + utxosToUnlock := make([]domain.UtxoKey, 0, len(utxos)) + spentUtxos := make([]domain.UtxoKey, 0, len(utxos)) + for _, u := range utxos { + if !u.IsSpent() && u.IsLocked() { + utxosToUnlock = append(utxosToUnlock, u.Key()) + } else { + spentUtxos = append(spentUtxos, u.Key()) + } + } + + if len(utxosToUnlock) > 0 { + // In case of errors here, the ticker is possibly reset to a shortest + // duration to keep retring to unlock the locked utxos as soon as + // possible. + count, err := ts.repoManager.UtxoRepository().UnlockUtxos( + ctx, utxosToUnlock, + ) + if err != nil { + shortDuration := 5 * time.Second + if shortDuration < unlockTime { + t.Reset(shortDuration) + } + continue + } + + if count > 0 { + ts.log("unlocked %d utxo(s) %s", count, UtxoKeys(keys)) + } + t.Stop() + } + if len(spentUtxos) > 0 { + ts.log( + "utxo(s) %s have been spent, skipping unlocking", + UtxoKeys(spentUtxos), + ) + } + } + }() + } +} + +func (ts *TransactionService) getWallet( + ctx context.Context, +) (*wallet.Wallet, error) { + w, err := ts.repoManager.WalletRepository().GetWallet(ctx) + if err != nil { + return nil, err + } + mnemonic, err := w.GetMnemonic() + if err != nil { + return nil, err + } + + return wallet.NewWalletFromMnemonic(wallet.NewWalletFromMnemonicArgs{ + RootPath: ts.rootPath, + Mnemonic: mnemonic, + }) +} + +func (ts *TransactionService) getAccount( + ctx context.Context, accountName string, +) (*domain.Account, error) { + w, err := ts.repoManager.WalletRepository().GetWallet(ctx) + if err != nil { + return nil, err + } + return w.GetAccount(accountName) +} + +func (ts *TransactionService) getLockedInputs( + ctx context.Context, ins Inputs, +) ([]wallet.Input, error) { + keys := make([]domain.UtxoKey, 0, len(ins)) + for _, in := range ins { + keys = append(keys, domain.UtxoKey(in)) + } + utxos, err := ts.repoManager.UtxoRepository().GetUtxosByKey(ctx, keys) + if err != nil { + return nil, err + } + if len(utxos) == 0 { + return nil, fmt.Errorf("no utxos found with given keys") + } + + w, _ := ts.repoManager.WalletRepository().GetWallet(ctx) + inputs := make([]wallet.Input, 0, len(utxos)) + for _, u := range utxos { + if !u.IsLocked() { + return nil, ErrForbiddenUnlockedInputs + } + + account, _ := w.GetAccount(u.AccountName) + script := hex.EncodeToString(u.Script) + derivationPath := account.DerivationPathByScript[script] + + inputs = append(inputs, wallet.Input{ + TxID: u.TxID, + TxIndex: u.VOut, + Value: u.Value, + Asset: u.Asset, + Script: u.Script, + ValueBlinder: u.ValueBlinder, + AssetBlinder: u.AssetBlinder, + ValueCommitment: u.ValueCommitment, + AssetCommitment: u.AssetCommitment, + Nonce: u.Nonce, + RangeProof: u.RangeProof, + SurjectionProof: u.SurjectionProof, + DerivationPath: derivationPath, + }) + } + + return inputs, nil +} + +func (ts *TransactionService) findLockedInputs( + ctx context.Context, tx string, +) (map[uint32]wallet.Input, error) { + rawTx, _ := transaction.NewTxFromHex(tx) + var keys = make([]domain.UtxoKey, 0) + if rawTx != nil { + keys = utxoKeysFromRawTx(tx) + } else { + keys = utxoKeysFromPartialTx(tx) + } + + utxos, err := ts.repoManager.UtxoRepository().GetUtxosByKey(ctx, keys) + if err != nil { + return nil, err + } + if len(utxos) == 0 { + return nil, fmt.Errorf("no wallet utxos found in given transaction") + } + + w, _ := ts.repoManager.WalletRepository().GetWallet(ctx) + + inputs := make(map[uint32]wallet.Input) + for _, u := range utxos { + if !u.IsLocked() { + return nil, fmt.Errorf( + "cannot use unlocked utxos. The utxos used within 'external' " + + "transactions must be coming from a coin selection so that they " + + "can be locked to prevent double spending them", + ) + + } + account, _ := w.GetAccount(u.AccountName) + script := hex.EncodeToString(u.Script) + inIndex := findUtxoIndexInTx(tx, u) + inputs[inIndex] = wallet.Input{ + TxID: u.TxID, + TxIndex: u.VOut, + Value: u.Value, + Asset: u.Asset, + Script: u.Script, + ValueBlinder: u.ValueBlinder, + AssetBlinder: u.AssetBlinder, + ValueCommitment: u.ValueCommitment, + AssetCommitment: u.AssetCommitment, + Nonce: u.Nonce, + DerivationPath: account.DerivationPathByScript[script], + } + } + return inputs, nil +} + +func (ts *TransactionService) getExternalInputs( + walletIns []wallet.Input, allIns Inputs, +) ([]wallet.Input, error) { + externalInputKeys := make([]domain.UtxoKey, 0) + for _, key := range allIns { + isExternalInput := true + for _, in := range walletIns { + if in.TxID == key.TxID && in.TxIndex == key.VOut { + isExternalInput = false + break + } + if !isExternalInput { + continue + } + externalInputKeys = append(externalInputKeys, domain.UtxoKey(key)) + } + } + + if len(externalInputKeys) == 0 { + return nil, nil + } + + utxos, err := ts.bcScanner.GetUtxos(externalInputKeys) + if err != nil { + return nil, err + } + + externalInputs := make([]wallet.Input, 0, len(utxos)) + for _, u := range utxos { + externalInputs = append(externalInputs, wallet.Input{ + TxID: u.TxID, + TxIndex: u.VOut, + Value: u.Value, + Asset: u.Asset, + ValueCommitment: u.ValueCommitment, + AssetCommitment: u.AssetCommitment, + Script: u.Script, + }) + } + return externalInputs, nil +} + +func utxoKeysFromRawTx(txHex string) []domain.UtxoKey { + tx, _ := transaction.NewTxFromHex(txHex) + keys := make([]domain.UtxoKey, 0, len(tx.Inputs)) + for _, in := range tx.Inputs { + keys = append(keys, domain.UtxoKey{ + TxID: elementsutil.TxIDFromBytes(in.Hash), + VOut: in.Index, + }) + } + return keys +} + +func utxoKeysFromPartialTx(psetBase64 string) []domain.UtxoKey { + tx, _ := psetv2.NewPsetFromBase64(psetBase64) + keys := make([]domain.UtxoKey, 0, len(tx.Inputs)) + for _, in := range tx.Inputs { + keys = append(keys, domain.UtxoKey{ + TxID: elementsutil.TxIDFromBytes(in.PreviousTxid), + VOut: in.PreviousTxIndex, + }) + } + return keys +} + +func findUtxoIndexInTx(tx string, utxo *domain.Utxo) uint32 { + rawTx, _ := transaction.NewTxFromHex(tx) + if rawTx != nil { + return findUtxoIndexInRawTx(tx, utxo) + } + + return findUtxoIndexInPartialTx(tx, utxo) +} + +func findUtxoIndexInRawTx(txHex string, utxo *domain.Utxo) uint32 { + tx, _ := transaction.NewTxFromHex(txHex) + + for i, in := range tx.Inputs { + key := domain.UtxoKey{ + TxID: elementsutil.TxIDFromBytes(in.Hash), + VOut: in.Index, + } + if utxo.Key() == key { + return uint32(i) + } + } + return uint32(len(tx.Inputs) - 1) +} + +func findUtxoIndexInPartialTx(psetBase64 string, utxo *domain.Utxo) uint32 { + tx, _ := psetv2.NewPsetFromBase64(psetBase64) + + for i, in := range tx.Inputs { + key := domain.UtxoKey{ + TxID: elementsutil.TxIDFromBytes(in.PreviousTxid), + VOut: in.PreviousTxIndex, + } + if utxo.Key() == key { + return uint32(i) + } + } + return uint32(len(tx.Inputs) - 1) +} + +func roundUpAmount(amount uint64) uint64 { + roundedAmount := float64(amount) + orderOfMagnitude := 0 + for roundedAmount > 10 { + roundedAmount /= 10 + orderOfMagnitude++ + } + roundedAmount = math.Ceil(roundedAmount) + roundedAmount *= math.Pow10(orderOfMagnitude) + return uint64(roundedAmount) +} + +func getRemainingUtxos(utxos, selectedUtxos []*domain.Utxo) []*domain.Utxo { + remainingUtxos := make([]*domain.Utxo, 0) + for _, u := range utxos { + isSelected := false + for _, su := range selectedUtxos { + if u.Key() == su.Key() { + isSelected = true + break + } + } + if isSelected { + continue + } + remainingUtxos = append(remainingUtxos, u) + } + return remainingUtxos +} diff --git a/internal/core/application/transaction_service_test.go b/internal/core/application/transaction_service_test.go new file mode 100644 index 0000000..05ea05f --- /dev/null +++ b/internal/core/application/transaction_service_test.go @@ -0,0 +1,173 @@ +package application_test + +import ( + "testing" + "time" + + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + "github.com/vulpemventures/ocean/internal/core/application" + "github.com/vulpemventures/ocean/internal/core/domain" + "github.com/vulpemventures/ocean/internal/core/ports" + dbbadger "github.com/vulpemventures/ocean/internal/infrastructure/storage/db/badger" + wallet "github.com/vulpemventures/ocean/pkg/single-key-wallet" +) + +var ( + coinSelectionStrategy = application.CoinSelectionStrategySmallestSubset + receiverAddress = "el1qqd926hzqpdeh33jkd2acujjvxwuyfnxpcnve7ts5rvv8w57wku53n8zumkc5ya9jejmejs92xu6gac38kup6u6yta3u4njavl" + outputs = []application.Output{ + {Asset: regtest.AssetID, Amount: 1000000, Address: receiverAddress}, + } + utxoExpiryDuration = 2 * time.Minute +) + +func TestTransactionService(t *testing.T) { + testInternalTransaction(t) + + testExternalTransaction(t) +} + +func testExternalTransaction(t *testing.T) { + t.Run("craft_transaction_externally", func(t *testing.T) { + mockedBcScanner := newMockedBcScanner() + mockedBcScanner.On("BroadcastTransaction", mock.Anything).Return(randomHex(32), nil) + mockedBcScanner.On("GetUtxos", mock.Anything).Return(nil, nil) + repoManager, err := newRepoManagerForTxService() + require.NoError(t, err) + require.NotNil(t, repoManager) + + svc := application.NewTransactionService( + repoManager, mockedBcScanner, regtest, rootPath, utxoExpiryDuration, + ) + + selectedUtxos, change, expirationDate, err := svc.SelectUtxos( + ctx, accountName, regtest.AssetID, 1000000, coinSelectionStrategy, + ) + require.NoError(t, err) + require.NotEmpty(t, selectedUtxos) + require.NotEmpty(t, expirationDate) + + inputs := make(application.Inputs, 0, len(selectedUtxos)) + for _, u := range selectedUtxos { + inputs = append(inputs, application.Input(u.Key())) + } + + if change > 0 { + addrInfo, err := repoManager.WalletRepository(). + DeriveNextInternalAddressesForAccount(ctx, accountName, 1) + require.NoError(t, err) + require.Len(t, addrInfo, 1) + + outputs = append(outputs, application.Output{ + Asset: regtest.AssetID, + Amount: change, + Address: addrInfo[0].Address, + }) + } + + feeAmount, err := svc.EstimateFees(ctx, inputs, outputs, 0) + require.NoError(t, err) + require.NotZero(t, feeAmount) + + // This is just for sake of simplicity. + // In real scenarios, there are 3 different situations: + // 1. feeAmount < changeAmount -> deduct fee amount from change (like done here) + // 2. feeAmount = changeAmount -> remove change output + // 3. feeAmount > changeAmount -> another round of coin-selection is required + // Take a look at how the app service handles these scenarios into "internal" + // transactions like Transfer(). + outputs[len(outputs)-1].Amount -= feeAmount + outputs = append(outputs, application.Output{ + Asset: regtest.AssetID, + Amount: feeAmount, + }) + + newPset, err := svc.CreatePset(ctx, inputs, outputs) + require.NoError(t, err) + require.NotEmpty(t, newPset) + + blindedPset, err := svc.BlindPset(ctx, newPset, nil, true) + require.NoError(t, err) + require.NotEmpty(t, blindedPset) + + signedPset, err := svc.SignPset(ctx, blindedPset, 0) + require.NoError(t, err) + + txHex, _, err := wallet.FinalizeAndExtractTransaction(wallet.FinalizeAndExtractTransactionArgs{ + PsetBase64: signedPset, + }) + require.NoError(t, err) + require.NotEmpty(t, txHex) + + txid, err := svc.BroadcastTransaction(ctx, txHex) + require.NoError(t, err) + require.NotEmpty(t, txid) + }) +} + +func testInternalTransaction(t *testing.T) { + t.Run("craft_transaction_internally", func(t *testing.T) { + mockedBcScanner := newMockedBcScanner() + mockedBcScanner.On("BroadcastTransaction", mock.Anything).Return(randomHex(32), nil) + repoManager, err := newRepoManagerForTxService() + require.NoError(t, err) + require.NotNil(t, repoManager) + + svc := application.NewTransactionService( + repoManager, mockedBcScanner, regtest, rootPath, utxoExpiryDuration, + ) + + txid, err := svc.Transfer(ctx, accountName, outputs, 0) + require.NoError(t, err) + require.NotEmpty(t, txid) + }) +} + +func newRepoManagerForTxService() (ports.RepoManager, error) { + rm, err := dbbadger.NewRepoManager("", nil) + if err != nil { + return nil, err + } + + wallet, err := domain.NewWallet( + mnemonic, password, rootPath, regtest.Name, birthdayBlockHeight, nil, + ) + if err != nil { + return nil, err + } + + if err := rm.WalletRepository().CreateWallet(ctx, wallet); err != nil { + return nil, err + } + + if err := rm.WalletRepository().UpdateWallet( + ctx, func(w *domain.Wallet) (*domain.Wallet, error) { + w.Unlock(password) + w.CreateAccount(accountName, 0) + return w, nil + }, + ); err != nil { + return nil, err + } + + addrInfo, err := rm.WalletRepository().DeriveNextExternalAddressesForAccount(ctx, accountName, 2) + if err != nil { + return nil, err + } + + addresses := application.AddressesInfo(addrInfo).Addresses() + utxos := make([]*domain.Utxo, 0, len(addresses)) + for _, addr := range addresses { + utxo := randomUtxo(accountName, addr) + utxo.Value = 100000000 + utxo.Asset = regtest.AssetID + utxos = append(utxos, utxo) + } + + if _, err := rm.UtxoRepository().AddUtxos(ctx, utxos); err != nil { + return nil, err + } + + return rm, nil +} diff --git a/internal/core/application/types.go b/internal/core/application/types.go new file mode 100644 index 0000000..eb92af4 --- /dev/null +++ b/internal/core/application/types.go @@ -0,0 +1,181 @@ +package application + +import ( + "encoding/hex" + "fmt" + "strings" + + "github.com/vulpemventures/go-elements/address" + "github.com/vulpemventures/ocean/internal/core/domain" + "github.com/vulpemventures/ocean/internal/core/ports" + ss_selector "github.com/vulpemventures/ocean/internal/infrastructure/coin-selector/smallest-subset" + wallet "github.com/vulpemventures/ocean/pkg/single-key-wallet" +) + +const ( + CoinSelectionStrategySmallestSubset = iota +) + +var ( + coinSelectorByType = map[int]CoinSelectorFactory{ + CoinSelectionStrategySmallestSubset: ss_selector.NewSmallestSubsetCoinSelector, + } + + DefaultCoinSelector = ss_selector.NewSmallestSubsetCoinSelector() + MinMillisatsPerByte = uint64(100) +) + +type WalletStatus struct { + IsInitialized bool + IsUnlocked bool + IsSynced bool +} + +type WalletInfo struct { + Network string + NativeAsset string + RootPath string + MasterBlindingKey string + BirthdayBlockHash string + BirthdayBlockHeight uint32 + Accounts []AccountInfo + BuildInfo BuildInfo +} + +type BuildInfo struct { + Version string + Commit string + Date string +} + +type UtxoInfo struct { + Spendable Utxos + Locked Utxos +} + +type TransactionInfo domain.Transaction + +type BlockInfo struct { + Hash []byte + Height uint32 + Timestamp int64 +} + +type AccountInfo domain.AccountInfo + +type AddressesInfo []domain.AddressInfo + +func (info AddressesInfo) Addresses() []string { + addresses := make([]string, 0, len(info)) + for _, in := range info { + addresses = append(addresses, in.Address) + } + return addresses +} + +type BalanceInfo map[string]*domain.Balance + +type Utxos []*domain.Utxo + +func (u Utxos) Keys() []domain.UtxoKey { + keys := make([]domain.UtxoKey, 0, len(u)) + for _, utxo := range u { + keys = append(keys, utxo.Key()) + } + return keys +} + +func (u Utxos) Info() []domain.UtxoInfo { + info := make([]domain.UtxoInfo, 0, len(u)) + for _, utxo := range u { + info = append(info, utxo.Info()) + } + return info +} + +type UtxosInfo []domain.UtxoInfo + +func (u UtxosInfo) Keys() []domain.UtxoKey { + keys := make([]domain.UtxoKey, 0, len(u)) + for _, utxo := range u { + keys = append(keys, utxo.Key()) + } + return keys +} + +type UtxoKeys []domain.UtxoKey + +func (u UtxoKeys) String() string { + str := make([]string, 0, len(u)) + for _, key := range u { + str = append(str, key.String()) + } + return strings.Join(str, ", ") +} + +type Input domain.UtxoKey + +type Output struct { + Asset string + Amount uint64 + Address string +} + +func (o Output) Validate() error { + if err := validateAsset(o.Asset); err != nil { + return err + } + if err := validateAddress(o.Address); err != nil { + return err + } + return nil +} + +type Inputs []Input + +type Outputs []Output + +type CoinSelectorFactory func() ports.CoinSelector + +func (o Outputs) totalAmountByAsset() map[string]uint64 { + totAmount := make(map[string]uint64) + for _, out := range o { + totAmount[out.Asset] += out.Amount + } + return totAmount +} + +func (o Outputs) toWalletOutputs() []wallet.Output { + outs := make([]wallet.Output, 0, len(o)) + for _, out := range o { + outs = append(outs, wallet.Output{ + Amount: out.Amount, Asset: out.Asset, Address: out.Address, + }) + } + return outs +} + +func validateAsset(asset string) error { + if asset == "" { + return fmt.Errorf("missing asset") + } + buf, err := hex.DecodeString(asset) + if err != nil { + return fmt.Errorf("asset is not in hex format") + } + if len(buf) != 32 { + return fmt.Errorf("invalid asset length") + } + return nil +} + +func validateAddress(addr string) error { + if addr == "" { + return nil + } + _, err := address.ToOutputScript(addr) + if err != nil { + return err + } + return nil +} diff --git a/internal/core/application/wallet_service.go b/internal/core/application/wallet_service.go new file mode 100644 index 0000000..5845bb1 --- /dev/null +++ b/internal/core/application/wallet_service.go @@ -0,0 +1,259 @@ +package application + +import ( + "context" + "fmt" + "sync" + + "github.com/vulpemventures/go-elements/elementsutil" + "github.com/vulpemventures/go-elements/network" + "github.com/vulpemventures/ocean/internal/core/domain" + "github.com/vulpemventures/ocean/internal/core/ports" + wallet "github.com/vulpemventures/ocean/pkg/single-key-wallet" +) + +// WalletService is responsible for operations related to the managment of the +// wallet: +// * Generate a new random 24-words mnemonic. +// * Create a new wallet from scratch with given mnemonic and locked with the given password. +// * Unlock the wallet with a password. +// * Change the wallet password. It requires the wallet to be locked. +// * Get the status of the wallet (initialized, unlocked, inSync). +// * Get non-sensiive (network, native asset) and possibly sensitive info (root path, master blinding key and basic accounts' info) about the wallet. Sensitive info are returned only if the wallet is unlocked. +// +// This service doesn't register any handler for wallet events, rather it +// allows its users to register their handler to manage situations like the +// unlocking of the wallet (for example, check how the grpc service uses this +// feature). +type WalletService struct { + repoManager ports.RepoManager + bcScanner ports.BlockchainScanner + rootPath string + network *network.Network + buildInfo BuildInfo + + initialized bool + unlocked bool + synced bool + lock *sync.RWMutex +} + +func NewWalletService( + repoManager ports.RepoManager, bcScanner ports.BlockchainScanner, + rootPath string, net *network.Network, buildInfo BuildInfo, +) *WalletService { + ws := &WalletService{ + repoManager: repoManager, + bcScanner: bcScanner, + rootPath: rootPath, + network: net, + buildInfo: buildInfo, + lock: &sync.RWMutex{}, + } + w, _ := ws.repoManager.WalletRepository().GetWallet(context.Background()) + if w != nil { + ws.setInitialized() + ws.setSynced() + } + return ws +} + +func (ws *WalletService) GenSeed(ctx context.Context) ([]string, error) { + return wallet.NewMnemonic(wallet.NewMnemonicArgs{}) +} + +func (ws *WalletService) CreateWallet( + ctx context.Context, mnemonic []string, passpharse string, +) (err error) { + defer func() { + if err == nil { + ws.setInitialized() + ws.setSynced() + } + }() + + if ws.isInitialized() { + return fmt.Errorf("wallet is already initialized") + } + + _, birthdayBlockHeight, err := ws.bcScanner.GetLatestBlock() + if err != nil { + return + } + + newWallet, err := domain.NewWallet( + mnemonic, passpharse, ws.rootPath, ws.network.Name, + birthdayBlockHeight, nil, + ) + if err != nil { + return + } + newWallet.Lock() + + return ws.repoManager.WalletRepository().CreateWallet(ctx, newWallet) +} + +func (ws *WalletService) Unlock( + ctx context.Context, password string, +) (err error) { + if ws.isUnlocked() { + return nil + } + + defer func() { + if err == nil { + ws.setUnlocked() + } + }() + + return ws.repoManager.WalletRepository().UnlockWallet(ctx, password) +} + +func (ws *WalletService) Lock(ctx context.Context) (err error) { + if !ws.isUnlocked() { + return nil + } + + defer func() { + if err == nil { + ws.setLocked() + } + }() + + return ws.repoManager.WalletRepository().LockWallet(ctx) +} + +func (ws *WalletService) ChangePassword( + ctx context.Context, currentPassword, newPassword string, +) error { + return ws.repoManager.WalletRepository().UpdateWallet( + ctx, func(w *domain.Wallet) (*domain.Wallet, error) { + if err := w.ChangePassword( + currentPassword, newPassword, + ); err != nil { + return nil, err + } + return w, nil + }, + ) +} + +func (ws *WalletService) RestoreWallet( + ctx context.Context, mnemonic []string, passpharse string, + birthdayBlockHash []byte, +) (err error) { + defer func() { + if err == nil { + ws.setInitialized() + ws.setSynced() + } + }() + + birthdayBlockHeight, err := ws.bcScanner.GetBlockHeight(birthdayBlockHash) + if err != nil { + return + } + // TODO: implement restoration + + newWallet, err := domain.NewWallet( + mnemonic, passpharse, ws.rootPath, ws.network.Name, + birthdayBlockHeight, nil, + ) + if err != nil { + return + } + + return ws.repoManager.WalletRepository().CreateWallet(ctx, newWallet) +} + +func (ws *WalletService) GetStatus(_ context.Context) WalletStatus { + return WalletStatus{ + IsInitialized: ws.isInitialized(), + IsUnlocked: ws.isUnlocked(), + IsSynced: ws.isSynced(), + } +} + +func (ws *WalletService) GetInfo(ctx context.Context) (*WalletInfo, error) { + w, _ := ws.repoManager.WalletRepository().GetWallet(ctx) + + if w == nil || w.IsLocked() { + return &WalletInfo{ + Network: ws.network.Name, + NativeAsset: ws.network.AssetID, + BuildInfo: ws.buildInfo, + }, nil + } + + birthdayBlock, _ := ws.bcScanner.GetBlockHash(w.BirthdayBlockHeight) + masterBlingingKey, _ := w.GetMasterBlindingKey() + accounts := make([]AccountInfo, 0, len(w.AccountsByKey)) + for _, a := range w.AccountsByKey { + accounts = append(accounts, AccountInfo(a.Info)) + } + return &WalletInfo{ + Network: w.NetworkName, + NativeAsset: ws.network.AssetID, + RootPath: w.RootPath, + MasterBlindingKey: masterBlingingKey, + BirthdayBlockHash: elementsutil.TxIDFromBytes(birthdayBlock), + BirthdayBlockHeight: w.BirthdayBlockHeight, + Accounts: accounts, + BuildInfo: ws.buildInfo, + }, nil +} + +func (ws *WalletService) RegisterHandlerForWalletEvent( + eventType domain.WalletEventType, handler ports.WalletEventHandler, +) { + ws.repoManager.RegisterHandlerForWalletEvent(eventType, handler) +} + +func (ws *WalletService) setInitialized() { + ws.lock.Lock() + defer ws.lock.Unlock() + + ws.initialized = true +} + +func (ws *WalletService) isInitialized() bool { + ws.lock.RLock() + defer ws.lock.RUnlock() + + return ws.initialized +} + +func (ws *WalletService) setUnlocked() { + ws.lock.Lock() + defer ws.lock.Unlock() + + ws.unlocked = true +} + +func (ws *WalletService) setLocked() { + ws.lock.Lock() + defer ws.lock.Unlock() + + ws.unlocked = false +} + +func (ws *WalletService) isUnlocked() bool { + ws.lock.RLock() + defer ws.lock.RUnlock() + + return ws.unlocked +} + +func (ws *WalletService) setSynced() { + ws.lock.Lock() + defer ws.lock.Unlock() + + ws.synced = true +} + +func (ws *WalletService) isSynced() bool { + ws.lock.RLock() + defer ws.lock.RUnlock() + + return ws.synced +} diff --git a/internal/core/application/wallet_service_test.go b/internal/core/application/wallet_service_test.go new file mode 100644 index 0000000..5ac5722 --- /dev/null +++ b/internal/core/application/wallet_service_test.go @@ -0,0 +1,264 @@ +package application_test + +import ( + "context" + "fmt" + "os" + "strings" + "testing" + + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + "github.com/vulpemventures/go-elements/network" + "github.com/vulpemventures/ocean/internal/core/application" + "github.com/vulpemventures/ocean/internal/core/domain" + "github.com/vulpemventures/ocean/internal/core/ports" + dbbadger "github.com/vulpemventures/ocean/internal/infrastructure/storage/db/badger" +) + +var ( + rootPath = "m/84'/1'" + regtest = &network.Regtest + ctx = context.Background() + password = "password" + newPassword = "newpassword" + mnemonic = []string{ + "leave", "dice", "fine", "decrease", "dune", "ribbon", "ocean", "earn", + "lunar", "account", "silver", "admit", "cheap", "fringe", "disorder", "trade", + "because", "trade", "steak", "clock", "grace", "video", "jacket", "equal", + } + encryptedMnemonic = "8f29524ee5995c838ca6f28c7ded7da6dc51de804fd2703775989e65ddc1bb3b60122bf0f430bb3b7a267449aaeee103375737d679bfdabf172c3842048925e6f8952e214f6b900435d24cff938be78ad3bb303d305702fbf168534a45a57ac98ca940d4c3319f14d0c97a20b5bcb456d72857d48d0b4f0e0dcf71d1965b6a42aca8d84fcb66aadeabc812a9994cf66e7a75f8718a031418468f023c560312a02f46ec8e65d5dd65c968ddb93e10950e96c8e730ce7a74d33c6ddad9e12f45e534879f1605eb07fe90432f6592f7996091bbb3e3b2" + accountName = "test1" + birthdayBlockHeight = uint32(randomIntInRange(1, 1000)) + birthdayBlockHash = randomBytes(32) + buildInfo = application.BuildInfo{ + Version: "test", Commit: "none", Date: "unknown", + } +) + +func TestMain(m *testing.M) { + mockedMnemonicCypher := &mockMnemonicCypher{} + mockedMnemonicCypher.On("Encrypt", mock.Anything, mock.Anything).Return(h2b(encryptedMnemonic), nil) + mockedMnemonicCypher.On("Decrypt", mock.Anything, []byte(password)).Return([]byte(strings.Join(mnemonic, " ")), nil) + mockedMnemonicCypher.On("Decrypt", h2b(encryptedMnemonic), []byte(newPassword)).Return([]byte(strings.Join(mnemonic, " ")), nil) + mockedMnemonicCypher.On("Decrypt", mock.Anything, mock.Anything).Return(nil, fmt.Errorf("invalid password")) + domain.MnemonicCypher = mockedMnemonicCypher + domain.MnemonicStore = newInMemoryMnemonicStore() + + os.Exit(m.Run()) +} + +func TestWalletService(t *testing.T) { + testInitWalletFromScratch(t) + + testInitWalletFromRestart(t) +} + +func testInitWalletFromScratch(t *testing.T) { + t.Run("init_wallet_from_scratch", func(t *testing.T) { + mockedBcScanner := newMockedBcScanner() + mockedBcScanner.On("GetLatestBlock").Return(birthdayBlockHash, birthdayBlockHeight, nil) + mockedBcScanner.On("GetBlockHash", mock.Anything).Return(birthdayBlockHash, nil) + mockedBcScanner.On("GetBlockHeight", mock.Anything).Return(birthdayBlockHeight, nil) + repoManager, err := newRepoManagerForNewWallet() + require.NoError(t, err) + require.NotNil(t, repoManager) + + svc := application.NewWalletService( + repoManager, mockedBcScanner, rootPath, regtest, buildInfo, + ) + + status := svc.GetStatus(ctx) + require.False(t, status.IsInitialized) + require.False(t, status.IsSynced) + require.False(t, status.IsUnlocked) + + info, err := svc.GetInfo(ctx) + require.NoError(t, err) + require.Condition(t, func() bool { + return info.Network != "" && info.NativeAsset != "" && + info.BuildInfo != application.BuildInfo{} && info.RootPath == "" && + info.MasterBlindingKey == "" && info.BirthdayBlockHash == "" && + info.BirthdayBlockHeight == 0 && len(info.Accounts) == 0 + }) + + newMnemonic, err := svc.GenSeed(ctx) + require.NoError(t, err) + + err = svc.CreateWallet(ctx, newMnemonic, password) + require.NoError(t, err) + + status = svc.GetStatus(ctx) + require.True(t, status.IsInitialized) + require.True(t, status.IsSynced) + require.False(t, status.IsUnlocked) + + info, err = svc.GetInfo(ctx) + require.NoError(t, err) + require.NotNil(t, info) + require.Equal(t, regtest.Name, info.Network) + require.Equal(t, regtest.AssetID, info.NativeAsset) + require.Empty(t, info.RootPath) + require.Empty(t, info.MasterBlindingKey) + require.Empty(t, info.Accounts) + + err = svc.Unlock(ctx, password) + require.NoError(t, err) + + status = svc.GetStatus(ctx) + require.True(t, status.IsInitialized) + require.True(t, status.IsSynced) + require.True(t, status.IsUnlocked) + + info, err = svc.GetInfo(ctx) + require.NoError(t, err) + require.NotNil(t, info) + require.Equal(t, regtest.Name, info.Network) + require.Equal(t, regtest.AssetID, info.NativeAsset) + require.Equal(t, rootPath, info.RootPath) + require.NotEmpty(t, info.MasterBlindingKey) + require.Empty(t, info.Accounts) + }) +} + +func testInitWalletFromRestart(t *testing.T) { + t.Run("init_wallet_from_restart", func(t *testing.T) { + mockedBcScanner := newMockedBcScanner() + mockedBcScanner.On("GetBlockHash", mock.Anything).Return(birthdayBlockHash, nil) + repoManager, err := newRepoManagerForExistingWallet() + require.NoError(t, err) + require.NotNil(t, repoManager) + + svc := application.NewWalletService( + repoManager, mockedBcScanner, rootPath, regtest, buildInfo, + ) + + status := svc.GetStatus(ctx) + require.True(t, status.IsInitialized) + require.True(t, status.IsSynced) + require.False(t, status.IsUnlocked) + + info, err := svc.GetInfo(ctx) + require.NoError(t, err) + require.NotNil(t, info) + require.Equal(t, regtest.Name, info.Network) + require.Equal(t, regtest.AssetID, info.NativeAsset) + require.Empty(t, info.RootPath) + require.Empty(t, info.MasterBlindingKey) + require.Empty(t, info.Accounts) + + err = svc.ChangePassword(ctx, password, newPassword) + require.NoError(t, err) + + err = svc.Unlock(ctx, newPassword) + require.NoError(t, err) + + status = svc.GetStatus(ctx) + require.True(t, status.IsInitialized) + require.True(t, status.IsSynced) + require.True(t, status.IsUnlocked) + + info, err = svc.GetInfo(ctx) + require.NoError(t, err) + require.NotNil(t, info) + require.Equal(t, regtest.Name, info.Network) + require.Equal(t, regtest.AssetID, info.NativeAsset) + require.Equal(t, rootPath, info.RootPath) + require.NotEmpty(t, info.MasterBlindingKey) + require.NotEmpty(t, info.Accounts) + }) +} + +// TODO: uncomment this test once supporting restring a wallet. +// (Changes might be required) +// func testInitWalletFromRestore(t *testing.T) { +// t.Run("init_wallet_from_restore", func(t *testing.T) { +// repoManager, err := newRepoManagerForRestoredWallet() +// require.NoError(t, err) + +// svc := application.NewWalletService(repoManager, rootPath, regtest) + +// status := svc.GetStatus(ctx) +// require.False(t, status.IsInitialized) +// require.False(t, status.IsSynced) +// require.False(t, status.IsUnlocked) + +// err = svc.RestoreWallet(ctx, restoreMnemonic, password) +// require.NoError(t, err) + +// status = svc.GetStatus(ctx) +// require.True(t, status.IsInitialized) +// require.False(t, status.IsSynced) +// require.False(t, status.IsUnlocked) + +// err = svc.Unlock(ctx, password) +// require.NoError(t, err) + +// status = svc.GetStatus(ctx) +// require.True(t, status.IsInitialized) +// require.False(t, status.IsSynced) +// require.True(t, status.IsUnlocked) + +// info, err := svc.GetInfo(ctx) +// require.NoError(t, err) +// require.NotNil(t, info) +// require.Equal(t, regtest.Name, info.Network) +// require.Equal(t, regtest.AssetID, info.NativeAsset) +// require.Equal(t, rootPath, info.RootPath) +// require.NotEmpty(t, info.MasterBlindingKey) +// require.Empty(t, info.Accounts) + +// status = svc.GetStatus(ctx) +// require.True(t, status.IsInitialized) +// require.True(t, status.IsSynced) +// require.True(t, status.IsUnlocked) + +// info, err = svc.GetInfo(ctx) +// require.NoError(t, err) +// require.NotNil(t, info) +// require.NotEmpty(t, info.Accounts) +// }) +// } + +func newRepoManagerForNewWallet() (ports.RepoManager, error) { + return dbbadger.NewRepoManager("", nil) +} + +func newRepoManagerForExistingWallet() (ports.RepoManager, error) { + rm, err := dbbadger.NewRepoManager("", nil) + if err != nil { + return nil, err + } + + accounts := []domain.Account{ + { + Info: domain.AccountInfo{ + Key: domain.AccountKey{Name: "test1", Index: 0}, + Xpub: "xpub6CvgMkAYP4RFDuozj9Mji9ncsoTiHyf4mFVVJKAHSTeecsR9hwxKa1PkfayopR32SXJRKx1WJJkGjgndyPxhDRpBxJGwzXJCELybhPQxd8Y", + DerivationPath: "m/84'/0'/0'", + }, + NextExternalIndex: 2, + NextInternalIndex: 4, + DerivationPathByScript: map[string]string{ + "00141d124e9e47aded6bcd2bdfe86eea2ea1c4391cbe": "0'/1/1", + "00143309416df9f260be2547e505251c4c888fa5d4fe": "0'/1/3", + "001440d399dca3f89e937534b1624aa3b6c4167aa6d9": "0'/0/0", + "0014488ebe5da5a52e111bf72241b11a722162f86473": "0'/1/2", + "001474ce4fc0b2443a9cca131f187a9eb1607e35636a": "0'/1/0", + "0014e9fe164b891a806aa3c729608cb8251e12753918": "0'/0/1", + }, + }, + } + wallet, err := domain.NewWallet( + mnemonic, password, rootPath, regtest.Name, birthdayBlockHeight, accounts, + ) + if err != nil { + return nil, err + } + wallet.Lock() + + if err := rm.WalletRepository().CreateWallet(ctx, wallet); err != nil { + return nil, err + } + return rm, nil +} diff --git a/internal/core/domain/mock_test.go b/internal/core/domain/mock_test.go new file mode 100644 index 0000000..97aba20 --- /dev/null +++ b/internal/core/domain/mock_test.go @@ -0,0 +1,78 @@ +package domain_test + +import ( + "strings" + "sync" + + "github.com/stretchr/testify/mock" + "github.com/vulpemventures/ocean/internal/core/domain" +) + +// MnemonicStore +type inMemoryMnemonicStore struct { + mnemonic []string + lock *sync.RWMutex +} + +func newInMemoryMnemonicStore() domain.IMnemonicStore { + return &inMemoryMnemonicStore{ + lock: &sync.RWMutex{}, + } +} + +func (s *inMemoryMnemonicStore) Set(mnemonic string) { + s.lock.Lock() + defer s.lock.Unlock() + + s.mnemonic = strings.Split(mnemonic, " ") +} + +func (s *inMemoryMnemonicStore) Unset() { + s.lock.Lock() + defer s.lock.Unlock() + + s.mnemonic = nil +} + +func (s *inMemoryMnemonicStore) IsSet() bool { + s.lock.RLock() + defer s.lock.RUnlock() + + return len(s.mnemonic) > 0 +} + +func (s *inMemoryMnemonicStore) Get() []string { + s.lock.RLock() + defer s.lock.RUnlock() + + return s.mnemonic +} + +// MnemonicCypher +type mockMnemonicCypher struct { + mock.Mock +} + +func (m *mockMnemonicCypher) Encrypt( + mnemonic, password []byte, +) ([]byte, error) { + args := m.Called(mnemonic, password) + + var res []byte + if a := args.Get(0); a != nil { + res = a.([]byte) + } + return res, args.Error(1) +} + +func (m *mockMnemonicCypher) Decrypt( + encryptedMnemonic, password []byte, +) ([]byte, error) { + args := m.Called(encryptedMnemonic, password) + + var res []byte + if a := args.Get(0); a != nil { + res = a.([]byte) + } + return res, args.Error(1) +} diff --git a/internal/core/domain/ports.go b/internal/core/domain/ports.go new file mode 100644 index 0000000..ed3a14f --- /dev/null +++ b/internal/core/domain/ports.go @@ -0,0 +1,20 @@ +package domain + +// IMnemonicStore defines the methods a store storing a mnemonic in plaintext +// must implement to either set, unset or get it. +type IMnemonicStore interface { + Set(mnemonic string) + Unset() + IsSet() bool + Get() []string +} + +// IMnemonicCipher defines the methods a cypher must implement to encrypt or +// decrypt a mnemonic with a password. +type IMnemonicCypher interface { + Encrypt(mnemonic, password []byte) ([]byte, error) + Decrypt(encryptedMnemonic, password []byte) ([]byte, error) +} + +var MnemonicStore IMnemonicStore +var MnemonicCypher IMnemonicCypher diff --git a/internal/core/domain/transaction.go b/internal/core/domain/transaction.go new file mode 100644 index 0000000..54b5a79 --- /dev/null +++ b/internal/core/domain/transaction.go @@ -0,0 +1,54 @@ +package domain + +// Transaction is the data structure representing an Elements tx with extra +// info like whether it is conifirmed/unconfirmed and the name of the accounts +// owning one or more of its inputs. +type Transaction struct { + TxID string + TxHex string + BlockHash string + BlockHeight uint64 + Accounts map[string]struct{} +} + +// IsConfirmed returns whther the tx is included in the blockchain. +func (t *Transaction) IsConfirmed() bool { + return t.BlockHash != "" +} + +// Confirm marks the tx as confirmed. +func (t *Transaction) Confirm(blockHash string, blockHeight uint64) { + if t.IsConfirmed() { + return + } + + t.BlockHash = blockHash + t.BlockHeight = blockHeight +} + +// AddAccount adds the given account to the map of those involved in the tx. +func (t *Transaction) AddAccount(accountName string) { + if t.Accounts == nil { + t.Accounts = make(map[string]struct{}) + } + t.Accounts[accountName] = struct{}{} +} + +// GetAccounts returns the account map as a slice of account names. +func (t *Transaction) GetAccounts() []string { + accounts := make([]string, 0, len(t.Accounts)) + for account := range t.Accounts { + accounts = append(accounts, account) + } + return accounts +} + +// HasAccounts returns whether the current tx contains all account names of the provided one. +func (t *Transaction) HasAccounts(tx *Transaction) bool { + for account := range tx.Accounts { + if _, ok := t.Accounts[account]; !ok { + return false + } + } + return true +} diff --git a/internal/core/domain/transaction_repository.go b/internal/core/domain/transaction_repository.go new file mode 100644 index 0000000..1f2a143 --- /dev/null +++ b/internal/core/domain/transaction_repository.go @@ -0,0 +1,54 @@ +package domain + +import "context" + +const ( + TransactionAdded TransactionEventType = iota + TransactionUnconfirmed + TransactionConfirmed +) + +var ( + txTypeString = map[TransactionEventType]string{ + TransactionAdded: "TransactionAdded", + TransactionUnconfirmed: "TransactionUnconfirmed", + TransactionConfirmed: "TransactionConfirmed", + } +) + +type TransactionEventType int + +func (t TransactionEventType) String() string { + return txTypeString[t] +} + +// TransactionEvent holds info about an event occured within the repository. +type TransactionEvent struct { + EventType TransactionEventType + Transaction *Transaction +} + +// TransactionRepository is the abstraction for any kind of database intended +// to persist Transactions. +type TransactionRepository interface { + // AddTransaction adds the provided transaction to the repository by + // preventing duplicates. + // Generates a TransactionAdded event if successfull. + AddTransaction(ctx context.Context, tx *Transaction) (bool, error) + // ConfirmTransaction adds the given blockhash and block height to the + // Transaction identified by the given txid. + // Generates a TransactionConfirmed event if successfull. + ConfirmTransaction( + ctx context.Context, txid, blockHash string, blockheight uint64, + ) (bool, error) + // GetTransaction returns the Transaction identified by the given txid. + GetTransaction(ctx context.Context, txid string) (*Transaction, error) + // UpdateTransaction allows to commit multiple changes to the same + // Transaction in a transactional way. + UpdateTransaction( + ctx context.Context, txid string, + updateFn func(tx *Transaction) (*Transaction, error), + ) error + // GetEventChannel retunrs the channel of TransactionEvents. + GetEventChannel() chan TransactionEvent +} diff --git a/internal/core/domain/transaction_test.go b/internal/core/domain/transaction_test.go new file mode 100644 index 0000000..0e66a7d --- /dev/null +++ b/internal/core/domain/transaction_test.go @@ -0,0 +1,68 @@ +package domain_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + "github.com/vulpemventures/ocean/internal/core/domain" +) + +func TestConfirmTransaction(t *testing.T) { + tx := &domain.Transaction{} + require.False(t, tx.IsConfirmed()) + + tx.Confirm("fa84eb6806daf1b3c495ed30554d80573a39335b2993b66b3cc1afaa53816e47", 1728312) + require.True(t, tx.IsConfirmed()) +} + +func TestAddAccounts(t *testing.T) { + tx := &domain.Transaction{} + accounts := tx.GetAccounts() + require.Empty(t, accounts) + + tx.AddAccount("test1") + accounts = tx.GetAccounts() + require.Len(t, accounts, 1) + + tx.AddAccount("test1") + accounts = tx.GetAccounts() + require.Len(t, accounts, 1) + + tx.AddAccount("test2") + accounts = tx.GetAccounts() + require.Len(t, accounts, 2) +} + +func TestHasAccounts(t *testing.T) { + tests := []struct { + t1 *domain.Transaction + t2 *domain.Transaction + expected bool + }{ + { + &domain.Transaction{Accounts: map[string]struct{}{"test": {}}}, + &domain.Transaction{Accounts: map[string]struct{}{"test": {}}}, + true, + }, + { + &domain.Transaction{Accounts: map[string]struct{}{"test": {}}}, + &domain.Transaction{Accounts: map[string]struct{}{"foo": {}}}, + false, + }, + { + &domain.Transaction{Accounts: map[string]struct{}{"test": {}}}, + &domain.Transaction{Accounts: map[string]struct{}{"test": {}, "foo": {}}}, + false, + }, + { + &domain.Transaction{Accounts: map[string]struct{}{"test": {}, "foo": {}}}, + &domain.Transaction{Accounts: map[string]struct{}{"test": {}}}, + true, + }, + } + + for _, tt := range tests { + res := tt.t1.HasAccounts(tt.t2) + require.Equal(t, tt.expected, res) + } +} diff --git a/internal/core/domain/utxo.go b/internal/core/domain/utxo.go new file mode 100644 index 0000000..3b40b40 --- /dev/null +++ b/internal/core/domain/utxo.go @@ -0,0 +1,184 @@ +package domain + +import ( + "encoding/hex" + "fmt" + "time" + + "github.com/btcsuite/btcd/btcutil" +) + +var ( + ErrUtxoAlreadyLocked = fmt.Errorf("utxo is already locked") +) + +// UtxoKey represents the key of an Utxo, composed by its txid and vout. +type UtxoKey struct { + TxID string + VOut uint32 +} + +func (k UtxoKey) Hash() string { + buf, _ := hex.DecodeString(k.TxID) + buf = append(buf, byte(k.VOut)) + return hex.EncodeToString(btcutil.Hash160(buf)) +} + +func (k UtxoKey) String() string { + return fmt.Sprintf("{%s: %d}", k.TxID, k.VOut) +} + +// UtxoInfo holds sensitive info about the utxo. For confidential utxos. +// they must be revealed to return useful UtxoInfo. +type UtxoInfo struct { + UtxoKey + Value uint64 + Asset string + Script []byte + ValueBlinder []byte + AssetBlinder []byte + AccountName string + SpentStatus UtxoStatus + ConfirmedStatus UtxoStatus +} + +func (i UtxoInfo) Key() UtxoKey { + return i.UtxoKey +} + +// Balance holds info about the balance of a list of utxos with the same asset. +type Balance struct { + Confirmed uint64 + Unconfirmed uint64 + Locked uint64 +} + +func (b *Balance) Total() uint64 { + return b.Confirmed + b.Unconfirmed + b.Locked +} + +type UtxoStatus struct { + Txid string + BlockHeight uint64 + BlockTime int64 + BlockHash string +} + +// Utxo is the data structure representing an Elements UTXO with extra info +// like whether it is spent/utxo, confirmed/unconfirmed or locked/unlocked and +// the name of the account owning it. +type Utxo struct { + UtxoKey + Value uint64 + Asset string + ValueCommitment []byte + AssetCommitment []byte + ValueBlinder []byte + AssetBlinder []byte + Script []byte + Nonce []byte + RangeProof []byte + SurjectionProof []byte + AccountName string + LockTimestamp int64 + SpentStatus UtxoStatus + ConfirmedStatus UtxoStatus +} + +// IsSpent returns whether the utxo have been spent. +func (u *Utxo) IsSpent() bool { + return u.SpentStatus != UtxoStatus{} +} + +// IsConfirmed returns whether the utxo is confirmed. +func (u *Utxo) IsConfirmed() bool { + return u.ConfirmedStatus != UtxoStatus{} +} + +// IsConfidential returns whether the utxo is a confidential one. +func (u *Utxo) IsConfidential() bool { + return len(u.ValueCommitment) > 0 && len(u.AssetCommitment) > 0 +} + +// IsRevealed returns whether the utxo is confidential and its blinded data +// (value, asset and relative blinders) have been revealed. +func (u *Utxo) IsRevealed() bool { + return len(u.ValueBlinder) > 0 && len(u.AssetBlinder) > 0 +} + +// IsLocked returns whether the utxo is locked. +func (u *Utxo) IsLocked() bool { + return u.LockTimestamp > 0 +} + +// CanUnlock reutrns whether a locked utxo can be unlocked. +func (u *Utxo) CanUnlock() bool { + if !u.IsLocked() { + return true + } + return time.Now().After(time.Unix(u.LockTimestamp, 0)) +} + +// Key returns the UtxoKey of the current utxo. +func (u *Utxo) Key() UtxoKey { + return u.UtxoKey +} + +// Info returns a light view of the current utxo. +func (u *Utxo) Info() UtxoInfo { + return UtxoInfo{ + u.Key(), u.Value, u.Asset, u.Script, u.ValueBlinder, u.AssetBlinder, + u.AccountName, u.SpentStatus, u.ConfirmedStatus, + } +} + +// Spend marks the utxos as spent. +func (u *Utxo) Spend(status UtxoStatus) error { + if u.IsSpent() { + return nil + } + + emptyStatus := UtxoStatus{} + if status == emptyStatus { + return fmt.Errorf("status must not be empty") + } + if status.Txid == "" { + return fmt.Errorf("missing txid") + } + if status.BlockHeight == 0 && status.BlockTime == 0 && status.BlockHash == "" { + return fmt.Errorf("missing block info") + } + u.SpentStatus = status + u.LockTimestamp = 0 + return nil +} + +// Confirm marks the utxos as confirmed. +func (u *Utxo) Confirm(status UtxoStatus) error { + if u.IsConfirmed() { + return nil + } + + emptyStatus := UtxoStatus{} + if status == emptyStatus { + return fmt.Errorf("status must not be empty") + } + if status.BlockHeight == 0 && status.BlockTime == 0 && status.BlockHash == "" { + return fmt.Errorf("missing block info") + } + u.ConfirmedStatus = status + u.ConfirmedStatus.Txid = "" + return nil +} + +// Lock marks the current utxo as locked. +func (u *Utxo) Lock(timestamp int64) { + if !u.IsLocked() { + u.LockTimestamp = timestamp + } +} + +// Unlock marks the current locked utxo as unlocked. +func (u *Utxo) Unlock() { + u.LockTimestamp = 0 +} diff --git a/internal/core/domain/utxo_repository.go b/internal/core/domain/utxo_repository.go new file mode 100644 index 0000000..78e5b77 --- /dev/null +++ b/internal/core/domain/utxo_repository.go @@ -0,0 +1,80 @@ +package domain + +import ( + "context" +) + +const ( + UtxoAdded UtxoEventType = iota + UtxoConfirmed + UtxoLocked + UtxoUnlocked + UtxoSpent +) + +var ( + utxoTypeString = map[UtxoEventType]string{ + UtxoAdded: "UtxoAdded", + UtxoConfirmed: "UtxoConfirmed", + UtxoLocked: "UtxoLocked", + UtxoUnlocked: "UtxoUnlocked", + UtxoSpent: "UtxoSpent", + } +) + +type UtxoEventType int + +func (t UtxoEventType) String() string { + return utxoTypeString[t] +} + +// UtxoEvent holds info about an event occured within the repository. +type UtxoEvent struct { + EventType UtxoEventType + Utxos []UtxoInfo +} + +// UtxoRepository is the abstraction for any kind of database intended to +// persist Utxos. +type UtxoRepository interface { + // AddUtxos adds the provided utxos to the repository by preventing + // duplicates. + // Generates a UtxoAdded event if successfull. + AddUtxos(ctx context.Context, utxos []*Utxo) (int, error) + // GetUtxosByKey returns the utxos identified by the given keys. + GetUtxosByKey(ctx context.Context, utxoKeys []UtxoKey) ([]*Utxo, error) + // GetAllUtxos returns the entire UTXO set, included those locked or + // already spent. + GetAllUtxos(ctx context.Context) []*Utxo + // GetSpendableUtxos returns all unlocked utxo UTXOs. + GetSpendableUtxos(ctx context.Context) ([]*Utxo, error) + // GetAllUtxosForAccount returns the list of all utxos for the given + // account. + GetAllUtxosForAccount(ctx context.Context, account string) ([]*Utxo, error) + // GetSpendableUtxosForAccount returns the list of spendable utxos for the + // given account. The list incldues only confirmed and unlocked utxos. + GetSpendableUtxosForAccount(ctx context.Context, account string) ([]*Utxo, error) + // GetLockedUtxosForAccount returns the list of all currently locked utxos + // for the given account. + GetLockedUtxosForAccount(ctx context.Context, account string) ([]*Utxo, error) + // GetBalanceForAccount returns the confirmed, unconfirmed and locked + // balances per each asset for the given account. + GetBalanceForAccount(ctx context.Context, account string) (map[string]*Balance, error) + // SpendUtxos updates the status of the given list of utxos to "spent". + // Generates a UtxoSpent event if successfull. + SpendUtxos(ctx context.Context, utxoKeys []UtxoKey, status UtxoStatus) (int, error) + // ConfirmUtxos updates the status of the given list of utxos to "confirmed". + // Generates a UtxoConfirmed event if successfull. + ConfirmUtxos(ctx context.Context, utxoKeys []UtxoKey, status UtxoStatus) (int, error) + // LockUtxos updates the status of the given list of utxos to "locked". + // Generates a UtxoLocked event if successfull. + LockUtxos(ctx context.Context, utxoKeys []UtxoKey, timestamp int64) (int, error) + // UnlockUtxos updates the status of the given list of utxos to "unlocked". + // Generates a UtxoUnlocked event if successfull. + UnlockUtxos(ctx context.Context, utxoKeys []UtxoKey) (int, error) + // DeleteUtxosForAccount deletes every utxo associated to the given account + // from the repository. + DeleteUtxosForAccount(ctx context.Context, accountName string) error + // GetEventChannel returns the channel of UtxoEvents. + GetEventChannel() chan UtxoEvent +} diff --git a/internal/core/domain/utxo_test.go b/internal/core/domain/utxo_test.go new file mode 100644 index 0000000..b1534d5 --- /dev/null +++ b/internal/core/domain/utxo_test.go @@ -0,0 +1,44 @@ +package domain_test + +import ( + "encoding/hex" + "testing" + "time" + + "github.com/stretchr/testify/require" + "github.com/vulpemventures/ocean/internal/core/domain" +) + +func TestSpendUtxo(t *testing.T) { + t.Parallel() + + u := domain.Utxo{} + require.False(t, u.IsSpent()) + + err := u.Spend(domain.UtxoStatus{hex.EncodeToString(make([]byte, 32)), 1, 0, ""}) + require.NoError(t, err) + require.True(t, u.IsSpent()) +} + +func TestConfirmUtxo(t *testing.T) { + t.Parallel() + + u := domain.Utxo{} + require.False(t, u.IsConfirmed()) + + u.Confirm(domain.UtxoStatus{"", 1, 0, ""}) + require.True(t, u.IsConfirmed()) +} + +func TestLockUnlockUtxo(t *testing.T) { + t.Parallel() + + u := domain.Utxo{} + require.False(t, u.IsLocked()) + + u.Lock(time.Now().Unix()) + require.True(t, u.IsLocked()) + + u.Unlock() + require.False(t, u.IsLocked()) +} diff --git a/internal/core/domain/wallet.go b/internal/core/domain/wallet.go new file mode 100644 index 0000000..f1c0d6c --- /dev/null +++ b/internal/core/domain/wallet.go @@ -0,0 +1,450 @@ +package domain + +import ( + "bytes" + "encoding/hex" + "fmt" + "strings" + + "github.com/btcsuite/btcd/btcutil" + "github.com/btcsuite/btcd/btcutil/hdkeychain" + "github.com/vulpemventures/go-elements/network" + wallet "github.com/vulpemventures/ocean/pkg/single-key-wallet" +) + +const ( + externalChain = 0 + internalChain = 1 +) + +var ( + ErrWalletMissingMnemonic = fmt.Errorf("missing mnemonic") + ErrWalletMissingPassword = fmt.Errorf("missing password") + ErrWalletMissingNetwork = fmt.Errorf("missing network name") + ErrWalletMissingBirthdayBlock = fmt.Errorf("missing birthday block height") + ErrWalletLocked = fmt.Errorf("wallet is locked") + ErrWalletUnlocked = fmt.Errorf("wallet must be locked") + ErrWalletMaxAccountNumberReached = fmt.Errorf("reached max number of accounts") + ErrWalletInvalidPassword = fmt.Errorf("wrong password") + ErrWalletInvalidNetwork = fmt.Errorf("unknown network") + ErrAccountNotFound = fmt.Errorf("account not found in wallet") + + networks = map[string]*network.Network{ + "liquid": &network.Liquid, + "testnet": &network.Testnet, + "regtest": &network.Regtest, + } +) + +// AddressInfo holds useful info about a derived address. +type AddressInfo struct { + AccountKey AccountKey + Address string + BlindingKey []byte + DerivationPath string + Script string +} + +// Wallet is the data structure representing a secure HD wallet, ie. protected +// by a password that encrypts/decrypts the mnemonic seed. +type Wallet struct { + EncryptedMnemonic []byte + PasswordHash []byte + BirthdayBlockHeight uint32 + RootPath string + NetworkName string + AccountsByKey map[string]*Account + AccountKeysByIndex map[uint32]string + AccountKeysByName map[string]string + NextAccountIndex uint32 +} + +// NewWallet encrypts the provided mnemonic with the passhrase and returns a new +// Wallet initialized with the encrypted mnemonic, the hash of the password, +// the given root path, network and possible a list of accounts for an already +// used one. +// The Wallet is locked by default since it is initialized without the mnemonic +// in plain text. +func NewWallet( + mnemonic []string, password, rootPath, network string, + birthdayBlock uint32, accounts []Account, +) (*Wallet, error) { + if len(mnemonic) <= 0 { + return nil, ErrWalletMissingMnemonic + } + if len(password) <= 0 { + return nil, ErrWalletMissingPassword + } + if birthdayBlock == 0 { + return nil, ErrWalletMissingBirthdayBlock + } + if network == "" { + return nil, ErrWalletMissingNetwork + } + if _, ok := networks[network]; !ok { + return nil, ErrWalletInvalidNetwork + } + + if _, err := wallet.NewWalletFromMnemonic(wallet.NewWalletFromMnemonicArgs{ + RootPath: rootPath, + Mnemonic: mnemonic, + }); err != nil { + return nil, err + } + + strMnemonic := strings.Join(mnemonic, " ") + encryptedMnemonic, err := MnemonicCypher.Encrypt( + []byte(strMnemonic), []byte(password), + ) + if err != nil { + return nil, err + } + + MnemonicStore.Set(strMnemonic) + + accountsByKey := make(map[string]*Account) + accountKeysByIndex := make(map[uint32]string) + accountKeysByName := make(map[string]string) + for _, a := range accounts { + key := a.Info.Key + accountsByKey[key.String()] = &a + accountKeysByIndex[key.Index] = key.String() + accountKeysByName[key.Name] = key.String() + } + + return &Wallet{ + EncryptedMnemonic: encryptedMnemonic, + PasswordHash: btcutil.Hash160([]byte(password)), + BirthdayBlockHeight: birthdayBlock, + RootPath: rootPath, + AccountsByKey: accountsByKey, + AccountKeysByIndex: accountKeysByIndex, + AccountKeysByName: accountKeysByName, + NetworkName: network, + }, nil +} + +// IsInitialized returns wheter the wallet is initialized with an encrypted +// mnemonic. +func (w *Wallet) IsInitialized() bool { + return len(w.EncryptedMnemonic) > 0 +} + +// IsLocked returns whether the wallet is initialized and the plaintext +// mnemonic is set in its store. +func (w *Wallet) IsLocked() bool { + return !w.IsInitialized() || !MnemonicStore.IsSet() +} + +// GetMnemonic safely returns the plaintext mnemonic. +func (w *Wallet) GetMnemonic() ([]string, error) { + if w.IsLocked() { + return nil, ErrWalletLocked + } + + return MnemonicStore.Get(), nil +} + +// GetMnemonic safely returns the master blinding key. +func (w *Wallet) GetMasterBlindingKey() (string, error) { + if w.IsLocked() { + return "", ErrWalletLocked + } + + mnemonic := MnemonicStore.Get() + ww, _ := wallet.NewWalletFromMnemonic(wallet.NewWalletFromMnemonicArgs{ + RootPath: w.RootPath, + Mnemonic: mnemonic, + }) + return ww.MasterBlindingKey() +} + +// Lock locks the Wallet by wiping the plaintext mnemonic from its store. +func (w *Wallet) Lock() { + if w.IsLocked() { + return + } + MnemonicStore.Unset() +} + +// Unlock attempts to decrypt the encrypted mnemonic with the provided +// password. +func (w *Wallet) Unlock(password string) error { + if !w.IsLocked() { + return nil + } + + if !w.isValidPassword(password) { + return ErrWalletInvalidPassword + } + + mnemonic, err := MnemonicCypher.Decrypt(w.EncryptedMnemonic, []byte(password)) + if err != nil { + return err + } + + MnemonicStore.Set(string(mnemonic)) + return nil +} + +// ChangePassword attempts to unlock the wallet with the given currentPassword, +// then encrypts the plaintext mnemonic again with new password, stores its hash +// and, finally, locks the Wallet again. +func (w *Wallet) ChangePassword(currentPassword, newPassword string) error { + if !w.IsLocked() { + return ErrWalletUnlocked + } + if !w.isValidPassword(currentPassword) { + return ErrWalletInvalidPassword + } + + mnemonic, err := MnemonicCypher.Decrypt(w.EncryptedMnemonic, []byte(currentPassword)) + if err != nil { + return err + } + + encryptedMnemonic, err := MnemonicCypher.Encrypt(mnemonic, []byte(newPassword)) + if err != nil { + return err + } + + w.EncryptedMnemonic = encryptedMnemonic + w.PasswordHash = btcutil.Hash160([]byte(newPassword)) + return nil +} + +// CreateAccount creates a new account with the given name by preventing +// collisions with existing ones. If successful, returns the Account created. +func (w *Wallet) CreateAccount(name string, birthdayBlock uint32) (*Account, error) { + if w.IsLocked() { + return nil, ErrWalletLocked + } + if _, ok := w.AccountKeysByName[name]; ok { + return nil, nil + } + if w.NextAccountIndex == hdkeychain.HardenedKeyStart { + return nil, ErrWalletMaxAccountNumberReached + } + + mnemonic := MnemonicStore.Get() + + ww, _ := wallet.NewWalletFromMnemonic(wallet.NewWalletFromMnemonicArgs{ + RootPath: w.RootPath, + Mnemonic: mnemonic, + }) + xpub, _ := ww.AccountExtendedPublicKey(wallet.ExtendedKeyArgs{Account: w.NextAccountIndex}) + + accountKey := AccountKey{name, w.NextAccountIndex} + derivationPath, _ := wallet.ParseDerivationPath(w.RootPath) + derivationPath = append(derivationPath, w.NextAccountIndex+hdkeychain.HardenedKeyStart) + bdayBlock := w.BirthdayBlockHeight + if birthdayBlock > bdayBlock { + bdayBlock = birthdayBlock + } + accountInfo := AccountInfo{accountKey, xpub, derivationPath.String()} + account := &Account{ + Info: accountInfo, + DerivationPathByScript: make(map[string]string), + BirthdayBlock: bdayBlock, + } + + w.AccountsByKey[accountKey.String()] = account + w.AccountKeysByIndex[accountKey.Index] = accountKey.String() + w.AccountKeysByName[accountKey.Name] = accountKey.String() + w.NextAccountIndex++ + return account, nil +} + +// GetAccount safely returns an Account identified by the given name. +func (w *Wallet) GetAccount(accountName string) (*Account, error) { + return w.getAccount(accountName) +} + +// DeleteAccount safely removes an Account and all related stored info from the +// Wallet. +func (w *Wallet) DeleteAccount(accountName string) error { + account, err := w.getAccount(accountName) + if err != nil { + return err + } + + delete(w.AccountKeysByIndex, account.Info.Key.Index) + delete(w.AccountKeysByName, account.Info.Key.Name) + delete(w.AccountsByKey, account.Info.Key.String()) + return nil +} + +// DeriveNextExternalAddressForAccount returns all useful info about the next +// new receiving address for the given account. +func (w *Wallet) DeriveNextExternalAddressForAccount( + accountName string, +) (*AddressInfo, error) { + return w.deriveNextAddressForAccount(accountName, externalChain) +} + +// DeriveNextInternalAddressForAccount returns all useful info about the next +// new change address for the given account. +func (w *Wallet) DeriveNextInternalAddressForAccount( + accountName string, +) (*AddressInfo, error) { + return w.deriveNextAddressForAccount(accountName, internalChain) +} + +// AllDerivedAddressesForAccount returns info about all derived receiving and +// change addresses derived so far for the given account. +func (w *Wallet) AllDerivedAddressesForAccount( + accountName string, +) ([]AddressInfo, error) { + return w.allDerivedAddressesForAccount(accountName, true) +} + +// AllDerivedExternalAddressesForAccount returns info about all derived +// receiving addresses derived so far for the given account. +func (w *Wallet) AllDerivedExternalAddressesForAccount( + accountName string, +) ([]AddressInfo, error) { + return w.allDerivedAddressesForAccount(accountName, false) +} + +func (w *Wallet) isValidPassword(password string) bool { + return bytes.Equal(w.PasswordHash, btcutil.Hash160([]byte(password))) +} + +func (w *Wallet) getAccount(accountName string) (*Account, error) { + if w.IsLocked() { + return nil, ErrWalletLocked + } + + accountkey, ok := w.AccountKeysByName[accountName] + if !ok { + return nil, ErrAccountNotFound + } + return w.AccountsByKey[accountkey], nil +} + +func (w *Wallet) deriveNextAddressForAccount( + accountName string, chainIndex int, +) (*AddressInfo, error) { + account, err := w.getAccount(accountName) + if err != nil { + return nil, err + } + + mnemonic, _ := w.GetMnemonic() + ww, _ := wallet.NewWalletFromMnemonic(wallet.NewWalletFromMnemonicArgs{ + RootPath: w.RootPath, + Mnemonic: mnemonic, + }) + + addressIndex := account.NextExternalIndex + if chainIndex == internalChain { + addressIndex = account.NextInternalIndex + } + derivationPath := fmt.Sprintf( + "%d'/%d/%d", + account.Info.Key.Index, chainIndex, addressIndex, + ) + net := networkFromName(w.NetworkName) + addr, script, err := ww.DeriveConfidentialAddress(wallet.DeriveConfidentialAddressArgs{ + DerivationPath: derivationPath, + Network: net, + }) + if err != nil { + return nil, err + } + + blindingKey, _, _ := ww.DeriveBlindingKeyPair(wallet.DeriveBlindingKeyPairArgs{ + Script: script, + }) + + account.addDerivationPath(hex.EncodeToString(script), derivationPath) + if chainIndex == internalChain { + account.incrementInternalIndex() + } else { + account.incrementExternalIndex() + } + + return &AddressInfo{ + AccountKey: account.Info.Key, + Address: addr, + Script: hex.EncodeToString(script), + BlindingKey: blindingKey.Serialize(), + DerivationPath: derivationPath, + }, nil +} + +func (w *Wallet) allDerivedAddressesForAccount( + accountName string, includeInternals bool, +) ([]AddressInfo, error) { + account, err := w.getAccount(accountName) + if err != nil { + return nil, err + } + + net := networkFromName(w.NetworkName) + mnemonic, _ := w.GetMnemonic() + ww, _ := wallet.NewWalletFromMnemonic(wallet.NewWalletFromMnemonicArgs{ + RootPath: w.RootPath, + Mnemonic: mnemonic, + }) + + infoLen := account.NextExternalIndex + if includeInternals { + infoLen += account.NextInternalIndex + } + info := make([]AddressInfo, 0, infoLen) + for i := 0; i < int(account.NextExternalIndex); i++ { + derivationPath := fmt.Sprintf( + "%d'/%d/%d", + account.Info.Key.Index, externalChain, i, + ) + addr, script, err := ww.DeriveConfidentialAddress(wallet.DeriveConfidentialAddressArgs{ + DerivationPath: derivationPath, + Network: net, + }) + if err != nil { + return nil, err + } + key, _, _ := ww.DeriveBlindingKeyPair(wallet.DeriveBlindingKeyPairArgs{ + Script: script, + }) + info = append(info, AddressInfo{ + AccountKey: account.Info.Key, + Address: addr, + BlindingKey: key.Serialize(), + DerivationPath: derivationPath, + Script: hex.EncodeToString(script), + }) + } + if includeInternals { + for i := 0; i < int(account.NextInternalIndex); i++ { + derivationPath := fmt.Sprintf( + "%d'/%d/%d", + account.Info.Key.Index, internalChain, i, + ) + addr, script, err := ww.DeriveConfidentialAddress(wallet.DeriveConfidentialAddressArgs{ + DerivationPath: derivationPath, + Network: net, + }) + if err != nil { + return nil, err + } + key, _, _ := ww.DeriveBlindingKeyPair(wallet.DeriveBlindingKeyPairArgs{ + Script: script, + }) + info = append(info, AddressInfo{ + AccountKey: account.Info.Key, + Address: addr, + BlindingKey: key.Serialize(), + DerivationPath: derivationPath, + Script: hex.EncodeToString(script), + }) + } + } + + return info, nil +} + +func networkFromName(net string) *network.Network { + return networks[net] +} diff --git a/internal/core/domain/wallet_account.go b/internal/core/domain/wallet_account.go new file mode 100644 index 0000000..6affcd4 --- /dev/null +++ b/internal/core/domain/wallet_account.go @@ -0,0 +1,62 @@ +package domain + +import ( + "encoding/hex" + "fmt" + + "github.com/btcsuite/btcd/btcutil" + "github.com/btcsuite/btcd/btcutil/hdkeychain" +) + +// AccountKey holds the unique info of an account: name and HD index. +type AccountKey struct { + Name string + Index uint32 +} + +func (ak *AccountKey) String() string { + key := btcutil.Hash160([]byte(fmt.Sprintf("%s%d", ak.Name, ak.Index))) + return hex.EncodeToString(key[:6]) +} + +// AccountInfo holds basic info about an account. +type AccountInfo struct { + Key AccountKey + Xpub string + DerivationPath string +} + +// Account defines the entity data struture for a derived account of the +// daemon's HD wallet +type Account struct { + Info AccountInfo + BirthdayBlock uint32 + NextExternalIndex uint + NextInternalIndex uint + DerivationPathByScript map[string]string +} + +func (a *Account) incrementExternalIndex() (next uint) { + // restart from 0 if index has reached the its max value + next = 0 + if a.NextExternalIndex != hdkeychain.HardenedKeyStart-1 { + next = a.NextExternalIndex + 1 + } + a.NextExternalIndex = next + return +} + +func (a *Account) incrementInternalIndex() (next uint) { + next = 0 + if a.NextInternalIndex != hdkeychain.HardenedKeyStart-1 { + next = a.NextInternalIndex + 1 + } + a.NextInternalIndex = next + return +} + +func (a *Account) addDerivationPath(outputScript, derivationPath string) { + if _, ok := a.DerivationPathByScript[outputScript]; !ok { + a.DerivationPathByScript[outputScript] = derivationPath + } +} diff --git a/internal/core/domain/wallet_repository.go b/internal/core/domain/wallet_repository.go new file mode 100644 index 0000000..22afb6d --- /dev/null +++ b/internal/core/domain/wallet_repository.go @@ -0,0 +1,85 @@ +package domain + +import ( + "context" +) + +const ( + WalletCreated WalletEventType = iota + WalletUnlocked + WalletLocked + WalletPasswordChanged + WalletAccountCreated + WalletAccountAddressesDerived + WalletAccountDeleted +) + +var ( + walletTypeString = map[WalletEventType]string{ + WalletCreated: "WalletCreated", + WalletUnlocked: "WalletUnlocked", + WalletLocked: "WalletLocked", + WalletPasswordChanged: "WalletPasswordChanged", + WalletAccountCreated: "WalletAccountCreated", + WalletAccountAddressesDerived: "WalletAccountAddressesDerived", + WalletAccountDeleted: "WalletAccountDeleted", + } +) + +type WalletEventType int + +func (t WalletEventType) String() string { + return walletTypeString[t] +} + +// WalletEvent holds info about an event occured within the repository. +type WalletEvent struct { + EventType WalletEventType + AccountName string + AccountBirthdayBlock uint32 + AccountAddresses []AddressInfo +} + +// WalletRepository is the abstraction for any kind of database intended to +// persist a Wallet. +type WalletRepository interface { + // CreateWallet stores a new Wallet if not yet existing. + // Generates a WalletCreated event if successfull. + CreateWallet(ctx context.Context, wallet *Wallet) error + // GetWallet returns the stored wallet, if existing. + GetWallet(ctx context.Context) (*Wallet, error) + // UnlockWallet attempts to update the status of the Wallet to "unlocked". + // Generates a WalletUnlocked event if successfull. + UnlockWallet(ctx context.Context, password string) error + // LockkWallet updates the status of the Wallet to "locked". + // Generates a WalletLocked event if successfull. + LockWallet(ctx context.Context) error + // UpdateWallet allows to make multiple changes to the Wallet in a + // transactional way. + UpdateWallet( + ctx context.Context, updateFn func(v *Wallet) (*Wallet, error), + ) error + // CreateAccount creates a new wallet account with the given name and returns + // its basic info. + // Generates a WalletAccountCreated event if successfull. + CreateAccount( + ctx context.Context, accountName string, birthdayBlock uint32, + ) (*AccountInfo, error) + // DeriveNextExternalAddressesForAccount returns one or more new receiving + // addresses for the given account. + // Generates a WalletAccountAddressesDerived event if successfull. + DeriveNextExternalAddressesForAccount( + ctx context.Context, accountName string, numOfAddresses uint64, + ) ([]AddressInfo, error) + // DeriveNextInternalAddressesForAccount returns one or more new change + // addresses for the given account. + // Generates a WalletAccountAddressesDerived event if successfull. + DeriveNextInternalAddressesForAccount( + ctx context.Context, accountName string, numOfAddresses uint64, + ) ([]AddressInfo, error) + // DeleteAccount deletes the wallet account with the given name. + // Generates a WalletAccountDeleted event if successfull. + DeleteAccount(ctx context.Context, accountName string) error + // GetEventChannel returns the channel of WalletEvents. + GetEventChannel() chan WalletEvent +} diff --git a/internal/core/domain/wallet_test.go b/internal/core/domain/wallet_test.go new file mode 100644 index 0000000..575ed70 --- /dev/null +++ b/internal/core/domain/wallet_test.go @@ -0,0 +1,243 @@ +package domain_test + +import ( + "encoding/hex" + "fmt" + "os" + "strings" + "testing" + + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + "github.com/vulpemventures/go-elements/network" + "github.com/vulpemventures/ocean/internal/core/domain" +) + +var ( + mnemonic = []string{ + "leave", "dice", "fine", "decrease", "dune", "ribbon", "ocean", "earn", + "lunar", "account", "silver", "admit", "cheap", "fringe", "disorder", "trade", + "because", "trade", "steak", "clock", "grace", "video", "jacket", "equal", + } + regtest = network.Regtest.Name + rootPath = "m/84'/1'" + password = "password" + newPassword = "newpassword" + wrongPassword = "wrongpassword" + masterBlingingKey = "9390be245db10fd2d5a1dd3b07a5cabfcc52108dd4f7bd93ee07d045ca872bda" + encryptedMnemonic = "8f29524ee5995c838ca6f28c7ded7da6dc51de804fd2703775989e65ddc1bb3b60122bf0f430bb3b7a267449aaeee103375737d679bfdabf172c3842048925e6f8952e214f6b900435d24cff938be78ad3bb303d305702fbf168534a45a57ac98ca940d4c3319f14d0c97a20b5bcb456d72857d48d0b4f0e0dcf71d1965b6a42aca8d84fcb66aadeabc812a9994cf66e7a75f8718a031418468f023c560312a02f46ec8e65d5dd65c968ddb93e10950e96c8e730ce7a74d33c6ddad9e12f45e534879f1605eb07fe90432f6592f7996091bbb3e3b2" + passwordHash = "b8affdb68657a0417b09a02dd209585480f5a920" + newPasswordHash = "b34d0f1bcefa7d25beefec121165c765c41550f7" + birthdayBlock = uint32(1) +) + +func TestMain(m *testing.M) { + mockedMnemonicCypher := &mockMnemonicCypher{} + mockedMnemonicCypher.On("Encrypt", mock.Anything, mock.Anything).Return(h2b(encryptedMnemonic), nil) + mockedMnemonicCypher.On("Decrypt", h2b(encryptedMnemonic), []byte(password)).Return([]byte(strings.Join(mnemonic, " ")), nil) + mockedMnemonicCypher.On("Decrypt", mock.Anything, mock.Anything).Return(nil, fmt.Errorf("invalid password")) + domain.MnemonicCypher = mockedMnemonicCypher + domain.MnemonicStore = newInMemoryMnemonicStore() + + os.Exit(m.Run()) +} + +func TestNewWallet(t *testing.T) { + t.Parallel() + + t.Run("valid", func(t *testing.T) { + t.Parallel() + + w, err := newTestWallet() + require.NoError(t, err) + require.NotNil(t, w) + require.Equal(t, "m/84'/1'", w.RootPath) + require.Equal(t, regtest, w.NetworkName) + require.Equal(t, encryptedMnemonic, b2h(w.EncryptedMnemonic)) + require.Equal(t, passwordHash, b2h(w.PasswordHash)) + require.Empty(t, w.AccountKeysByIndex) + require.Empty(t, w.AccountKeysByName) + require.Empty(t, w.AccountsByKey) + require.Equal(t, 0, int(w.NextAccountIndex)) + require.True(t, w.IsInitialized()) + require.False(t, w.IsLocked()) + + m, err := w.GetMnemonic() + require.NoError(t, err) + require.Equal(t, mnemonic, m) + + masterKey, err := w.GetMasterBlindingKey() + require.NoError(t, err) + require.Equal(t, masterBlingingKey, masterKey) + + w.Lock() + require.True(t, w.IsLocked()) + + m, err = w.GetMnemonic() + require.EqualError(t, domain.ErrWalletLocked, err.Error()) + require.Empty(t, m) + + masterKey, err = w.GetMasterBlindingKey() + require.EqualError(t, domain.ErrWalletLocked, err.Error()) + require.Empty(t, masterKey) + }) + + t.Run("invalid", func(t *testing.T) { + t.Parallel() + + tests := []struct { + mnemonic []string + password string + network string + birthdayBlock uint32 + expectedError error + }{ + {nil, password, regtest, birthdayBlock, domain.ErrWalletMissingMnemonic}, + {mnemonic, "", regtest, birthdayBlock, domain.ErrWalletMissingPassword}, + {mnemonic, password, "", birthdayBlock, domain.ErrWalletMissingNetwork}, + {mnemonic, password, regtest, 0, domain.ErrWalletMissingBirthdayBlock}, + } + + for _, tt := range tests { + v, err := domain.NewWallet( + tt.mnemonic, tt.password, "", tt.network, tt.birthdayBlock, nil, + ) + require.Nil(t, v) + require.EqualError(t, err, tt.expectedError.Error()) + } + }) +} + +func TestLockUnlock(t *testing.T) { + t.Parallel() + + w, err := newTestWallet() + require.NoError(t, err) + + err = w.Unlock(password) + require.NoError(t, err) + + w.Lock() + + err = w.Unlock(wrongPassword) + require.Error(t, err) + + err = w.Unlock(password) + require.NoError(t, err) +} + +func TestChangePassword(t *testing.T) { + t.Parallel() + + w, err := newTestWallet() + require.NoError(t, err) + + err = w.ChangePassword(password, newPassword) + require.EqualError(t, domain.ErrWalletUnlocked, err.Error()) + + w.Lock() + + err = w.ChangePassword(password, newPassword) + require.NoError(t, err) + require.Equal(t, newPasswordHash, b2h(w.PasswordHash)) +} + +func TestWalletAccount(t *testing.T) { + t.Parallel() + + w, err := newTestWallet() + require.NoError(t, err) + + w.Lock() + + accountName := "test1" + account, err := w.CreateAccount(accountName, 0) + require.EqualError(t, domain.ErrWalletLocked, err.Error()) + require.Nil(t, account) + + err = w.Unlock(password) + require.NoError(t, err) + + account, err = w.CreateAccount(accountName, 0) + require.NoError(t, err) + require.NotNil(t, account) + require.Empty(t, account.NextExternalIndex) + require.Empty(t, account.NextInternalIndex) + require.Empty(t, account.DerivationPathByScript) + require.Equal(t, 0, int(account.Info.Key.Index)) + require.Equal(t, accountName, account.Info.Key.Name) + require.Equal(t, "m/84'/1'/0'", account.Info.DerivationPath) + require.NotEmpty(t, account.Info.Xpub) + + w.Lock() + + gotAccount, err := w.GetAccount(accountName) + require.EqualError(t, domain.ErrWalletLocked, err.Error()) + require.Nil(t, gotAccount) + + w.Unlock(password) + + gotAccount, err = w.GetAccount(accountName) + require.NoError(t, err) + require.Exactly(t, *account, *gotAccount) + + w.Lock() + + allAddrInfo, err := w.AllDerivedAddressesForAccount(accountName) + require.EqualError(t, domain.ErrWalletLocked, err.Error()) + require.Nil(t, allAddrInfo) + + w.Unlock(password) + + allAddrInfo, err = w.AllDerivedAddressesForAccount(accountName) + require.NoError(t, err) + require.Empty(t, allAddrInfo) + + w.Lock() + + addrInfo, err := w.DeriveNextExternalAddressForAccount(accountName) + require.EqualError(t, domain.ErrWalletLocked, err.Error()) + require.Nil(t, addrInfo) + + w.Unlock(password) + + addrInfo, err = w.DeriveNextExternalAddressForAccount(accountName) + require.NoError(t, err) + require.NotNil(t, addrInfo) + require.NotEmpty(t, addrInfo.Address) + require.NotEmpty(t, addrInfo.BlindingKey) + require.NotEmpty(t, addrInfo.Script) + require.NotEmpty(t, addrInfo.DerivationPath) + require.NotEmpty(t, addrInfo.AccountKey.Name) + + allAddrInfo, err = w.AllDerivedAddressesForAccount(accountName) + require.NoError(t, err) + require.Len(t, allAddrInfo, 1) + require.Exactly(t, *addrInfo, allAddrInfo[0]) + + w.Lock() + + err = w.DeleteAccount(accountName) + require.EqualError(t, domain.ErrWalletLocked, err.Error()) + + w.Unlock(password) + + err = w.DeleteAccount(accountName) + require.NoError(t, err) + + _, err = w.GetAccount(accountName) + require.EqualError(t, domain.ErrAccountNotFound, err.Error()) +} + +func newTestWallet() (*domain.Wallet, error) { + return domain.NewWallet(mnemonic, password, rootPath, regtest, birthdayBlock, nil) +} + +func b2h(buf []byte) string { + return hex.EncodeToString(buf) +} + +func h2b(str string) []byte { + buf, _ := hex.DecodeString(str) + return buf +} diff --git a/internal/core/ports/blockchain_scanner.go b/internal/core/ports/blockchain_scanner.go new file mode 100644 index 0000000..b593c15 --- /dev/null +++ b/internal/core/ports/blockchain_scanner.go @@ -0,0 +1,46 @@ +package ports + +import ( + "github.com/vulpemventures/ocean/internal/core/domain" +) + +// BlockchainScanner is the abstraction for any kind of service representing an +// Elements node. It gives info about txs and utxos related to one or more HD +// accounts in a aync way (via channels), and lets broadcast transactions over +// the Liquid network. +type BlockchainScanner interface { + // Start starts the service. + Start() + // Stop stops the service. + Stop() + + // WatchForAccount instructs the scanner to start notifying about txs/utxos + // related to the given list of addresses belonging to the given HD account. + WatchForAccount( + accountName string, startingBlockHeight uint32, + addresses []domain.AddressInfo, + ) + // StopWatchForAccount instructs the scanner to stop notifying about + // txs/utxos related to any address belonging to the given HD account. + StopWatchForAccount(accountName string) + + // GetUtxoChannel returns the channel where notification about utxos realated + // to the given HD account are sent. + GetUtxoChannel(accountName string) chan []*domain.Utxo + // GetTxChannel returns the channel where notification about txs realated to + // the given HD account are sent. + GetTxChannel(accountName string) chan *domain.Transaction + + // GetLatestBlock returns the header of the latest block of the blockchain. + GetLatestBlock() ([]byte, uint32, error) + // GetBlockHeight returns the height of the block identified by its hash. + GetBlockHeight(hash []byte) (uint32, error) + // GetBlockHash returns the hash of the block identified by its height. + GetBlockHash(height uint32) ([]byte, error) + // GetUtxos is a sync function to get info about the utxos represented by + // given outpoints (UtxoKeys). + GetUtxos(utxoKeys []domain.UtxoKey) ([]*domain.Utxo, error) + // BroadcastTransaction sends the given raw tx (in hex string) over the + // network in order to be included in a later block of the Liquid blockchain. + BroadcastTransaction(txHex string) (string, error) +} diff --git a/internal/core/ports/coin_selector.go b/internal/core/ports/coin_selector.go new file mode 100644 index 0000000..fe0db75 --- /dev/null +++ b/internal/core/ports/coin_selector.go @@ -0,0 +1,13 @@ +package ports + +import "github.com/vulpemventures/ocean/internal/core/domain" + +// CoinSelector is the abstraction for any kind of service intended to return a +// subset of the given utxos with target asset hash, covering the target amount +// based on a specific strategy. +type CoinSelector interface { + // SelectUtxos implements a certain coin selection strategy. + SelectUtxos( + utxos []*domain.Utxo, targetAmount uint64, targetAsset string, + ) (selectedUtxos []*domain.Utxo, change uint64, err error) +} diff --git a/internal/core/ports/repo_manager.go b/internal/core/ports/repo_manager.go new file mode 100644 index 0000000..c04e5a5 --- /dev/null +++ b/internal/core/ports/repo_manager.go @@ -0,0 +1,40 @@ +package ports + +import ( + "github.com/vulpemventures/ocean/internal/core/domain" +) + +type WalletEventHandler func(event domain.WalletEvent) +type UtxoEventHandler func(event domain.UtxoEvent) +type TxEventHandler func(event domain.TransactionEvent) + +// RepoManager is the abstraction for any kind of service intended to manage +// domain repositories implementations of the same concrete type. +type RepoManager interface { + // WalletRepository returns the concrete implentation as domain interface. + WalletRepository() domain.WalletRepository + // UtxoRepository returns the concrete implentation as domain interface. + UtxoRepository() domain.UtxoRepository + // TransactionRepository returns the concrete implentation as domain interface. + TransactionRepository() domain.TransactionRepository + + // RegisterHandlerForWalletEvent registers an handler function, executed + // whenever the given event type occurs. + RegisterHandlerForWalletEvent( + eventType domain.WalletEventType, handler WalletEventHandler, + ) + // RegisterHandlerForUtxoEvent registers an handler function, executed + // whenever the given event type occurs. + RegisterHandlerForUtxoEvent( + eventType domain.UtxoEventType, handler UtxoEventHandler, + ) + // RegisterHandlerForTxEvent registers an handler function, executed + // whenever the given event type occurs. + RegisterHandlerForTxEvent( + eventType domain.TransactionEventType, handler TxEventHandler, + ) + + // Close closes the connection with all concrete repositories + // implementations. + Close() +} diff --git a/internal/infrastructure/blockchain-scanner/neutrino/scanner.go b/internal/infrastructure/blockchain-scanner/neutrino/scanner.go new file mode 100644 index 0000000..7e513f0 --- /dev/null +++ b/internal/infrastructure/blockchain-scanner/neutrino/scanner.go @@ -0,0 +1,211 @@ +package neutrino_scanner + +import ( + "encoding/hex" + "fmt" + "sync" + "time" + + "github.com/btcsuite/btcd/chaincfg/chainhash" + log "github.com/sirupsen/logrus" + "github.com/vulpemventures/go-elements/confidential" + "github.com/vulpemventures/go-elements/elementsutil" + "github.com/vulpemventures/neutrino-elements/pkg/blockservice" + "github.com/vulpemventures/neutrino-elements/pkg/repository" + "github.com/vulpemventures/neutrino-elements/pkg/scanner" + "github.com/vulpemventures/ocean/internal/core/domain" +) + +type scannerService struct { + accountName string + svc scanner.ScannerService + blindingKeys map[string][]byte + startingBlockHeight uint32 + chTxs chan *domain.Transaction + chUtxos chan []*domain.Utxo + lock *sync.RWMutex + + log func(format string, a ...interface{}) + warn func(err error, format string, a ...interface{}) +} + +func newScannerSvc( + accountName string, + startingBlockHeight uint32, + filtersDb repository.FilterRepository, + headersDb repository.BlockHeaderRepository, + blockSvc blockservice.BlockService, genesisHash *chainhash.Hash, +) *scannerService { + logFn := func(format string, a ...interface{}) { + format = fmt.Sprintf("scanner: %s", format) + log.Debugf(format, a...) + } + warnFn := func(err error, format string, a ...interface{}) { + format = fmt.Sprintf("scanner: %s", format) + log.WithError(err).Warnf(format, a...) + } + scannerSvc := &scannerService{ + accountName: accountName, + svc: scanner.New(filtersDb, headersDb, blockSvc, genesisHash), + blindingKeys: make(map[string][]byte), + startingBlockHeight: startingBlockHeight, + chTxs: make(chan *domain.Transaction, 10), + chUtxos: make(chan []*domain.Utxo, 10), + lock: &sync.RWMutex{}, + log: logFn, + warn: warnFn, + } + chReports, _ := scannerSvc.svc.Start() + go scannerSvc.listenToReports(chReports) + return scannerSvc +} + +func (s *scannerService) stop() { + s.svc.Stop() + close(s.chTxs) + close(s.chUtxos) +} + +func (s *scannerService) watchAddresses(addressesInfo []domain.AddressInfo) { + s.lock.Lock() + defer s.lock.Unlock() + + for _, info := range addressesInfo { + // Prevent duplicates + if _, ok := s.blindingKeys[info.Script]; ok { + continue + } + + s.blindingKeys[info.Script] = info.BlindingKey + item, _ := scanner.NewScriptWatchItemFromAddress(info.Address) + s.svc.Watch( + scanner.WithWatchItem(item), + scanner.WithStartBlock(s.startingBlockHeight), + scanner.WithPersistentWatch(), + ) + s.log( + "start watching address %s for account %s", + info.DerivationPath, s.accountName, + ) + } +} + +func (s *scannerService) listenToReports(chReports <-chan scanner.Report) { + s.log("start listening to incoming reports from node") + for r := range chReports { + time.Sleep(time.Millisecond) + + if r.Transaction == nil { + continue + } + + tx := r.Transaction + txid := tx.TxHash().String() + txHex, _ := tx.ToHex() + + s.log("received report for tx %s", txid) + + var blockHash string + var blockHeight uint64 + if r.BlockHash != nil { + blockHash = r.BlockHash.String() + blockHeight = uint64(r.BlockHeight) + } + select { + case s.chTxs <- &domain.Transaction{ + TxID: txid, + TxHex: txHex, + Accounts: map[string]struct{}{ + s.accountName: {}, + }, + BlockHash: blockHash, + BlockHeight: blockHeight, + }: + default: + } + + spentUtxos := make([]*domain.Utxo, 0, len(tx.Inputs)) + for _, in := range tx.Inputs { + spentUtxos = append(spentUtxos, &domain.Utxo{ + UtxoKey: domain.UtxoKey{ + TxID: elementsutil.TxIDFromBytes(in.Hash), + VOut: in.Index, + }, + SpentStatus: domain.UtxoStatus{ + Txid: txid, + BlockHeight: blockHeight, + BlockHash: blockHash, + }, + }) + } + select { + case s.chUtxos <- spentUtxos: + default: + } + + newUtxos := make([]*domain.Utxo, 0) + for i, out := range tx.Outputs { + if len(out.Script) == 0 { + continue + } + + script := hex.EncodeToString(out.Script) + blindingKey, ok := s.getBlindingKey(script) + if !ok { + continue + } + + revealed, err := confidential.UnblindOutputWithKey(out, blindingKey) + if err != nil { + s.warn(err, "failed to unblind utxo with given blinding key") + continue + } + + var assetCommitment, valueCommitment []byte + if out.IsConfidential() { + valueCommitment, assetCommitment = out.Value, out.Asset + } + + newUtxos = append(newUtxos, &domain.Utxo{ + UtxoKey: domain.UtxoKey{ + TxID: txid, + VOut: uint32(i), + }, + Value: revealed.Value, + Asset: assetFromBytes(revealed.Asset), + ValueCommitment: valueCommitment, + AssetCommitment: assetCommitment, + ValueBlinder: revealed.ValueBlindingFactor, + AssetBlinder: revealed.AssetBlindingFactor, + Script: out.Script, + Nonce: out.Nonce, + RangeProof: out.RangeProof, + SurjectionProof: out.SurjectionProof, + AccountName: s.accountName, + ConfirmedStatus: domain.UtxoStatus{ + BlockHeight: blockHeight, + BlockHash: blockHash, + }, + }) + } + + if len(newUtxos) > 0 { + select { + case s.chUtxos <- newUtxos: + default: + } + } + } +} + +func (s *scannerService) getBlindingKey(script string) ([]byte, bool) { + s.lock.RLock() + defer s.lock.RUnlock() + + key, ok := s.blindingKeys[script] + return key, ok +} + +func assetFromBytes(buf []byte) string { + return hex.EncodeToString(elementsutil.ReverseBytes(buf)) +} diff --git a/internal/infrastructure/blockchain-scanner/neutrino/service.go b/internal/infrastructure/blockchain-scanner/neutrino/service.go new file mode 100644 index 0000000..6d600b9 --- /dev/null +++ b/internal/infrastructure/blockchain-scanner/neutrino/service.go @@ -0,0 +1,277 @@ +package neutrino_scanner + +import ( + "context" + "encoding/hex" + "encoding/json" + "fmt" + "io" + "net/http" + "sync" + + "github.com/btcsuite/btcd/chaincfg/chainhash" + "github.com/vulpemventures/go-elements/transaction" + "github.com/vulpemventures/neutrino-elements/pkg/blockservice" + "github.com/vulpemventures/neutrino-elements/pkg/node" + "github.com/vulpemventures/neutrino-elements/pkg/protocol" + "github.com/vulpemventures/neutrino-elements/pkg/repository" + "github.com/vulpemventures/neutrino-elements/pkg/repository/inmemory" + "github.com/vulpemventures/ocean/internal/core/domain" + "github.com/vulpemventures/ocean/internal/core/ports" +) + +const ( + userAgent = "neutrino-elements:0.1.0-rc.0" +) + +type service struct { + nodeConfig NodeServiceArgs + nodeSvc node.NodeService + blockSvc blockservice.BlockService + scanners map[string]*scannerService + + filtersRepo repository.FilterRepository + headersRepo repository.BlockHeaderRepository + lock *sync.RWMutex +} + +type NodeServiceArgs struct { + Network string + FiltersDatadir string + BlockHeadersDatadir string + EsploraUrl string + Peers []string +} + +func (a NodeServiceArgs) validate() error { + if a.Network == "" { + return fmt.Errorf("missing network") + } + if a.FiltersDatadir == "" { + return fmt.Errorf("missing filters datadir") + } + if a.BlockHeadersDatadir == "" { + return fmt.Errorf("missing block headers datadir") + } + if a.EsploraUrl == "" { + return fmt.Errorf("missing esplora url") + } + if len(a.Peers) == 0 { + return fmt.Errorf("list of peers must not be empty") + } + return nil +} + +func NewNeutrinoScanner(args NodeServiceArgs) (ports.BlockchainScanner, error) { + if err := args.validate(); err != nil { + return nil, err + } + + filtersDb := inmemory.NewFilterInmemory() + headersDb := inmemory.NewHeaderInmemory() + nodeSvc, err := node.New(node.NodeConfig{ + Network: args.Network, + UserAgent: userAgent, + FiltersDB: filtersDb, + BlockHeadersDB: headersDb, + }) + if err != nil { + return nil, err + } + blockSvc := blockservice.NewEsploraBlockService(args.EsploraUrl) + scanners := make(map[string]*scannerService) + lock := &sync.RWMutex{} + return &service{ + args, nodeSvc, blockSvc, scanners, filtersDb, headersDb, lock, + }, nil +} + +func (s *service) Start() { + s.nodeSvc.Start(s.nodeConfig.Peers[0]) +} + +func (s *service) Stop() { + s.nodeSvc.Stop() + for _, scanner := range s.scanners { + scanner.stop() + } +} + +func (s *service) GetUtxoChannel(accountName string) chan []*domain.Utxo { + scannerSvc := s.getOrCreateScanner(accountName, 0) + return scannerSvc.chUtxos +} + +func (s *service) GetTxChannel(accountName string) chan *domain.Transaction { + scannerSvc := s.getOrCreateScanner(accountName, 0) + return scannerSvc.chTxs +} + +func (s *service) WatchForAccount( + accountName string, startingBlock uint32, addressesInfo []domain.AddressInfo, +) { + scannerSvc := s.getOrCreateScanner(accountName, startingBlock) + scannerSvc.watchAddresses(addressesInfo) +} + +func (s *service) StopWatchForAccount(accountName string) { + scannerSvc := s.getOrCreateScanner(accountName, 0) + scannerSvc.stop() + s.removeScanner(accountName) +} + +func (s *service) GetUtxos(utxoKeys []domain.UtxoKey) ([]*domain.Utxo, error) { + baseUrl := s.nodeConfig.EsploraUrl + client := &http.Client{} + utxos := make([]*domain.Utxo, 0, len(utxoKeys)) + for _, key := range utxoKeys { + url := fmt.Sprintf("%s/tx/%s", baseUrl, key.TxID) + resp, err := client.Get(url) + if err != nil { + return nil, err + } + + defer resp.Body.Close() + body, err := io.ReadAll(resp.Body) + if err != nil { + return nil, err + } + tx := esploraTx{} + json.Unmarshal(body, &tx) + confirmedStatus := domain.UtxoStatus{ + BlockHeight: tx.Status.BlockHeight, + BlockTime: tx.Status.BlockTimestamp, + BlockHash: tx.Status.BlockHash, + } + utxo := tx.Outputs[key.VOut].toDomain(key, confirmedStatus) + utxos = append(utxos, utxo) + } + + return utxos, nil +} + +func (s *service) BroadcastTransaction(txHex string) (string, error) { + tx, err := transaction.NewTxFromHex(txHex) + if err != nil { + return "", fmt.Errorf("invalid tx: %s", err) + } + if err := s.nodeSvc.SendTransaction(txHex); err != nil { + return "", err + } + return tx.TxHash().String(), nil +} + +func (s *service) GetLatestBlock() ([]byte, uint32, error) { + block, err := s.headersRepo.ChainTip(context.Background()) + if err != nil { + return nil, 0, err + } + hash, _ := block.Hash() + return hash.CloneBytes(), block.Height, nil +} + +func (s *service) GetBlockHeight(blockHash []byte) (uint32, error) { + hash, err := chainhash.NewHash(blockHash) + if err != nil { + return 0, err + } + block, err := s.headersRepo.GetBlockHeader(context.Background(), *hash) + if err != nil { + return 0, err + } + return block.Height, nil +} + +func (s *service) GetBlockHash(height uint32) ([]byte, error) { + hash, err := s.headersRepo.GetBlockHashByHeight(context.Background(), height) + if err != nil { + return nil, err + } + return hash.CloneBytes(), nil +} + +func (s *service) getOrCreateScanner( + accountName string, startingBlock uint32, +) *scannerService { + s.lock.Lock() + defer s.lock.Unlock() + + if scannerSvc, ok := s.scanners[accountName]; ok { + return scannerSvc + } + + genesisHash := genesisBlockHashForNetwork(s.nodeConfig.Network) + scannerSvc := newScannerSvc( + accountName, startingBlock, s.filtersRepo, s.headersRepo, s.blockSvc, + genesisHash, + ) + s.scanners[accountName] = scannerSvc + return scannerSvc +} + +func (s *service) removeScanner(accountName string) { + s.lock.Lock() + defer s.lock.Unlock() + + delete(s.scanners, accountName) +} + +func genesisBlockHashForNetwork(net string) *chainhash.Hash { + magic := protocol.Networks[net] + genesis := protocol.GetCheckpoints(magic)[0] + h, _ := chainhash.NewHashFromStr(genesis) + return h +} + +type esploraTx struct { + Txid string `json:"txid"` + Version uint32 `json:"version"` + Locktime uint32 `json:"locktime"` + Inputs []esploraTxIn `json:"vin"` + Outputs []esploraTxOut `json:"vout"` + Size uint32 `json:"size"` + Weight uint32 `json:"weight"` + Fee uint32 `json:"fee"` + Status esploraTxStatus `json:"status"` +} + +type esploraTxOut struct { + Asset string `json:"asset,omitempty"` + Value uint64 `json:"value,omitempty"` + AssetCommitment string `json:"assetcommitment,omitempty"` + ValueCommitment string `json:"valuecommitment,omitempty"` + Script string `json:"scriptpubkey"` +} + +func (o esploraTxOut) toDomain( + key domain.UtxoKey, confirmedStatus domain.UtxoStatus, +) *domain.Utxo { + script, _ := hex.DecodeString(o.Script) + valueCommitment, _ := hex.DecodeString(o.ValueCommitment) + assetCommitment, _ := hex.DecodeString(o.AssetCommitment) + return &domain.Utxo{ + UtxoKey: key, + Value: o.Value, + Asset: o.Asset, + AssetCommitment: assetCommitment, + ValueCommitment: valueCommitment, + Script: script, + ConfirmedStatus: confirmedStatus, + } +} + +type esploraTxIn struct { + Txid string `json:"txid"` + TxIndex string `json:"vout"` + Prevout esploraTxOut `json:"prevout"` + Script string `json:"scriptsig"` + Sequence uint32 `json:"sequence"` + Witness []string `json:"witness"` +} + +type esploraTxStatus struct { + Confirmed bool `json:"confirmed"` + BlockHeight uint64 `json:"block_height"` + BlockHash string `json:"block_hash"` + BlockTimestamp int64 `json:"block_time"` +} diff --git a/internal/infrastructure/coin-selector/smallest-subset/selector.go b/internal/infrastructure/coin-selector/smallest-subset/selector.go new file mode 100644 index 0000000..3f6b096 --- /dev/null +++ b/internal/infrastructure/coin-selector/smallest-subset/selector.go @@ -0,0 +1,162 @@ +package smallestsubset_selector + +import ( + "fmt" + "sort" + + "github.com/vulpemventures/ocean/internal/core/domain" + "github.com/vulpemventures/ocean/internal/core/ports" +) + +var ( + ErrBlindedUtxos = fmt.Errorf("error on utxos: all confidential utxos must be already revealed") + ErrTargetAmountNotReached = fmt.Errorf("not found enough utxos to cover target amount") +) + +type selector struct{} + +func NewSmallestSubsetCoinSelector() ports.CoinSelector { + return &selector{} +} + +func (s *selector) SelectUtxos( + utxos []*domain.Utxo, targetAmount uint64, targetAsset string, +) ([]*domain.Utxo, uint64, error) { + sort.Slice(utxos, func(i, j int) bool { + return utxos[i].Value < utxos[j].Value + }) + + targetUtxos := make([]*domain.Utxo, 0) + totalAmount := uint64(0) + for i := range utxos { + utxo := utxos[i] + if utxo.IsConfidential() && !utxo.IsRevealed() { + return nil, 0, ErrBlindedUtxos + } + if utxo.Asset == targetAsset { + targetUtxos = append(targetUtxos, utxo) + } + } + + indexes := selectUtxos(targetAmount, targetUtxos) + if len(indexes) <= 0 { + return nil, 0, ErrTargetAmountNotReached + } + + selectedUtxos := make([]*domain.Utxo, 0) + for _, v := range indexes { + totalAmount += targetUtxos[v].Value + selectedUtxos = append(selectedUtxos, targetUtxos[v]) + } + + change := totalAmount - targetAmount + return selectedUtxos, change, nil +} + +// selectUtxos returns the index of the utxos that are going to be selected. +// The goal of this strategy is to select as less utxos as possible covering +// the target amount. +func selectUtxos(targetAmount uint64, utxos []*domain.Utxo) []int { + utxoValues := []uint64{} + for _, u := range utxos { + utxoValues = append(utxoValues, u.Value) + } + + list := getBestCombination(utxoValues, targetAmount) + + //since list variable contains values, + //indexes holding those values needs to be calculated + indexes := findIndexes(list, utxoValues) + + return indexes +} + +func findIndexes(list []uint64, utxosValues []uint64) []int { + var indexes []int +loop: + for _, v := range list { + for i, v1 := range utxosValues { + if v == v1 { + if isIndexOccupied(i, indexes) { + continue + } else { + indexes = append(indexes, i) + continue loop + } + } + } + } + return indexes +} + +func isIndexOccupied(i int, list []int) bool { + for _, v := range list { + if v == i { + return true + } + } + return false +} + +// getBestCombination attempts to select as less items as possible +// covering the given target amount. +// The strategy here is to try finding exactly 1 utxo covering the given target +// amount or, otherwise, progressively increase the number of utxos until +// finding a combination that satisfies the criteria. +// If a combination exceeds the target amount, it is returned straightaway if +// its total amount is lower than 10 times the target one. +// Otherwise, if no combination satisfies this last criteria, the very first +// one found is returned. +func getBestCombination(items []uint64, target uint64) []uint64 { + combinations := [][]uint64{} + for i := 1; i < len(items)+1; i++ { + combinations = append(combinations, getCombination(items, i, 0)...) + for j := 0; j < len(combinations); j++ { + total := sum(combinations[j]) + if total < target { + continue + } + if total == target { + return combinations[j] + } + if total <= target*10 { + return combinations[j] + } + } + } + + for _, combo := range combinations { + if totalAmount := sum(combo); totalAmount >= target { + return combo + } + } + + return []uint64{} +} + +var combination = []uint64{} + +// getCombination returns all combinations of size elements from the src slice. +func getCombination(src []uint64, size int, offset int) [][]uint64 { + result := [][]uint64{} + if size == 0 { + temp := make([]uint64, len(combination)) + copy(temp, combination) + return append(result, temp) + } + for i := offset; i <= len(src)-size; i++ { + combination = append(combination, src[i]) + temp := getCombination(src, size-1, i+1) + result = append(result, temp...) + combination = combination[:len(combination)-1] + } + return result[:] +} + +func sum(items []uint64) uint64 { + var total uint64 + for _, v := range items { + total += v + } + return total +} diff --git a/internal/infrastructure/coin-selector/smallest-subset/selector_internal_test.go b/internal/infrastructure/coin-selector/smallest-subset/selector_internal_test.go new file mode 100644 index 0000000..adc132e --- /dev/null +++ b/internal/infrastructure/coin-selector/smallest-subset/selector_internal_test.go @@ -0,0 +1,115 @@ +package smallestsubset_selector + +import ( + "sort" + "testing" + + "github.com/stretchr/testify/require" +) + +func TestGetBestPairs(t *testing.T) { + type args struct { + items []uint64 + target uint64 + } + tests := []struct { + name string + args args + expected []uint64 + }{ + { + name: "1", + args: args{ + items: []uint64{61, 61, 61, 38, 61, 61, 61, 1, 1, 1, 3}, + target: 6, + }, + expected: []uint64{38}, + }, + { + name: "2", + args: args{ + items: []uint64{61, 61, 61, 61, 61, 61, 1, 1, 1, 3}, + target: 6, + }, + expected: []uint64{3, 1, 1, 1}, + }, + { + name: "3", + args: args{ + items: []uint64{61, 61}, + target: 6, + }, + expected: []uint64{61}, + }, + { + name: "4", + args: args{ + items: []uint64{2, 2}, + target: 6, + }, + expected: []uint64{}, + }, + { + name: "5", + args: args{ + items: []uint64{61, 1, 1, 1, 3, 56}, + target: 6, + }, + expected: []uint64{56}, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + sort.Slice(tt.args.items, func(i, j int) bool { + return tt.args.items[i] > tt.args.items[j] + }) + combos := getBestCombination(tt.args.items, tt.args.target) + require.Equal(t, tt.expected, combos) + }) + } +} + +func TestFindIndexes(t *testing.T) { + type args struct { + list []uint64 + unblindedUtxosValues []uint64 + } + tests := []struct { + name string + args args + expected []int + }{ + { + name: "1", + args: args{ + list: []uint64{1000}, + unblindedUtxosValues: []uint64{1000, 1000, 1000}, + }, + expected: []int{0}, + }, + { + name: "2", + args: args{ + list: []uint64{1000, 1000}, + unblindedUtxosValues: []uint64{1000, 2000, 1000}, + }, + expected: []int{0, 2}, + }, + { + name: "3", + args: args{ + list: []uint64{2000, 2000}, + unblindedUtxosValues: []uint64{1000, 2000, 1000, 2000, 2000, + 2000}, + }, + expected: []int{1, 3}, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + indexes := findIndexes(tt.args.list, tt.args.unblindedUtxosValues) + require.Equal(t, tt.expected, indexes) + }) + } +} diff --git a/internal/infrastructure/mnemonic-cypher/aes128/cypher.go b/internal/infrastructure/mnemonic-cypher/aes128/cypher.go new file mode 100644 index 0000000..117c2a3 --- /dev/null +++ b/internal/infrastructure/mnemonic-cypher/aes128/cypher.go @@ -0,0 +1,106 @@ +package cypher_aes128 + +import ( + "crypto/aes" + "crypto/cipher" + "crypto/rand" + "fmt" + "runtime/debug" + + "golang.org/x/crypto/scrypt" +) + +type Cypher struct{} + +func NewAES128Cypher() *Cypher { + return &Cypher{} +} + +func (c *Cypher) Encrypt(mnemonic, password []byte) ([]byte, error) { + // Due to https://github.com/golang/go/issues/7168. + // This call makes sure that memory is freed in case the GC doesn't do that + // right after the encryption/decryption. + defer debug.FreeOSMemory() + + if len(mnemonic) == 0 { + return nil, fmt.Errorf("missing plaintext mnemonic") + } + if len(password) == 0 { + return nil, fmt.Errorf("missing encryption password") + } + + key, salt, err := deriveKey(password, nil) + if err != nil { + return nil, err + } + + blockCipher, err := aes.NewCipher(key) + if err != nil { + return nil, err + } + gcm, err := cipher.NewGCM(blockCipher) + if err != nil { + return nil, err + } + nonce := make([]byte, gcm.NonceSize()) + if _, err = rand.Read(nonce); err != nil { + return nil, err + } + + ciphertext := gcm.Seal(nonce, nonce, mnemonic, nil) + ciphertext = append(ciphertext, salt...) + + return ciphertext, nil +} + +func (c *Cypher) Decrypt(encryptedMnemonic, password []byte) ([]byte, error) { + defer debug.FreeOSMemory() + + if len(encryptedMnemonic) == 0 { + return nil, fmt.Errorf("missing encrypted mnemonic") + } + if len(password) == 0 { + return nil, fmt.Errorf("missing decryption password") + } + + salt := encryptedMnemonic[len(encryptedMnemonic)-32:] + data := encryptedMnemonic[:len(encryptedMnemonic)-32] + + key, _, err := deriveKey(password, salt) + if err != nil { + return nil, err + } + + blockCipher, err := aes.NewCipher(key) + if err != nil { + return nil, err + } + gcm, err := cipher.NewGCM(blockCipher) + if err != nil { + return nil, err + } + nonce, text := data[:gcm.NonceSize()], data[gcm.NonceSize():] + plaintext, err := gcm.Open(nil, nonce, text, nil) + if err != nil { + return nil, fmt.Errorf("invalid passpharse") + } + return plaintext, nil +} + +// deriveKey derives a 32 byte array key from a custom passhprase +func deriveKey(password, salt []byte) ([]byte, []byte, error) { + if salt == nil { + salt = make([]byte, 32) + if _, err := rand.Read(salt); err != nil { + return nil, nil, err + } + } + // 2^20 = 1048576 recommended length for key-stretching + // check the doc for other recommended values: + // https://godoc.org/golang.org/x/crypto/scrypt + key, err := scrypt.Key(password, salt, 1048576, 8, 1, 32) + if err != nil { + return nil, nil, err + } + return key, salt, nil +} diff --git a/internal/infrastructure/mnemonic-store/in-memory/store.go b/internal/infrastructure/mnemonic-store/in-memory/store.go new file mode 100644 index 0000000..6702ab1 --- /dev/null +++ b/internal/infrastructure/mnemonic-store/in-memory/store.go @@ -0,0 +1,34 @@ +package mnemonic_store + +import ( + "strings" + + "github.com/vulpemventures/ocean/internal/config" +) + +const ( + mnemonicKey = "MNEMONIC" +) + +type MnemonicInMemoryStore struct{} + +func NewInMemoryMnemonicStore() *MnemonicInMemoryStore { + return &MnemonicInMemoryStore{} +} + +func (s *MnemonicInMemoryStore) Set(mnemonic string) { + config.Set(mnemonicKey, mnemonic) +} + +func (s *MnemonicInMemoryStore) Unset() { + config.Unset(mnemonicKey) +} + +func (s *MnemonicInMemoryStore) IsSet() bool { + return len(config.GetString(mnemonicKey)) > 0 +} + +func (s *MnemonicInMemoryStore) Get() []string { + mnemonic := config.GetString(mnemonicKey) + return strings.Split(mnemonic, " ") +} diff --git a/internal/infrastructure/storage/db/badger/repo_manager.go b/internal/infrastructure/storage/db/badger/repo_manager.go new file mode 100644 index 0000000..2ef53e2 --- /dev/null +++ b/internal/infrastructure/storage/db/badger/repo_manager.go @@ -0,0 +1,202 @@ +package dbbadger + +import ( + "fmt" + "path/filepath" + "sync" + "time" + + "github.com/dgraph-io/badger/v3" + "github.com/dgraph-io/badger/v3/options" + log "github.com/sirupsen/logrus" + "github.com/timshannon/badgerhold/v4" + "github.com/vulpemventures/ocean/internal/core/domain" + "github.com/vulpemventures/ocean/internal/core/ports" +) + +// repoManager holds all the badgerhold stores and domain repositories +// implementations in a single data structure. +type repoManager struct { + utxoRepository *utxoRepository + walletRepository *walletRepository + txRepository *transactionRepository + + walletEventHandlers *handlerMap + utxoEventHandlers *handlerMap + txEventHandlers *handlerMap +} + +// NewRepoManager is the factory for creating a new badger implementation +// of the ports.RepoManager interface. +// It takes care of creating the db files on disk (or in-memory if no baseDbDir +// is provided - to be used only for testing purposes), and opening and closing +// the connection to them. +func NewRepoManager(baseDbDir string, logger badger.Logger) (ports.RepoManager, error) { + var walletdbDir, utxoDir, txDir string + if len(baseDbDir) > 0 { + walletdbDir = filepath.Join(baseDbDir, "wallet") + utxoDir = filepath.Join(baseDbDir, "utxos") + txDir = filepath.Join(baseDbDir, "txs") + } + + walletDb, err := createDb(walletdbDir, logger) + if err != nil { + return nil, fmt.Errorf("opening wallet db: %w", err) + } + + utxoDb, err := createDb(utxoDir, logger) + if err != nil { + return nil, fmt.Errorf("opening utxo db: %w", err) + } + + txDb, err := createDb(txDir, logger) + if err != nil { + return nil, fmt.Errorf("opening tx db: %w", err) + } + + utxoRepo := newUtxoRepository(utxoDb) + walletRepo := newWalletRepository(walletDb) + txRepo := newTransactionRepository(txDb) + + rm := &repoManager{ + utxoRepository: utxoRepo, + walletRepository: walletRepo, + txRepository: txRepo, + walletEventHandlers: newHandlerMap(), //make(map[domain.WalletEventType]ports.WalletEventHandler), + utxoEventHandlers: newHandlerMap(), // make(map[domain.UtxoEventType]ports.UtxoEventHandler), + txEventHandlers: newHandlerMap(), // make(map[domain.TransactionEventType]ports.TxEventHandler), + } + + go rm.listenToWalletEvents() + go rm.listenToUtxoEvents() + go rm.listenToTxEvents() + + return rm, nil +} + +func (d *repoManager) UtxoRepository() domain.UtxoRepository { + return d.utxoRepository +} + +func (d *repoManager) WalletRepository() domain.WalletRepository { + return d.walletRepository +} + +func (d *repoManager) TransactionRepository() domain.TransactionRepository { + return d.txRepository +} + +func (rm *repoManager) RegisterHandlerForWalletEvent( + eventType domain.WalletEventType, handler ports.WalletEventHandler, +) { + rm.walletEventHandlers.set(int(eventType), handler) +} + +func (rm *repoManager) RegisterHandlerForUtxoEvent( + eventType domain.UtxoEventType, handler ports.UtxoEventHandler, +) { + rm.utxoEventHandlers.set(int(eventType), handler) +} + +func (rm *repoManager) RegisterHandlerForTxEvent( + eventType domain.TransactionEventType, handler ports.TxEventHandler, +) { + rm.txEventHandlers.set(int(eventType), handler) +} + +func (d *repoManager) Close() { + d.walletRepository.close() + d.utxoRepository.close() + d.txRepository.close() +} + +func (rm *repoManager) listenToWalletEvents() { + for event := range rm.walletRepository.chEvents { + if handler, ok := rm.walletEventHandlers.get(int(event.EventType)); ok { + handler.(ports.WalletEventHandler)(event) + } + } +} + +func (rm *repoManager) listenToUtxoEvents() { + for event := range rm.utxoRepository.chEvents { + if handler, ok := rm.utxoEventHandlers.get(int(event.EventType)); ok { + handler.(ports.UtxoEventHandler)(event) + } + } +} + +func (rm *repoManager) listenToTxEvents() { + for event := range rm.txRepository.chEvents { + if handler, ok := rm.txEventHandlers.get(int(event.EventType)); ok { + handler.(ports.TxEventHandler)(event) + } + } +} + +func createDb(dbDir string, logger badger.Logger) (*badgerhold.Store, error) { + isInMemory := len(dbDir) <= 0 + + opts := badger.DefaultOptions(dbDir) + opts.Logger = logger + + if isInMemory { + opts.InMemory = true + } else { + opts.Compression = options.ZSTD + } + + db, err := badgerhold.Open(badgerhold.Options{ + Encoder: badgerhold.DefaultEncode, + Decoder: badgerhold.DefaultDecode, + SequenceBandwith: 100, + Options: opts, + }) + if err != nil { + return nil, err + } + + if !isInMemory { + ticker := time.NewTicker(30 * time.Minute) + + go func() { + for { + <-ticker.C + if err := db.Badger().RunValueLogGC(0.5); err != nil && err != badger.ErrNoRewrite { + log.Warnf("garbage collector: %s", err) + } + } + }() + } + + return db, nil +} + +// handlerMap is a util type to prevent race conditions when registering +// or retrieving handlers for events. +type handlerMap struct { + handlersByEventType map[int]interface{} + lock *sync.RWMutex +} + +func newHandlerMap() *handlerMap { + return &handlerMap{ + handlersByEventType: make(map[int]interface{}), + lock: &sync.RWMutex{}, + } +} + +func (m *handlerMap) set(key int, val interface{}) { + m.lock.Lock() + defer m.lock.Unlock() + if _, ok := m.handlersByEventType[key]; !ok { + m.handlersByEventType[key] = val + } +} + +func (m *handlerMap) get(key int) (interface{}, bool) { + m.lock.RLock() + defer m.lock.RUnlock() + val, ok := m.handlersByEventType[key] + return val, ok +} diff --git a/internal/infrastructure/storage/db/badger/transaction_repository.go b/internal/infrastructure/storage/db/badger/transaction_repository.go new file mode 100644 index 0000000..9a953b8 --- /dev/null +++ b/internal/infrastructure/storage/db/badger/transaction_repository.go @@ -0,0 +1,182 @@ +package dbbadger + +import ( + "context" + "fmt" + "sync" + + "github.com/dgraph-io/badger/v3" + log "github.com/sirupsen/logrus" + "github.com/timshannon/badgerhold/v4" + "github.com/vulpemventures/ocean/internal/core/domain" +) + +type transactionRepository struct { + store *badgerhold.Store + chEvents chan domain.TransactionEvent + externalChEvents chan domain.TransactionEvent + lock *sync.Mutex + + log func(format string, a ...interface{}) +} + +func NewTransactionRepository( + store *badgerhold.Store, +) domain.TransactionRepository { + return newTransactionRepository(store) +} + +func newTransactionRepository( + store *badgerhold.Store, +) *transactionRepository { + chEvents := make(chan domain.TransactionEvent) + extrernalChEvents := make(chan domain.TransactionEvent) + lock := &sync.Mutex{} + logFn := func(format string, a ...interface{}) { + format = fmt.Sprintf("transaction repository: %s", format) + log.Debugf(format, a...) + } + return &transactionRepository{ + store, chEvents, extrernalChEvents, lock, logFn, + } +} + +func (r *transactionRepository) AddTransaction( + ctx context.Context, tx *domain.Transaction, +) (bool, error) { + done, err := r.insertTx(ctx, tx) + if done { + go r.publishEvent(domain.TransactionEvent{ + EventType: domain.TransactionAdded, + Transaction: tx, + }) + } + return done, err +} + +func (r *transactionRepository) ConfirmTransaction( + ctx context.Context, txid, blockHash string, blockheight uint64, +) (bool, error) { + tx, err := r.getTx(ctx, txid) + if err != nil { + return false, err + } + + if tx.IsConfirmed() { + return false, nil + } + + tx.Confirm(blockHash, blockheight) + + if err := r.updateTx(ctx, *tx); err != nil { + return false, err + } + + go r.publishEvent(domain.TransactionEvent{ + EventType: domain.TransactionConfirmed, + Transaction: tx, + }) + + return true, nil +} + +func (r *transactionRepository) GetTransaction( + ctx context.Context, txid string, +) (*domain.Transaction, error) { + return r.getTx(ctx, txid) +} + +func (r *transactionRepository) UpdateTransaction( + ctx context.Context, txid string, + updateFn func(*domain.Transaction) (*domain.Transaction, error), +) error { + tx, err := r.getTx(ctx, txid) + if err != nil { + return err + } + + updatedTx, err := updateFn(tx) + if err != nil { + return err + } + + return r.updateTx(ctx, *updatedTx) +} + +func (r *transactionRepository) GetEventChannel() chan domain.TransactionEvent { + return r.externalChEvents +} + +func (r *transactionRepository) insertTx( + ctx context.Context, tx *domain.Transaction, +) (bool, error) { + var err error + if ctx.Value("tx") != nil { + t := ctx.Value("tx").(*badger.Txn) + err = r.store.TxInsert(t, tx.TxID, tx) + } else { + err = r.store.Insert(tx.TxID, tx) + } + + if err != nil { + if err == badgerhold.ErrKeyExists { + return false, nil + } + return false, err + } + + return true, nil +} + +func (r *transactionRepository) getTx( + ctx context.Context, txid string, +) (*domain.Transaction, error) { + var err error + var tx domain.Transaction + + if ctx.Value("tx") != nil { + t := ctx.Value("tx").(*badger.Txn) + err = r.store.TxGet(t, txid, &tx) + } else { + err = r.store.Get(txid, &tx) + } + + if err != nil { + if err == badgerhold.ErrNotFound { + return nil, fmt.Errorf("transaction not found") + } + return nil, err + } + + return &tx, nil +} + +func (r *transactionRepository) updateTx( + ctx context.Context, tx domain.Transaction, +) error { + if ctx.Value("tx") != nil { + t := ctx.Value("tx").(*badger.Txn) + return r.store.TxUpdate(t, tx.TxID, tx) + } + return r.store.Update(tx.TxID, tx) +} + +func (r *transactionRepository) publishEvent(event domain.TransactionEvent) { + r.lock.Lock() + defer r.lock.Unlock() + + r.log("publish event %s", event.EventType) + r.chEvents <- event + + // send over channel without blocking in case nobody is listening. + select { + case r.externalChEvents <- event: + default: + } +} + +func (r *transactionRepository) close() { + r.store.Close() + close(r.chEvents) + close(r.externalChEvents) +} diff --git a/internal/infrastructure/storage/db/badger/utxo_repository.go b/internal/infrastructure/storage/db/badger/utxo_repository.go new file mode 100644 index 0000000..b2cbc5c --- /dev/null +++ b/internal/infrastructure/storage/db/badger/utxo_repository.go @@ -0,0 +1,533 @@ +package dbbadger + +import ( + "context" + "fmt" + "sync" + + "github.com/dgraph-io/badger/v3" + log "github.com/sirupsen/logrus" + "github.com/timshannon/badgerhold/v4" + "github.com/vulpemventures/ocean/internal/core/domain" +) + +type utxoRepository struct { + store *badgerhold.Store + chEvents chan domain.UtxoEvent + externalChEvents chan domain.UtxoEvent + lock *sync.Mutex + + log func(format string, a ...interface{}) +} + +func NewUtxoRepository(store *badgerhold.Store) domain.UtxoRepository { + return newUtxoRepository(store) +} + +func newUtxoRepository(store *badgerhold.Store) *utxoRepository { + chEvents := make(chan domain.UtxoEvent) + externalChEvents := make(chan domain.UtxoEvent) + lock := &sync.Mutex{} + logFn := func(format string, a ...interface{}) { + format = fmt.Sprintf("utxo repository: %s", format) + log.Debugf(format, a...) + } + return &utxoRepository{store, chEvents, externalChEvents, lock, logFn} +} + +func (r *utxoRepository) AddUtxos( + ctx context.Context, utxos []*domain.Utxo, +) (int, error) { + return r.addUtxos(ctx, utxos) +} + +func (r *utxoRepository) GetUtxosByKey( + ctx context.Context, utxoKeys []domain.UtxoKey, +) ([]*domain.Utxo, error) { + utxos := make([]*domain.Utxo, 0, len(utxoKeys)) + for _, key := range utxoKeys { + query := badgerhold.Where("TxID").Eq(key.TxID).And("VOut").Eq(key.VOut) + foundUtxos, err := r.findUtxos(ctx, query) + if err != nil { + return nil, err + } + if len(foundUtxos) > 0 { + utxos = append(utxos, foundUtxos[0]) + } + } + + if len(utxos) == 0 { + return nil, fmt.Errorf("no utxos found with given keys") + } + return utxos, nil +} + +func (r *utxoRepository) GetAllUtxos( + ctx context.Context, +) []*domain.Utxo { + return r.getAllUtxos(ctx) +} + +func (r *utxoRepository) GetSpendableUtxos( + ctx context.Context, +) ([]*domain.Utxo, error) { + query := badgerhold.Where("SpentStatus").Eq(domain.UtxoStatus{}). + And("ConfirmedStatus").Ne(domain.UtxoStatus{}).And("LockTimestamp").Eq(int64(0)) + + return r.findUtxos(ctx, query) +} + +func (r *utxoRepository) GetAllUtxosForAccount( + ctx context.Context, accountName string, +) ([]*domain.Utxo, error) { + query := badgerhold.Where("AccountName").Eq(accountName) + + return r.findUtxos(ctx, query) +} + +func (r *utxoRepository) GetSpendableUtxosForAccount( + ctx context.Context, accountName string, +) ([]*domain.Utxo, error) { + query := badgerhold.Where("SpentStatus").Eq(domain.UtxoStatus{}). + And("ConfirmedStatus").Ne(domain.UtxoStatus{}). + And("LockTimestamp").Eq(int64(0)).And("AccountName").Eq(accountName) + + return r.findUtxos(ctx, query) +} + +func (r *utxoRepository) GetLockedUtxosForAccount( + ctx context.Context, accountName string, +) ([]*domain.Utxo, error) { + query := badgerhold.Where("SpentStatus").Eq(domain.UtxoStatus{}). + And("LockTimestamp").Gt(int64(0)).And("AccountName").Eq(accountName) + + return r.findUtxos(ctx, query) +} + +func (r *utxoRepository) GetBalanceForAccount( + ctx context.Context, accountName string, +) (map[string]*domain.Balance, error) { + utxos, err := r.GetAllUtxosForAccount(ctx, accountName) + if err != nil { + return nil, err + } + + balance := make(map[string]*domain.Balance) + for _, u := range utxos { + if u.IsSpent() { + continue + } + + if _, ok := balance[u.Asset]; !ok { + balance[u.Asset] = &domain.Balance{} + } + + b := balance[u.Asset] + if u.IsLocked() { + b.Locked += u.Value + } else { + if u.IsConfirmed() { + b.Confirmed += u.Value + } else { + b.Unconfirmed += u.Value + } + } + } + return balance, nil +} + +func (r *utxoRepository) SpendUtxos( + ctx context.Context, utxoKeys []domain.UtxoKey, status domain.UtxoStatus, +) (int, error) { + return r.spendUtxos(ctx, utxoKeys, status) +} + +func (r *utxoRepository) ConfirmUtxos( + ctx context.Context, utxoKeys []domain.UtxoKey, status domain.UtxoStatus, +) (int, error) { + return r.confirmUtxos(ctx, utxoKeys, status) +} + +func (r *utxoRepository) LockUtxos( + ctx context.Context, utxoKeys []domain.UtxoKey, timestamp int64, +) (int, error) { + return r.lockUtxos(ctx, utxoKeys, timestamp) +} + +func (r *utxoRepository) UnlockUtxos( + ctx context.Context, utxoKeys []domain.UtxoKey, +) (int, error) { + return r.unlockUtxos(ctx, utxoKeys) +} + +func (r *utxoRepository) DeleteUtxosForAccount( + ctx context.Context, accountName string, +) error { + query := badgerhold.Where("AccountName").Eq(accountName) + + utxos, err := r.findUtxos(ctx, query) + if err != nil { + return err + } + + utxoKeys := make([]domain.UtxoKey, 0, len(utxos)) + for _, u := range utxos { + utxoKeys = append(utxoKeys, u.Key()) + } + return r.deleteUtxos(ctx, utxoKeys) +} + +func (r *utxoRepository) GetEventChannel() chan domain.UtxoEvent { + return r.externalChEvents +} + +func (r *utxoRepository) addUtxos( + ctx context.Context, utxos []*domain.Utxo, +) (int, error) { + count := 0 + utxosInfo := make([]domain.UtxoInfo, 0) + for _, u := range utxos { + done, err := r.insertUtxo(ctx, u) + if err != nil { + return -1, err + } + if done { + count++ + utxosInfo = append(utxosInfo, u.Info()) + } + } + + if count > 0 { + go r.publishEvent(domain.UtxoEvent{ + EventType: domain.UtxoAdded, + Utxos: utxosInfo, + }) + } + + return count, nil +} + +func (r *utxoRepository) getAllUtxos(ctx context.Context) []*domain.Utxo { + utxos, _ := r.findUtxos(ctx, nil) + return utxos +} + +func (r *utxoRepository) spendUtxos( + ctx context.Context, utxoKeys []domain.UtxoKey, status domain.UtxoStatus, +) (int, error) { + count := 0 + utxosInfo := make([]domain.UtxoInfo, 0) + for _, key := range utxoKeys { + done, info, err := r.spendUtxo(ctx, key, status) + if err != nil { + return -1, err + } + if done { + count++ + utxosInfo = append(utxosInfo, *info) + } + } + if count > 0 { + go r.publishEvent(domain.UtxoEvent{ + EventType: domain.UtxoSpent, + Utxos: utxosInfo, + }) + } + + return count, nil +} + +func (r *utxoRepository) confirmUtxos( + ctx context.Context, utxoKeys []domain.UtxoKey, status domain.UtxoStatus, +) (int, error) { + count := 0 + utxosInfo := make([]domain.UtxoInfo, 0) + for _, key := range utxoKeys { + done, info, err := r.confirmUtxo(ctx, key, status) + if err != nil { + return -1, err + } + if done { + count++ + utxosInfo = append(utxosInfo, *info) + } + } + + if count > 0 { + go r.publishEvent(domain.UtxoEvent{ + EventType: domain.UtxoConfirmed, + Utxos: utxosInfo, + }) + } + + return count, nil +} + +func (r *utxoRepository) lockUtxos( + ctx context.Context, utxoKeys []domain.UtxoKey, timestamp int64, +) (int, error) { + count := 0 + utxosInfo := make([]domain.UtxoInfo, 0) + for _, key := range utxoKeys { + done, info, err := r.lockUtxo(ctx, key, timestamp) + if err != nil { + return -1, err + } + if done { + count++ + utxosInfo = append(utxosInfo, *info) + } + } + + if count > 0 { + go r.publishEvent(domain.UtxoEvent{ + EventType: domain.UtxoLocked, + Utxos: utxosInfo, + }) + } + + return count, nil +} + +func (r *utxoRepository) unlockUtxos( + ctx context.Context, utxoKeys []domain.UtxoKey, +) (int, error) { + count := 0 + utxosInfo := make([]domain.UtxoInfo, 0) + for _, key := range utxoKeys { + done, info, err := r.unlockUtxo(ctx, key) + if err != nil { + return -1, err + } + if done { + count++ + utxosInfo = append(utxosInfo, *info) + } + } + + if count > 0 { + go r.publishEvent(domain.UtxoEvent{ + EventType: domain.UtxoUnlocked, + Utxos: utxosInfo, + }) + } + + return count, nil +} + +func (r *utxoRepository) spendUtxo( + ctx context.Context, key domain.UtxoKey, status domain.UtxoStatus, +) (bool, *domain.UtxoInfo, error) { + query := badgerhold.Where("TxID").Eq(key.TxID).And("VOut").Eq(key.VOut) + utxos, err := r.findUtxos(ctx, query) + if err != nil { + return false, nil, err + } + + if utxos == nil { + return false, nil, nil + } + + utxo := utxos[0] + if utxo.IsSpent() { + return false, nil, nil + } + + if err := utxo.Spend(status); err != nil { + return false, nil, err + } + if err := r.updateUtxo(ctx, utxo); err != nil { + return false, nil, err + } + + utxoInfo := utxo.Info() + return true, &utxoInfo, nil +} + +func (r *utxoRepository) confirmUtxo( + ctx context.Context, key domain.UtxoKey, status domain.UtxoStatus, +) (bool, *domain.UtxoInfo, error) { + query := badgerhold.Where("TxID").Eq(key.TxID).And("VOut").Eq(key.VOut) + utxos, err := r.findUtxos(ctx, query) + if err != nil { + return false, nil, err + } + + if utxos == nil { + return false, nil, nil + } + + utxo := utxos[0] + if utxo.IsConfirmed() { + return false, nil, nil + } + + if err := utxo.Confirm(status); err != nil { + return false, nil, err + } + if err := r.updateUtxo(ctx, utxo); err != nil { + return false, nil, err + } + + utxoInfo := utxo.Info() + return true, &utxoInfo, nil +} + +func (r *utxoRepository) lockUtxo( + ctx context.Context, key domain.UtxoKey, timestamp int64, +) (bool, *domain.UtxoInfo, error) { + query := badgerhold.Where("TxID").Eq(key.TxID).And("VOut").Eq(key.VOut) + utxos, err := r.findUtxos(ctx, query) + if err != nil { + return false, nil, err + } + + if utxos == nil { + return false, nil, nil + } + + utxo := utxos[0] + if utxo.IsLocked() { + return false, nil, nil + } + + utxo.Lock(timestamp) + if err := r.updateUtxo(ctx, utxo); err != nil { + return false, nil, err + } + + utxoInfo := utxo.Info() + return true, &utxoInfo, nil +} + +func (r *utxoRepository) unlockUtxo( + ctx context.Context, key domain.UtxoKey, +) (bool, *domain.UtxoInfo, error) { + query := badgerhold.Where("TxID").Eq(key.TxID).And("VOut").Eq(key.VOut) + utxos, err := r.findUtxos(ctx, query) + if err != nil { + return false, nil, err + } + + if utxos == nil { + return false, nil, nil + } + + utxo := utxos[0] + if !utxo.IsLocked() { + return false, nil, nil + } + + utxo.Unlock() + if err := r.updateUtxo(ctx, utxo); err != nil { + return false, nil, err + } + + utxoInfo := utxo.Info() + return true, &utxoInfo, nil +} + +func (r *utxoRepository) findUtxos( + ctx context.Context, query *badgerhold.Query, +) ([]*domain.Utxo, error) { + var list []domain.Utxo + var utxos []*domain.Utxo + var err error + if ctx.Value("tx") != nil { + tx := ctx.Value("tx").(*badger.Txn) + err = r.store.TxFind(tx, &utxos, query) + } else { + err = r.store.Find(&utxos, query) + } + if err != nil { + if err == badgerhold.ErrNotFound { + return nil, nil + } + return nil, err + } + + for i := range list { + u := &list[i] + utxos = append(utxos, u) + } + return utxos, nil +} + +func (r *utxoRepository) updateUtxo( + ctx context.Context, utxo *domain.Utxo, +) error { + key := utxo.Key() + query := badgerhold.Where("TxID").Eq(key.TxID).And("VOut").Eq(key.VOut) + if ctx.Value("tx") != nil { + tx := ctx.Value("tx").(*badger.Txn) + return r.store.TxUpdateMatching( + tx, domain.Utxo{}, query, func(record interface{}) error { + u := record.(*domain.Utxo) + *u = *utxo + return nil + }, + ) + } + + return r.store.UpdateMatching(domain.Utxo{}, query, func(record interface{}) error { + u := record.(*domain.Utxo) + *u = *utxo + return nil + }) +} + +func (r *utxoRepository) insertUtxo( + ctx context.Context, utxo *domain.Utxo, +) (bool, error) { + var err error + if ctx.Value("tx") != nil { + tx := ctx.Value("tx").(*badger.Txn) + err = r.store.TxInsert(tx, utxo.Key().Hash(), *utxo) + } else { + err = r.store.Insert(utxo.Key().Hash(), *utxo) + } + if err != nil { + if err == badgerhold.ErrKeyExists { + return false, nil + } + return false, err + } + return true, nil +} + +func (r *utxoRepository) deleteUtxos( + ctx context.Context, keys []domain.UtxoKey, +) error { + query := &badgerhold.Query{} + for _, key := range keys { + qq := badgerhold.Where("TxID").Eq(key.TxID).And("VOut").Eq(key.VOut) + query = query.Or(qq) + } + + if ctx.Value("tx") != nil { + tx := ctx.Value("tx").(*badger.Txn) + return r.store.TxDeleteMatching(tx, &domain.Utxo{}, query) + } + + return r.store.DeleteMatching(&domain.Utxo{}, query) +} + +func (r *utxoRepository) publishEvent(event domain.UtxoEvent) { + r.lock.Lock() + defer r.lock.Unlock() + + r.log("publish event %s", event.EventType) + r.chEvents <- event + + // send over channel without blocking in case nobody is listening. + select { + case r.externalChEvents <- event: + default: + } +} + +func (r *utxoRepository) close() { + r.store.Close() + close(r.chEvents) + close(r.externalChEvents) +} diff --git a/internal/infrastructure/storage/db/badger/wallet_repository.go b/internal/infrastructure/storage/db/badger/wallet_repository.go new file mode 100644 index 0000000..fa191b4 --- /dev/null +++ b/internal/infrastructure/storage/db/badger/wallet_repository.go @@ -0,0 +1,308 @@ +package dbbadger + +import ( + "context" + "fmt" + "sync" + + "github.com/dgraph-io/badger/v3" + log "github.com/sirupsen/logrus" + "github.com/timshannon/badgerhold/v4" + "github.com/vulpemventures/ocean/internal/core/domain" +) + +const ( + //since there can be only 1 wallet in database, + //key is hardcoded for easier retrival + walletKey = "wallet" +) + +type walletRepository struct { + store *badgerhold.Store + chEvents chan domain.WalletEvent + externalChEvents chan domain.WalletEvent + lock *sync.Mutex + + log func(format string, a ...interface{}) +} + +func NewWalletRepository(store *badgerhold.Store) domain.WalletRepository { + return newWalletRepository(store) +} + +func newWalletRepository(store *badgerhold.Store) *walletRepository { + chEvents := make(chan domain.WalletEvent, 10) + extrernalChEvents := make(chan domain.WalletEvent, 10) + lock := &sync.Mutex{} + logFn := func(format string, a ...interface{}) { + format = fmt.Sprintf("wallet repository: %s", format) + log.Debugf(format, a...) + } + return &walletRepository{store, chEvents, extrernalChEvents, lock, logFn} +} + +func (r *walletRepository) CreateWallet( + ctx context.Context, wallet *domain.Wallet, +) error { + wallet.Lock() + if err := r.insertWallet(ctx, wallet); err != nil { + return err + } + + go r.publishEvent(domain.WalletEvent{ + EventType: domain.WalletCreated, + }) + + return nil +} + +func (r *walletRepository) GetWallet( + ctx context.Context, +) (*domain.Wallet, error) { + return r.getWallet(ctx) +} + +func (r *walletRepository) UnlockWallet( + ctx context.Context, password string, +) error { + if err := r.UpdateWallet( + ctx, func(w *domain.Wallet) (*domain.Wallet, error) { + if err := w.Unlock(password); err != nil { + return nil, err + } + return w, nil + }, + ); err != nil { + return err + } + + go r.publishEvent(domain.WalletEvent{ + EventType: domain.WalletUnlocked, + }) + + return nil +} + +func (r *walletRepository) LockWallet(ctx context.Context) error { + if err := r.UpdateWallet( + ctx, func(w *domain.Wallet) (*domain.Wallet, error) { + w.Lock() + return w, nil + }, + ); err != nil { + return err + } + + go r.publishEvent(domain.WalletEvent{ + EventType: domain.WalletLocked, + }) + + return nil +} + +func (r *walletRepository) UpdateWallet( + ctx context.Context, updateFn func(v *domain.Wallet) (*domain.Wallet, error), +) error { + wallet, err := r.getWallet(ctx) + if err != nil { + return err + } + + updatedWallet, err := updateFn(wallet) + if err != nil { + return err + } + + return r.updateWallet(ctx, updatedWallet) +} + +func (r *walletRepository) CreateAccount( + ctx context.Context, accountName string, birthdayBlock uint32, +) (*domain.AccountInfo, error) { + var accountInfo *domain.AccountInfo + if err := r.UpdateWallet( + ctx, func(w *domain.Wallet) (*domain.Wallet, error) { + account, err := w.CreateAccount(accountName, birthdayBlock) + if err != nil { + return nil, err + } + if account == nil { + return nil, fmt.Errorf("account %s already existing", accountName) + } + accountInfo = &account.Info + return w, nil + }, + ); err != nil { + return nil, err + } + + go r.publishEvent(domain.WalletEvent{ + EventType: domain.WalletAccountCreated, + AccountName: accountName, + AccountBirthdayBlock: birthdayBlock, + }) + + return accountInfo, nil +} + +func (r *walletRepository) DeriveNextExternalAddressesForAccount( + ctx context.Context, accountName string, numOfAddress uint64, +) ([]domain.AddressInfo, error) { + if numOfAddress == 0 { + numOfAddress = 1 + } + + var addressesInfo []domain.AddressInfo + if err := r.UpdateWallet( + ctx, func(w *domain.Wallet) (*domain.Wallet, error) { + for i := 0; i < int(numOfAddress); i++ { + addrInfo, err := w.DeriveNextExternalAddressForAccount(accountName) + if err != nil { + return nil, err + } + addressesInfo = append(addressesInfo, *addrInfo) + } + return w, nil + }, + ); err != nil { + return nil, err + } + + go r.publishEvent(domain.WalletEvent{ + EventType: domain.WalletAccountAddressesDerived, + AccountName: accountName, + AccountAddresses: addressesInfo, + }) + + return addressesInfo, nil +} + +func (r *walletRepository) DeriveNextInternalAddressesForAccount( + ctx context.Context, accountName string, numOfAddress uint64, +) ([]domain.AddressInfo, error) { + if numOfAddress == 0 { + numOfAddress = 1 + } + + var addressesInfo []domain.AddressInfo + if err := r.UpdateWallet( + ctx, func(w *domain.Wallet) (*domain.Wallet, error) { + for i := 0; i < int(numOfAddress); i++ { + addrInfo, err := w.DeriveNextInternalAddressForAccount(accountName) + if err != nil { + return nil, err + } + addressesInfo = append(addressesInfo, *addrInfo) + } + return w, nil + }, + ); err != nil { + return nil, err + } + + go r.publishEvent(domain.WalletEvent{ + EventType: domain.WalletAccountAddressesDerived, + AccountName: accountName, + AccountAddresses: addressesInfo, + }) + + return addressesInfo, nil +} + +func (r *walletRepository) DeleteAccount( + ctx context.Context, accountName string, +) error { + if err := r.UpdateWallet( + ctx, func(w *domain.Wallet) (*domain.Wallet, error) { + if err := w.DeleteAccount(accountName); err != nil { + return nil, err + } + return w, nil + }, + ); err != nil { + return err + } + + go r.publishEvent(domain.WalletEvent{ + EventType: domain.WalletAccountDeleted, + AccountName: accountName, + }) + + return nil +} + +func (r *walletRepository) GetEventChannel() chan domain.WalletEvent { + return r.externalChEvents +} + +func (r *walletRepository) insertWallet( + ctx context.Context, wallet *domain.Wallet, +) error { + var err error + + if ctx.Value("tx") != nil { + tx := ctx.Value("tx").(*badger.Txn) + err = r.store.TxInsert(tx, walletKey, *wallet) + } else { + err = r.store.Insert(walletKey, *wallet) + } + if err != nil { + if err == badgerhold.ErrKeyExists { + return fmt.Errorf("wallet is already initialized") + } + return err + } + + return nil +} + +func (r *walletRepository) getWallet(ctx context.Context) (*domain.Wallet, error) { + var err error + var wallet domain.Wallet + + if ctx.Value("tx") != nil { + tx := ctx.Value("tx").(*badger.Txn) + err = r.store.TxGet(tx, walletKey, &wallet) + } else { + err = r.store.Get(walletKey, &wallet) + } + + if err != nil { + if err == badgerhold.ErrNotFound { + return nil, fmt.Errorf("wallet is not initialized") + } + return nil, err + } + + return &wallet, nil +} + +func (r *walletRepository) updateWallet( + ctx context.Context, wallet *domain.Wallet, +) error { + if ctx.Value("tx") != nil { + tx := ctx.Value("tx").(*badger.Txn) + return r.store.TxUpdate(tx, walletKey, *wallet) + } + return r.store.Update(walletKey, *wallet) +} + +func (r *walletRepository) publishEvent(event domain.WalletEvent) { + r.lock.Lock() + defer r.lock.Unlock() + + r.log("publish event %s", event.EventType) + r.chEvents <- event + + // send over channel without blocking in case nobody is listening. + select { + case r.externalChEvents <- event: + default: + } +} + +func (r *walletRepository) close() { + r.store.Close() + close(r.chEvents) + close(r.externalChEvents) +} diff --git a/internal/infrastructure/storage/db/inmemory/repo_manager.go b/internal/infrastructure/storage/db/inmemory/repo_manager.go new file mode 100644 index 0000000..ff2c68a --- /dev/null +++ b/internal/infrastructure/storage/db/inmemory/repo_manager.go @@ -0,0 +1,135 @@ +package inmemory + +import ( + "sync" + "time" + + "github.com/vulpemventures/ocean/internal/core/domain" + "github.com/vulpemventures/ocean/internal/core/ports" +) + +type repoManager struct { + utxoRepository *utxoRepository + walletRepository *walletRepository + txRepository *txRepository + + walletEventHandlers *handlerMap + utxoEventHandlers *handlerMap + txEventHandlers *handlerMap +} + +func NewRepoManager() ports.RepoManager { + utxoRepo := newUtxoRepository() + walletRepo := newWalletRepository() + txRepo := newTransactionRepository() + + rm := &repoManager{ + utxoRepository: utxoRepo, + walletRepository: walletRepo, + txRepository: txRepo, + walletEventHandlers: newHandlerMap(), + utxoEventHandlers: newHandlerMap(), + txEventHandlers: newHandlerMap(), + } + + go rm.listenToWalletEvents() + go rm.listenToUtxoEvents() + go rm.listenToTxEvents() + + return rm +} + +func (rm *repoManager) UtxoRepository() domain.UtxoRepository { + return rm.utxoRepository +} + +func (rm *repoManager) WalletRepository() domain.WalletRepository { + return rm.walletRepository +} + +func (rm *repoManager) TransactionRepository() domain.TransactionRepository { + return rm.txRepository +} + +func (rm *repoManager) RegisterHandlerForWalletEvent( + eventType domain.WalletEventType, handler ports.WalletEventHandler, +) { + rm.walletEventHandlers.set(int(eventType), handler) +} + +func (rm *repoManager) RegisterHandlerForUtxoEvent( + eventType domain.UtxoEventType, handler ports.UtxoEventHandler, +) { + rm.utxoEventHandlers.set(int(eventType), handler) +} + +func (rm *repoManager) RegisterHandlerForTxEvent( + eventType domain.TransactionEventType, handler ports.TxEventHandler, +) { + rm.txEventHandlers.set(int(eventType), handler) +} + +func (rm *repoManager) listenToWalletEvents() { + for event := range rm.walletRepository.chEvents { + time.Sleep(time.Millisecond) + + if handler, ok := rm.walletEventHandlers.get(int(event.EventType)); ok { + handler.(ports.WalletEventHandler)(event) + } + } +} + +func (rm *repoManager) listenToUtxoEvents() { + for event := range rm.utxoRepository.chEvents { + time.Sleep(time.Millisecond) + + if handler, ok := rm.utxoEventHandlers.get(int(event.EventType)); ok { + handler.(ports.UtxoEventHandler)(event) + } + } +} + +func (rm *repoManager) listenToTxEvents() { + for event := range rm.txRepository.chEvents { + time.Sleep(time.Millisecond) + + if handler, ok := rm.txEventHandlers.get(int(event.EventType)); ok { + handler.(ports.TxEventHandler)(event) + } + } +} + +func (rm *repoManager) Close() { + rm.walletRepository.close() + rm.utxoRepository.close() + rm.txRepository.close() +} + +// handlerMap is a util type to prevent race conditions when registering +// or retrieving handlers for events. +type handlerMap struct { + handlersByEventType map[int]interface{} + lock *sync.RWMutex +} + +func newHandlerMap() *handlerMap { + return &handlerMap{ + handlersByEventType: make(map[int]interface{}), + lock: &sync.RWMutex{}, + } +} + +func (m *handlerMap) set(key int, val interface{}) { + m.lock.Lock() + defer m.lock.Unlock() + if _, ok := m.handlersByEventType[key]; !ok { + m.handlersByEventType[key] = val + } +} + +func (m *handlerMap) get(key int) (interface{}, bool) { + m.lock.RLock() + defer m.lock.RUnlock() + val, ok := m.handlersByEventType[key] + return val, ok +} diff --git a/internal/infrastructure/storage/db/inmemory/transaction_repository.go b/internal/infrastructure/storage/db/inmemory/transaction_repository.go new file mode 100644 index 0000000..06ec4dc --- /dev/null +++ b/internal/infrastructure/storage/db/inmemory/transaction_repository.go @@ -0,0 +1,157 @@ +package inmemory + +import ( + "context" + "fmt" + "sync" + + "github.com/vulpemventures/ocean/internal/core/domain" +) + +type txInmemoryStore struct { + txs map[string]*domain.Transaction + lock *sync.RWMutex +} + +type txRepository struct { + store *txInmemoryStore + chEvents chan domain.TransactionEvent + externalChEvents chan domain.TransactionEvent + chLock *sync.Mutex +} + +func NewTransactionRepository() domain.TransactionRepository { + return newTransactionRepository() +} + +func newTransactionRepository() *txRepository { + return &txRepository{ + store: &txInmemoryStore{ + txs: make(map[string]*domain.Transaction), + lock: &sync.RWMutex{}, + }, + chEvents: make(chan domain.TransactionEvent), + externalChEvents: make(chan domain.TransactionEvent), + chLock: &sync.Mutex{}, + } +} + +func (r *txRepository) AddTransaction( + ctx context.Context, tx *domain.Transaction, +) (bool, error) { + r.store.lock.Lock() + defer r.store.lock.Unlock() + + return r.addTx(ctx, tx) +} + +func (r *txRepository) ConfirmTransaction( + ctx context.Context, txid, blockHash string, blockheight uint64, +) (bool, error) { + r.store.lock.Lock() + defer r.store.lock.Unlock() + + return r.confirmTx(ctx, txid, blockHash, blockheight) +} + +func (r *txRepository) GetTransaction( + ctx context.Context, txid string, +) (*domain.Transaction, error) { + r.store.lock.RLock() + defer r.store.lock.RUnlock() + + return r.getTx(ctx, txid) +} + +func (r *txRepository) UpdateTransaction( + ctx context.Context, txid string, + updateFn func(tx *domain.Transaction) (*domain.Transaction, error), +) error { + r.store.lock.Lock() + defer r.store.lock.Unlock() + + tx, err := r.getTx(ctx, txid) + if err != nil { + return err + } + + updatedTx, err := updateFn(tx) + if err != nil { + return err + } + + r.store.txs[txid] = updatedTx + return nil +} + +func (r *txRepository) GetEventChannel() chan domain.TransactionEvent { + return r.externalChEvents +} + +func (r *txRepository) addTx( + _ context.Context, tx *domain.Transaction, +) (bool, error) { + if _, ok := r.store.txs[tx.TxID]; ok { + return false, nil + } + + r.store.txs[tx.TxID] = tx + + go r.publishEvent(domain.TransactionEvent{ + EventType: domain.TransactionAdded, + Transaction: tx, + }) + + return true, nil +} + +func (r *txRepository) confirmTx( + ctx context.Context, txid string, blockHash string, blockHeight uint64, +) (bool, error) { + tx, err := r.getTx(ctx, txid) + if err != nil { + return false, nil + } + + if tx.IsConfirmed() { + return false, nil + } + + tx.Confirm(blockHash, blockHeight) + + r.store.txs[txid] = tx + + go r.publishEvent(domain.TransactionEvent{ + EventType: domain.TransactionConfirmed, + Transaction: tx, + }) + + return true, nil +} + +func (r *txRepository) getTx( + _ context.Context, txid string, +) (*domain.Transaction, error) { + tx, ok := r.store.txs[txid] + if !ok { + return nil, fmt.Errorf("transaction not found") + } + return tx, nil +} + +func (r *txRepository) publishEvent(event domain.TransactionEvent) { + r.chLock.Lock() + defer r.chLock.Unlock() + + r.chEvents <- event + // send over channel without blocking in case nobody is listening. + select { + case r.externalChEvents <- event: + default: + } +} + +func (r *txRepository) close() { + close(r.chEvents) + close(r.externalChEvents) +} diff --git a/internal/infrastructure/storage/db/inmemory/utxo_repository.go b/internal/infrastructure/storage/db/inmemory/utxo_repository.go new file mode 100644 index 0000000..ed9fb3f --- /dev/null +++ b/internal/infrastructure/storage/db/inmemory/utxo_repository.go @@ -0,0 +1,407 @@ +package inmemory + +import ( + "context" + "fmt" + "sync" + + "github.com/vulpemventures/ocean/internal/core/domain" +) + +type utxoInmemoryStore struct { + utxosByAccount map[string][]domain.UtxoKey + utxos map[string]*domain.Utxo + lock *sync.RWMutex +} + +type utxoRepository struct { + store *utxoInmemoryStore + chEvents chan domain.UtxoEvent + externalChEvents chan domain.UtxoEvent + chLock *sync.Mutex +} + +func NewUtxoRepository() domain.UtxoRepository { + return newUtxoRepository() +} + +func newUtxoRepository() *utxoRepository { + return &utxoRepository{ + store: &utxoInmemoryStore{ + utxosByAccount: make(map[string][]domain.UtxoKey), + utxos: make(map[string]*domain.Utxo), + lock: &sync.RWMutex{}, + }, + chEvents: make(chan domain.UtxoEvent), + externalChEvents: make(chan domain.UtxoEvent), + chLock: &sync.Mutex{}, + } +} + +func (r *utxoRepository) AddUtxos( + _ context.Context, utxos []*domain.Utxo, +) (int, error) { + r.store.lock.Lock() + defer r.store.lock.Unlock() + + return r.addUtxos(utxos) +} + +func (r *utxoRepository) GetUtxosByKey( + _ context.Context, utxoKeys []domain.UtxoKey, +) ([]*domain.Utxo, error) { + r.store.lock.RLock() + defer r.store.lock.RUnlock() + + utxos := make([]*domain.Utxo, 0, len(utxoKeys)) + for _, key := range utxoKeys { + u, ok := r.store.utxos[key.Hash()] + if !ok { + continue + } + utxos = append(utxos, u) + } + + if len(utxos) == 0 { + return nil, fmt.Errorf("no utxos found with given keys") + } + + return utxos, nil +} + +func (r *utxoRepository) GetAllUtxos(_ context.Context) []*domain.Utxo { + r.store.lock.RLock() + defer r.store.lock.RUnlock() + + return r.getUtxos(false) +} + +func (r *utxoRepository) GetSpendableUtxos(_ context.Context) ([]*domain.Utxo, error) { + r.store.lock.RLock() + defer r.store.lock.RUnlock() + + return r.getUtxos(true), nil +} + +func (r *utxoRepository) GetAllUtxosForAccount( + _ context.Context, account string, +) ([]*domain.Utxo, error) { + r.store.lock.RLock() + defer r.store.lock.RUnlock() + + return r.getUtxosForAccount(account, false, false) +} + +func (r *utxoRepository) GetSpendableUtxosForAccount( + _ context.Context, account string, +) ([]*domain.Utxo, error) { + r.store.lock.RLock() + defer r.store.lock.RUnlock() + + return r.getUtxosForAccount(account, true, false) +} + +func (r *utxoRepository) GetLockedUtxosForAccount( + _ context.Context, account string, +) ([]*domain.Utxo, error) { + r.store.lock.RLock() + defer r.store.lock.RUnlock() + + return r.getUtxosForAccount(account, false, true) +} + +func (r *utxoRepository) GetBalanceForAccount( + _ context.Context, account string, +) (map[string]*domain.Balance, error) { + r.store.lock.RLock() + defer r.store.lock.RUnlock() + + utxos, _ := r.getUtxosForAccount(account, false, false) + balance := make(map[string]*domain.Balance) + for _, u := range utxos { + if u.IsSpent() { + continue + } + + if _, ok := balance[u.Asset]; !ok { + balance[u.Asset] = &domain.Balance{} + } + b := balance[u.Asset] + if u.IsLocked() { + b.Locked += u.Value + } else { + if u.IsConfirmed() { + b.Confirmed += u.Value + } else { + b.Unconfirmed += u.Value + } + } + } + + return balance, nil +} + +func (r *utxoRepository) SpendUtxos( + _ context.Context, utxos []domain.UtxoKey, status domain.UtxoStatus, +) (int, error) { + r.store.lock.Lock() + defer r.store.lock.Unlock() + + return r.spendUtxos(utxos, status) +} + +func (r *utxoRepository) ConfirmUtxos( + _ context.Context, utxos []domain.UtxoKey, status domain.UtxoStatus, +) (int, error) { + r.store.lock.Lock() + defer r.store.lock.Unlock() + + return r.confirmUtxos(utxos, status) +} + +func (r *utxoRepository) LockUtxos( + _ context.Context, utxos []domain.UtxoKey, timestamp int64, +) (int, error) { + r.store.lock.Lock() + defer r.store.lock.Unlock() + + return r.lockUtxos(utxos, timestamp) +} + +func (r *utxoRepository) UnlockUtxos( + _ context.Context, utxos []domain.UtxoKey, +) (int, error) { + r.store.lock.Lock() + defer r.store.lock.Unlock() + + return r.unlockUtxos(utxos) +} + +func (r *utxoRepository) DeleteUtxosForAccount( + _ context.Context, accountName string, +) error { + keys, ok := r.store.utxosByAccount[accountName] + if !ok { + return nil + } + for _, key := range keys { + delete(r.store.utxos, key.Hash()) + } + delete(r.store.utxosByAccount, accountName) + return nil +} + +func (r *utxoRepository) GetEventChannel() chan domain.UtxoEvent { + return r.externalChEvents +} + +func (r *utxoRepository) addUtxos(utxos []*domain.Utxo) (int, error) { + count := 0 + utxosInfo := make([]domain.UtxoInfo, 0, len(utxos)) + for _, u := range utxos { + if _, ok := r.store.utxos[u.Key().Hash()]; ok { + continue + } + r.store.utxos[u.Key().Hash()] = u + r.store.utxosByAccount[u.AccountName] = append( + r.store.utxosByAccount[u.AccountName], u.Key(), + ) + utxosInfo = append(utxosInfo, u.Info()) + count++ + } + + if count > 0 { + go r.publishEvent(domain.UtxoEvent{ + EventType: domain.UtxoAdded, + Utxos: utxosInfo, + }) + } + + return count, nil +} + +func (r *utxoRepository) getUtxos(spendableOnly bool) []*domain.Utxo { + utxos := make([]*domain.Utxo, 0, len(r.store.utxos)) + for _, u := range r.store.utxos { + if spendableOnly { + if !u.IsLocked() && u.IsConfirmed() && !u.IsSpent() { + utxos = append(utxos, u) + } + continue + } + utxos = append(utxos, u) + } + return utxos +} + +func (r *utxoRepository) getUtxosForAccount( + account string, spendableOnly, lockedOnly bool, +) ([]*domain.Utxo, error) { + keys := r.store.utxosByAccount[account] + if len(keys) == 0 { + return nil, nil + } + + utxos := make([]*domain.Utxo, 0, len(keys)) + for _, k := range keys { + u := r.store.utxos[k.Hash()] + + if spendableOnly { + if !u.IsLocked() && u.IsConfirmed() && !u.IsSpent() { + utxos = append(utxos, u) + } + continue + } + + if lockedOnly { + if u.IsLocked() { + utxos = append(utxos, u) + } + continue + } + utxos = append(utxos, u) + } + + return utxos, nil +} + +func (r *utxoRepository) spendUtxos( + keys []domain.UtxoKey, status domain.UtxoStatus, +) (int, error) { + count := 0 + utxosInfo := make([]domain.UtxoInfo, 0, len(keys)) + for _, key := range keys { + utxo, ok := r.store.utxos[key.Hash()] + if !ok { + continue + } + + if utxo.IsSpent() { + continue + } + + if err := utxo.Spend(status); err != nil { + return -1, err + } + + utxosInfo = append(utxosInfo, utxo.Info()) + count++ + } + + if count > 0 { + go r.publishEvent(domain.UtxoEvent{ + EventType: domain.UtxoSpent, + Utxos: utxosInfo, + }) + } + + return count, nil +} + +func (r *utxoRepository) confirmUtxos( + keys []domain.UtxoKey, status domain.UtxoStatus, +) (int, error) { + count := 0 + utxosInfo := make([]domain.UtxoInfo, 0, len(keys)) + for _, key := range keys { + utxo, ok := r.store.utxos[key.Hash()] + if !ok { + continue + } + + if utxo.IsConfirmed() { + continue + } + + if err := utxo.Confirm(status); err != nil { + return -1, err + } + + utxosInfo = append(utxosInfo, utxo.Info()) + count++ + } + + if count > 0 { + go r.publishEvent(domain.UtxoEvent{ + EventType: domain.UtxoConfirmed, + Utxos: utxosInfo, + }) + } + + return count, nil +} + +func (r *utxoRepository) lockUtxos( + keys []domain.UtxoKey, timestamp int64, +) (int, error) { + count := 0 + utxosInfo := make([]domain.UtxoInfo, 0, len(keys)) + for _, key := range keys { + utxo, ok := r.store.utxos[key.Hash()] + if !ok { + continue + } + + if utxo.IsLocked() { + continue + } + + utxo.Lock(timestamp) + utxosInfo = append(utxosInfo, utxo.Info()) + count++ + } + + if count > 0 { + go r.publishEvent(domain.UtxoEvent{ + EventType: domain.UtxoLocked, + Utxos: utxosInfo, + }) + } + + return count, nil +} + +func (r *utxoRepository) unlockUtxos(keys []domain.UtxoKey) (int, error) { + count := 0 + utxosInfo := make([]domain.UtxoInfo, 0, len(keys)) + for _, key := range keys { + utxo, ok := r.store.utxos[key.Hash()] + if !ok { + continue + } + + if !utxo.IsLocked() { + continue + } + + utxo.Unlock() + utxosInfo = append(utxosInfo, utxo.Info()) + count++ + } + + if count > 0 { + go r.publishEvent(domain.UtxoEvent{ + EventType: domain.UtxoUnlocked, + Utxos: utxosInfo, + }) + } + + return count, nil +} + +func (r *utxoRepository) publishEvent(event domain.UtxoEvent) { + r.chLock.Lock() + defer r.chLock.Unlock() + + r.chEvents <- event + // send over channel without blocking in case nobody is listening. + select { + case r.externalChEvents <- event: + default: + } +} + +func (r *utxoRepository) close() { + close(r.chEvents) + close(r.externalChEvents) +} diff --git a/internal/infrastructure/storage/db/inmemory/wallet_repository.go b/internal/infrastructure/storage/db/inmemory/wallet_repository.go new file mode 100644 index 0000000..de4aeb9 --- /dev/null +++ b/internal/infrastructure/storage/db/inmemory/wallet_repository.go @@ -0,0 +1,256 @@ +package inmemory + +import ( + "context" + "fmt" + "sync" + + "github.com/vulpemventures/ocean/internal/core/domain" +) + +var ( + ErrWalletAlreadyExisting = fmt.Errorf("wallet already existing") +) + +type walletInmemoryStore struct { + wallet *domain.Wallet + lock *sync.RWMutex +} + +type walletRepository struct { + store *walletInmemoryStore + chEvents chan domain.WalletEvent + externalChEvents chan domain.WalletEvent + chLock *sync.Mutex +} + +func NewWalletRepository() domain.WalletRepository { + return newWalletRepository() +} + +func newWalletRepository() *walletRepository { + return &walletRepository{ + store: &walletInmemoryStore{ + lock: &sync.RWMutex{}, + }, + chEvents: make(chan domain.WalletEvent), + externalChEvents: make(chan domain.WalletEvent), + chLock: &sync.Mutex{}, + } +} + +func (r *walletRepository) CreateWallet( + ctx context.Context, wallet *domain.Wallet, +) error { + r.store.lock.Lock() + defer r.store.lock.Unlock() + + if r.store.wallet != nil { + return ErrWalletAlreadyExisting + } + + wallet.Lock() + r.store.wallet = wallet + + go r.publishEvent(domain.WalletEvent{ + EventType: domain.WalletCreated, + }) + + return nil +} + +func (r *walletRepository) GetWallet(ctx context.Context) (*domain.Wallet, error) { + r.store.lock.RLock() + defer r.store.lock.RUnlock() + + if r.store.wallet == nil { + return nil, fmt.Errorf("wallet is not initialized") + } + return r.store.wallet, nil +} + +func (r *walletRepository) UnlockWallet( + ctx context.Context, password string, +) error { + if err := r.UpdateWallet( + ctx, func(w *domain.Wallet) (*domain.Wallet, error) { + if err := w.Unlock(password); err != nil { + return nil, err + } + return w, nil + }, + ); err != nil { + return err + } + + go r.publishEvent(domain.WalletEvent{ + EventType: domain.WalletUnlocked, + }) + + return nil +} + +func (r *walletRepository) LockWallet(ctx context.Context) error { + if err := r.UpdateWallet( + ctx, func(w *domain.Wallet) (*domain.Wallet, error) { + w.Lock() + return w, nil + }, + ); err != nil { + return err + } + + go r.publishEvent(domain.WalletEvent{ + EventType: domain.WalletLocked, + }) + + return nil +} + +func (r *walletRepository) UpdateWallet( + ctx context.Context, updateFn func(*domain.Wallet) (*domain.Wallet, error), +) error { + wallet, err := r.GetWallet(ctx) + if err != nil { + return err + } + + r.store.lock.Lock() + defer r.store.lock.Unlock() + + updatedWallet, err := updateFn(wallet) + if err != nil { + return err + } + + r.store.wallet = updatedWallet + return nil +} + +func (r *walletRepository) CreateAccount( + ctx context.Context, accountName string, birthdayBlock uint32, +) (*domain.AccountInfo, error) { + var accountInfo *domain.AccountInfo + + if err := r.UpdateWallet( + ctx, func(w *domain.Wallet) (*domain.Wallet, error) { + account, err := w.CreateAccount(accountName, birthdayBlock) + if err != nil { + return nil, err + } + if account == nil { + return nil, fmt.Errorf("account %s already existing", accountName) + } + accountInfo = &account.Info + return w, nil + }, + ); err != nil { + return nil, err + } + + go r.publishEvent(domain.WalletEvent{ + EventType: domain.WalletAccountCreated, + AccountName: accountName, + }) + + return accountInfo, nil +} + +func (r *walletRepository) DeriveNextExternalAddressesForAccount( + ctx context.Context, accountName string, numOfAddresses uint64, +) ([]domain.AddressInfo, error) { + addressesInfo := make([]domain.AddressInfo, 0) + + if err := r.UpdateWallet( + ctx, func(w *domain.Wallet) (*domain.Wallet, error) { + for i := 0; i < int(numOfAddresses); i++ { + addrInfo, err := w.DeriveNextExternalAddressForAccount(accountName) + if err != nil { + return nil, err + } + addressesInfo = append(addressesInfo, *addrInfo) + } + return w, nil + }, + ); err != nil { + return nil, err + } + + go r.publishEvent(domain.WalletEvent{ + EventType: domain.WalletAccountAddressesDerived, + AccountName: accountName, + AccountAddresses: addressesInfo, + }) + + return addressesInfo, nil +} + +func (r *walletRepository) DeriveNextInternalAddressesForAccount( + ctx context.Context, accountName string, numOfAddresses uint64, +) ([]domain.AddressInfo, error) { + addressesInfo := make([]domain.AddressInfo, 0) + + if err := r.UpdateWallet( + ctx, func(w *domain.Wallet) (*domain.Wallet, error) { + for i := 0; i < int(numOfAddresses); i++ { + addrInfo, err := w.DeriveNextInternalAddressForAccount(accountName) + if err != nil { + return nil, err + } + addressesInfo = append(addressesInfo, *addrInfo) + } + return w, nil + }, + ); err != nil { + return nil, err + } + + go r.publishEvent(domain.WalletEvent{ + EventType: domain.WalletAccountAddressesDerived, + AccountName: accountName, + AccountAddresses: addressesInfo, + }) + + return addressesInfo, nil +} + +func (r *walletRepository) DeleteAccount(ctx context.Context, accountName string) error { + if err := r.UpdateWallet( + ctx, func(w *domain.Wallet) (*domain.Wallet, error) { + if err := w.DeleteAccount(accountName); err != nil { + return nil, err + } + return w, nil + }, + ); err != nil { + return err + } + + go r.publishEvent(domain.WalletEvent{ + EventType: domain.WalletAccountDeleted, + AccountName: accountName, + }) + + return nil +} + +func (r *walletRepository) GetEventChannel() chan domain.WalletEvent { + return r.externalChEvents +} + +func (r *walletRepository) publishEvent(event domain.WalletEvent) { + r.chLock.Lock() + defer r.chLock.Unlock() + + r.chEvents <- event + // send over channel without blocking in case nobody is listening. + select { + case r.externalChEvents <- event: + default: + } +} + +func (r *walletRepository) close() { + close(r.chEvents) + close(r.externalChEvents) +} diff --git a/internal/infrastructure/storage/db/test/mocks_test.go b/internal/infrastructure/storage/db/test/mocks_test.go new file mode 100644 index 0000000..af9097c --- /dev/null +++ b/internal/infrastructure/storage/db/test/mocks_test.go @@ -0,0 +1,174 @@ +package db_test + +import ( + "crypto/rand" + "encoding/hex" + "math/big" + "strings" + "sync" + + "github.com/stretchr/testify/mock" + "github.com/vulpemventures/ocean/internal/core/domain" +) + +// MnemonicStore +type inMemoryMnemonicStore struct { + mnemonic []string + lock *sync.RWMutex +} + +func newInMemoryMnemonicStore() domain.IMnemonicStore { + return &inMemoryMnemonicStore{ + lock: &sync.RWMutex{}, + } +} + +func (s *inMemoryMnemonicStore) Set(mnemonic string) { + s.lock.Lock() + defer s.lock.Unlock() + + s.mnemonic = strings.Split(mnemonic, " ") +} + +func (s *inMemoryMnemonicStore) Unset() { + s.lock.Lock() + defer s.lock.Unlock() + + s.mnemonic = nil +} + +func (s *inMemoryMnemonicStore) IsSet() bool { + s.lock.RLock() + defer s.lock.RUnlock() + + return len(s.mnemonic) > 0 +} + +func (s *inMemoryMnemonicStore) Get() []string { + s.lock.RLock() + defer s.lock.RUnlock() + + return s.mnemonic +} + +// MnemonicCypher +type mockMnemonicCypher struct { + mock.Mock +} + +func (m *mockMnemonicCypher) Encrypt( + mnemonic, password []byte, +) ([]byte, error) { + args := m.Called(mnemonic, password) + + var res []byte + if a := args.Get(0); a != nil { + res = a.([]byte) + } + return res, args.Error(1) +} + +func (m *mockMnemonicCypher) Decrypt( + encryptedMnemonic, password []byte, +) ([]byte, error) { + args := m.Called(encryptedMnemonic, password) + + var res []byte + if a := args.Get(0); a != nil { + res = a.([]byte) + } + return res, args.Error(1) +} + +func randomUtxosForAccount( + accountName string, +) ([]*domain.Utxo, []domain.UtxoKey, map[string]*domain.Balance) { + num := randomIntInRange(1, 5) + utxos := make([]*domain.Utxo, 0, num) + keys := make([]domain.UtxoKey, 0, num) + balanceByAsset := make(map[string]*domain.Balance) + for i := 0; i < num; i++ { + key := randomKey() + utxo := &domain.Utxo{ + UtxoKey: key, + Value: randomValue(), + Asset: randomHex(32), + ValueCommitment: randomValueCommitment(), + AssetCommitment: randomAssetCommitment(), + ValueBlinder: randomBytes(32), + AssetBlinder: randomBytes(32), + Script: randomScript(), + Nonce: randomBytes(33), + AccountName: accountName, + } + + if _, ok := balanceByAsset[utxo.Asset]; !ok { + balanceByAsset[utxo.Asset] = &domain.Balance{} + } + balanceByAsset[utxo.Asset].Unconfirmed += utxo.Value + keys = append(keys, key) + utxos = append(utxos, utxo) + } + return utxos, keys, balanceByAsset +} + +func randomTx(accountName string) *domain.Transaction { + return &domain.Transaction{ + TxID: randomHex(32), + TxHex: randomHex(100), + Accounts: map[string]struct{}{ + accountName: {}, + }, + } +} + +func randomKey() domain.UtxoKey { + return domain.UtxoKey{ + TxID: randomHex(32), + VOut: randomVout(), + } +} + +func randomScript() []byte { + return append([]byte{0, 20}, randomBytes(20)...) +} + +func randomValueCommitment() []byte { + return append([]byte{9}, randomBytes(32)...) +} + +func randomAssetCommitment() []byte { + return append([]byte{10}, randomBytes(32)...) +} + +func randomHex(len int) string { + return hex.EncodeToString(randomBytes(len)) +} + +func randomVout() uint32 { + return uint32(randomIntInRange(0, 15)) +} + +func randomValue() uint64 { + return uint64(randomIntInRange(1000000, 10000000000)) +} + +func randomBytes(len int) []byte { + b := make([]byte, len) + rand.Read(b) + return b +} + +func randomIntInRange(min, max int) int { + n, _ := rand.Int(rand.Reader, big.NewInt(int64(max))) + return int(int(n.Int64())) + min +} + +func b2h(buf []byte) string { + return hex.EncodeToString(buf) +} + +func h2b(str string) []byte { + buf, _ := hex.DecodeString(str) + return buf +} diff --git a/internal/infrastructure/storage/db/test/transaction_repository_test.go b/internal/infrastructure/storage/db/test/transaction_repository_test.go new file mode 100644 index 0000000..264b413 --- /dev/null +++ b/internal/infrastructure/storage/db/test/transaction_repository_test.go @@ -0,0 +1,126 @@ +package db_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + "github.com/vulpemventures/ocean/internal/core/domain" + "github.com/vulpemventures/ocean/internal/core/ports" + dbbadger "github.com/vulpemventures/ocean/internal/infrastructure/storage/db/badger" + "github.com/vulpemventures/ocean/internal/infrastructure/storage/db/inmemory" +) + +func TestTransactionRepository(t *testing.T) { + repositories, err := newTransactionRepositories( + func(repoType string) ports.TxEventHandler { + return func(event domain.TransactionEvent) { + t.Logf( + "received event from %s repo: {EventType: %s, Transaction: "+ + "{TxID: %s, Accounts: %v}}\n", repoType, event.EventType, + event.Transaction.TxID, event.Transaction.GetAccounts(), + ) + } + }, + ) + require.NoError(t, err) + + for name, repo := range repositories { + t.Run(name, func(t *testing.T) { + testTransactionRepository(t, repo) + }) + } +} + +func testTransactionRepository(t *testing.T, repo domain.TransactionRepository) { + accountName := "test1" + newTx := randomTx(accountName) + txid := newTx.TxID + wrongTxid := randomHex(32) + + t.Run("add_transaction", func(t *testing.T) { + done, err := repo.AddTransaction(ctx, newTx) + require.NoError(t, err) + require.True(t, done) + + done, err = repo.AddTransaction(ctx, newTx) + require.NoError(t, err) + require.False(t, done) + }) + + t.Run("get_transaction", func(t *testing.T) { + tx, err := repo.GetTransaction(ctx, txid) + require.NoError(t, err) + require.NotNil(t, tx) + require.Exactly(t, *newTx, *tx) + + tx, err = repo.GetTransaction(ctx, wrongTxid) + require.Error(t, err) + require.Nil(t, tx) + }) + + t.Run("confirm_transaction", func(t *testing.T) { + blockHash := randomHex(32) + blockHeight := uint64(randomIntInRange(100, 1000)) + + done, err := repo.ConfirmTransaction(ctx, txid, blockHash, blockHeight) + require.NoError(t, err) + require.True(t, done) + + done, err = repo.ConfirmTransaction(ctx, txid, blockHash, blockHeight) + require.NoError(t, err) + require.False(t, done) + + tx, err := repo.GetTransaction(ctx, txid) + require.NoError(t, err) + require.NotNil(t, tx) + require.True(t, tx.IsConfirmed()) + }) + + t.Run("update_transaction", func(t *testing.T) { + tx, err := repo.GetTransaction(ctx, txid) + require.NoError(t, err) + require.NotNil(t, tx) + require.Len(t, tx.GetAccounts(), 1) + + err = repo.UpdateTransaction( + ctx, txid, func(tx *domain.Transaction) (*domain.Transaction, error) { + return tx, nil + }, + ) + require.NoError(t, err) + + err = repo.UpdateTransaction( + ctx, txid, func(tx *domain.Transaction) (*domain.Transaction, error) { + return nil, errSomethingWentWrong + }, + ) + require.EqualError(t, errSomethingWentWrong, err.Error()) + }) +} + +func newTransactionRepositories( + handlerFactory func(repoType string) ports.TxEventHandler, +) (map[string]domain.TransactionRepository, error) { + inmemoryRepoManager := inmemory.NewRepoManager() + badgerRepoManager, err := dbbadger.NewRepoManager("", nil) + if err != nil { + return nil, err + } + + handlers := []ports.TxEventHandler{ + handlerFactory("badger"), handlerFactory("inmemory"), + } + repoManagers := []ports.RepoManager{badgerRepoManager, inmemoryRepoManager} + + for i, handler := range handlers { + repoManager := repoManagers[i] + repoManager.RegisterHandlerForTxEvent(domain.TransactionAdded, handler) + repoManager.RegisterHandlerForTxEvent(domain.TransactionUnconfirmed, handler) + repoManager.RegisterHandlerForTxEvent(domain.TransactionConfirmed, handler) + } + + return map[string]domain.TransactionRepository{ + "inmemory": inmemoryRepoManager.TransactionRepository(), + "badger": badgerRepoManager.TransactionRepository(), + }, nil +} diff --git a/internal/infrastructure/storage/db/test/utxo_repository_test.go b/internal/infrastructure/storage/db/test/utxo_repository_test.go new file mode 100644 index 0000000..c683859 --- /dev/null +++ b/internal/infrastructure/storage/db/test/utxo_repository_test.go @@ -0,0 +1,273 @@ +package db_test + +import ( + "encoding/hex" + "testing" + "time" + + "github.com/stretchr/testify/require" + "github.com/vulpemventures/ocean/internal/core/domain" + "github.com/vulpemventures/ocean/internal/core/ports" + dbbadger "github.com/vulpemventures/ocean/internal/infrastructure/storage/db/badger" + "github.com/vulpemventures/ocean/internal/infrastructure/storage/db/inmemory" +) + +var ( + accountName = "test1" + wrongAccountName = "test2" + newUtxos []*domain.Utxo + utxoKeys []domain.UtxoKey + balanceByAsset map[string]*domain.Balance + txid = hex.EncodeToString(make([]byte, 32)) +) + +func TestUtxoRepository(t *testing.T) { + repositories, err := newUtxoRepositories( + func(repoType string) ports.UtxoEventHandler { + return func(event domain.UtxoEvent) { + t.Logf("received event from %s repo: %+v\n", repoType, event) + } + }, + ) + require.NoError(t, err) + + for name, repo := range repositories { + t.Run(name, func(t *testing.T) { + testUtxoRepository(t, repo) + }) + } +} + +func testUtxoRepository(t *testing.T, repo domain.UtxoRepository) { + newUtxos, utxoKeys, balanceByAsset = randomUtxosForAccount(accountName) + testAddUtxos(t, repo) + + testGetUtxos(t, repo) + + testGetBalanceForAccount(t, repo) + + testConfirmUtxos(t, repo) + + testLockUtxos(t, repo) + + testUnlockUtxos(t, repo) + + testSpendUtxos(t, repo) +} + +func testAddUtxos(t *testing.T, repo domain.UtxoRepository) { + t.Run("add_utxos", func(t *testing.T) { + count, err := repo.AddUtxos(ctx, newUtxos) + require.NoError(t, err) + require.Equal(t, len(newUtxos), count) + + count, err = repo.AddUtxos(ctx, newUtxos) + require.NoError(t, err) + require.Zero(t, count) + }) +} + +func testGetUtxos(t *testing.T, repo domain.UtxoRepository) { + t.Run("get_utxos", func(t *testing.T) { + utxos := repo.GetAllUtxos(ctx) + require.Len(t, utxos, len(newUtxos)) + + utxos, err := repo.GetAllUtxosForAccount(ctx, accountName) + require.NoError(t, err) + require.Len(t, utxos, len(newUtxos)) + + utxos, err = repo.GetAllUtxosForAccount(ctx, wrongAccountName) + require.NoError(t, err) + require.Empty(t, utxos) + + utxos, err = repo.GetSpendableUtxos(ctx) + require.NoError(t, err) + require.Empty(t, utxos) + + utxos, err = repo.GetSpendableUtxosForAccount(ctx, accountName) + require.NoError(t, err) + require.Empty(t, utxos) + + utxos, err = repo.GetLockedUtxosForAccount(ctx, accountName) + require.NoError(t, err) + require.Empty(t, utxos) + + utxos, err = repo.GetUtxosByKey(ctx, utxoKeys) + require.NoError(t, err) + require.Len(t, utxos, len(newUtxos)) + + otherKeys := []domain.UtxoKey{randomKey()} + utxos, err = repo.GetUtxosByKey(ctx, otherKeys) + require.Error(t, err) + require.Empty(t, utxos) + + allKeys := append(utxoKeys, otherKeys...) + utxos, err = repo.GetUtxosByKey(ctx, allKeys) + require.NoError(t, err) + require.Len(t, utxos, len(newUtxos)) + }) +} + +func testGetBalanceForAccount(t *testing.T, repo domain.UtxoRepository) { + t.Run("get_balance_for_account", func(t *testing.T) { + utxoBalance, err := repo.GetBalanceForAccount(ctx, accountName) + require.NoError(t, err) + require.NotNil(t, utxoBalance) + for asset, balance := range utxoBalance { + require.Exactly(t, *balanceByAsset[asset], *balance) + } + + utxoBalance, err = repo.GetBalanceForAccount(ctx, wrongAccountName) + require.NoError(t, err) + require.Empty(t, utxoBalance) + }) +} + +func testConfirmUtxos(t *testing.T, repo domain.UtxoRepository) { + t.Run("confirm_utxos", func(t *testing.T) { + status := domain.UtxoStatus{"", 1, 0, ""} + count, err := repo.ConfirmUtxos(ctx, utxoKeys, status) + require.NoError(t, err) + require.Equal(t, len(newUtxos), count) + + count, err = repo.ConfirmUtxos(ctx, utxoKeys, status) + require.NoError(t, err) + require.Zero(t, count) + + utxos, err := repo.GetSpendableUtxos(ctx) + require.NoError(t, err) + require.Len(t, utxos, len(newUtxos)) + + utxos, err = repo.GetSpendableUtxosForAccount(ctx, accountName) + require.NoError(t, err) + require.Len(t, utxos, len(newUtxos)) + + utxoBalance, err := repo.GetBalanceForAccount(ctx, accountName) + require.NoError(t, err) + require.NotNil(t, utxoBalance) + for asset, balance := range utxoBalance { + prevBalance := balanceByAsset[asset] + require.Equal(t, prevBalance.Unconfirmed, balance.Confirmed) + require.Equal(t, prevBalance.Confirmed, balance.Unconfirmed) + require.Equal(t, prevBalance.Locked, balance.Locked) + } + }) +} + +func testLockUtxos(t *testing.T, repo domain.UtxoRepository) { + t.Run("lock_utxos", func(t *testing.T) { + count, err := repo.LockUtxos(ctx, utxoKeys, time.Now().Unix()) + require.NoError(t, err) + require.Equal(t, len(newUtxos), count) + + count, err = repo.LockUtxos(ctx, utxoKeys, time.Now().Unix()) + require.NoError(t, err) + require.Zero(t, count) + + utxos, err := repo.GetLockedUtxosForAccount(ctx, accountName) + require.NoError(t, err) + require.Len(t, utxos, len(newUtxos)) + + utxos, err = repo.GetSpendableUtxos(ctx) + require.NoError(t, err) + require.Empty(t, utxos) + + utxos, err = repo.GetSpendableUtxosForAccount(ctx, accountName) + require.NoError(t, err) + require.Empty(t, utxos) + + utxoBalance, err := repo.GetBalanceForAccount(ctx, accountName) + require.NoError(t, err) + require.NotNil(t, utxoBalance) + for asset, balance := range utxoBalance { + prevBalance := balanceByAsset[asset] + require.Zero(t, balance.Confirmed) + require.Zero(t, balance.Unconfirmed) + require.Equal(t, prevBalance.Unconfirmed, balance.Locked) + } + }) +} + +func testUnlockUtxos(t *testing.T, repo domain.UtxoRepository) { + t.Run("unlock_utxos", func(t *testing.T) { + count, err := repo.UnlockUtxos(ctx, utxoKeys) + require.NoError(t, err) + require.Equal(t, len(newUtxos), count) + + count, err = repo.UnlockUtxos(ctx, utxoKeys) + require.NoError(t, err) + require.Zero(t, count) + + utxos, err := repo.GetLockedUtxosForAccount(ctx, accountName) + require.NoError(t, err) + require.Empty(t, utxos) + + utxos, err = repo.GetSpendableUtxos(ctx) + require.NoError(t, err) + require.Len(t, utxos, len(newUtxos)) + + utxos, err = repo.GetSpendableUtxosForAccount(ctx, accountName) + require.NoError(t, err) + require.Len(t, utxos, len(newUtxos)) + + utxoBalance, err := repo.GetBalanceForAccount(ctx, accountName) + require.NoError(t, err) + require.NotNil(t, utxoBalance) + for asset, balance := range utxoBalance { + prevBalance := balanceByAsset[asset] + require.Equal(t, prevBalance.Unconfirmed, balance.Confirmed) + require.Equal(t, prevBalance.Confirmed, balance.Unconfirmed) + require.Equal(t, prevBalance.Locked, balance.Locked) + } + }) +} + +func testSpendUtxos(t *testing.T, repo domain.UtxoRepository) { + t.Run("spend_utxos", func(t *testing.T) { + status := domain.UtxoStatus{txid, 1, 0, ""} + count, err := repo.SpendUtxos(ctx, utxoKeys, status) + require.NoError(t, err) + require.Equal(t, len(newUtxos), count) + + count, err = repo.SpendUtxos(ctx, utxoKeys, status) + require.NoError(t, err) + require.Zero(t, count) + + utxos, err := repo.GetSpendableUtxos(ctx) + require.NoError(t, err) + require.Empty(t, utxos) + + utxos, err = repo.GetSpendableUtxosForAccount(ctx, accountName) + require.NoError(t, err) + require.Empty(t, utxos) + + utxoBalance, err := repo.GetBalanceForAccount(ctx, accountName) + require.NoError(t, err) + require.Empty(t, utxoBalance) + }) +} + +func newUtxoRepositories(handlerFactory func(repoType string) ports.UtxoEventHandler) (map[string]domain.UtxoRepository, error) { + inmemoryRepoManager := inmemory.NewRepoManager() + badgerRepoManager, err := dbbadger.NewRepoManager("", nil) + if err != nil { + return nil, err + } + handlers := []ports.UtxoEventHandler{ + handlerFactory("badger"), handlerFactory("inmemory"), + } + repoManagers := []ports.RepoManager{badgerRepoManager, inmemoryRepoManager} + + for i, handler := range handlers { + repoManager := repoManagers[i] + repoManager.RegisterHandlerForUtxoEvent(domain.UtxoAdded, handler) + repoManager.RegisterHandlerForUtxoEvent(domain.UtxoConfirmed, handler) + repoManager.RegisterHandlerForUtxoEvent(domain.UtxoLocked, handler) + repoManager.RegisterHandlerForUtxoEvent(domain.UtxoUnlocked, handler) + repoManager.RegisterHandlerForUtxoEvent(domain.UtxoSpent, handler) + } + return map[string]domain.UtxoRepository{ + "inmemory": inmemoryRepoManager.UtxoRepository(), + "badger": badgerRepoManager.UtxoRepository(), + }, nil +} diff --git a/internal/infrastructure/storage/db/test/wallet_repository_test.go b/internal/infrastructure/storage/db/test/wallet_repository_test.go new file mode 100644 index 0000000..3719eca --- /dev/null +++ b/internal/infrastructure/storage/db/test/wallet_repository_test.go @@ -0,0 +1,202 @@ +package db_test + +import ( + "context" + "fmt" + "os" + "strings" + "testing" + + "github.com/stretchr/testify/mock" + "github.com/stretchr/testify/require" + "github.com/vulpemventures/go-elements/network" + "github.com/vulpemventures/ocean/internal/core/application" + "github.com/vulpemventures/ocean/internal/core/domain" + "github.com/vulpemventures/ocean/internal/core/ports" + dbbadger "github.com/vulpemventures/ocean/internal/infrastructure/storage/db/badger" + "github.com/vulpemventures/ocean/internal/infrastructure/storage/db/inmemory" +) + +var ( + mnemonic = []string{ + "leave", "dice", "fine", "decrease", "dune", "ribbon", "ocean", "earn", + "lunar", "account", "silver", "admit", "cheap", "fringe", "disorder", "trade", + "because", "trade", "steak", "clock", "grace", "video", "jacket", "equal", + } + encryptedMnemonic = "8f29524ee5995c838ca6f28c7ded7da6dc51de804fd2703775989e65ddc1bb3b60122bf0f430bb3b7a267449aaeee103375737d679bfdabf172c3842048925e6f8952e214f6b900435d24cff938be78ad3bb303d305702fbf168534a45a57ac98ca940d4c3319f14d0c97a20b5bcb456d72857d48d0b4f0e0dcf71d1965b6a42aca8d84fcb66aadeabc812a9994cf66e7a75f8718a031418468f023c560312a02f46ec8e65d5dd65c968ddb93e10950e96c8e730ce7a74d33c6ddad9e12f45e534879f1605eb07fe90432f6592f7996091bbb3e3b2" + password = "password" + newPassword = "newPassword" + rootPath = "m/84'/1'" + regtest = network.Regtest.Name + birthdayBlock = uint32(1) + ctx = context.Background() + errSomethingWentWrong = fmt.Errorf("something went wrong") +) + +func TestMain(m *testing.M) { + mockedMnemonicCypher := &mockMnemonicCypher{} + mockedMnemonicCypher.On("Encrypt", mock.Anything, mock.Anything).Return(h2b(encryptedMnemonic), nil) + mockedMnemonicCypher.On("Decrypt", mock.Anything, []byte(password)).Return([]byte(strings.Join(mnemonic, " ")), nil) + mockedMnemonicCypher.On("Decrypt", mock.Anything, []byte(newPassword)).Return([]byte(strings.Join(mnemonic, " ")), nil) + mockedMnemonicCypher.On("Decrypt", mock.Anything, mock.Anything).Return(nil, fmt.Errorf("invalid password")) + domain.MnemonicCypher = mockedMnemonicCypher + domain.MnemonicStore = newInMemoryMnemonicStore() + + os.Exit(m.Run()) +} + +func TestWalletRepository(t *testing.T) { + repositories, err := newWalletRepositories( + func(repoType string) ports.WalletEventHandler { + return func(event domain.WalletEvent) { + addresses := application.AddressesInfo(event.AccountAddresses).Addresses() + t.Logf( + "received event from %s repo: {EventType: %s, AccountName: %s, AccountAddresses: %v}\n", + repoType, event.EventType, event.AccountName, addresses, + ) + } + }, + ) + require.NoError(t, err) + + for name, repo := range repositories { + t.Run(name, func(t *testing.T) { + testWalletRepository(t, repo) + }) + } +} + +func testWalletRepository(t *testing.T, repo domain.WalletRepository) { + testManageWallet(t, repo) + + testManageWalletAccount(t, repo) +} + +func testManageWallet(t *testing.T, repo domain.WalletRepository) { + t.Run("create_wallet", func(t *testing.T) { + wallet, err := repo.GetWallet(ctx) + require.Error(t, err) + require.Nil(t, wallet) + + w, _ := domain.NewWallet( + mnemonic, password, rootPath, regtest, birthdayBlock, nil, + ) + err = repo.CreateWallet(ctx, w) + require.NoError(t, err) + + err = repo.CreateWallet(ctx, w) + require.Error(t, err) + + wallet, err = repo.GetWallet(ctx) + require.NoError(t, err) + require.NotNil(t, wallet) + require.Exactly(t, *w, *wallet) + require.True(t, wallet.IsInitialized()) + require.True(t, wallet.IsLocked()) + }) + + t.Run("update_unlock_wallet", func(t *testing.T) { + err := repo.UpdateWallet( + ctx, func(w *domain.Wallet) (*domain.Wallet, error) { + if err := w.ChangePassword(password, newPassword); err != nil { + return nil, err + } + return w, nil + }, + ) + require.NoError(t, err) + + wallet, err := repo.GetWallet(ctx) + require.NoError(t, err) + require.NotNil(t, wallet) + require.True(t, wallet.IsLocked()) + + err = repo.UpdateWallet( + ctx, func(w *domain.Wallet) (*domain.Wallet, error) { + return nil, errSomethingWentWrong + }, + ) + require.EqualError(t, errSomethingWentWrong, err.Error()) + + err = repo.UnlockWallet(ctx, password) + require.Error(t, err) + + wallet, err = repo.GetWallet(ctx) + require.NoError(t, err) + require.NotNil(t, wallet) + require.True(t, wallet.IsLocked()) + + err = repo.UnlockWallet(ctx, newPassword) + require.NoError(t, err) + + wallet, err = repo.GetWallet(ctx) + require.NoError(t, err) + require.NotNil(t, wallet) + require.False(t, wallet.IsLocked()) + }) +} + +func testManageWalletAccount(t *testing.T, repo domain.WalletRepository) { + t.Run("create_wallet_account", func(t *testing.T) { + err := repo.DeleteAccount(ctx, accountName) + require.Error(t, err) + + account, err := repo.CreateAccount(ctx, accountName, 0) + require.NoError(t, err) + require.NotNil(t, account) + + account, err = repo.CreateAccount(ctx, account.Key.Name, 0) + require.Error(t, err) + require.Nil(t, account) + }) + + t.Run("derive_wallet_account_addresses", func(t *testing.T) { + addrInfo, err := repo.DeriveNextExternalAddressesForAccount(ctx, accountName, 2) + require.NoError(t, err) + require.Len(t, addrInfo, 2) + + addrInfo, err = repo.DeriveNextInternalAddressesForAccount(ctx, accountName, 3) + require.NoError(t, err) + require.Len(t, addrInfo, 3) + }) + + t.Run("delete_wallet_account", func(t *testing.T) { + err := repo.DeleteAccount(ctx, accountName) + require.NoError(t, err) + + wallet, err := repo.GetWallet(ctx) + require.NoError(t, err) + require.NotNil(t, wallet) + + account, err := wallet.GetAccount(accountName) + require.Error(t, err) + require.Nil(t, account) + }) +} + +func newWalletRepositories( + handlerFactory func(repoType string) ports.WalletEventHandler, +) (map[string]domain.WalletRepository, error) { + inmemoryRepoManager := inmemory.NewRepoManager() + badgerRepoManager, err := dbbadger.NewRepoManager("", nil) + if err != nil { + return nil, err + } + handlers := []ports.WalletEventHandler{ + handlerFactory("badger"), handlerFactory("inmemory"), + } + repoManagers := []ports.RepoManager{badgerRepoManager, inmemoryRepoManager} + + for i, handler := range handlers { + repoManager := repoManagers[i] + repoManager.RegisterHandlerForWalletEvent(domain.WalletCreated, handler) + repoManager.RegisterHandlerForWalletEvent(domain.WalletUnlocked, handler) + repoManager.RegisterHandlerForWalletEvent(domain.WalletAccountCreated, handler) + repoManager.RegisterHandlerForWalletEvent(domain.WalletAccountAddressesDerived, handler) + repoManager.RegisterHandlerForWalletEvent(domain.WalletAccountDeleted, handler) + } + return map[string]domain.WalletRepository{ + "inmemory": inmemoryRepoManager.WalletRepository(), + "badger": badgerRepoManager.WalletRepository(), + }, nil +} diff --git a/internal/interfaces/grpc/config.go b/internal/interfaces/grpc/config.go new file mode 100644 index 0000000..8dbfa49 --- /dev/null +++ b/internal/interfaces/grpc/config.go @@ -0,0 +1,73 @@ +package grpc_interface + +import ( + "crypto/rand" + "crypto/tls" + "fmt" + "net" + "path/filepath" + + "golang.org/x/net/http2" +) + +const ( + minPort = 1024 + maxPort = 49151 +) + +type ServiceConfig struct { + Port int + NoTLS bool + TLSLocation string + ExtraIPs []string + ExtraDomains []string +} + +func (c ServiceConfig) validate() error { + if c.Port < minPort || c.Port > maxPort { + return fmt.Errorf("port must be in range [%d, %d]", minPort, maxPort) + } + return nil +} + +func (c ServiceConfig) insecure() bool { + return c.NoTLS +} + +func (c ServiceConfig) address() string { + return fmt.Sprintf(":%d", c.Port) +} + +func (c ServiceConfig) listener() net.Listener { + lis, _ := net.Listen("tcp", c.address()) + + if c.insecure() { + return lis + } + return tls.NewListener(lis, c.tlsConfig()) +} + +func (c ServiceConfig) tlsConfig() *tls.Config { + if c.insecure() { + return nil + } + cert, _ := tls.LoadX509KeyPair(c.tlsCertPath(), c.tlsKeyPath()) + return &tls.Config{ + MinVersion: tls.VersionTLS12, + NextProtos: []string{"http/1.1", http2.NextProtoTLS, "h2-14"}, // h2-14 is just for compatibility. will be eventually removed. + Certificates: []tls.Certificate{cert}, + CipherSuites: []uint16{ + tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, + tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, + }, + Rand: rand.Reader, + } +} + +func (c ServiceConfig) tlsKeyPath() string { + return filepath.Join(c.TLSLocation, tlsKeyFile) +} + +func (c ServiceConfig) tlsCertPath() string { + return filepath.Join(c.TLSLocation, tlsCertFile) +} diff --git a/internal/interfaces/grpc/handler/account.go b/internal/interfaces/grpc/handler/account.go new file mode 100644 index 0000000..1267a9e --- /dev/null +++ b/internal/interfaces/grpc/handler/account.go @@ -0,0 +1,173 @@ +package grpc_handler + +import ( + "context" + + pb "github.com/vulpemventures/ocean/api-spec/protobuf/gen/go/ocean/v1" + "github.com/vulpemventures/ocean/internal/core/application" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +type account struct { + appSvc *application.AccountService +} + +func NewAccountHandler(appSvc *application.AccountService) pb.AccountServiceServer { + return &account{ + appSvc: appSvc, + } +} + +func (a *account) CreateAccountBIP44( + ctx context.Context, req *pb.CreateAccountBIP44Request, +) (*pb.CreateAccountBIP44Response, error) { + name, err := parseAccountName(req.GetName()) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + + accountInfo, err := a.appSvc.CreateAccountBIP44(ctx, name) + if err != nil { + return nil, err + } + return &pb.CreateAccountBIP44Response{ + AccountName: accountInfo.Key.Name, + AccountIndex: accountInfo.Key.Index, + Xpub: accountInfo.Xpub, + }, nil +} + +func (a *account) CreateAccountCustom( + ctx context.Context, req *pb.CreateAccountCustomRequest, +) (*pb.CreateAccountCustomResponse, error) { + return &pb.CreateAccountCustomResponse{}, nil +} + +func (a *account) SetAccountTemplate( + ctx context.Context, req *pb.SetAccountTemplateRequest, +) (*pb.SetAccountTemplateResponse, error) { + return &pb.SetAccountTemplateResponse{}, nil +} + +func (a *account) DeriveAddress( + ctx context.Context, req *pb.DeriveAddressRequest, +) (*pb.DeriveAddressResponse, error) { + name, err := parseAccountName(req.GetAccountName()) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + numOfAddresses := req.GetNumOfAddresses() + + addressesInfo, err := a.appSvc.DeriveAddressForAccount( + ctx, name, numOfAddresses, + ) + if err != nil { + return nil, err + } + + return &pb.DeriveAddressResponse{ + Addresses: addressesInfo.Addresses(), + }, nil +} + +func (a *account) DeriveChangeAddress( + ctx context.Context, req *pb.DeriveChangeAddressRequest, +) (*pb.DeriveChangeAddressResponse, error) { + name, err := parseAccountName(req.GetAccountName()) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + numOfAddresses := req.GetNumOfAddresses() + + addressesInfo, err := a.appSvc.DeriveChangeAddressForAccount( + ctx, name, numOfAddresses, + ) + if err != nil { + return nil, err + } + return &pb.DeriveChangeAddressResponse{ + Addresses: addressesInfo.Addresses(), + }, nil +} + +func (a *account) ListAddresses( + ctx context.Context, req *pb.ListAddressesRequest, +) (*pb.ListAddressesResponse, error) { + name, err := parseAccountName(req.GetAccountName()) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + + addressesInfo, err := a.appSvc.ListAddressesForAccount(ctx, name) + if err != nil { + return nil, err + } + return &pb.ListAddressesResponse{ + Addresses: addressesInfo.Addresses(), + }, nil +} + +func (a *account) Balance( + ctx context.Context, req *pb.BalanceRequest, +) (*pb.BalanceResponse, error) { + name, err := parseAccountName(req.GetAccountName()) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + + balanceInfo, err := a.appSvc.GetBalanceForAccount(ctx, name) + if err != nil { + return nil, err + } + balance := make(map[string]*pb.BalanceInfo) + for asset, b := range balanceInfo { + balance[asset] = &pb.BalanceInfo{ + ConfirmedBalance: b.Confirmed, + UnconfirmedBalance: b.Unconfirmed, + LockedBalance: b.Locked, + TotalBalance: b.Total(), + } + } + return &pb.BalanceResponse{Balance: balance}, nil +} + +func (a *account) ListUtxos( + ctx context.Context, req *pb.ListUtxosRequest, +) (*pb.ListUtxosResponse, error) { + name, err := parseAccountName(req.GetAccountName()) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + + utxosInfo, err := a.appSvc.ListUtxosForAccount(ctx, name) + if err != nil { + return nil, err + } + spendableUtxos := parseUtxos(utxosInfo.Spendable.Info()) + lockedUtxos := parseUtxos(utxosInfo.Locked.Info()) + return &pb.ListUtxosResponse{ + SpendableUtxos: &pb.Utxos{ + AccountName: name, + Utxos: spendableUtxos, + }, + LockedUtxos: &pb.Utxos{ + AccountName: name, + Utxos: lockedUtxos, + }, + }, nil +} + +func (a *account) DeleteAccount( + ctx context.Context, req *pb.DeleteAccountRequest, +) (*pb.DeleteAccountResponse, error) { + name, err := parseAccountName(req.GetAccountName()) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + + if err := a.appSvc.DeleteAccount(ctx, name); err != nil { + return nil, err + } + return &pb.DeleteAccountResponse{}, nil +} diff --git a/internal/interfaces/grpc/handler/notification.go b/internal/interfaces/grpc/handler/notification.go new file mode 100644 index 0000000..9534125 --- /dev/null +++ b/internal/interfaces/grpc/handler/notification.go @@ -0,0 +1,101 @@ +package grpc_handler + +import ( + "context" + "fmt" + + pb "github.com/vulpemventures/ocean/api-spec/protobuf/gen/go/ocean/v1" + "github.com/vulpemventures/ocean/internal/core/application" +) + +var ErrStreamConnectionClosed = fmt.Errorf("connection closed on by server") + +type notification struct { + appSvc *application.NotificationService + chClose chan struct{} +} + +func NewNotificationHandler( + appSvc *application.NotificationService, chClose chan struct{}, +) pb.NotificationServiceServer { + return ¬ification{appSvc, chClose} +} + +func (n notification) TransactionNotifications( + req *pb.TransactionNotificationsRequest, + stream pb.NotificationService_TransactionNotificationsServer, +) error { + chTxEvents, err := n.appSvc.GetTxChannel(stream.Context()) + if err != nil { + return err + } + + for { + select { + case e := <-chTxEvents: + var blockDetails *pb.BlockDetails + if e.Transaction.IsConfirmed() { + blockDetails = &pb.BlockDetails{ + Hash: e.Transaction.BlockHash, + Height: e.Transaction.BlockHeight, + } + } + if err := stream.Send(&pb.TransactionNotificationsResponse{ + AccountNames: e.Transaction.GetAccounts(), + Txid: e.Transaction.TxID, + BlockDetails: blockDetails, + EventType: parseTxEventType(e.EventType), + }); err != nil { + return err + } + case <-stream.Context().Done(): + return nil + case <-n.chClose: + return ErrStreamConnectionClosed + } + } +} + +func (n notification) UtxosNotifications( + req *pb.UtxosNotificationsRequest, + stream pb.NotificationService_UtxosNotificationsServer, +) error { + chUtxoEvents, err := n.appSvc.GetUtxoChannel(stream.Context()) + if err != nil { + return err + } + + for { + select { + case e := <-chUtxoEvents: + if err := stream.Send(&pb.UtxosNotificationsResponse{ + Utxos: parseUtxos(e.Utxos), + EventType: parseUtxoEventType(e.EventType), + }); err != nil { + return err + } + case <-stream.Context().Done(): + return nil + case <-n.chClose: + return ErrStreamConnectionClosed + } + } +} + +func (n notification) AddWebhook( + ctx context.Context, req *pb.AddWebhookRequest, +) (*pb.AddWebhookResponse, error) { + return nil, nil +} + +func (n notification) RemoveWebhook( + ctx context.Context, req *pb.RemoveWebhookRequest, +) (*pb.RemoveWebhookResponse, error) { + return nil, nil +} + +func (n notification) ListWebhooks( + ctx context.Context, req *pb.ListWebhooksRequest, +) (*pb.ListWebhooksResponse, error) { + return nil, nil +} diff --git a/internal/interfaces/grpc/handler/transaction.go b/internal/interfaces/grpc/handler/transaction.go new file mode 100644 index 0000000..a90a74e --- /dev/null +++ b/internal/interfaces/grpc/handler/transaction.go @@ -0,0 +1,267 @@ +package grpc_handler + +import ( + "context" + "fmt" + + pb "github.com/vulpemventures/ocean/api-spec/protobuf/gen/go/ocean/v1" + "github.com/vulpemventures/ocean/internal/core/application" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +type transaction struct { + appSvc *application.TransactionService +} + +func NewTransactionHandler( + appSvc *application.TransactionService, +) pb.TransactionServiceServer { + return &transaction{appSvc} +} + +func (t *transaction) GetTransaction( + ctx context.Context, req *pb.GetTransactionRequest, +) (*pb.GetTransactionResponse, error) { + txid := req.GetTxid() + if err := validateTxid(txid); err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + + txInfo, err := t.appSvc.GetTransactionInfo(ctx, txid) + if err != nil { + return nil, err + } + blockDetails := parseBlockDetails(*txInfo) + return &pb.GetTransactionResponse{ + TxHex: txInfo.TxHex, + BlockDetails: blockDetails, + }, nil +} + +func (t *transaction) SelectUtxos( + ctx context.Context, req *pb.SelectUtxosRequest, +) (*pb.SelectUtxosResponse, error) { + accountName, err := parseAccountName(req.GetAccountName()) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + targetAmount, err := parseAmount(req.GetTargetAmount()) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + targetAsset, err := parseAsset(req.GetTargetAsset()) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + strategy := parseCoinSelectionStrategy(req.GetStrategy()) + + utxos, change, expirationDate, err := t.appSvc.SelectUtxos( + ctx, accountName, targetAsset, targetAmount, strategy, + ) + if err != nil { + return nil, err + } + return &pb.SelectUtxosResponse{ + Utxos: parseUtxos(utxos.Info()), + Change: change, + ExpirationDate: expirationDate, + }, nil +} + +func (t *transaction) EstimateFees( + ctx context.Context, req *pb.EstimateFeesRequest, +) (*pb.EstimateFeesResponse, error) { + inputs, err := parseInputs(req.GetInputs()) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + outputs, err := parseOutputs(req.GetOutputs()) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + millisatsPerByte, err := parseMillisatsPerByte(req.GetMillisatsPerByte()) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + + feeAmount, err := t.appSvc.EstimateFees( + ctx, inputs, outputs, millisatsPerByte, + ) + if err != nil { + return nil, err + } + + return &pb.EstimateFeesResponse{FeeAmount: uint64(feeAmount)}, nil +} + +func (t *transaction) SignTransaction( + ctx context.Context, req *pb.SignTransactionRequest, +) (*pb.SignTransactionResponse, error) { + txHex, err := parseTxHex(req.GetTxHex()) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + + signedTx, err := t.appSvc.SignTransaction(ctx, txHex, req.GetSighashType()) + if err != nil { + return nil, err + } + + return &pb.SignTransactionResponse{TxHex: signedTx}, nil +} + +func (t *transaction) BroadcastTransaction( + ctx context.Context, req *pb.BroadcastTransactionRequest, +) (*pb.BroadcastTransactionResponse, error) { + txHex, err := parseTxHex(req.GetTxHex()) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + + txid, err := t.appSvc.BroadcastTransaction(ctx, txHex) + if err != nil { + return nil, err + } + + return &pb.BroadcastTransactionResponse{Txid: txid}, nil +} + +func (t *transaction) CreatePset( + ctx context.Context, req *pb.CreatePsetRequest, +) (*pb.CreatePsetResponse, error) { + inputs, err := parseInputs(req.GetInputs()) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + outputs, err := parseOutputs(req.GetOutputs()) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + + ptx, err := t.appSvc.CreatePset(ctx, inputs, outputs) + if err != nil { + return nil, err + } + return &pb.CreatePsetResponse{Pset: ptx}, nil +} + +func (t *transaction) UpdatePset( + ctx context.Context, req *pb.UpdatePsetRequest, +) (*pb.UpdatePsetResponse, error) { + ptx, err := parsePset(req.GetPset()) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + inputs, err := parseInputs(req.GetInputs()) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + outputs, err := parseOutputs(req.GetOutputs()) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + + updatedPtx, err := t.appSvc.UpdatePset(ctx, ptx, inputs, outputs) + if err != nil { + return nil, err + } + + return &pb.UpdatePsetResponse{Pset: updatedPtx}, nil +} + +func (t *transaction) BlindPset( + ctx context.Context, req *pb.BlindPsetRequest, +) (*pb.BlindPsetResponse, error) { + ptx, err := parsePset(req.GetPset()) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + + blindedPtx, err := t.appSvc.BlindPset(ctx, ptx, nil, req.GetLastBlinder()) + if err != nil { + return nil, err + } + + return &pb.BlindPsetResponse{Pset: blindedPtx}, nil +} + +func (t *transaction) SignPset( + ctx context.Context, req *pb.SignPsetRequest, +) (*pb.SignPsetResponse, error) { + ptx, err := parsePset(req.GetPset()) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + + signedPtx, err := t.appSvc.SignPset(ctx, ptx, req.GetSighashType()) + if err != nil { + return nil, err + } + + return &pb.SignPsetResponse{Pset: signedPtx}, nil +} + +func (t *transaction) Mint( + ctx context.Context, req *pb.MintRequest, +) (*pb.MintResponse, error) { + return nil, fmt.Errorf("to be implemented") +} + +func (t *transaction) Remint( + ctx context.Context, req *pb.RemintRequest, +) (*pb.RemintResponse, error) { + return nil, fmt.Errorf("to be implemented") +} + +func (t *transaction) Burn( + ctx context.Context, req *pb.BurnRequest, +) (*pb.BurnResponse, error) { + return nil, fmt.Errorf("to be implemented") +} + +func (t *transaction) Transfer( + ctx context.Context, req *pb.TransferRequest, +) (*pb.TransferResponse, error) { + accountName, err := parseAccountName(req.GetAccountName()) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + outputs, err := parseOutputs(req.GetReceivers()) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + millisatsPerByte, err := parseMillisatsPerByte(req.GetMillisatsPerByte()) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + + txHex, err := t.appSvc.Transfer(ctx, accountName, outputs, millisatsPerByte) + if err != nil { + return nil, err + } + + return &pb.TransferResponse{TxHex: txHex}, nil +} + +func (t *transaction) PegInAddress( + ctx context.Context, req *pb.PegInAddressRequest, +) (*pb.PegInAddressResponse, error) { + return nil, fmt.Errorf("to be implemented") +} + +func (t *transaction) ClaimPegIn( + ctx context.Context, req *pb.ClaimPegInRequest, +) (*pb.ClaimPegInResponse, error) { + return nil, fmt.Errorf("to be implemented") +} + +func validateTxid(txid string) error { + if txid == "" { + return fmt.Errorf("missing txid") + } + if len(txid) != 64 { + return fmt.Errorf("invalid txid length") + } + return nil +} diff --git a/internal/interfaces/grpc/handler/util.go b/internal/interfaces/grpc/handler/util.go new file mode 100644 index 0000000..3f9ec09 --- /dev/null +++ b/internal/interfaces/grpc/handler/util.go @@ -0,0 +1,226 @@ +package grpc_handler + +import ( + "encoding/hex" + "fmt" + + pb "github.com/vulpemventures/ocean/api-spec/protobuf/gen/go/ocean/v1" + "github.com/vulpemventures/ocean/internal/core/application" + "github.com/vulpemventures/ocean/internal/core/domain" +) + +func parseMnemonic(mnemonic string) (string, error) { + if mnemonic == "" { + return "", fmt.Errorf("missing mnemonic") + } + return mnemonic, nil +} + +func parsePassword(password string) (string, error) { + if password == "" { + return "", fmt.Errorf("missing password") + } + return password, nil +} + +func parseNetwork(network string) pb.GetInfoResponse_Network { + switch network { + case "liquid": + return pb.GetInfoResponse_NETWORK_MAINNET + case "testnet": + return pb.GetInfoResponse_NETWORK_TESTNET + case "regtest": + return pb.GetInfoResponse_NETWORK_REGTEST + default: + return pb.GetInfoResponse_NETWORK_UNSPECIFIED + } +} + +func parseAccounts(accounts []application.AccountInfo) []*pb.AccountInfo { + list := make([]*pb.AccountInfo, 0, len(accounts)) + for _, a := range accounts { + list = append(list, &pb.AccountInfo{ + Name: a.Key.Name, + Index: a.Key.Index, + Xpub: a.Xpub, + DerivationPath: a.DerivationPath, + }) + } + return list +} + +func parseAccountName(name string) (string, error) { + if name == "" { + return "", fmt.Errorf("missing account name") + } + return name, nil +} + +func parseUtxos(utxos []domain.UtxoInfo) []*pb.Utxo { + list := make([]*pb.Utxo, 0, len(utxos)) + for _, u := range utxos { + emptyStatus := domain.UtxoStatus{} + var spentStatus, confirmedStatus *pb.UtxoStatus + if u.SpentStatus != emptyStatus { + spentStatus = &pb.UtxoStatus{ + Txid: u.SpentStatus.Txid, + BlockInfo: &pb.BlockDetails{ + Hash: u.SpentStatus.BlockHash, + Height: u.SpentStatus.BlockHeight, + Timestamp: u.SpentStatus.BlockTime, + }, + } + } + if u.ConfirmedStatus != emptyStatus { + confirmedStatus = &pb.UtxoStatus{ + BlockInfo: &pb.BlockDetails{ + Hash: u.ConfirmedStatus.BlockHash, + Height: u.ConfirmedStatus.BlockHeight, + Timestamp: u.ConfirmedStatus.BlockTime, + }, + } + } + list = append(list, &pb.Utxo{ + Txid: u.Key().TxID, + Index: u.Key().VOut, + Asset: u.Asset, + Value: u.Value, + Script: u.Script, + AssetBlinder: u.AssetBlinder, + ValueBlinder: u.ValueBlinder, + AccountName: u.AccountName, + SpentStatus: spentStatus, + ConfirmedStatus: confirmedStatus, + }) + } + return list +} + +func parseBlockDetails(tx application.TransactionInfo) *pb.BlockDetails { + if tx.BlockHash == "" { + return nil + } + return &pb.BlockDetails{ + Hash: tx.BlockHash, + Height: tx.BlockHeight, + Timestamp: int64(tx.BlockHeight), + } +} + +func parseInputs(ins []*pb.Input) ([]application.Input, error) { + inputs := make([]application.Input, 0, len(ins)) + for _, in := range ins { + inputs = append(inputs, application.Input{ + TxID: in.GetTxid(), + VOut: in.GetIndex(), + }) + } + return inputs, nil +} + +func parseOutputs(outs []*pb.Output) ([]application.Output, error) { + outputs := make([]application.Output, 0, len(outs)) + for _, out := range outs { + output := application.Output{ + Asset: out.GetAsset(), + Amount: out.GetAmount(), + Address: out.GetAddress(), + } + if err := output.Validate(); err != nil { + return nil, err + } + outputs = append(outputs, output) + } + return outputs, nil +} + +func parseAmount(amount uint64) (uint64, error) { + if amount == 0 { + return 0, fmt.Errorf("missing amount") + } + return amount, nil +} + +func parseAsset(asset string) (string, error) { + if len(asset) == 0 { + return "", fmt.Errorf("missing asset") + } + buf, err := hex.DecodeString(asset) + if err != nil { + return "", fmt.Errorf("invalid asset format") + } + if len(buf) != 32 { + return "", fmt.Errorf("invalid asset length") + } + return asset, nil +} + +func parseCoinSelectionStrategy(str pb.SelectUtxosRequest_Strategy) int { + return application.CoinSelectionStrategySmallestSubset +} + +func parseMillisatsPerByte(ratio uint64) (uint64, error) { + if ratio == 0 { + return application.MinMillisatsPerByte, nil + } + if ratio < application.MinMillisatsPerByte { + return 0, fmt.Errorf("mSats/byte ratio is too low") + } + return ratio, nil +} + +func parseTxHex(txHex string) (string, error) { + if len(txHex) == 0 { + return "", fmt.Errorf("missing tx hex") + } + return txHex, nil +} + +func parsePset(ptx string) (string, error) { + if len(ptx) == 0 { + return "", fmt.Errorf("missing pset") + } + return ptx, nil +} + +func parseTxEventType(eventType domain.TransactionEventType) pb.TxEventType { + switch eventType { + case domain.TransactionAdded: + return pb.TxEventType_TX_EVENT_TYPE_BROADCASTED + case domain.TransactionConfirmed: + return pb.TxEventType_TX_EVENT_TYPE_CONFIRMED + default: + return pb.TxEventType_TX_EVENT_TYPE_UNSPECIFIED + } +} + +func parseUtxoEventType(eventType domain.UtxoEventType) pb.UtxoEventType { + switch eventType { + case domain.UtxoAdded: + return pb.UtxoEventType_UTXO_EVENT_TYPE_NEW + case domain.UtxoConfirmed: + return pb.UtxoEventType_UTXO_EVENT_TYPE_CONFIRMED + case domain.UtxoLocked: + return pb.UtxoEventType_UTXO_EVENT_TYPE_LOCKED + case domain.UtxoUnlocked: + return pb.UtxoEventType_UTXO_EVENT_TYPE_UNLOCKED + case domain.UtxoSpent: + return pb.UtxoEventType_UTXO_EVENT_TYPE_SPENT + default: + return pb.UtxoEventType_UTXO_EVENT_TYPE_UNSPECIFIED + } +} + +func parseBlockHash(hash string) ([]byte, error) { + if len(hash) == 0 { + return nil, fmt.Errorf("missing block hash") + } + buf, err := hex.DecodeString(hash) + if err != nil { + return nil, fmt.Errorf("invalid block hash format") + } + if len(buf) != 32 { + return nil, fmt.Errorf("invalid block hash length") + } + return buf, nil +} diff --git a/internal/interfaces/grpc/handler/wallet.go b/internal/interfaces/grpc/handler/wallet.go new file mode 100644 index 0000000..9954ed0 --- /dev/null +++ b/internal/interfaces/grpc/handler/wallet.go @@ -0,0 +1,159 @@ +package grpc_handler + +import ( + "context" + "strings" + + pb "github.com/vulpemventures/ocean/api-spec/protobuf/gen/go/ocean/v1" + "github.com/vulpemventures/ocean/internal/core/application" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +type wallet struct { + appSvc *application.WalletService +} + +func NewWalletHandler( + appSvc *application.WalletService, +) pb.WalletServiceServer { + return &wallet{ + appSvc: appSvc, + } +} + +func (w *wallet) GenSeed( + ctx context.Context, _ *pb.GenSeedRequest, +) (*pb.GenSeedResponse, error) { + mnemonic, err := w.appSvc.GenSeed(ctx) + if err != nil { + return nil, err + } + return &pb.GenSeedResponse{ + Mnemonic: strings.Join(mnemonic, " "), + }, nil +} + +func (w *wallet) CreateWallet( + ctx context.Context, req *pb.CreateWalletRequest, +) (*pb.CreateWalletResponse, error) { + mnemonic, err := parseMnemonic(req.GetMnemonic()) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + password, err := parsePassword(req.GetPassword()) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + + if err := w.appSvc.CreateWallet( + ctx, strings.Split(mnemonic, " "), password, + ); err != nil { + return nil, err + } + + return &pb.CreateWalletResponse{}, nil +} + +func (w *wallet) Unlock( + ctx context.Context, req *pb.UnlockRequest, +) (*pb.UnlockResponse, error) { + password, err := parsePassword(req.GetPassword()) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + + if err := w.appSvc.Unlock(ctx, password); err != nil { + return nil, err + } + + return &pb.UnlockResponse{}, nil +} + +func (w *wallet) Lock( + ctx context.Context, req *pb.LockRequest, +) (*pb.LockResponse, error) { + if err := w.appSvc.Lock(ctx); err != nil { + return nil, err + } + + return &pb.LockResponse{}, nil +} + +func (w *wallet) ChangePassword( + ctx context.Context, req *pb.ChangePasswordRequest, +) (*pb.ChangePasswordResponse, error) { + currentPwd, err := parsePassword(req.GetCurrentPassword()) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + newPwd, err := parsePassword(req.GetNewPassword()) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + + if err := w.appSvc.ChangePassword( + ctx, currentPwd, newPwd, + ); err != nil { + return nil, err + } + + return &pb.ChangePasswordResponse{}, nil +} + +func (w *wallet) RestoreWallet( + ctx context.Context, req *pb.RestoreWalletRequest, +) (*pb.RestoreWalletResponse, error) { + mnemonic, err := parseMnemonic(req.GetMnemonic()) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + password, err := parsePassword(req.GetPassword()) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + birthdayBlock, err := parseBlockHash(req.GetBirthdayBlockHash()) + if err != nil { + return nil, status.Error(codes.InvalidArgument, err.Error()) + } + + if err := w.appSvc.RestoreWallet( + ctx, strings.Split(mnemonic, " "), password, birthdayBlock, + ); err != nil { + return nil, err + } + + return &pb.RestoreWalletResponse{}, nil +} + +func (w *wallet) Status(ctx context.Context, _ *pb.StatusRequest) (*pb.StatusResponse, error) { + status := w.appSvc.GetStatus(ctx) + return &pb.StatusResponse{ + Initialized: status.IsInitialized, + Unlocked: status.IsUnlocked, + Synced: status.IsSynced, + }, nil +} + +func (w *wallet) GetInfo(ctx context.Context, _ *pb.GetInfoRequest) (*pb.GetInfoResponse, error) { + info, err := w.appSvc.GetInfo(ctx) + if err != nil { + return nil, err + } + network := parseNetwork(info.Network) + accounts := parseAccounts(info.Accounts) + return &pb.GetInfoResponse{ + Network: network, + NativeAsset: info.NativeAsset, + RootPath: info.RootPath, + MasterBlindingKey: info.MasterBlindingKey, + BirthdayBlockHash: info.BirthdayBlockHash, + BirthdayBlockHeight: info.BirthdayBlockHeight, + Accounts: accounts, + BuildInfo: &pb.BuildInfo{ + Version: info.BuildInfo.Version, + Commit: info.BuildInfo.Commit, + Date: info.BuildInfo.Date, + }, + }, nil +} diff --git a/internal/interfaces/grpc/interceptor/interceptor.go b/internal/interfaces/grpc/interceptor/interceptor.go new file mode 100644 index 0000000..2936320 --- /dev/null +++ b/internal/interfaces/grpc/interceptor/interceptor.go @@ -0,0 +1,24 @@ +package grpc_interceptor + +import ( + middleware "github.com/grpc-ecosystem/go-grpc-middleware" + "google.golang.org/grpc" +) + +// UnaryInterceptor returns the unary interceptor +func UnaryInterceptor() grpc.ServerOption { + return grpc.UnaryInterceptor( + middleware.ChainUnaryServer( + unaryLogger, + ), + ) +} + +// StreamInterceptor returns the stream interceptor with a logrus log +func StreamInterceptor() grpc.ServerOption { + return grpc.StreamInterceptor( + middleware.ChainStreamServer( + streamLogger, + ), + ) +} diff --git a/internal/interfaces/grpc/interceptor/logger.go b/internal/interfaces/grpc/interceptor/logger.go new file mode 100644 index 0000000..a0a5bbd --- /dev/null +++ b/internal/interfaces/grpc/interceptor/logger.go @@ -0,0 +1,28 @@ +package grpc_interceptor + +import ( + "context" + + log "github.com/sirupsen/logrus" + "google.golang.org/grpc" +) + +func unaryLogger( + ctx context.Context, + req interface{}, + info *grpc.UnaryServerInfo, + handler grpc.UnaryHandler, +) (interface{}, error) { + log.Debugf("gRPC method: %s", info.FullMethod) + return handler(ctx, req) +} + +func streamLogger( + srv interface{}, + stream grpc.ServerStream, + info *grpc.StreamServerInfo, + handler grpc.StreamHandler, +) error { + log.Debugf("gRPC method: %s", info.FullMethod) + return handler(srv, stream) +} diff --git a/internal/interfaces/grpc/service.go b/internal/interfaces/grpc/service.go new file mode 100644 index 0000000..72ab66f --- /dev/null +++ b/internal/interfaces/grpc/service.go @@ -0,0 +1,133 @@ +package grpc_interface + +import ( + "fmt" + "math/big" + + log "github.com/sirupsen/logrus" + pb "github.com/vulpemventures/ocean/api-spec/protobuf/gen/go/ocean/v1" + appconfig "github.com/vulpemventures/ocean/internal/app-config" + grpc_handler "github.com/vulpemventures/ocean/internal/interfaces/grpc/handler" + grpc_interceptor "github.com/vulpemventures/ocean/internal/interfaces/grpc/interceptor" + "google.golang.org/grpc" + "google.golang.org/grpc/credentials" +) + +var ( + tlsKeyFile = "key.pem" + tlsCertFile = "cert.pem" + serialNumberLimit = new(big.Int).Lsh(big.NewInt(1), 128) +) + +type service struct { + config ServiceConfig + appConfig *appconfig.AppConfig + grpcServer *grpc.Server + chCloseStreamConnections chan (struct{}) + + log func(format string, a ...interface{}) +} + +func NewService(config ServiceConfig, appConfig *appconfig.AppConfig) (*service, error) { + logFn := func(format string, a ...interface{}) { + format = fmt.Sprintf("service: %s", format) + log.Infof(format, a...) + } + if err := config.validate(); err != nil { + return nil, fmt.Errorf("invalid config: %s", err) + } + if err := appConfig.Validate(); err != nil { + return nil, fmt.Errorf("invalid app config: %s", err) + } + + if !config.insecure() { + if err := generateTLSKeyPair( + config.TLSLocation, config.ExtraIPs, config.ExtraDomains, + ); err != nil { + return nil, fmt.Errorf("error while creating TLS keypair: %s", err) + } + logFn("created TLS keypair in path %s", config.TLSLocation) + } + chCloseStreamConnections := make(chan struct{}) + return &service{config, appConfig, nil, chCloseStreamConnections, logFn}, nil +} + +func (s *service) Start() error { + srv, err := s.start() + if err != nil { + return err + } + + s.appConfig.BlockchainScanner().Start() + s.log("started blockchain scanner") + + s.log("start listening on %s", s.config.address()) + + s.grpcServer = srv + return nil +} + +func (s *service) Stop() { + onlyGrpcServer := true + allServices := !onlyGrpcServer + s.stop(allServices) + s.log("shutdown") +} + +func (s *service) start() (*grpc.Server, error) { + grpcConfig := []grpc.ServerOption{ + grpc_interceptor.UnaryInterceptor(), grpc_interceptor.StreamInterceptor(), + } + if !s.config.insecure() { + creds, err := credentials.NewServerTLSFromFile( + s.config.tlsCertPath(), s.config.tlsKeyPath(), + ) + if err != nil { + return nil, err + } + grpcConfig = append(grpcConfig, grpc.Creds(creds)) + } + + grpcServer := grpc.NewServer(grpcConfig...) + + walletHandler := grpc_handler.NewWalletHandler(s.appConfig.WalletService()) + pb.RegisterWalletServiceServer(grpcServer, walletHandler) + + s.log("registered wallet handler on public interface") + + accountHandler := grpc_handler.NewAccountHandler(s.appConfig.AccountService()) + txHandler := grpc_handler.NewTransactionHandler(s.appConfig.TransactionService()) + notifyHandler := grpc_handler.NewNotificationHandler( + s.appConfig.NotificationService(), s.chCloseStreamConnections, + ) + + pb.RegisterAccountServiceServer(grpcServer, accountHandler) + pb.RegisterTransactionServiceServer(grpcServer, txHandler) + pb.RegisterNotificationServiceServer(grpcServer, notifyHandler) + s.log("registered account handler on public interface") + s.log("registered transaction handler on public interface") + s.log("registered notification handler on public interface") + + go grpcServer.Serve(s.config.listener()) + + return grpcServer, nil +} + +func (s *service) stop(onlyGrpcServer bool) { + select { + case s.chCloseStreamConnections <- struct{}{}: + s.log("closed stream connections") + default: + } + + s.grpcServer.GracefulStop() + s.log("stopped grpc server") + if onlyGrpcServer { + return + } + + s.appConfig.BlockchainScanner().Stop() + s.log("stopped blockchain scanner") + s.appConfig.RepoManager().Close() + s.log("closed connection with db") +} diff --git a/internal/interfaces/grpc/util.go b/internal/interfaces/grpc/util.go new file mode 100644 index 0000000..8986998 --- /dev/null +++ b/internal/interfaces/grpc/util.go @@ -0,0 +1,221 @@ +package grpc_interface + +import ( + "bytes" + "crypto" + "crypto/ecdsa" + "crypto/ed25519" + "crypto/elliptic" + "crypto/rand" + "crypto/rsa" + "crypto/x509" + "crypto/x509/pkix" + "encoding/pem" + "fmt" + "io/ioutil" + "net" + "os" + "path/filepath" + "strings" + "time" +) + +func generateTLSKeyPair( + datadir string, extraIPs, extraDomains []string, +) error { + if err := makeDirectoryIfNotExists(datadir); err != nil { + return err + } + keyPath := filepath.Join(datadir, tlsKeyFile) + certPath := filepath.Join(datadir, tlsCertFile) + + // if key and cert files already exist nothing to do here. + if pathExists(keyPath) && pathExists(certPath) { + return nil + } + + organization := "vulpemventures" + now := time.Now() + validUntil := now.AddDate(1, 0, 0) + + // Generate a serial number that's below the serialNumberLimit. + serialNumber, err := rand.Int(rand.Reader, serialNumberLimit) + if err != nil { + return fmt.Errorf("failed to generate serial number: %s", err) + } + + // Collect the host's IP addresses, including loopback, in a slice. + ipAddresses := []net.IP{net.ParseIP("127.0.0.1"), net.ParseIP("::1")} + + if len(extraIPs) > 0 { + for _, ip := range extraIPs { + ipAddresses = append(ipAddresses, net.ParseIP(ip)) + } + } + + // addIP appends an IP address only if it isn't already in the slice. + addIP := func(ipAddr net.IP) { + for _, ip := range ipAddresses { + if bytes.Equal(ip, ipAddr) { + return + } + } + ipAddresses = append(ipAddresses, ipAddr) + } + + // Add all the interface IPs that aren't already in the slice. + addrs, err := net.InterfaceAddrs() + if err != nil { + return err + } + for _, a := range addrs { + ipAddr, _, err := net.ParseCIDR(a.String()) + if err == nil { + addIP(ipAddr) + } + } + + host, err := os.Hostname() + if err != nil { + return err + } + + dnsNames := []string{host} + if host != "localhost" { + dnsNames = append(dnsNames, "localhost") + } + + if len(extraDomains) > 0 { + for _, domain := range extraDomains { + dnsNames = append(dnsNames, domain) + } + } + + dnsNames = append(dnsNames, "unix", "unixpacket") + + priv, err := createOrLoadTLSKey(keyPath) + if err != nil { + return err + } + + keybytes, err := x509.MarshalECPrivateKey(priv) + if err != nil { + return err + } + + // construct certificate template + template := x509.Certificate{ + SerialNumber: serialNumber, + Subject: pkix.Name{ + Organization: []string{organization}, + CommonName: host, + }, + NotBefore: now.Add(-time.Hour * 24), + NotAfter: validUntil, + + KeyUsage: x509.KeyUsageKeyEncipherment | + x509.KeyUsageDigitalSignature | x509.KeyUsageCertSign, + IsCA: true, + BasicConstraintsValid: true, + + DNSNames: dnsNames, + IPAddresses: ipAddresses, + } + + derBytes, err := x509.CreateCertificate( + rand.Reader, &template, &template, &priv.PublicKey, priv, + ) + if err != nil { + return fmt.Errorf("failed to create certificate: %v", err) + } + + certBuf := &bytes.Buffer{} + if err := pem.Encode( + certBuf, &pem.Block{Type: "CERTIFICATE", Bytes: derBytes}, + ); err != nil { + return fmt.Errorf("failed to encode certificate: %v", err) + } + + keyBuf := &bytes.Buffer{} + if err := pem.Encode( + keyBuf, &pem.Block{Type: "EC PRIVATE KEY", Bytes: keybytes}, + ); err != nil { + return fmt.Errorf("failed to encode private key: %v", err) + } + + if err := ioutil.WriteFile(certPath, certBuf.Bytes(), 0644); err != nil { + return err + } + if err := ioutil.WriteFile(keyPath, keyBuf.Bytes(), 0600); err != nil { + os.Remove(certPath) + return err + } + + return nil +} + +func createOrLoadTLSKey(keyPath string) (*ecdsa.PrivateKey, error) { + if !pathExists(keyPath) { + return ecdsa.GenerateKey(elliptic.P256(), rand.Reader) + } + + b, err := ioutil.ReadFile(keyPath) + if err != nil { + return nil, err + } + + key, err := privateKeyFromPEM(b) + if err != nil { + return nil, err + } + return key.(*ecdsa.PrivateKey), nil +} + +func privateKeyFromPEM(pemBlock []byte) (crypto.PrivateKey, error) { + var derBlock *pem.Block + for { + derBlock, pemBlock = pem.Decode(pemBlock) + if derBlock == nil { + return nil, fmt.Errorf("tls: failed to find any PEM data in key input") + } + if derBlock.Type == "PRIVATE KEY" || strings.HasSuffix(derBlock.Type, " PRIVATE KEY") { + break + } + } + return parsePrivateKey(derBlock.Bytes) +} + +func parsePrivateKey(der []byte) (crypto.PrivateKey, error) { + if key, err := x509.ParsePKCS1PrivateKey(der); err == nil { + return key, nil + } + if key, err := x509.ParsePKCS8PrivateKey(der); err == nil { + switch key := key.(type) { + case *rsa.PrivateKey, *ecdsa.PrivateKey, ed25519.PrivateKey: + return key, nil + default: + return nil, fmt.Errorf("tls: found unknown private key type in PKCS#8 wrapping") + } + } + if key, err := x509.ParseECPrivateKey(der); err == nil { + return key, nil + } + + return nil, fmt.Errorf("tls: failed to parse private key") +} + +func makeDirectoryIfNotExists(path string) error { + if pathExists(path) { + return nil + } + return os.MkdirAll(path, os.ModeDir|0755) +} + +func pathExists(path string) bool { + if _, err := os.Stat(path); err != nil { + if os.IsNotExist(err) { + return false + } + } + return true +} diff --git a/internal/interfaces/service.go b/internal/interfaces/service.go new file mode 100644 index 0000000..6bc3fff --- /dev/null +++ b/internal/interfaces/service.go @@ -0,0 +1,35 @@ +package interfaces + +import ( + "fmt" + + appconfig "github.com/vulpemventures/ocean/internal/app-config" + "github.com/vulpemventures/ocean/internal/core/domain" + cypher "github.com/vulpemventures/ocean/internal/infrastructure/mnemonic-cypher/aes128" + store "github.com/vulpemventures/ocean/internal/infrastructure/mnemonic-store/in-memory" + grpc_interface "github.com/vulpemventures/ocean/internal/interfaces/grpc" +) + +// Service interface defines the methods that every kind of interface, whether +// gRPC, REST, or whatever must be compliant with. +type Service interface { + Start() error + Stop() +} + +type ServiceManager struct { + Service +} + +func NewGrpcServiceManager( + config grpc_interface.ServiceConfig, appConfig *appconfig.AppConfig, +) (*ServiceManager, error) { + svc, err := grpc_interface.NewService(config, appConfig) + if err != nil { + return nil, fmt.Errorf("failed to initalize grpc service: %s", err) + } + + domain.MnemonicCypher = cypher.NewAES128Cypher() + domain.MnemonicStore = store.NewInMemoryMnemonicStore() + return &ServiceManager{svc}, nil +} diff --git a/pkg/profiler/service.go b/pkg/profiler/service.go new file mode 100644 index 0000000..b0805d7 --- /dev/null +++ b/pkg/profiler/service.go @@ -0,0 +1,186 @@ +package profiler + +import ( + "bufio" + "context" + "fmt" + "math" + "net/http" + "os" + "path/filepath" + "runtime" + "time" + + "github.com/prometheus/client_golang/prometheus" + log "github.com/sirupsen/logrus" +) + +const ( + minPort = 1024 + maxPort = 49151 +) + +// Service opts holds configuration options for the profiler service. +type ServiceOpts struct { + Port int + StatsInterval time.Duration + Datadir string +} + +func (o ServiceOpts) validate() error { + if len(o.Datadir) == 0 { + return fmt.Errorf("missing profiler datadir") + } + if o.Port < minPort || o.Port > maxPort { + return fmt.Errorf("port must be in range [%d, %d]", minPort, maxPort) + } + return nil +} + +func (o ServiceOpts) address() string { + return fmt.Sprintf(":%d", o.Port) +} + +// ProfilerService is the data structure representing a profiler webserver. +type ProfilerService struct { + opts ServiceOpts + server *http.Server + stopFn context.CancelFunc + ticker *time.Ticker + + log func(level log.Level, format string, a ...interface{}) + warn func(err error, format string, a ...interface{}) +} + +// NewService returns a new Profiler instance. +func NewService(opts ServiceOpts) (*ProfilerService, error) { + if err := opts.validate(); err != nil { + return nil, err + } + server := &http.Server{Addr: opts.address()} + logFn := func(level log.Level, format string, a ...interface{}) { + format = fmt.Sprintf("profiler: %s", format) + var logFn func(format string, args ...interface{}) + switch level { + case log.InfoLevel: + logFn = log.Infof + default: + logFn = log.Debugf + } + logFn(format, a...) + } + warnFn := func(err error, format string, a ...interface{}) { + format = fmt.Sprintf("profiler: %s", format) + log.WithError(err).Warnf(format, a...) + } + ticker := time.NewTicker(opts.StatsInterval) + return &ProfilerService{opts, server, nil, ticker, logFn, warnFn}, nil +} + +// Start starts the profiler. +func (s *ProfilerService) Start() error { + runtime.SetBlockProfileRate(1) + go s.server.ListenAndServe() + ctx, cancelStats := context.WithCancel(context.Background()) + s.enableMemoryStatistics(ctx, s.opts.Datadir) + s.stopFn = cancelStats + s.log( + log.InfoLevel, + "start at url http://localhost:%d/debug/pprof/", s.opts.Port, + ) + return nil +} + +// Stop stops the profiler. +func (s *ProfilerService) Stop() { + s.stopFn() + s.server.Shutdown(context.Background()) + s.ticker.Stop() + s.log(log.InfoLevel, "shutdown") +} + +// enableMemoryStatistics starts a goroutine that periodically logs memory +// usage of the go process to stdout. +func (s *ProfilerService) enableMemoryStatistics( + ctx context.Context, path string, +) { + go func() { + for { + select { + case <-s.ticker.C: + s.printMemoryStatistics() + s.printNumOfRoutines() + case <-ctx.Done(): + if err := s.dumpPrometheusDefaults(path); err != nil { + s.warn(err, "error while dumping Prometheus defaults") + } + return + } + } + }() +} + +// printMemoryStatistics logs memory statistics to stdout. +func (s *ProfilerService) printMemoryStatistics() { + var memStats runtime.MemStats + runtime.ReadMemStats(&memStats) + + bytesTotalAllocated := memStats.TotalAlloc + bytesHeapAllocated := memStats.HeapAlloc + countMalloc := memStats.Mallocs + countFrees := memStats.Frees + + s.log( + log.DebugLevel, + "total allocated: %.3fGB, heap allocated: %.3fGB, "+ + "allocated objects count: %v, freed objects count: %v", + toGigabytes(bytesTotalAllocated), + toGigabytes(bytesHeapAllocated), + countMalloc, + countFrees, + ) +} + +// printNumOfRoutines logs on stdout the number of go routines currently +// running. +func (s *ProfilerService) printNumOfRoutines() { + s.log( + log.DebugLevel, + "num of go routines: %v\n", runtime.NumGoroutine(), + ) +} + +// dumpPrometheusDefaults writes default Prometheus metrics to the given file +// path. +func (s *ProfilerService) dumpPrometheusDefaults(path string) error { + filename := filepath.Join(path, time.Now().Format(time.RFC3339)) + file, err := os.OpenFile( + filename, os.O_APPEND|os.O_CREATE|os.O_RDWR, 0644, + ) + if err != nil { + return err + } + defer file.Close() + + writer := bufio.NewWriter(file) + defer writer.Flush() + + metricFamily, err := prometheus.DefaultGatherer.Gather() + if err != nil { + return err + } + for _, v := range metricFamily { + if _, err := writer.WriteString(v.String() + "\n"); err != nil { + return err + } + } + + s.log(log.InfoLevel, "dumped Prometheus metrics to file %s", filename) + + return nil +} + +// toGigabytes returns given memory in bytes to gigabytes. +func toGigabytes(bytes uint64) float64 { + return float64(bytes) / math.Pow10(9) +} diff --git a/pkg/single-key-wallet/blind.go b/pkg/single-key-wallet/blind.go new file mode 100644 index 0000000..948d5a3 --- /dev/null +++ b/pkg/single-key-wallet/blind.go @@ -0,0 +1,301 @@ +package wallet + +import ( + "encoding/hex" + "fmt" + + "github.com/vulpemventures/go-elements/confidential" + "github.com/vulpemventures/go-elements/elementsutil" + "github.com/vulpemventures/go-elements/psetv2" +) + +type BlindPsetWithOwnedInputsArgs struct { + PsetBase64 string + OwnedInputsByIndex map[uint32]Input + ExtraBlindingKeys map[string][]byte + LastBlinder bool +} + +func (a BlindPsetWithOwnedInputsArgs) validate() error { + if a.PsetBase64 == "" { + return ErrMissingPset + } + ptx, err := psetv2.NewPsetFromBase64(a.PsetBase64) + if err != nil { + return err + } + if len(a.OwnedInputsByIndex) == 0 { + return ErrMissingOwnedInputs + } + for i, in := range a.OwnedInputsByIndex { + if int(i) >= int(ptx.Global.InputCount) { + return ErrBlindInvalidInputIndex + } + if err := in.validate(); err != nil { + return err + } + } + return nil +} + +func (a BlindPsetWithOwnedInputsArgs) ownedInputs() map[uint32]psetv2.OwnedInput { + ownedInputs := make(map[uint32]psetv2.OwnedInput) + for i, in := range a.OwnedInputsByIndex { + ownedInputs[i] = psetv2.OwnedInput{ + Index: i, + Value: in.Value, + Asset: in.Asset, + ValueBlinder: in.ValueBlinder, + AssetBlinder: in.AssetBlinder, + } + } + return ownedInputs +} + +func (a BlindPsetWithOwnedInputsArgs) inputIndexes() ([]uint32, []uint32) { + ownedInputIndexes := make([]uint32, 0, len(a.OwnedInputsByIndex)) + for i := range a.OwnedInputsByIndex { + ownedInputIndexes = append(ownedInputIndexes, i) + } + + if len(a.ExtraBlindingKeys) == 0 { + return ownedInputIndexes, nil + } + + ptx, _ := psetv2.NewPsetFromBase64(a.PsetBase64) + notOwnedInputIndexes := make([]uint32, 0) + for i, in := range ptx.Inputs { + prevout := in.GetUtxo() + prevoutScript := hex.EncodeToString(prevout.Script) + if _, ok := a.ExtraBlindingKeys[prevoutScript]; !ok { + continue + } + notOwnedInputIndexes = append(notOwnedInputIndexes, uint32(i)) + } + return ownedInputIndexes, notOwnedInputIndexes +} + +func (w *Wallet) BlindPsetWithOwnedInputs( + args BlindPsetWithOwnedInputsArgs, +) (string, error) { + if err := args.validate(); err != nil { + return "", err + } + + ptx, _ := psetv2.NewPsetFromBase64(args.PsetBase64) + ownedInputIndexes, notOwnedInputIndexes := args.inputIndexes() + + extraInputs, err := w.unblindNotOwnedInputs( + ptx, args.ExtraBlindingKeys, notOwnedInputIndexes, + ) + if err != nil { + return "", err + } + + ownedInputsByIndex := args.ownedInputs() + inputIndexes := ownedInputIndexes + if len(extraInputs) > 0 { + inputIndexes = append(inputIndexes, notOwnedInputIndexes...) + for _, i := range notOwnedInputIndexes { + ownedInputsByIndex[i] = extraInputs[i] + } + } + + blindingValidator := confidential.NewZKPValidator() + blindingGenerator, err := confidential.NewZKPGeneratorFromOwnedInputs( + ownedInputsByIndex, nil, + ) + if err != nil { + return "", err + } + + outputIndexesToBlind := w.getOutputIndexesToBlind(ptx, inputIndexes) + outBlindArgs, err := blindingGenerator.BlindOutputs( + ptx, outputIndexesToBlind, nil, + ) + if err != nil { + return "", err + } + + ownedInputs := make([]psetv2.OwnedInput, 0, len(ownedInputsByIndex)) + for i := 0; i < len(ownedInputIndexes); i++ { + ownedInputs = append(ownedInputs, ownedInputsByIndex[uint32(i)]) + } + + blinder, err := psetv2.NewBlinder( + ptx, ownedInputs, blindingValidator, blindingGenerator, + ) + if err != nil { + return "", err + } + + blindingFn := blinder.BlindNonLast + if args.LastBlinder { + blindingFn = blinder.BlindLast + } + if err := blindingFn(nil, outBlindArgs); err != nil { + return "", err + } + + return ptx.ToBase64() +} + +type BlindPsetWithMasterKeyArgs struct { + PsetBase64 string + ExtraBlindingKeys map[string][]byte + LastBlinder bool +} + +func (a BlindPsetWithMasterKeyArgs) validate() error { + if a.PsetBase64 == "" { + return ErrMissingPset + } + if _, err := psetv2.NewPsetFromBase64(a.PsetBase64); err != nil { + return err + } + return nil +} + +func (a BlindPsetWithMasterKeyArgs) inputIndexes() ([]uint32, []uint32) { + ptx, _ := psetv2.NewPsetFromBase64(a.PsetBase64) + if len(a.ExtraBlindingKeys) == 0 { + indexes := make([]uint32, 0, len(ptx.Inputs)) + for i := range ptx.Inputs { + indexes = append(indexes, uint32(i)) + } + return indexes, nil + } + + ownedIns, notOwnedIns := make([]uint32, 0), make([]uint32, 0) + for i, in := range ptx.Inputs { + prevout := in.GetUtxo() + prevoutScript := hex.EncodeToString(prevout.Script) + if _, ok := a.ExtraBlindingKeys[prevoutScript]; ok { + notOwnedIns = append(notOwnedIns, uint32(i)) + continue + } + ownedIns = append(ownedIns, uint32(i)) + } + return ownedIns, notOwnedIns +} + +func (w *Wallet) BlindPsetWithMasterKey( + args BlindPsetWithMasterKeyArgs, +) (string, error) { + if err := args.validate(); err != nil { + return "", err + } + + ptx, _ := psetv2.NewPsetFromBase64(args.PsetBase64) + ownedInputIndexes, notOwnedInputIndexes := args.inputIndexes() + + extraInputs, err := w.unblindNotOwnedInputs( + ptx, args.ExtraBlindingKeys, notOwnedInputIndexes, + ) + if err != nil { + return "", err + } + + blindingValidator := confidential.NewZKPValidator() + blindingGenerator, err := confidential.NewZKPGeneratorFromMasterBlindingKey( + w.blindingMasterKey, nil, + ) + if err != nil { + return "", err + } + + ownedInputs, err := blindingGenerator.UnblindInputs(ptx, ownedInputIndexes) + if err != nil { + return "", err + } + + inputIndexes := ownedInputIndexes + if len(args.ExtraBlindingKeys) > 0 { + inputIndexes = append(inputIndexes, notOwnedInputIndexes...) + } + + outputIndexesToBlind := w.getOutputIndexesToBlind( + ptx, inputIndexes, + ) + + outBlindArgs, err := blindingGenerator.BlindOutputs( + ptx, outputIndexesToBlind, nil, + ) + if err != nil { + return "", err + } + + // extraInputs is empty in case no ExtraBlindingKeys are passaed within args. + ownedInputs = append(ownedInputs, extraInputs...) + blinder, err := psetv2.NewBlinder( + ptx, ownedInputs, blindingValidator, blindingGenerator, + ) + if err != nil { + return "", err + } + + blindingFn := blinder.BlindNonLast + if args.LastBlinder { + blindingFn = blinder.BlindLast + } + if err := blindingFn(nil, outBlindArgs); err != nil { + return "", err + } + + return ptx.ToBase64() +} + +func (w *Wallet) unblindNotOwnedInputs( + ptx *psetv2.Pset, blindKeysByScript map[string][]byte, inputIndexes []uint32, +) ([]psetv2.OwnedInput, error) { + if len(blindKeysByScript) == 0 { + return nil, nil + } + + revealedOuts := make([]psetv2.OwnedInput, 0) + for _, inIndex := range inputIndexes { + in := ptx.Inputs[inIndex] + prevout := in.GetUtxo() + script := hex.EncodeToString(prevout.Script) + key := blindKeysByScript[script] + revealed, err := confidential.UnblindOutputWithKey(prevout, key) + if err != nil { + return nil, fmt.Errorf( + "failed to unblind not owned input %d with given blinding key "+ + "generated by prevout script %s", inIndex, script, + ) + } + revealedOuts = append(revealedOuts, psetv2.OwnedInput{ + Value: revealed.Value, + Asset: hex.EncodeToString(elementsutil.ReverseBytes(revealed.Asset)), + ValueBlinder: revealed.ValueBlindingFactor, + AssetBlinder: revealed.AssetBlindingFactor, + }) + } + return revealedOuts, nil +} + +func (w *Wallet) getOutputIndexesToBlind( + ptx *psetv2.Pset, ownedInputIndexes []uint32, +) []uint32 { + ownedOuts := make([]uint32, 0) + + isOwnedOutput := func(index uint32) bool { + for _, i := range ownedInputIndexes { + if i == index { + return true + } + } + return false + } + + for i, out := range ptx.Outputs { + if out.NeedsBlinding() { + if !isOwnedOutput(out.BlinderIndex) { + continue + } + ownedOuts = append(ownedOuts, uint32(i)) + } + } + return ownedOuts +} diff --git a/pkg/single-key-wallet/derivation_path.go b/pkg/single-key-wallet/derivation_path.go new file mode 100644 index 0000000..b7c6d93 --- /dev/null +++ b/pkg/single-key-wallet/derivation_path.go @@ -0,0 +1,116 @@ +package wallet + +import ( + "fmt" + "math" + "math/big" + "strings" + + "github.com/btcsuite/btcd/btcutil/hdkeychain" +) + +// DerivationPath is the data structure representing an HD path. +type DerivationPath []uint32 + +// ParseDerivationPath converts a derivation path in string format to a +// DerivationPath type. +func ParseDerivationPath(strPath string) (DerivationPath, error) { + return parseDerivationPath(strPath, false) +} + +func ParseRootDerivationPath(strPath string) (DerivationPath, error) { + path, err := parseDerivationPath(strPath, true) + if err != nil { + return nil, err + } + if len(path) != 2 { + return nil, ErrInvalidRootPathLen + } + if path[0] < hdkeychain.HardenedKeyStart || path[1] < hdkeychain.HardenedKeyStart { + return nil, ErrInvalidRootPath + } + return path, nil +} + +func (path DerivationPath) String() string { + if len(path) <= 0 { + return "" + } + + result := "m" + for _, component := range path { + var hardened bool + if component >= hdkeychain.HardenedKeyStart { + component -= hdkeychain.HardenedKeyStart + hardened = true + } + result = fmt.Sprintf("%s/%d", result, component) + if hardened { + result += "'" + } + } + return result +} + +func parseDerivationPath( + strPath string, checkAbsolutePath bool, +) (DerivationPath, error) { + if strPath == "" { + return nil, ErrMissingDerivationPath + } + + elems := strings.Split(strPath, "/") + if containsEmptyString(elems) { + return nil, ErrMalformedDerivationPath + } + if checkAbsolutePath { + if elems[0] != "m" { + return nil, ErrRequiredAbsoluteDerivationPath + } + } + if len(elems) < 2 { + return nil, ErrMalformedDerivationPath + } + if strings.TrimSpace(elems[0]) == "m" { + elems = elems[1:] + } + + path := make(DerivationPath, 0) + for _, elem := range elems { + elem = strings.TrimSpace(elem) + var value uint32 + + if strings.HasSuffix(elem, "'") { + value = hdkeychain.HardenedKeyStart + elem = strings.TrimSpace(strings.TrimSuffix(elem, "'")) + } + + // use big int for convertion + bigval, ok := new(big.Int).SetString(elem, 0) + if !ok { + return nil, fmt.Errorf("invalid elem '%s' in path", elem) + } + + max := math.MaxUint32 - value + if bigval.Sign() < 0 || bigval.Cmp(big.NewInt(int64(max))) > 0 { + if value == 0 { + return nil, fmt.Errorf("elem %v must be in range [0, %d]", bigval, max) + } + return nil, fmt.Errorf("elem %v must be in hardened range [0, %d]", bigval, max) + } + value += uint32(bigval.Uint64()) + + path = append(path, value) + } + + return path, nil +} + +func containsEmptyString(composedPath []string) bool { + for _, s := range composedPath { + if s == "" { + return true + } + } + return false +} diff --git a/pkg/single-key-wallet/derivation_path_test.go b/pkg/single-key-wallet/derivation_path_test.go new file mode 100644 index 0000000..2552221 --- /dev/null +++ b/pkg/single-key-wallet/derivation_path_test.go @@ -0,0 +1,116 @@ +package wallet_test + +import ( + "testing" + + "github.com/btcsuite/btcd/btcutil/hdkeychain" + "github.com/stretchr/testify/require" + wallet "github.com/vulpemventures/ocean/pkg/single-key-wallet" +) + +func TestParseDerivationPath(t *testing.T) { + t.Parallel() + + t.Run("valid", func(t *testing.T) { + t.Parallel() + + tests := []struct { + derivationPath string + expected wallet.DerivationPath + }{ + // Plain absolute derivation paths + {"m/84'/0'/0'/0", wallet.DerivationPath{hdkeychain.HardenedKeyStart + 84, hdkeychain.HardenedKeyStart, hdkeychain.HardenedKeyStart, 0}}, + {"m/84'/0'/0'/128", wallet.DerivationPath{hdkeychain.HardenedKeyStart + 84, hdkeychain.HardenedKeyStart, hdkeychain.HardenedKeyStart, 128}}, + {"m/84'/0'/0'/0'", wallet.DerivationPath{hdkeychain.HardenedKeyStart + 84, hdkeychain.HardenedKeyStart, hdkeychain.HardenedKeyStart, hdkeychain.HardenedKeyStart}}, + {"m/84'/0'/0'/128'", wallet.DerivationPath{hdkeychain.HardenedKeyStart + 84, hdkeychain.HardenedKeyStart, hdkeychain.HardenedKeyStart + 0, hdkeychain.HardenedKeyStart + 128}}, + {"m/2147483732/2147483648/2147483648/0", wallet.DerivationPath{hdkeychain.HardenedKeyStart + 84, hdkeychain.HardenedKeyStart, hdkeychain.HardenedKeyStart, 0}}, + {"m/2147483732/2147483648/2147483648/2147483648", wallet.DerivationPath{hdkeychain.HardenedKeyStart + 84, hdkeychain.HardenedKeyStart, hdkeychain.HardenedKeyStart, hdkeychain.HardenedKeyStart}}, + + // Hexadecimal absolute derivation paths + {"m/0x54'/0x00'/0x00'/0x00", wallet.DerivationPath{hdkeychain.HardenedKeyStart + 84, hdkeychain.HardenedKeyStart, hdkeychain.HardenedKeyStart, 0}}, + {"m/0x54'/0x00'/0x00'/0x80", wallet.DerivationPath{hdkeychain.HardenedKeyStart + 84, hdkeychain.HardenedKeyStart, hdkeychain.HardenedKeyStart, 128}}, + {"m/0x54'/0x00'/0x00'/0x00'", wallet.DerivationPath{hdkeychain.HardenedKeyStart + 84, hdkeychain.HardenedKeyStart, hdkeychain.HardenedKeyStart, hdkeychain.HardenedKeyStart}}, + {"m/0x54'/0x00'/0x00'/0x80'", wallet.DerivationPath{hdkeychain.HardenedKeyStart + 84, hdkeychain.HardenedKeyStart, hdkeychain.HardenedKeyStart, hdkeychain.HardenedKeyStart + 128}}, + {"m/0x80000054/0x80000000/0x80000000/0x00", wallet.DerivationPath{hdkeychain.HardenedKeyStart + 84, hdkeychain.HardenedKeyStart, hdkeychain.HardenedKeyStart, 0}}, + {"m/0x80000054/0x80000000/0x80000000/0x80000000", wallet.DerivationPath{hdkeychain.HardenedKeyStart + 84, hdkeychain.HardenedKeyStart, hdkeychain.HardenedKeyStart, hdkeychain.HardenedKeyStart}}, + + // Weird inputs just to ensure they work + {" m / 84 '\n/\n 00 \n\n\t' /\n0 ' /\t\t 0", wallet.DerivationPath{hdkeychain.HardenedKeyStart + 84, hdkeychain.HardenedKeyStart, hdkeychain.HardenedKeyStart, 0}}, + + // Relative derivation paths + {"84'/0'/0/0", wallet.DerivationPath{hdkeychain.HardenedKeyStart + 84, hdkeychain.HardenedKeyStart, 0, 0}}, + {"0'/0/0", wallet.DerivationPath{hdkeychain.HardenedKeyStart, 0, 0}}, + {"0/0", wallet.DerivationPath{0, 0}}, + } + for _, tt := range tests { + path, err := wallet.ParseDerivationPath(tt.derivationPath) + require.NoError(t, err) + require.Equal(t, tt.expected, path) + } + }) + + t.Run("invalid", func(t *testing.T) { + t.Parallel() + + tests := []struct { + derivationPath string + expectedErr error + }{ + // Invalid derivation paths + {"", wallet.ErrMissingDerivationPath}, // Empty relative derivation path + {"m", wallet.ErrMalformedDerivationPath}, // Empty absolute derivation path + {"m/", wallet.ErrMalformedDerivationPath}, // Missing last derivation component + {"/84'/0'/0'/0", wallet.ErrMalformedDerivationPath}, // Absolute path without m prefix, might be user error + {"m/2147483648'", nil}, // Overflows 32 bit integer (dynamic values on error, not constant) + {"m/-1'", nil}, // Cannot contain negative number (dynamic values on error, not constant) + {"0", wallet.ErrMalformedDerivationPath}, // Bad derivation path + } + + for _, tt := range tests { + _, err := wallet.ParseDerivationPath(tt.derivationPath) + require.Error(t, err) + if tt.expectedErr != nil { + require.EqualError(t, tt.expectedErr, err.Error()) + } + } + }) +} + +func TestParseRootDerivationPath(t *testing.T) { + t.Run("valid", func(t *testing.T) { + tests := []struct { + rootPath string + expected wallet.DerivationPath + }{ + {"m/84'/0'", wallet.DerivationPath{hdkeychain.HardenedKeyStart + 84, hdkeychain.HardenedKeyStart}}, + {"m/84'/1'", wallet.DerivationPath{hdkeychain.HardenedKeyStart + 84, hdkeychain.HardenedKeyStart + 1}}, + {"m/44'/0'", wallet.DerivationPath{hdkeychain.HardenedKeyStart + 44, hdkeychain.HardenedKeyStart}}, + {"m/44'/1'", wallet.DerivationPath{hdkeychain.HardenedKeyStart + 44, hdkeychain.HardenedKeyStart + 1}}, + } + + for _, tt := range tests { + path, err := wallet.ParseRootDerivationPath(tt.rootPath) + require.NoError(t, err) + require.Equal(t, tt.expected, path) + } + }) + + t.Run("invalid", func(t *testing.T) { + tests := []struct { + rootPath string + expectedErr error + }{ + {"", wallet.ErrMissingDerivationPath}, + {"m/84'", wallet.ErrInvalidRootPathLen}, + {"m/84'/0'/0'", wallet.ErrInvalidRootPathLen}, + {"m/84'/0", wallet.ErrInvalidRootPath}, + {"m/84/0'", wallet.ErrInvalidRootPath}, + {"84'/0'", wallet.ErrRequiredAbsoluteDerivationPath}, + } + + for _, tt := range tests { + _, err := wallet.ParseRootDerivationPath(tt.rootPath) + require.EqualError(t, tt.expectedErr, err.Error()) + } + }) +} diff --git a/pkg/single-key-wallet/errors.go b/pkg/single-key-wallet/errors.go new file mode 100644 index 0000000..648a0c3 --- /dev/null +++ b/pkg/single-key-wallet/errors.go @@ -0,0 +1,40 @@ +package wallet + +import ( + "fmt" + + "github.com/btcsuite/btcd/btcutil/hdkeychain" +) + +var ( + ErrMissingNetwork = fmt.Errorf("missing network") + ErrMissingMnemonic = fmt.Errorf("missing mnemonic") + ErrMissingSigningMasterKey = fmt.Errorf("missing signing master key") + ErrMissingBlindingMasterKey = fmt.Errorf("missing blinding master key") + ErrMissingDerivationPath = fmt.Errorf("missing derivation path") + ErrMissingOutputScript = fmt.Errorf("missing output script") + ErrMissingPset = fmt.Errorf("missing pset base64") + ErrMissingDerivationPaths = fmt.Errorf("missing derivation path map") + + ErrInvalidEntropySize = fmt.Errorf("entropy size must be a multiple of 32 in the range [128,256]") + ErrInvalidMnemonic = fmt.Errorf("blinding mnemonic is invalid") + ErrInvalidRootPathLen = fmt.Errorf("invalid root path length, must be in the form \"m/purpose'/coin_type'\"") + ErrInvalidRootPath = fmt.Errorf("root path must contain only hardended values") + ErrRequiredAbsoluteDerivationPath = fmt.Errorf("path must be an absolute derivation starting with 'm/'") + ErrInvalidDerivationPathLength = fmt.Errorf("derivation path must be a relative path in the form \"account'/branch/index\"") + ErrInvalidDerivationPathAccount = fmt.Errorf("derivation path's account (first elem) must be hardened (suffix ')") + ErrInvalidSignatures = fmt.Errorf("transaction contains invalid signature(s)") + + ErrMalformedDerivationPath = fmt.Errorf("path must not start or end with a '/'") + ErrOutOfRangeDerivationPathAccount = fmt.Errorf("account index must be in hardened range [0', %d']", hdkeychain.HardenedKeyStart-1) + + ErrMissingPrevOuts = fmt.Errorf("missing prevouts") + ErrInputMissingTxid = fmt.Errorf("input is missing txid") + ErrInputInvalidTxid = fmt.Errorf("invalid input txid length: must be exactly 32 bytes") + ErrOutputMissingAsset = fmt.Errorf("output is missing asset") + ErrOutputInvalidAsset = fmt.Errorf("invalid output asset length: must be exactly 32 bytes") + ErrMissingInputs = fmt.Errorf("at least one input is mandatory to create a partial transaction with one or more confidential outputs") + ErrMissingOwnedInputs = fmt.Errorf("missing list of owned inputs") + ErrBlindInvalidInputIndex = fmt.Errorf("input index to blind is out of range") + ErrMissingRootPath = fmt.Errorf("missing root derivation path") +) diff --git a/pkg/single-key-wallet/estimation.go b/pkg/single-key-wallet/estimation.go new file mode 100644 index 0000000..0cb0b4a --- /dev/null +++ b/pkg/single-key-wallet/estimation.go @@ -0,0 +1,171 @@ +package wallet + +import "github.com/vulpemventures/go-elements/address" + +const ( + P2PK = iota + P2PKH + P2MS + P2SH_P2WPKH + P2SH_P2WSH + P2WPKH + P2WSH +) + +var ( + scriptTypes = map[int]int{ + address.P2PkhScript: P2PKH, + address.P2ShScript: P2SH_P2WPKH, + address.P2WpkhScript: P2WPKH, + address.P2WshScript: P2WSH, + } +) + +// EstimateTxSize makes an estimation of the virtual size of a transaction for +// which is required to specify the type of the inputs and outputs according to +// those of the Bitcoin standard (P2PK, P2PKH, P2MS, P2SH(P2WPKH), P2SH(P2WSH), +// P2WPKH, P2WSH). +// The estimation might not be accurate in case of one or more P2MS inputs +// since the method is not able to retrieve the size of redeem script containg +// all pubkeys, nor it expects anyone as arg. +func EstimateTxSize(inputs []Input, outputs []Output) uint64 { + inputScriptTypes := make([]int, 0, len(inputs)) + for _, in := range inputs { + inputScriptTypes = append(inputScriptTypes, in.scriptType()) + } + outputScripts := make([]int, 0, len(outputs)) + for _, out := range outputs { + outputScripts = append(outputScripts, out.scriptSize()) + } + + txSize := estimateTxSize(inputScriptTypes, nil, nil, outputScripts) + return uint64(txSize) +} + +// EstimateFees estimates the virtual size of the transaciton composed of the +// given Inputs and Outputs and then returns the corresponding fee amount based +// on the given mSats/Byte ratio. +func EstimateFees( + inputs []Input, outputs []Output, millisatsPerByte uint64, +) uint64 { + txSize := EstimateTxSize(inputs, outputs) + satsPerByte := float64(millisatsPerByte) / 1000 + return uint64(float64(txSize) * satsPerByte) +} + +func estimateTxSize( + inScriptTypes, inAuxiliaryRedeemScriptSize, inAuxiliaryWitnessSize, + outScripts []int, +) int { + baseSize := calcTxSize( + false, + inScriptTypes, inAuxiliaryRedeemScriptSize, inAuxiliaryWitnessSize, + outScripts, + ) + totalSize := calcTxSize( + true, + inScriptTypes, inAuxiliaryRedeemScriptSize, inAuxiliaryWitnessSize, + outScripts, + ) + + weight := baseSize*3 + totalSize + vsize := (weight + 3) / 4 + + return vsize +} + +func calcTxSize( + withWitness bool, + inScriptTypes, inAuxiliaryRedeemScriptSize, inAuxiliaryWitnessSize, + outScriptSizes []int, +) int { + txSize := calcTxBaseSize( + inScriptTypes, inAuxiliaryRedeemScriptSize, + outScriptSizes, + ) + if withWitness { + txSize += calcTxWitnessSize( + inScriptTypes, inAuxiliaryWitnessSize, + outScriptSizes, + ) + } + return txSize +} + +var ( + scripsigtSizeByScriptType = map[int]int{ + P2PK: 140, // len + opcode + sig + opcode + pubkey uncompressed + P2PKH: 108, // len + opcode + sig + opcode + pubkey + P2SH_P2WPKH: 23, // len + p2wpkh script + P2SH_P2WSH: 35, // len + p2wsh script + P2WPKH: 1, // no scriptsig, still len is serialized + P2WSH: 1, // no scriptsig + } + scriptPubKeySizeByScriptType = map[int]int{ + P2PK: 67, // len + pubkey uncompressed + opcode + P2PKH: 26, // len + opcodes (3) + hash(pubkey) + opcodes (2) + P2SH_P2WPKH: 24, // len + opcodes (2) + hash(script) + opcode + P2SH_P2WSH: 24, // len + opcodes (2) + hash(script) + opcode + P2WPKH: 23, // len + opcodes (2) + hash(script) + P2WSH: 35, // len + opcodes (2) + hash(script) + } +) + +func calcTxBaseSize( + inScriptTypes, inAuxiliaryRedeemScriptSize, + outScriptSizes []int, +) int { + // hash + index + sequence + inBaseSize := 40 + insSize := 0 + auxCount := 0 + for _, scriptType := range inScriptTypes { + scriptSize, ok := scripsigtSizeByScriptType[scriptType] + if !ok { + scriptSize = inAuxiliaryRedeemScriptSize[auxCount] + auxCount++ + } + insSize += inBaseSize + scriptSize + } + + // asset + value + nonce commitments + outBaseSize := 33 + 33 + 33 + outsSize := 0 + for _, scriptSize := range outScriptSizes { + outsSize += outBaseSize + scriptSize + } + // size of unconf fee out + // asset + unconf value + empty script + empty nonce + outsSize += 33 + 9 + 1 + 1 + + return 9 + + varIntSerializeSize(uint64(len(inScriptTypes))) + + varIntSerializeSize(uint64(len(outScriptSizes)+1)) + + insSize + outsSize +} + +func calcTxWitnessSize( + inScriptTypes, inAuxiliaryWitnessSize, + outScriptTypes []int, +) int { + insSize := 0 + auxCount := 0 + for _, scriptType := range inScriptTypes { + if scriptType == P2SH_P2WPKH || scriptType == P2WPKH { + // len + witness[sig,pubkey] + no issuance proof + no token proof + no pegin + insSize += (1 + 107 + 1 + 1 + 1) + } + if scriptType == P2SH_P2WSH || scriptType == P2WSH { + insSize += inAuxiliaryWitnessSize[auxCount] + auxCount++ + } + } + + numOutputs := len(outScriptTypes) + // size(range proof) + proof + size(surjection proof) + proof + outsSize := (3 + 4174 + 1 + 131) * numOutputs + // size of proofs for unconf fee out + outsSize += 1 + 1 + + return insSize + outsSize +} diff --git a/pkg/single-key-wallet/estimation_test.go b/pkg/single-key-wallet/estimation_test.go new file mode 100644 index 0000000..3316b1b --- /dev/null +++ b/pkg/single-key-wallet/estimation_test.go @@ -0,0 +1,96 @@ +package wallet_test + +import ( + "encoding/hex" + "testing" + + "github.com/stretchr/testify/require" + wallet "github.com/vulpemventures/ocean/pkg/single-key-wallet" +) + +func TestEstimateTxSize(t *testing.T) { + tests := []struct { + inputs []wallet.Input + outputs []wallet.Output + expectedSize int + }{ + // https://blockstream.info/liquid/tx/3bf5b21f9b5785de089be6dc4963058b4734bf86a9434c9910ad739dbf742eb0 + { + inputs: []wallet.Input{ + {Script: h2b("16001483a220425cf9f653175e81e7438f57ba7483e262")}, + }, + outputs: []wallet.Output{ + {Address: "H4mWpfhRc6FTpbd8aSFxjiAGSccHDo6oSr"}, + {Address: "GwyYE4fNG2Q9NyfYy8bfivgTeWawvGFJXm"}, + }, + expectedSize: 2516, + }, + // https://blockstream.info/liquid/tx/06d4897d60128cccc588ccd5e1d62eba3d23b154ce8954e6b8057356c9eb9fa0 + { + inputs: []wallet.Input{ + {Script: h2b("1600142fab026d04a9f8534b5ee1c93129a085527ba7b8")}, + {Script: h2b("160014d33bf8fad507164c32bd28ea6e295fa0f4bfee95")}, + }, + outputs: []wallet.Output{ + {Address: "ex1qpgtfm6wk7c5rx8e39mdjm84qmd872geltlcf26"}, + {Address: "ex1qkwff7kmuge4c5mpdx7ywtgjmkeu5t57r6jpghu"}, + }, + expectedSize: 2621, + }, + // https://blockstream.info/liquid/tx/34941db50a2128008451304200e396b64b68120f411f0a4fe0c2f9cef1f9864f + { + inputs: []wallet.Input{ + {Script: h2b("00140b51f5036527f61a234015ed3bdc84497793b26d")}, + {Script: h2b("0014ae71e8f6d614c5df51711760edfd7146e7fb9d74")}, + {Script: h2b("00143020f079534e777b49b8278558405c928951c1fe")}, + }, + outputs: []wallet.Output{ + {Address: "ex1q3l8sp8hsnjkjwa3pywwretxm2lffyqcvn9qwjg"}, + {Address: "ex1qsf9c7vfrq5lld9upu6r00uxs6ajpdvhw54p95u"}, + {Address: "ex1qq94dlx7sk20daj87jf5cwuk5yprme2lr7397k9"}, + {Address: "ex1qy97txclaacxallufez0vuq4s05vxw8pmv6fnk4"}, + {Address: "ex1qwgupjdvval9wscrtr2eesuu0s6expdx3vd4ru6"}, + }, + expectedSize: 6258, + }, + // https://blockstream.info/liquid/tx/14a920f9af73e3f9e34fcb4707b1cccd0adca86e27003a32ed77184d4d41d0f6 + { + inputs: []wallet.Input{ + {Script: h2b("22002026b2fb5626d5dbb0e089fd99ecbbf11561bc2a63b05401d3a27e24c7f2ee9cc5")}, + }, + outputs: []wallet.Output{ + {Address: "ex1qg2mk6dkrwm2q9mdkru3eergac28n5glkdft5fr"}, + }, + expectedSize: 1373, + }, + // example tx with lots of P2WPKH ins and outs + { + inputs: []wallet.Input{ + {Script: h2b("00140b51f5036527f61a234015ed3bdc84497793b26d")}, + {Script: h2b("00140b51f5036527f61a234015ed3bdc84497793b26d")}, + {Script: h2b("00140b51f5036527f61a234015ed3bdc84497793b26d")}, + {Script: h2b("00140b51f5036527f61a234015ed3bdc84497793b26d")}, + {Script: h2b("00140b51f5036527f61a234015ed3bdc84497793b26d")}, + {Script: h2b("00140b51f5036527f61a234015ed3bdc84497793b26d")}, + {Script: h2b("00140b51f5036527f61a234015ed3bdc84497793b26d")}, + }, + outputs: []wallet.Output{ + {Address: "ex1q3l8sp8hsnjkjwa3pywwretxm2lffyqcvn9qwjg"}, + {Address: "ex1q3l8sp8hsnjkjwa3pywwretxm2lffyqcvn9qwjg"}, + {Address: "ex1q3l8sp8hsnjkjwa3pywwretxm2lffyqcvn9qwjg"}, + {Address: "ex1q3l8sp8hsnjkjwa3pywwretxm2lffyqcvn9qwjg"}, + {Address: "ex1q3l8sp8hsnjkjwa3pywwretxm2lffyqcvn9qwjg"}, + }, + expectedSize: 6532, + }, + } + for _, tt := range tests { + size := wallet.EstimateTxSize(tt.inputs, tt.outputs) + require.GreaterOrEqual(t, int(size), tt.expectedSize) + } +} + +func h2b(str string) []byte { + buf, _ := hex.DecodeString(str) + return buf +} diff --git a/pkg/single-key-wallet/keys.go b/pkg/single-key-wallet/keys.go new file mode 100644 index 0000000..7feba31 --- /dev/null +++ b/pkg/single-key-wallet/keys.go @@ -0,0 +1,248 @@ +package wallet + +import ( + "encoding/hex" + + "github.com/btcsuite/btcd/btcec/v2" + "github.com/btcsuite/btcd/btcutil/base58" + "github.com/btcsuite/btcd/btcutil/hdkeychain" + "github.com/vulpemventures/go-elements/network" + "github.com/vulpemventures/go-elements/payment" + "github.com/vulpemventures/go-elements/slip77" +) + +type ExtendedKeyArgs struct { + Account uint32 +} + +func (a ExtendedKeyArgs) validate() error { + if a.Account >= hdkeychain.HardenedKeyStart { + return ErrOutOfRangeDerivationPathAccount + } + return nil +} + +// AccountExtendedPrivateKey returns the extended private key in base58 format +// for the given account index. +func (w *Wallet) AccountExtendedPrivateKey(args ExtendedKeyArgs) (string, error) { + if err := args.validate(); err != nil { + return "", err + } + if err := w.validate(); err != nil { + return "", err + } + + xprv, err := w.extendedPrivateKey(args.Account) + if err != nil { + return "", err + } + + return xprv.String(), nil +} + +// AccountExtendedPublicKey returns the extended public key in base58 format +// for the given account index. +func (w *Wallet) AccountExtendedPublicKey(args ExtendedKeyArgs) (string, error) { + if err := args.validate(); err != nil { + return "", err + } + if err := w.validate(); err != nil { + return "", err + } + + xprv, err := w.extendedPrivateKey(args.Account) + if err != nil { + return "", err + } + + xpub, err := xprv.Neuter() + if err != nil { + return "", err + } + + return xpub.String(), nil +} + +// MasterBlindingKey returns the SLIP-77 master blinding key of the wallet in +// hex format. +func (w *Wallet) MasterBlindingKey() (string, error) { + if err := w.validate(); err != nil { + return "", err + } + + if len(w.mnemonic) == 0 { + return "", nil + } + + return hex.EncodeToString(w.blindingMasterKey), nil +} + +type DeriveSigningKeyPairArgs struct { + DerivationPath string +} + +func (a DeriveSigningKeyPairArgs) validate() error { + derivationPath, err := ParseDerivationPath(a.DerivationPath) + if err != nil { + return err + } + + return checkDerivationPath(derivationPath) +} + +// DeriveSigningKeyPair derives the key pair from the given derivation path. +func (w *Wallet) DeriveSigningKeyPair(args DeriveSigningKeyPairArgs) ( + *btcec.PrivateKey, *btcec.PublicKey, error, +) { + if err := args.validate(); err != nil { + return nil, nil, err + } + if err := w.validate(); err != nil { + return nil, nil, err + } + + hdNode, err := hdkeychain.NewKeyFromString( + base58.Encode(w.signingMasterKey), + ) + if err != nil { + return nil, nil, err + } + + derivationPath, _ := ParseDerivationPath(args.DerivationPath) + for _, step := range derivationPath { + hdNode, err = hdNode.Derive(step) + if err != nil { + return nil, nil, err + } + } + + privateKey, err := hdNode.ECPrivKey() + if err != nil { + return nil, nil, err + } + + publicKey, err := hdNode.ECPubKey() + if err != nil { + return nil, nil, err + } + + prvKey := (*btcec.PrivateKey)(privateKey) + pubKey := (*btcec.PublicKey)(publicKey) + return prvKey, pubKey, nil +} + +type DeriveBlindingKeyPairArgs struct { + Script []byte +} + +func (a DeriveBlindingKeyPairArgs) validate() error { + if len(a.Script) <= 0 { + return ErrMissingOutputScript + } + return nil +} + +// DeriveBlindingKeyPair derives the SLIP77 blinding key pair from the given +// output script. +func (w *Wallet) DeriveBlindingKeyPair( + args DeriveBlindingKeyPairArgs, +) (*btcec.PrivateKey, *btcec.PublicKey, error) { + if err := args.validate(); err != nil { + return nil, nil, err + } + if err := w.validate(); err != nil { + return nil, nil, err + } + if len(w.blindingMasterKey) <= 0 { + return nil, nil, ErrMissingBlindingMasterKey + } + slip77Node, err := slip77.FromMasterKey(w.blindingMasterKey) + if err != nil { + return nil, nil, err + } + return slip77Node.DeriveKey(args.Script) +} + +type DeriveConfidentialAddressArgs struct { + DerivationPath string + Network *network.Network +} + +func (a DeriveConfidentialAddressArgs) validate() error { + derivationPath, err := ParseDerivationPath(a.DerivationPath) + if err != nil { + return err + } + + err = checkDerivationPath(derivationPath) + if err != nil { + return err + } + + if a.Network == nil { + return ErrMissingNetwork + } + + return nil +} + +// DeriveConfidentialAddress derives both the HD signing and the SLIP-77 +// blinding key-pairs to generate a confidential address. +func (w *Wallet) DeriveConfidentialAddress( + args DeriveConfidentialAddressArgs, +) (string, []byte, error) { + if err := args.validate(); err != nil { + return "", nil, err + } + if err := w.validate(); err != nil { + return "", nil, err + } + + _, pubkey, err := w.DeriveSigningKeyPair(DeriveSigningKeyPairArgs{ + DerivationPath: args.DerivationPath, + }) + if err != nil { + return "", nil, err + } + + script := payment.FromPublicKey(pubkey, args.Network, nil).WitnessScript + + _, blindingPubkey, err := w.DeriveBlindingKeyPair(DeriveBlindingKeyPairArgs{ + Script: script, + }) + if err != nil { + return "", nil, err + } + + p2wpkh := payment.FromPublicKey(pubkey, args.Network, blindingPubkey) + addr, err := p2wpkh.ConfidentialWitnessPubKeyHash() + if err != nil { + return "", nil, err + } + return addr, p2wpkh.WitnessScript, nil +} + +func (w *Wallet) extendedPrivateKey( + account uint32, +) (*hdkeychain.ExtendedKey, error) { + masterKey, err := hdkeychain.NewKeyFromString( + base58.Encode(w.signingMasterKey), + ) + if err != nil { + return nil, err + } + + step := account + hdkeychain.HardenedKeyStart + return masterKey.Derive(step) +} + +func checkDerivationPath(path DerivationPath) error { + if len(path) != 3 { + return ErrInvalidDerivationPathLength + } + // first elem must be hardened! + if path[0] < hdkeychain.HardenedKeyStart { + return ErrInvalidDerivationPathAccount + } + return nil +} diff --git a/pkg/single-key-wallet/keys_test.go b/pkg/single-key-wallet/keys_test.go new file mode 100644 index 0000000..1579065 --- /dev/null +++ b/pkg/single-key-wallet/keys_test.go @@ -0,0 +1,208 @@ +package wallet_test + +import ( + "encoding/hex" + "testing" + + "github.com/btcsuite/btcd/btcutil/hdkeychain" + "github.com/stretchr/testify/require" + "github.com/vulpemventures/go-elements/network" + wallet "github.com/vulpemventures/ocean/pkg/single-key-wallet" +) + +func TestAccountExtendedKey(t *testing.T) { + t.Parallel() + + t.Run("valid", func(t *testing.T) { + t.Parallel() + + w, err := wallet.NewWallet(wallet.NewWalletArgs{RootPath: testRootPath}) + require.NoError(t, err) + + args := wallet.ExtendedKeyArgs{ + Account: 0, + } + xprv, err := w.AccountExtendedPrivateKey(args) + require.NoError(t, err) + require.NotEmpty(t, xprv) + + xpub, err := w.AccountExtendedPublicKey(args) + require.NoError(t, err) + require.NotEmpty(t, xpub) + }) + + t.Run("invalid", func(t *testing.T) { + t.Parallel() + + w, err := wallet.NewWallet(wallet.NewWalletArgs{RootPath: testRootPath}) + require.NoError(t, err) + + tests := []struct { + args wallet.ExtendedKeyArgs + err error + }{ + { + args: wallet.ExtendedKeyArgs{ + Account: hdkeychain.HardenedKeyStart, + }, + err: wallet.ErrOutOfRangeDerivationPathAccount, + }, + } + + for _, tt := range tests { + _, err := w.AccountExtendedPrivateKey(tt.args) + require.EqualError(t, tt.err, err.Error()) + _, err = w.AccountExtendedPublicKey(tt.args) + require.EqualError(t, tt.err, err.Error()) + } + }) +} + +func TestDeriveSigningKeyPair(t *testing.T) { + t.Parallel() + + t.Run("valid", func(t *testing.T) { + t.Parallel() + + w, err := wallet.NewWallet(wallet.NewWalletArgs{RootPath: testRootPath}) + require.NoError(t, err) + + args := wallet.DeriveSigningKeyPairArgs{ + DerivationPath: "0'/0/0", + } + prvkey, pubkey, err := w.DeriveSigningKeyPair(args) + require.NoError(t, err) + require.NotNil(t, prvkey) + require.NotNil(t, pubkey) + }) + + t.Run("invalid", func(t *testing.T) { + t.Parallel() + + w, err := wallet.NewWallet(wallet.NewWalletArgs{RootPath: testRootPath}) + require.NoError(t, err) + + tests := []struct { + args wallet.DeriveSigningKeyPairArgs + err error + }{ + { + args: wallet.DeriveSigningKeyPairArgs{"0/0"}, + err: wallet.ErrInvalidDerivationPathLength, + }, + { + args: wallet.DeriveSigningKeyPairArgs{"0/0/0/0"}, + err: wallet.ErrInvalidDerivationPathLength, + }, + { + args: wallet.DeriveSigningKeyPairArgs{"0'/0/0/0"}, + err: wallet.ErrInvalidDerivationPathLength, + }, + { + args: wallet.DeriveSigningKeyPairArgs{"0/0/0"}, + err: wallet.ErrInvalidDerivationPathAccount, + }, + } + + for _, tt := range tests { + _, _, err := w.DeriveSigningKeyPair(tt.args) + require.EqualError(t, tt.err, err.Error()) + } + }) +} + +func TestDeriveBlindingKeyPair(t *testing.T) { + t.Parallel() + + t.Run("valid", func(t *testing.T) { + t.Parallel() + + w, err := wallet.NewWallet(wallet.NewWalletArgs{RootPath: testRootPath}) + require.NoError(t, err) + + script, _ := hex.DecodeString("001439397080b51ef22c59bd7469afacffbeec0da12e") + args := wallet.DeriveBlindingKeyPairArgs{ + Script: script, + } + blindingPrvkey, blindingPubkey, err := w.DeriveBlindingKeyPair(args) + require.NoError(t, err) + require.NotNil(t, blindingPrvkey) + require.NotNil(t, blindingPubkey) + }) + + t.Run("invalid", func(t *testing.T) { + t.Parallel() + + w, err := wallet.NewWallet(wallet.NewWalletArgs{RootPath: testRootPath}) + if err != nil { + t.Fatal(err) + } + + tests := []struct { + args wallet.DeriveBlindingKeyPairArgs + err error + }{ + { + args: wallet.DeriveBlindingKeyPairArgs{[]byte{}}, + err: wallet.ErrMissingOutputScript, + }, + } + + for _, tt := range tests { + _, _, err := w.DeriveBlindingKeyPair(tt.args) + require.EqualError(t, tt.err, err.Error()) + } + }) +} + +func TestDeriveConfidentialAddress(t *testing.T) { + t.Parallel() + + t.Run("valid", func(t *testing.T) { + t.Parallel() + + w, err := wallet.NewWallet(wallet.NewWalletArgs{RootPath: testRootPath}) + require.NoError(t, err) + + args := wallet.DeriveConfidentialAddressArgs{ + DerivationPath: "0'/0/0", + Network: &network.Liquid, + } + ctAddress, script, err := w.DeriveConfidentialAddress(args) + require.NoError(t, err) + require.NotNil(t, ctAddress) + require.NotNil(t, script) + }) + + t.Run("invalid", func(t *testing.T) { + t.Parallel() + + w, err := wallet.NewWallet(wallet.NewWalletArgs{RootPath: testRootPath}) + require.NoError(t, err) + + tests := []struct { + args wallet.DeriveConfidentialAddressArgs + err error + }{ + { + args: wallet.DeriveConfidentialAddressArgs{ + DerivationPath: "", + Network: &network.Liquid, + }, + err: wallet.ErrMissingDerivationPath, + }, + { + args: wallet.DeriveConfidentialAddressArgs{ + DerivationPath: "0'/0/0", + Network: nil, + }, + err: wallet.ErrMissingNetwork, + }, + } + + for _, tt := range tests { + _, _, err := w.DeriveConfidentialAddress(tt.args) + require.EqualError(t, tt.err, err.Error()) + } + }) +} diff --git a/pkg/single-key-wallet/mnemonic.go b/pkg/single-key-wallet/mnemonic.go new file mode 100644 index 0000000..161f75e --- /dev/null +++ b/pkg/single-key-wallet/mnemonic.go @@ -0,0 +1,28 @@ +package wallet + +type NewMnemonicArgs struct { + EntropySize uint32 +} + +func (a NewMnemonicArgs) validate() error { + if a.EntropySize > 0 { + if a.EntropySize < 128 || a.EntropySize > 256 || a.EntropySize%32 != 0 { + return ErrInvalidEntropySize + } + } + return nil +} + +// NewMnemonic returns a new mnemonic as a list of words: +// * EntropySize: 256 -> 24-words mnemonic. +// * EntropySize: 128 -> 12-words mnemonic. +func NewMnemonic(args NewMnemonicArgs) ([]string, error) { + if err := args.validate(); err != nil { + return nil, err + } + if args.EntropySize == 0 { + args.EntropySize = 256 + } + + return generateMnemonic(int(args.EntropySize)) +} diff --git a/pkg/single-key-wallet/sign.go b/pkg/single-key-wallet/sign.go new file mode 100644 index 0000000..5480451 --- /dev/null +++ b/pkg/single-key-wallet/sign.go @@ -0,0 +1,263 @@ +package wallet + +import ( + "encoding/hex" + "fmt" + + "github.com/btcsuite/btcd/btcec/v2/ecdsa" + "github.com/btcsuite/btcd/txscript" + "github.com/vulpemventures/go-elements/elementsutil" + "github.com/vulpemventures/go-elements/payment" + "github.com/vulpemventures/go-elements/psetv2" + "github.com/vulpemventures/go-elements/transaction" +) + +type SignTransactionArgs struct { + TxHex string + InputsToSign map[uint32]Input + SigHashType txscript.SigHashType +} + +func (a SignTransactionArgs) validate() error { + tx, err := transaction.NewTxFromHex(a.TxHex) + if err != nil { + return err + } + if len(a.InputsToSign) <= 0 { + return ErrMissingPrevOuts + } + + for index, in := range a.InputsToSign { + if int(index) >= len(tx.Inputs) { + return fmt.Errorf("input index %d out of range", index) + } + if in.DerivationPath == "" { + return fmt.Errorf( + "invalid input %d: %s", index, ErrMissingDerivationPath, + ) + } + derivationPath, err := ParseDerivationPath(in.DerivationPath) + if err != nil { + return fmt.Errorf( + "invalid derivation path '%s' for input %d: %v", + in.DerivationPath, index, err, + ) + } + if err = checkDerivationPath(derivationPath); err != nil { + return fmt.Errorf( + "invalid derivation path '%s' for input %d: %v", + in.DerivationPath, index, err, + ) + } + } + + return nil +} + +func (a SignTransactionArgs) sighashType() txscript.SigHashType { + if a.SigHashType == 0 { + return txscript.SigHashAll + } + return a.SigHashType +} + +// SignTransaction signs all requested inputs of the given raw transaction. +func (w *Wallet) SignTransaction(args SignTransactionArgs) (string, error) { + if err := args.validate(); err != nil { + return "", err + } + if err := w.validate(); err != nil { + return "", err + } + + tx, _ := transaction.NewTxFromHex(args.TxHex) + for i, in := range args.InputsToSign { + if err := w.signTxInput(tx, i, in, args.sighashType()); err != nil { + return "", err + } + } + + return tx.ToHex() +} + +type SignPsetArgs struct { + PsetBase64 string + DerivationPathMap map[string]string + SigHashType txscript.SigHashType +} + +func (a SignPsetArgs) validate() error { + ptx, err := psetv2.NewPsetFromBase64(a.PsetBase64) + if err != nil { + return err + } + if len(a.DerivationPathMap) <= 0 { + return ErrMissingDerivationPaths + } + + for script, path := range a.DerivationPathMap { + derivationPath, err := ParseDerivationPath(path) + if err != nil { + return fmt.Errorf( + "invalid derivation path '%s' for script '%s': %v", + path, script, err, + ) + } + err = checkDerivationPath(derivationPath) + if err != nil { + return fmt.Errorf( + "invalid derivation path '%s' for script '%s': %v", + path, script, err, + ) + } + } + + for i, in := range ptx.Inputs { + script := in.GetUtxo().Script + _, ok := a.DerivationPathMap[hex.EncodeToString(script)] + if !ok { + return fmt.Errorf( + "derivation path not found in list for input %d with script '%s'", + i, + hex.EncodeToString(script), + ) + } + } + + return nil +} + +func (a SignPsetArgs) sighashType() txscript.SigHashType { + if a.SigHashType == 0 { + return txscript.SigHashAll + } + return a.SigHashType +} + +// SignPset signs all inputs of a partial transaction matching the given +// scripts of the derivation path map. +func (w *Wallet) SignPset(args SignPsetArgs) (string, error) { + if err := args.validate(); err != nil { + return "", err + } + if err := w.validate(); err != nil { + return "", err + } + + ptx, _ := psetv2.NewPsetFromBase64(args.PsetBase64) + for i, in := range ptx.Inputs { + path := args.DerivationPathMap[hex.EncodeToString(in.WitnessUtxo.Script)] + err := w.signInput(ptx, i, path, args.sighashType()) + if err != nil { + return "", err + } + } + + return ptx.ToBase64() +} + +func (w *Wallet) signTxInput( + tx *transaction.Transaction, inIndex uint32, input Input, + sighashType txscript.SigHashType, +) error { + prvkey, pubkey, err := w.DeriveSigningKeyPair(DeriveSigningKeyPairArgs{ + DerivationPath: input.DerivationPath, + }) + if err != nil { + return err + } + + pay, err := payment.FromScript(input.Script, nil, nil) + if err != nil { + return err + } + script := pay.Script + + unsignedTx := tx.Copy() + for _, in := range unsignedTx.Inputs { + in.Script = nil + in.Witness = nil + in.PeginWitness = nil + in.InflationRangeProof = nil + in.IssuanceRangeProof = nil + } + + var value []byte + if len(input.ValueCommitment) == 0 { + value, _ = elementsutil.ValueToBytes(input.Value) + } + hashForSignature := unsignedTx.HashForWitnessV0( + int(inIndex), script, value, sighashType, + ) + + signature := ecdsa.Sign(prvkey, hashForSignature[:]) + if !signature.Verify(hashForSignature[:], pubkey) { + return fmt.Errorf( + "signature verification failed for input %d", + inIndex, + ) + } + + sigWithSigHashType := append(signature.Serialize(), byte(sighashType)) + + tx.Inputs[inIndex].Witness = transaction.TxWitness{ + sigWithSigHashType, pubkey.SerializeCompressed(), + } + + return nil +} + +func (w *Wallet) signInput( + ptx *psetv2.Pset, inIndex int, derivationPath string, + sighashType txscript.SigHashType, +) error { + signer, err := psetv2.NewSigner(ptx) + if err != nil { + return err + } + + if ptx.Inputs[inIndex].SigHashType == 0 { + if err := signer.AddInSighashType(inIndex, sighashType); err != nil { + return err + } + } + input := ptx.Inputs[inIndex] + + prvkey, pubkey, err := w.DeriveSigningKeyPair(DeriveSigningKeyPairArgs{ + DerivationPath: derivationPath, + }) + + if err != nil { + return err + } + + pay, err := payment.FromScript( + input.WitnessUtxo.Script, nil, nil, + ) + if err != nil { + return err + } + + script := pay.Script + unsingedTx, err := ptx.UnsignedTx() + if err != nil { + return err + } + + hashForSignature := unsingedTx.HashForWitnessV0( + inIndex, script, ptx.Inputs[inIndex].WitnessUtxo.Value, input.SigHashType, + ) + + signature := ecdsa.Sign(prvkey, hashForSignature[:]) + if !signature.Verify(hashForSignature[:], pubkey) { + return fmt.Errorf( + "signature verification failed for input %d", + inIndex, + ) + } + + sigWithSigHashType := append(signature.Serialize(), byte(input.SigHashType)) + return signer.SignInput( + inIndex, sigWithSigHashType, pubkey.SerializeCompressed(), nil, nil, + ) +} diff --git a/pkg/single-key-wallet/transaction.go b/pkg/single-key-wallet/transaction.go new file mode 100644 index 0000000..f4cce04 --- /dev/null +++ b/pkg/single-key-wallet/transaction.go @@ -0,0 +1,315 @@ +package wallet + +import ( + "fmt" + + "github.com/vulpemventures/go-elements/address" + "github.com/vulpemventures/go-elements/elementsutil" + "github.com/vulpemventures/go-elements/psetv2" + "github.com/vulpemventures/go-elements/transaction" +) + +var ( + // DummyFeeAmount is used as the fee amount to cover when coin-selecting the + // inputs to use to cover the true fee amount, which, instead, is calculated + // with more precision from the tx size. + // The real fee amount strictly depends on the number of tx inputs and + // outputs, and even input types. + // This value is thought for transactions on TDEX network, whose are composed + // by at least 3 inputs and 6 outputs. + // If all inputs are wrapped or native segwit, is shouls be unlikely for the + // tx virtual size to be higher than 700 vB/sat, taking into account that + // this pkg supports ONLY native segwit scripts/addresses. + // For any other case this value can be tweaked at will. + DummyFeeAmount uint64 = 700 +) + +// Input is the data structure representing an input to be added to a partial +// transaction, therefore including the previous outpoint as long as all the +// info about the prevout itself (and the derivation path generating its script +// as extra info). +type Input struct { + TxID string + TxIndex uint32 + Value uint64 + Asset string + Script []byte + ValueBlinder []byte + AssetBlinder []byte + ValueCommitment []byte + AssetCommitment []byte + Nonce []byte + RangeProof []byte + SurjectionProof []byte + DerivationPath string +} + +func (i Input) validate() error { + if i.TxID == "" { + return ErrInputMissingTxid + } + buf, err := elementsutil.TxIDToBytes(i.TxID) + if err != nil { + return err + } + if len(buf) != 32 { + return ErrInputInvalidTxid + } + return nil +} + +func (i Input) prevout() *transaction.TxOutput { + value := i.ValueCommitment + if len(value) == 0 { + value, _ = elementsutil.ValueToBytes(i.Value) + } + asset := i.AssetCommitment + if len(asset) == 0 { + asset, _ = elementsutil.AssetHashToBytes(i.Asset) + } + nonce := i.Nonce + if len(nonce) == 0 { + nonce = make([]byte, 1) + } + return &transaction.TxOutput{ + Asset: asset, + Value: value, + Script: i.Script, + Nonce: nonce, + RangeProof: i.RangeProof, + SurjectionProof: i.SurjectionProof, + } +} + +func (i Input) scriptType() int { + return scriptTypes[address.GetScriptType(i.Script)] +} + +// Output is the data structure representing an output to be added to a partial +// transaction, therefore inclusing asset, amount and address. +type Output struct { + Asset string + Amount uint64 + Address string +} + +func (o Output) validate() error { + if o.Asset == "" { + return ErrOutputMissingAsset + } + asset, err := elementsutil.AssetHashToBytes(o.Asset) + if err != nil { + return err + } + if len(asset) != 33 { + return ErrOutputInvalidAsset + } + if o.Address != "" { + if _, err := address.IsConfidential(o.Address); err != nil { + return err + } + } + return nil +} + +func (o Output) scriptSize() int { + if o.Address == "" { + return 0 + } + script, _ := address.ToOutputScript(o.Address) + return varSliceSerializeSize(script) +} + +type CreatePsetArgs struct { + Inputs []Input + Outputs []Output +} + +func (a CreatePsetArgs) validate() error { + for i, in := range a.Inputs { + if err := in.validate(); err != nil { + return fmt.Errorf("invalid input %d: %s", i, err) + } + } + + for i, out := range a.Outputs { + if err := out.validate(); err != nil { + return fmt.Errorf("invalid output %d: %s", i, err) + } + isConfidential, _ := address.IsConfidential(out.Address) + if isConfidential && len(a.Inputs) == 0 { + return ErrMissingInputs + } + } + + return nil +} + +func (a CreatePsetArgs) inputs() []psetv2.InputArgs { + ins := make([]psetv2.InputArgs, 0, len(a.Inputs)) + for _, in := range a.Inputs { + ins = append(ins, psetv2.InputArgs{ + Txid: in.TxID, + TxIndex: in.TxIndex, + }) + } + return ins +} + +func (a CreatePsetArgs) outputs() []psetv2.OutputArgs { + outs := make([]psetv2.OutputArgs, 0, len(a.Outputs)) + for _, out := range a.Outputs { + outs = append(outs, psetv2.OutputArgs{ + Amount: out.Amount, + Asset: out.Asset, + Address: out.Address, + }) + } + return outs +} + +// CreatePset creates a new partial transaction with given inputs and outputs. +func (w *Wallet) CreatePset(args CreatePsetArgs) (string, error) { + if err := args.validate(); err != nil { + return "", err + } + + ptx, err := psetv2.New(args.inputs(), args.outputs(), nil) + if err != nil { + return "", err + } + + updater, err := psetv2.NewUpdater(ptx) + if err != nil { + return "", err + } + for i, in := range args.Inputs { + updater.AddInWitnessUtxo(i, in.prevout()) + } + + return ptx.ToBase64() +} + +type UpdatePsetArgs struct { + PsetBase64 string + Inputs []Input + Outputs []Output +} + +func (a UpdatePsetArgs) validate() error { + if len(a.PsetBase64) == 0 { + return ErrMissingPset + } + if _, err := psetv2.NewPsetFromBase64(a.PsetBase64); err != nil { + return err + } + + for i, in := range a.Inputs { + if err := in.validate(); err != nil { + return fmt.Errorf("invalid input %d: %s", i, err) + } + } + + for i, out := range a.Outputs { + if err := out.validate(); err != nil { + return fmt.Errorf("invalid output %d: %s", i, err) + } + } + return nil +} + +func (a UpdatePsetArgs) inputs() []psetv2.InputArgs { + ins := make([]psetv2.InputArgs, 0, len(a.Inputs)) + for _, in := range a.Inputs { + ins = append(ins, psetv2.InputArgs{ + Txid: in.TxID, + TxIndex: in.TxIndex, + }) + } + return ins +} + +func (a UpdatePsetArgs) outputs(blinderIndex uint32) []psetv2.OutputArgs { + outs := make([]psetv2.OutputArgs, 0, len(a.Outputs)) + for _, out := range a.Outputs { + outs = append(outs, psetv2.OutputArgs{ + Amount: out.Amount, + Asset: out.Asset, + Address: out.Address, + BlinderIndex: blinderIndex, + }) + } + return outs +} + +// UpdatesPset adds inputs and outputs to the given partial transaction. +func (w *Wallet) UpdatePset(args UpdatePsetArgs) (string, error) { + if err := args.validate(); err != nil { + return "", err + } + + ptx, _ := psetv2.NewPsetFromBase64(args.PsetBase64) + updater, err := psetv2.NewUpdater(ptx) + if err != nil { + return "", err + } + + nextInputIndex := uint32(ptx.Global.InputCount) + if err := updater.AddInputs(args.inputs()); err != nil { + return "", err + } + + for i, in := range args.Inputs { + updater.AddInWitnessUtxo(int(nextInputIndex)+i, in.prevout()) + } + + if err := updater.AddOutputs(args.outputs(nextInputIndex)); err != nil { + return "", err + } + + return ptx.ToBase64() +} + +type FinalizeAndExtractTransactionArgs struct { + PsetBase64 string +} + +func (a FinalizeAndExtractTransactionArgs) validate() error { + if _, err := psetv2.NewPsetFromBase64(a.PsetBase64); err != nil { + return err + } + return nil +} + +// FinalizeAndExtractTransaction attempts to finalize the provided partial +// transaction and eventually extracts the final raw transaction, returning +// it in hex string format, along with its transaction id. +func FinalizeAndExtractTransaction(args FinalizeAndExtractTransactionArgs) (string, string, error) { + if err := args.validate(); err != nil { + return "", "", err + } + + ptx, _ := psetv2.NewPsetFromBase64(args.PsetBase64) + + ok, err := ptx.ValidateAllSignatures() + if err != nil { + return "", "", err + } + if !ok { + return "", "", ErrInvalidSignatures + } + + if err := psetv2.FinalizeAll(ptx); err != nil { + return "", "", err + } + + tx, err := psetv2.Extract(ptx) + if err != nil { + return "", "", err + } + txHex, err := tx.ToHex() + if err != nil { + return "", "", err + } + return txHex, tx.TxHash().String(), nil +} diff --git a/pkg/single-key-wallet/transaction_test.go b/pkg/single-key-wallet/transaction_test.go new file mode 100644 index 0000000..9ac0dec --- /dev/null +++ b/pkg/single-key-wallet/transaction_test.go @@ -0,0 +1,41 @@ +package wallet_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + "github.com/vulpemventures/go-elements/psetv2" + wallet "github.com/vulpemventures/ocean/pkg/single-key-wallet" +) + +var ( + testAddresses = []string{ + "el1qqfttsemg4sapwrfmmccyztj4wa8gpn5yfetkda4z5uy5e2jysgrszmj0xa8tzftde78kvtl26dtxw6q6gcuawte5xeyvkunws", + "AzpjXSNnwaFpQQwf2A8AUj6Axqa3YXokJtEwmNvQWvoGn2ymKUzmofHmjxBKzPr7bszjrEJRpPSgJqUp", + "CTExJqr9PvAveGHmK3ymA3YVdBFvEWh1Vqkj5U9DCv4L46BJhhAd3g8SdjPNCZR268VnsaynRGmyzrQa", + } +) + +func TestCreatePset(t *testing.T) { + t.Parallel() + + t.Run("valid", func(t *testing.T) { + inputs := randomInputs(2) + outputs := randomOutputs(3) + + w, err := wallet.NewWallet(wallet.NewWalletArgs{RootPath: testRootPath}) + require.NoError(t, err) + require.NotNil(t, w) + + psetBase64, err := w.CreatePset(wallet.CreatePsetArgs{ + Inputs: inputs, + Outputs: outputs, + }) + require.NoError(t, err) + require.NotEmpty(t, psetBase64) + + ptx, err := psetv2.NewPsetFromBase64(psetBase64) + require.NoError(t, err) + require.NotNil(t, ptx) + }) +} diff --git a/pkg/single-key-wallet/util.go b/pkg/single-key-wallet/util.go new file mode 100644 index 0000000..2bfca4a --- /dev/null +++ b/pkg/single-key-wallet/util.go @@ -0,0 +1,87 @@ +package wallet + +import ( + "math" + "strings" + + "github.com/btcsuite/btcd/btcutil/base58" + "github.com/btcsuite/btcd/btcutil/hdkeychain" + "github.com/btcsuite/btcd/chaincfg" + "github.com/vulpemventures/go-bip39" + "github.com/vulpemventures/go-elements/slip77" +) + +/* + Utils for wallet creation. +*/ +func generateMnemonic(entropySize int) ([]string, error) { + entropy, err := bip39.NewEntropy(entropySize) + if err != nil { + return nil, err + } + mnemonic, err := bip39.NewMnemonic(entropy) + if err != nil { + return nil, err + } + return strings.Split(mnemonic, " "), nil +} + +func generateSeedFromMnemonic(mnemonic []string) []byte { + m := strings.Join(mnemonic, " ") + return bip39.NewSeed(m, "") +} + +func isMnemonicValid(mnemonic []string) bool { + m := strings.Join(mnemonic, " ") + return bip39.IsMnemonicValid(m) +} + +func generateSigningMasterKey(seed []byte, path DerivationPath) ([]byte, error) { + hdNode, err := hdkeychain.NewMaster(seed, &chaincfg.MainNetParams) + if err != nil { + return nil, err + } + for _, step := range path { + hdNode, err = hdNode.Derive(step) + if err != nil { + return nil, err + } + } + return base58.Decode(hdNode.String()), nil +} + +func generateBlindingMasterKey(seed []byte) ([]byte, error) { + slip77Node, err := slip77.FromSeed(seed) + if err != nil { + return nil, err + } + return slip77Node.MasterKey, nil +} + +/* + Utils for fee estimation. +*/ +func varIntSerializeSize(val uint64) int { + // The value is small enough to be represented by itself, so it's + // just 1 byte. + if val < 0xfd { + return 1 + } + + // Discriminant 1 byte plus 2 bytes for the uint16. + if val <= math.MaxUint16 { + return 3 + } + + // Discriminant 1 byte plus 4 bytes for the uint32. + if val <= math.MaxUint32 { + return 5 + } + + // Discriminant 1 byte plus 8 bytes for the uint64. + return 9 +} + +func varSliceSerializeSize(val []byte) int { + return varIntSerializeSize(uint64(len(val))) + len(val) +} diff --git a/pkg/single-key-wallet/util_test.go b/pkg/single-key-wallet/util_test.go new file mode 100644 index 0000000..2981250 --- /dev/null +++ b/pkg/single-key-wallet/util_test.go @@ -0,0 +1,76 @@ +package wallet_test + +import ( + "crypto/rand" + "encoding/hex" + "math/big" + + wallet "github.com/vulpemventures/ocean/pkg/single-key-wallet" +) + +func randomInputs(num int) []wallet.Input { + ins := make([]wallet.Input, 0, num) + for i := 0; i < num; i++ { + ins = append(ins, wallet.Input{ + TxID: randomHex(32), + TxIndex: randomVout(), + Value: randomValue(), + Asset: randomHex(32), + Script: randomScript(), + ValueBlinder: randomBytes(32), + AssetBlinder: randomBytes(32), + ValueCommitment: randomValueCommitment(), + AssetCommitment: randomAssetCommitment(), + Nonce: randomBytes(33), + }) + } + return ins +} + +func randomOutputs(num int) []wallet.Output { + outs := make([]wallet.Output, 0, num) + for i := 0; i < num; i++ { + outs = append(outs, wallet.Output{ + Asset: randomHex(32), + Amount: randomValue(), + Address: testAddresses[i%3], + }) + } + + return outs +} + +func randomScript() []byte { + return append([]byte{0, 20}, randomBytes(20)...) +} + +func randomValueCommitment() []byte { + return append([]byte{9}, randomBytes(32)...) +} + +func randomAssetCommitment() []byte { + return append([]byte{10}, randomBytes(32)...) +} + +func randomHex(len int) string { + return hex.EncodeToString(randomBytes(len)) +} + +func randomVout() uint32 { + return uint32(randomIntInRange(0, 15)) +} + +func randomValue() uint64 { + return uint64(randomIntInRange(1000000, 10000000000)) +} + +func randomBytes(len int) []byte { + b := make([]byte, len) + rand.Read(b) + return b +} + +func randomIntInRange(min, max int) int { + n, _ := rand.Int(rand.Reader, big.NewInt(int64(max))) + return int(int(n.Int64())) + min +} diff --git a/pkg/single-key-wallet/wallet.go b/pkg/single-key-wallet/wallet.go new file mode 100644 index 0000000..7386d2c --- /dev/null +++ b/pkg/single-key-wallet/wallet.go @@ -0,0 +1,127 @@ +package wallet + +// Wallet is the data structure representing an HD wallet of an Elements based +// network. +type Wallet struct { + mnemonic []string + signingMasterKey []byte + blindingMasterKey []byte +} + +type NewWalletArgs struct { + RootPath string +} + +func (a NewWalletArgs) validate() error { + if a.RootPath == "" { + return ErrMissingRootPath + } + if _, err := ParseRootDerivationPath(a.RootPath); err != nil { + return err + } + if _, err := NewMnemonic(NewMnemonicArgs{EntropySize: 256}); err != nil { + return err + } + return nil +} + +// NewWallet creates a new HD wallet with a random mnemonic +func NewWallet(args NewWalletArgs) (*Wallet, error) { + if err := args.validate(); err != nil { + return nil, err + } + + mnemonic, _ := NewMnemonic(NewMnemonicArgs{EntropySize: 256}) + seed := generateSeedFromMnemonic(mnemonic) + rootPath, _ := ParseRootDerivationPath(args.RootPath) + signingMasterKey, err := generateSigningMasterKey(seed, rootPath) + if err != nil { + return nil, err + } + blindingMasterKey, err := generateBlindingMasterKey(seed) + if err != nil { + return nil, err + } + + return &Wallet{ + mnemonic: mnemonic, + signingMasterKey: signingMasterKey, + blindingMasterKey: blindingMasterKey, + }, nil +} + +type NewWalletFromMnemonicArgs struct { + RootPath string + Mnemonic []string +} + +func (a NewWalletFromMnemonicArgs) validate() error { + if a.RootPath == "" { + return ErrMissingRootPath + } + if _, err := ParseRootDerivationPath(a.RootPath); err != nil { + return err + } + if len(a.Mnemonic) == 0 { + return ErrMissingMnemonic + } + if !isMnemonicValid(a.Mnemonic) { + return ErrInvalidMnemonic + } + return nil +} + +// NewWalletFromMnemonic creates a new HD wallet with the given mnemonic seed +// and root path +func NewWalletFromMnemonic(args NewWalletFromMnemonicArgs) (*Wallet, error) { + if err := args.validate(); err != nil { + return nil, err + } + + seed := generateSeedFromMnemonic(args.Mnemonic) + rootPath, _ := ParseRootDerivationPath(args.RootPath) + signingMasterKey, err := generateSigningMasterKey(seed, rootPath) + if err != nil { + return nil, err + } + blindingMasterKey, err := generateBlindingMasterKey(seed) + if err != nil { + return nil, err + } + + return &Wallet{ + mnemonic: args.Mnemonic, + signingMasterKey: signingMasterKey, + blindingMasterKey: blindingMasterKey, + }, nil +} + +func (w *Wallet) validate() error { + if len(w.signingMasterKey) <= 0 { + return ErrMissingSigningMasterKey + } + if len(w.mnemonic) <= 0 { + return ErrMissingMnemonic + } + if !isMnemonicValid(w.mnemonic) { + return ErrInvalidMnemonic + } + + if len(w.mnemonic) > 0 { + if !isMnemonicValid(w.mnemonic) { + return ErrInvalidMnemonic + } + if len(w.blindingMasterKey) <= 0 { + return ErrMissingBlindingMasterKey + } + } + return nil +} + +// Mnemonic returns the mnemonic of the wallet. +func (w *Wallet) Mnemonic() ([]string, error) { + if err := w.validate(); err != nil { + return nil, err + } + return w.mnemonic, nil +} diff --git a/pkg/single-key-wallet/wallet_test.go b/pkg/single-key-wallet/wallet_test.go new file mode 100644 index 0000000..3de3a12 --- /dev/null +++ b/pkg/single-key-wallet/wallet_test.go @@ -0,0 +1,68 @@ +package wallet_test + +import ( + "strings" + "testing" + + "github.com/stretchr/testify/require" + wallet "github.com/vulpemventures/ocean/pkg/single-key-wallet" +) + +const ( + testRootPath = "m/84'/1'" +) + +func TestNewWallet(t *testing.T) { + t.Parallel() + + t.Run("valid", func(t *testing.T) { + t.Parallel() + + w, err := wallet.NewWallet(wallet.NewWalletArgs{RootPath: testRootPath}) + require.NoError(t, err) + + mnemonic, err := w.Mnemonic() + require.NoError(t, err) + + otherWallet, err := wallet.NewWalletFromMnemonic( + wallet.NewWalletFromMnemonicArgs{ + RootPath: testRootPath, + Mnemonic: mnemonic, + }, + ) + require.NoError(t, err) + + require.Equal(t, *w, *otherWallet) + }) + + t.Run("invalid", func(t *testing.T) { + tests := []struct { + args wallet.NewWalletFromMnemonicArgs + err error + }{ + { + args: wallet.NewWalletFromMnemonicArgs{ + Mnemonic: strings.Split("legal winner thank year wave sausage worth useful legal winner thank yellow", " "), + }, + err: wallet.ErrMissingRootPath, + }, + { + args: wallet.NewWalletFromMnemonicArgs{ + RootPath: testRootPath, + }, + err: wallet.ErrMissingMnemonic, + }, + { + args: wallet.NewWalletFromMnemonicArgs{ + RootPath: testRootPath, + Mnemonic: strings.Split("legal winner thank year wave sausage worth useful legal winner thank yellow yellow", " "), + }, + err: wallet.ErrInvalidMnemonic, + }, + } + for _, tt := range tests { + _, err := wallet.NewWalletFromMnemonic(tt.args) + require.EqualError(t, tt.err, err.Error()) + } + }) +} diff --git a/scripts/build b/scripts/build new file mode 100755 index 0000000..a3088a2 --- /dev/null +++ b/scripts/build @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e + +PARENT_PATH=$(dirname $( + cd $(dirname $0) + pwd -P +)) + +OS=$(eval "go env GOOS") +ARCH=$(eval "go env GOARCH") + +pushd $PARENT_PATH +mkdir -p build +GO111MODULE=on CGO_ENABLED=1 go build -ldflags="-s -w" -o build/oceand-$OS-$ARCH cmd/oceand/main.go +popd diff --git a/scripts/build-cli b/scripts/build-cli new file mode 100755 index 0000000..a69dfb9 --- /dev/null +++ b/scripts/build-cli @@ -0,0 +1,16 @@ +#!/bin/bash + +set -e + +PARENT_PATH=$(dirname $( + cd $(dirname $0) + pwd -P +)) + +OS=$(eval "go env GOOS") +ARCH=$(eval "go env GOARCH") + +pushd $PARENT_PATH +mkdir -p build +GO111MODULE=on go build -ldflags="-s -w" -o build/ocean-cli-$OS-$ARCH ./cmd/ocean +popd