Compare commits

..

41 Commits

Author SHA1 Message Date
3dabf399f7 Add context to error message (#57)
All checks were successful
Tests / sdk_tests (push) Successful in 22m48s
Part of [Fix error propagation from laconicd to client SDK](https://www.notion.so/Fix-error-propagation-from-laconicd-to-client-SDK-1bd20c5a4e8141a99e5809ea1fd7832f)

- Use error in response raw log from laconicd

Co-authored-by: neeraj <neeraj.rtly@gmail.com>
Reviewed-on: cerc-io/laconic-sdk#57
2024-04-02 12:57:33 +00:00
73bef00dd3 Handle record attributes with null values (#56)
All checks were successful
Tests / sdk_tests (push) Successful in 22m32s
Part of cerc-io/laconicd#144

Reviewed-on: cerc-io/laconic-sdk#56
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
2024-02-08 05:39:31 +00:00
809c4d8f5b Run tests only from src folder (#55)
All checks were successful
Tests / sdk_tests (push) Successful in 21m47s
Reviewed-on: cerc-io/laconic-sdk#55
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Co-committed-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
2024-01-23 12:10:56 +00:00
fedf35d702 Tests cleanup (#53)
Some checks failed
Tests / sdk_tests (push) Failing after 7m52s
General test improvements.
- Simplifies Dockerfile
- Refactors tests so they can be run independently

Co-authored-by: Roy Crihfield <roy@manteia.ltd>
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Reviewed-on: cerc-io/laconic-sdk#53
Reviewed-by: Thomas E Lackey <telackey@noreply.git.vdb.to>
Co-authored-by: Prathamesh Musale <prathamesh@noreply.git.vdb.to>
Co-committed-by: Prathamesh Musale <prathamesh@noreply.git.vdb.to>
2024-01-22 08:30:35 +00:00
65001568c8 Remove hard-coded record types (#52)
Some checks failed
Tests / sdk_tests (push) Failing after 8m38s
Refactors the `Record.Attributes` from Any into a byte string.
Companion to cerc-io/laconicd#132.

Resolves https://github.com/cerc-io/laconicd/issues/107

Co-authored-by: Roy Crihfield <roy@manteia.ltd>
Co-authored-by: Prathamesh Musale <prathamesh.musale0@gmail.com>
Reviewed-on: cerc-io/laconic-sdk#52
Reviewed-by: Thomas E Lackey <telackey@noreply.git.vdb.to>
Co-authored-by: Nabarun <nabarun@deepstacksoft.com>
Co-committed-by: Nabarun <nabarun@deepstacksoft.com>
2024-01-15 04:58:55 +00:00
990e427c3f Add ApplicationDeploymentRemovalRequests (#51)
Some checks failed
Tests / sdk_tests (push) Failing after 24m12s
```
message ApplicationDeploymentRemovalRequest {
  string type           = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
  string version        = 2 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
  string deployment     = 3 [(gogoproto.moretags) = "json:\"deployment\" yaml:\"deployment\""];
  string request        = 4 [(gogoproto.moretags) = "json:\"request\" yaml:\"request\""];
  string meta           = 20 [(gogoproto.moretags) = "json:\"meta\" yaml:\"meta\""];
  repeated string tags  = 21 [(gogoproto.moretags) = "json:\"tags\" yaml:\"tags\""];
}

message ApplicationDeploymentRemovalRecord {
  string type           = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
  string version        = 2 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
  string deployment     = 3 [(gogoproto.moretags) = "json:\"deployment\" yaml:\"deployment\""];
  string request        = 4 [(gogoproto.moretags) = "json:\"request\" yaml:\"request\""];
  string meta           = 20 [(gogoproto.moretags) = "json:\"meta\" yaml:\"meta\""];
  repeated string tags  = 21 [(gogoproto.moretags) = "json:\"tags\" yaml:\"tags\""];
}
```

Reviewed-on: cerc-io/laconic-sdk#51
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2023-12-21 21:19:49 +00:00
419dddc35a Make 'repository' a repeated value and add ApplicationArtifact type. (#50)
All checks were successful
Tests / sdk_tests (push) Successful in 19m39s
Reviewed-on: cerc-io/laconic-sdk#50
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2023-12-13 20:51:12 +00:00
99bc3f0ce5 Deployment, not crn (#49)
Some checks failed
Tests / sdk_tests (push) Failing after 9m14s
Reviewed-on: cerc-io/laconic-sdk#49
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2023-12-08 04:37:09 +00:00
fc2987a5ca Add DnsRecord and ApplicationDeploymentRequest (#48)
Some checks failed
Tests / sdk_tests (push) Failing after 16m23s
```
message DnsRecord {
  string type           = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
  string name           = 2 [(gogoproto.moretags) = "json:\"name\" yaml:\"name\""];
  string version        = 3 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
  string resource_type  = 4 [(gogoproto.moretags) = "json:\"resourceType\" yaml:\"resourceType\""];
  string value          = 5 [(gogoproto.moretags) = "json:\"value\" yaml:\"value\""];
  string meta           = 20 [(gogoproto.moretags) = "json:\"meta\" yaml:\"meta\""];
  repeated string tags  = 21 [(gogoproto.moretags) = "json:\"tags\" yaml:\"tags\""];
}

message ApplicationDeploymentRequest {
  string type           = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
  string name           = 2 [(gogoproto.moretags) = "json:\"name\" yaml:\"name\""];
  string version        = 3 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
  string application    = 4 [(gogoproto.moretags) = "json:\"application\" yaml:\"application\""];
  string dns            = 5 [(gogoproto.moretags) = "json:\"dns\" yaml:\"dns\""];
  string config         = 6 [(gogoproto.moretags) = "json:\"config\" yaml:\"config\""];
  repeated string crn   = 7 [(gogoproto.moretags) = "json:\"crn\" yaml:\"crn\""];
  string meta           = 20 [(gogoproto.moretags) = "json:\"meta\" yaml:\"meta\""];
  repeated string tags  = 21 [(gogoproto.moretags) = "json:\"tags\" yaml:\"tags\""];
}
```

Also rename WebAppDeploymentRecord to ApplicationDeploymentRecord.

Reviewed-on: cerc-io/laconic-sdk#48
Reviewed-by: David Boreham <dboreham@noreply.git.vdb.to>
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2023-12-07 22:08:49 +00:00
aba95a275c More publishing fixes
All checks were successful
Tests / sdk_tests (push) Successful in 21m38s
Reviewed-on: cerc-io/laconic-sdk#47
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2023-11-21 23:29:12 +00:00
a3603e2738 Fix publishing (#46)
Some checks failed
Tests / sdk_tests (push) Has been cancelled
Reviewed-on: cerc-io/laconic-sdk#46
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2023-11-21 22:55:18 +00:00
27443c3cac v0.1.7 (#45)
All checks were successful
Tests / sdk_tests (push) Successful in 20m36s
Reviewed-on: cerc-io/laconic-sdk#45
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2023-11-21 22:31:06 +00:00
b5fce86d48 Add new record types ApplicationRecord, WebAppDeploymentRecord, GeneralRecord (#44)
All checks were successful
Tests / sdk_tests (push) Successful in 20m38s
See also: cerc-io/laconicd#113

![image](/attachments/db05bbb6-86ca-4fbb-a8a4-fcd06501b1b1)

```
message ApplicationRecord {
  string type           = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
  string name           = 2 [(gogoproto.moretags) = "json:\"name\" yaml:\"name\""];
  string description    = 3 [(gogoproto.moretags) = "json:\"description\" yaml:\"description\""];
  string version        = 4 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
  string homepage       = 5 [(gogoproto.moretags) = "json:\"homepage\" yaml:\"homepage\""];
  string license        = 6 [(gogoproto.moretags) = "json:\"license\" yaml:\"license\""];
  string author         = 7 [(gogoproto.moretags) = "json:\"author\" yaml:\"author\""];
  string repository     = 8 [(gogoproto.moretags) = "json:\"repository\" yaml:\"repository\""];
  string repository_tag = 9 [(gogoproto.moretags) = "json:\"repositoryTag\" yaml:\"repositoryTag\""];
  string app_version    = 10 [(gogoproto.moretags) = "json:\"appVersion\" yaml:\"appVersion\""];
  string app_type       = 11 [(gogoproto.moretags) = "json:\"appType\" yaml:\"appType\""];
  string meta           = 20 [(gogoproto.moretags) = "json:\"meta\" yaml:\"meta\""];
  repeated string tags  = 21 [(gogoproto.moretags) = "json:\"tags\" yaml:\"tags\""];
}

message WebAppDeploymentRecord {
  string type           = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
  string name           = 2 [(gogoproto.moretags) = "json:\"name\" yaml:\"name\""];
  string description    = 3 [(gogoproto.moretags) = "json:\"description\" yaml:\"description\""];
  string version        = 4 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
  string application    = 5 [(gogoproto.moretags) = "json:\"application\" yaml:\"application\""];
  string url            = 6 [(gogoproto.moretags) = "json:\"\" yaml:\"name\""];
  string meta           = 20 [(gogoproto.moretags) = "json:\"meta\" yaml:\"meta\""];
  repeated string tags  = 21 [(gogoproto.moretags) = "json:\"tags\" yaml:\"tags\""];
}

message GeneralRecord {
  string type           = 1 [(gogoproto.moretags) = "json:\"type\" yaml:\"type\""];
  string name           = 2 [(gogoproto.moretags) = "json:\"name\" yaml:\"name\""];
  string description    = 3 [(gogoproto.moretags) = "json:\"description\" yaml:\"description\""];
  string version        = 4 [(gogoproto.moretags) = "json:\"version\" yaml:\"version\""];
  string category       = 5 [(gogoproto.moretags) = "json:\"category\" yaml:\"category\""];
  string value          = 6 [(gogoproto.moretags) = "json:\"value\" yaml:\"value\""];
  string meta           = 20 [(gogoproto.moretags) = "json:\"meta\" yaml:\"meta\""];
  repeated string tags  = 21 [(gogoproto.moretags) = "json:\"tags\" yaml:\"tags\""];
```

```
❯ cat general.yml
record:
  type: GeneralRecord
  name: my-generic-record
  version: 0.0.1
  value: "anything-goes-here"
  category: filter-by-this
  tags:
    - a
    - b
    - c
  meta:
    foo: bar
    bar:
      baz: boz

❯ bin/laconic cns record publish --filename general.yml --bond-id ba774084e25af5b29be126dda0bb910d93dea3634713a438ac257da5bbdc631c
{
  "id": "bafyreigt3he52eia5g4i5pnst4dfcuwwgjdoul6xmcke2obz5os4xwoo3q"
}

❯ bin/laconic cns record get --id bafyreigt3he52eia5g4i5pnst4dfcuwwgjdoul6xmcke2obz5os4xwoo3q
[
  {
    "id": "bafyreigt3he52eia5g4i5pnst4dfcuwwgjdoul6xmcke2obz5os4xwoo3q",
    "names": null,
    "owners": [
      "9A66500A9AA574CAAB4EDB26F7333590BF452CE0"
    ],
    "bondId": "ba774084e25af5b29be126dda0bb910d93dea3634713a438ac257da5bbdc631c",
    "createTime": "2023-11-17T23:11:27Z",
    "expiryTime": "2024-11-16T23:11:27Z",
    "attributes": {
      "meta": "{\"foo\":\"bar\",\"bar\":{\"baz\":\"boz\"}}",
      "tags": [
        "a",
        "b",
        "c"
      ],
      "type": "GeneralRecord",
      "name": "my-generic-record",
      "version": "0.0.1",
      "category": "filter-by-this",
      "value": "anything-goes-here"
    }
  }
]
```

> Note: The repeated items are preserved as lists, but the object/map ends up encoded as a string.  It would be nice to avoid this.

Reviewed-on: cerc-io/laconic-sdk#44
Reviewed-by: David Boreham <dboreham@noreply.git.vdb.to>
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2023-11-20 22:01:19 +00:00
82d8626d0f
typo (#40) 2023-04-20 14:36:32 -05:00
6b53c43c51
typo (#39) 2023-04-20 14:32:44 -05:00
7dd8dca408
Running Gitea actions (#38)
* Gitea actions.

* Tweak for gitea

* Tweak for gitea
2023-03-29 18:12:24 -05:00
Michael
2493e2c706
Revert "remaining record types support (#27)" (#35)
This reverts commit db3f9707d2.
2023-03-06 16:54:02 -05:00
Michael
81f45e95a8
debugging statements for provisionBondId (#34)
* debugging statements for provisionBondId

* always create new bond with provisionBondId helper call
2023-03-06 16:30:04 -05:00
Murali Krishna Komatireddy
db3f9707d2
remaining record types support (#27)
* remaining record types support

* fix sdk tests

* create record types from examples

* bond tests

* registry expiry tests

* fix typos
2023-03-06 16:17:43 -05:00
Michael
2870a7543a
version bump to 0.1.6 (#31) 2023-02-15 10:23:49 -05:00
Michael
77af2e5e22
Auction nameservice tests (#28)
* truncated testing until questions of intent answered

* nameservice passes local tests

* first pass running tests from sdk side

* lint cleanup

* move into dir rather than args

* double bond in naming test

* first pass building test container on sdk side... only basic tests this iteration

* missing jest

* docker compose exec got dropped

* start both containers, not just laconicd

* script cleanup in action

* working directory

* diagnostic

* diagnostic

* run against dev branch of laconicd

* run auction and nameservice-expiry tests

* switch to main branch
2023-02-10 14:44:23 -05:00
Michael
663ebbf8e0
Merge pull request #30 from cerc-io/readme_quick
quick README update to reflect reality
2023-02-06 12:48:21 -05:00
Michael Shaw
c6a37ac419 quick README update to reflect reality 2023-02-06 12:47:29 -05:00
Ian Norden
80348594f8
Merge pull request #20 from cerc-io/zramsay-patch-1
remove duplicate line in tests
2023-01-12 18:59:34 -06:00
Zach
55675c7b55
rm duplicate line (typo?) 2023-01-11 18:27:00 -05:00
Zach
10d58ca028
Merge pull request #19 from cerc-io/ian/bump_version
Update package to 0.1.5
2023-01-11 17:02:56 -05:00
i-norden
95bdacb4a1 version 0.1.5 2023-01-11 15:48:24 -06:00
0xmuralik
49ebd1ab65 chain-id 2023-01-11 10:46:03 +05:30
0xmuralik
497d72bf9b increase fee 2023-01-09 12:49:27 +05:30
Murali Krishna Komatireddy
3fca7c7844
Merge pull request #15 from cerc-io/murali/fix-tests
fix: Test fail after PR#40
2023-01-09 12:17:08 +05:30
cdf58773a7
Update README.md 2023-01-03 07:20:35 -07:00
0xmuralik
e8a56f2b97 fix failing tests 2023-01-03 14:50:38 +05:30
0xmuralik
0ace77c778 versioning record attributes 2023-01-02 17:44:06 +05:30
0xmuralik
1793a890d9 remove version from record 2022-12-28 16:12:34 +05:30
0xmuralik
e295b8de36 to byte array 2022-12-27 12:17:02 +05:30
0xmuralik
c0f71b0b8f record attribute types in registry.ts 2022-12-26 11:22:03 +05:30
fd26bd88dd
Merge pull request #18 from cerc-io/dboreham/is-url-is-broken
Remove broken is-url dependency
2022-12-21 13:50:32 -07:00
ebe628d082 Remove broken is-url dependency 2022-12-21 13:08:09 -07:00
0xmuralik
eaafeb9107 rename to registry 2022-12-19 11:44:18 +05:30
0xmuralik
43593c15b2 attributes to any 2022-12-19 11:25:28 +05:30
b867ea61e8
Merge pull request #9 from cerc-io/dboreham/npm-publish-fixes
Add scope to package name
2022-12-09 07:16:13 -07:00
57 changed files with 5075 additions and 3505 deletions

2
.dockerignore Normal file
View File

@ -0,0 +1,2 @@
Dockerfile
node_modules

View File

@ -0,0 +1,36 @@
name: Publish npm package to gitea
on:
release:
types: [published]
jobs:
npm_publish:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 18.x ]
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Download yarn
run: |
curl -fsSL -o /usr/local/bin/yarn https://github.com/yarnpkg/yarn/releases/download/v1.22.21/yarn-1.22.21.js
chmod +x /usr/local/bin/yarn
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: yarn
- name: Run yarn build
run: |
yarn build
- name: Configure git.vdb.to npm registry
run: |
npm config set registry https://git.vdb.to/api/packages/cerc-io/npm/
- name: Authenticate to git.vdb.to registry
run: |
npm config set -- '//git.vdb.to/api/packages/cerc-io/npm/:_authToken' "${{ secrets.CICD_PUBLISH_TOKEN }}"
- name: npm publish
run: |
npm publish

63
.gitea/workflows/test.yml Normal file
View File

@ -0,0 +1,63 @@
name: Tests
on:
pull_request:
branches:
- '*'
push:
branches:
- main
- release/**
env:
DOCKER_HOST: unix:///var/run/dind.sock
jobs:
sdk_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout laconicd
uses: actions/checkout@v3
with:
path: "./laconicd/"
repository: cerc-io/laconicd
fetch-depth: 0
ref: main
- name: Environment
run: ls -tlh && env
- name: Start dockerd
run: |
dockerd -H $DOCKER_HOST --userland-proxy=false &
sleep 5
- name: Build laconicd container
working-directory: laconicd/tests/sdk_tests
run: ./build-laconicd-container.sh
- name: Build laconic-sdk container
run: ./scripts/build-sdk-test-container.sh
- name: Start containers
working-directory: laconicd/tests/sdk_tests
run: docker compose up -d
- name: Run tests
working-directory: laconicd/tests/sdk_tests
run: ./run-tests.sh
- name: Start containers (auctions enabled)
working-directory: laconicd/tests/sdk_tests
env:
TEST_AUCTION_ENABLED: true
run: docker compose up -d
- name: Run auction tests
working-directory: laconicd/tests/sdk_tests
run: ./run-tests.sh test:auctions
- name: Start containers (expiry enabled)
working-directory: laconicd/tests/sdk_tests
env:
TEST_REGISTRY_EXPIRY: true
run: docker compose up -d
- name: Run nameservice expiry tests
working-directory: laconicd/tests/sdk_tests
run: ./run-tests.sh test:nameservice-expiry

53
.github/workflows/test.yml vendored Normal file
View File

@ -0,0 +1,53 @@
name: Tests
on:
pull_request:
push:
branches:
- main
- release/**
jobs:
sdk_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Checkout laconicd
uses: actions/checkout@v3
with:
path: "./laconicd/"
repository: cerc-io/laconicd
fetch-depth: 0
ref: main
- name: Environment
run: ls -tlh && env
- name: Build laconicd container
working-directory: laconicd/tests/sdk_tests
run: ./build-laconicd-container.sh
- name: Build laconic-sdk container
run: ./scripts/build-sdk-test-container.sh
- name: Start containers
working-directory: laconicd/tests/sdk_tests
run: docker compose up -d
- name: Run tests
working-directory: laconicd/tests/sdk_tests
run: ./run-tests.sh
- name: Start containers (auctions enabled)
working-directory: laconicd/tests/sdk_tests
env:
TEST_AUCTION_ENABLED: true
run: docker compose up -d
- name: Run auction tests
working-directory: laconicd/tests/sdk_tests
run: ./run-tests.sh test:auctions
- name: Start containers (expiry enabled)
working-directory: laconicd/tests/sdk_tests
env:
TEST_REGISTRY_EXPIRY: true
run: docker compose up -d
- name: Run nameservice expiry tests
working-directory: laconicd/tests/sdk_tests
run: ./run-tests.sh test:nameservice-expiry

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
node_modules node_modules
dist dist
.env .env
.idea*

View File

@ -12,13 +12,5 @@ Run following scripts when [proto files](./proto/) are updated.
2. Generate typescript code for the proto files 2. Generate typescript code for the proto files
```bash ```bash
./scripts/create-proto-files.sh ./scripts/proto-gen.sh
``` ```
3. Remove GRPC code from generated code
```bash
./scripts/remove-grpc.sh
```
Reference: https://github.com/tharsis/evmosjs/tree/main/packages/proto#note

38
Dockerfile Normal file
View File

@ -0,0 +1,38 @@
# Originally from: https://github.com/devcontainers/images/blob/main/src/javascript-node/.devcontainer/Dockerfile
# [Choice] Node.js version (use -bullseye variants on local arm64/Apple Silicon): 18, 16, 14, 18-bullseye, 16-bullseye, 14-bullseye, 18-buster, 16-buster, 14-buster
ARG VARIANT=16-bullseye
FROM node:${VARIANT}
ARG USERNAME=node
ARG NPM_GLOBAL=/usr/local/share/npm-global
# Add NPM global to PATH.
ENV PATH=${NPM_GLOBAL}/bin:${PATH}
RUN \
# Configure global npm install location, use group to adapt to UID/GID changes
if ! cat /etc/group | grep -e "^npm:" > /dev/null 2>&1; then groupadd -r npm; fi \
&& usermod -a -G npm ${USERNAME} \
&& umask 0002 \
&& mkdir -p ${NPM_GLOBAL} \
&& touch /usr/local/etc/npmrc \
&& chown ${USERNAME}:npm ${NPM_GLOBAL} /usr/local/etc/npmrc \
&& chmod g+s ${NPM_GLOBAL} \
&& npm config -g set prefix ${NPM_GLOBAL} \
&& su ${USERNAME} -c "npm config -g set prefix ${NPM_GLOBAL}" \
# Install eslint
&& su ${USERNAME} -c "umask 0002 && npm install -g eslint" \
&& npm cache clean --force > /dev/null 2>&1
WORKDIR /
COPY entrypoint.sh .
ENTRYPOINT ["/entrypoint.sh"]
CMD node --version
WORKDIR /app/laconic-sdk
COPY package*.json .
RUN yarn install
COPY . .
WORKDIR /app/laconic-sdk

View File

@ -1,5 +1,7 @@
# laconic-sdk # laconic-sdk
Client library used by TS/JS applications to communicate with laconicd.
## Tests ## Tests
Follow these steps to run the tests: Follow these steps to run the tests:
@ -32,6 +34,12 @@ Follow these steps to run the tests:
- Run the tests with auctions enabled - Run the tests with auctions enabled
- Remove laconicd data from previous run
```bash
rm -rf ~/.laconicd
```
- In laconicd repo run: - In laconicd repo run:
```bash ```bash
@ -52,10 +60,16 @@ Follow these steps to run the tests:
- Run the tests for record and authority expiry - Run the tests for record and authority expiry
- Remove laconicd data from previous run
```bash
rm -rf ~/.laconicd
```
- In laconicd repo run: - In laconicd repo run:
```bash ```bash
TEST_NAMESERVICE_EXPIRY=true ./init.sh TEST_REGISTRY_EXPIRY=true ./init.sh
``` ```
- Export the private key and change it in `.env` file again using: - Export the private key and change it in `.env` file again using:

3
entrypoint.sh Executable file
View File

@ -0,0 +1,3 @@
#!/bin/sh
exec "$@"

View File

@ -1,13 +1,12 @@
{ {
"name": "@cerc-io/laconic-sdk", "name": "@cerc-io/laconic-sdk",
"version": "0.1.4", "version": "0.1.16",
"main": "dist/index.js", "main": "dist/index.js",
"types": "dist/index.d.ts", "types": "dist/index.d.ts",
"repository": "git@github.com:cerc-io/laconic-sdk.git", "repository": "git@github.com:cerc-io/laconic-sdk.git",
"author": "", "author": "",
"license": "UNLICENSED", "license": "UNLICENSED",
"devDependencies": { "devDependencies": {
"@types/is-url": "^1.2.30",
"@types/jest": "^27.4.1", "@types/jest": "^27.4.1",
"@types/lodash": "^4.14.181", "@types/lodash": "^4.14.181",
"@types/semver": "^7.3.9", "@types/semver": "^7.3.9",
@ -15,7 +14,7 @@
"dotenv": "^16.0.0", "dotenv": "^16.0.0",
"google-protobuf": "^3.21.0", "google-protobuf": "^3.21.0",
"jest": "29.0.0", "jest": "29.0.0",
"protoc-gen-ts": "^0.8.5", "protoc-gen-ts": "^0.8.7",
"ts-jest": "^29.0.2", "ts-jest": "^29.0.2",
"typescript": "^4.6.2" "typescript": "^4.6.2"
}, },
@ -38,7 +37,6 @@
"ethers": "^5.6.2", "ethers": "^5.6.2",
"evmosjs": "^0.2.5", "evmosjs": "^0.2.5",
"graphql.js": "^0.6.8", "graphql.js": "^0.6.8",
"is-url": "^1.2.4",
"js-sha256": "^0.9.0", "js-sha256": "^0.9.0",
"js-yaml": "^3.14.1", "js-yaml": "^3.14.1",
"jsonschema": "^1.4.0", "jsonschema": "^1.4.0",
@ -50,7 +48,7 @@
"tiny-secp256k1": "^1.1.6" "tiny-secp256k1": "^1.1.6"
}, },
"scripts": { "scripts": {
"test": "jest --runInBand --verbose", "test": "jest --runInBand --verbose --testPathPattern=src",
"test:auctions": "TEST_AUCTIONS_ENABLED=1 jest --runInBand --verbose src/auction.test.ts", "test:auctions": "TEST_AUCTIONS_ENABLED=1 jest --runInBand --verbose src/auction.test.ts",
"test:nameservice-expiry": "TEST_NAMESERVICE_EXPIRY=1 jest --runInBand --verbose src/nameservice-expiry.test.ts", "test:nameservice-expiry": "TEST_NAMESERVICE_EXPIRY=1 jest --runInBand --verbose src/nameservice-expiry.test.ts",
"build": "tsc" "build": "tsc"

View File

@ -0,0 +1,115 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
syntax = "proto3";
package google.protobuf;
option cc_enable_arenas = true;
option go_package = "google.golang.org/protobuf/types/known/durationpb";
option java_package = "com.google.protobuf";
option java_outer_classname = "DurationProto";
option java_multiple_files = true;
option objc_class_prefix = "GPB";
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
// A Duration represents a signed, fixed-length span of time represented
// as a count of seconds and fractions of seconds at nanosecond
// resolution. It is independent of any calendar and concepts like "day"
// or "month". It is related to Timestamp in that the difference between
// two Timestamp values is a Duration and it can be added or subtracted
// from a Timestamp. Range is approximately +-10,000 years.
//
// # Examples
//
// Example 1: Compute Duration from two Timestamps in pseudo code.
//
// Timestamp start = ...;
// Timestamp end = ...;
// Duration duration = ...;
//
// duration.seconds = end.seconds - start.seconds;
// duration.nanos = end.nanos - start.nanos;
//
// if (duration.seconds < 0 && duration.nanos > 0) {
// duration.seconds += 1;
// duration.nanos -= 1000000000;
// } else if (duration.seconds > 0 && duration.nanos < 0) {
// duration.seconds -= 1;
// duration.nanos += 1000000000;
// }
//
// Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
//
// Timestamp start = ...;
// Duration duration = ...;
// Timestamp end = ...;
//
// end.seconds = start.seconds + duration.seconds;
// end.nanos = start.nanos + duration.nanos;
//
// if (end.nanos < 0) {
// end.seconds -= 1;
// end.nanos += 1000000000;
// } else if (end.nanos >= 1000000000) {
// end.seconds += 1;
// end.nanos -= 1000000000;
// }
//
// Example 3: Compute Duration from datetime.timedelta in Python.
//
// td = datetime.timedelta(days=3, minutes=10)
// duration = Duration()
// duration.FromTimedelta(td)
//
// # JSON Mapping
//
// In JSON format, the Duration type is encoded as a string rather than an
// object, where the string ends in the suffix "s" (indicating seconds) and
// is preceded by the number of seconds, with nanoseconds expressed as
// fractional seconds. For example, 3 seconds with 0 nanoseconds should be
// encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
// be expressed in JSON format as "3.000000001s", and 3 seconds and 1
// microsecond should be expressed in JSON format as "3.000001s".
//
message Duration {
// Signed seconds of the span of time. Must be from -315,576,000,000
// to +315,576,000,000 inclusive. Note: these bounds are computed from:
// 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
int64 seconds = 1;
// Signed fractions of a second at nanosecond resolution of the span
// of time. Durations less than one second are represented with a 0
// `seconds` field and a positive or negative `nanos` field. For durations
// of one second or more, a non-zero value for the `nanos` field must be
// of the same sign as the `seconds` field. Must be from -999,999,999
// to +999,999,999 inclusive.
int32 nanos = 2;
}

View File

@ -0,0 +1,144 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
syntax = "proto3";
package google.protobuf;
option cc_enable_arenas = true;
option go_package = "google.golang.org/protobuf/types/known/timestamppb";
option java_package = "com.google.protobuf";
option java_outer_classname = "TimestampProto";
option java_multiple_files = true;
option objc_class_prefix = "GPB";
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
// A Timestamp represents a point in time independent of any time zone or local
// calendar, encoded as a count of seconds and fractions of seconds at
// nanosecond resolution. The count is relative to an epoch at UTC midnight on
// January 1, 1970, in the proleptic Gregorian calendar which extends the
// Gregorian calendar backwards to year one.
//
// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
// second table is needed for interpretation, using a [24-hour linear
// smear](https://developers.google.com/time/smear).
//
// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
// restricting to that range, we ensure that we can convert to and from [RFC
// 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
//
// # Examples
//
// Example 1: Compute Timestamp from POSIX `time()`.
//
// Timestamp timestamp;
// timestamp.set_seconds(time(NULL));
// timestamp.set_nanos(0);
//
// Example 2: Compute Timestamp from POSIX `gettimeofday()`.
//
// struct timeval tv;
// gettimeofday(&tv, NULL);
//
// Timestamp timestamp;
// timestamp.set_seconds(tv.tv_sec);
// timestamp.set_nanos(tv.tv_usec * 1000);
//
// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
//
// FILETIME ft;
// GetSystemTimeAsFileTime(&ft);
// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
//
// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
// Timestamp timestamp;
// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
//
// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
//
// long millis = System.currentTimeMillis();
//
// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
// .setNanos((int) ((millis % 1000) * 1000000)).build();
//
// Example 5: Compute Timestamp from Java `Instant.now()`.
//
// Instant now = Instant.now();
//
// Timestamp timestamp =
// Timestamp.newBuilder().setSeconds(now.getEpochSecond())
// .setNanos(now.getNano()).build();
//
// Example 6: Compute Timestamp from current time in Python.
//
// timestamp = Timestamp()
// timestamp.GetCurrentTime()
//
// # JSON Mapping
//
// In JSON format, the Timestamp type is encoded as a string in the
// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
// format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
// where {year} is always expressed using four digits while {month}, {day},
// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
// is required. A proto3 JSON serializer should always use UTC (as indicated by
// "Z") when printing the Timestamp type and a proto3 JSON parser should be
// able to accept both UTC and other timezones (as indicated by an offset).
//
// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
// 01:30 UTC on January 15, 2017.
//
// In JavaScript, one can convert a Date object to this format using the
// standard
// [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
// method. In Python, a standard `datetime.datetime` object can be converted
// to this format using
// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
// the Joda Time's [`ISODateTimeFormat.dateTime()`](
// http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
// ) to obtain a formatter capable of generating timestamps in this format.
//
message Timestamp {
// Represents seconds of UTC time since Unix epoch
// 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
// 9999-12-31T23:59:59Z inclusive.
int64 seconds = 1;
// Non-negative fractions of a second at nanosecond resolution. Negative
// second values with fractions must still have non-negative nanos values
// that count forward in time. Must be from 0 to 999,999,999
// inclusive.
int32 nanos = 2;
}

View File

@ -1,30 +0,0 @@
syntax = "proto3";
package vulcanize.nameservice.v1beta1;
import "gogoproto/gogo.proto";
import "vulcanize/nameservice/v1beta1/nameservice.proto";
option go_package = "github.com/tharsis/ethermint/x/nameservice/types";
// GenesisState defines the nameservice module's genesis state.
message GenesisState {
// params defines all the params of nameservice module.
Params params = 1 [
(gogoproto.nullable) = false
];
// records
repeated Record records = 2 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"records\" yaml:\"records\""
];
// authorities
repeated AuthorityEntry authorities = 3 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"authorities\" yaml:\"authorities\""
];
// names
repeated NameEntry names = 4 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"names\" yaml:\"names\""
];
}

View File

@ -1,169 +0,0 @@
syntax = "proto3";
package vulcanize.nameservice.v1beta1;
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
import "gogoproto/gogo.proto";
import "cosmos/base/v1beta1/coin.proto";
option go_package = "github.com/tharsis/ethermint/x/nameservice/types";
// Params defines the nameservice module parameters
message Params {
cosmos.base.v1beta1.Coin record_rent = 1 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"record_rent\" yaml:\"record_rent\""
];
google.protobuf.Duration record_rent_duration = 2 [
(gogoproto.nullable) = false,
(gogoproto.stdduration) = true,
(gogoproto.moretags) = "json:\"record_rent_duration\" yaml:\"record_rent_duration\""
];
cosmos.base.v1beta1.Coin authority_rent = 3 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"authority_rent\" yaml:\"authority_rent\""
];
google.protobuf.Duration authority_rent_duration = 4 [
(gogoproto.nullable) = false,
(gogoproto.stdduration) = true,
(gogoproto.moretags) = "json:\"authority_rent_duration\" yaml:\"authority_rent_duration\""
];
google.protobuf.Duration authority_grace_period = 5 [
(gogoproto.nullable) = false,
(gogoproto.stdduration) = true,
(gogoproto.moretags) = "json:\"authority_grace_period\" yaml:\"authority_grace_period\""
];
bool authority_auction_enabled = 6 [
(gogoproto.moretags) = "json:\"authority_auction_enabled\" yaml:\"authority_auction_enabled\""
];
google.protobuf.Duration authority_auction_commits_duration = 7 [
(gogoproto.nullable) = false,
(gogoproto.stdduration) = true,
(gogoproto.moretags) = "json:\"authority_auction_commits_duration\" yaml:\"authority_auction_commits_duration\""
];
google.protobuf.Duration authority_auction_reveals_duration = 8 [
(gogoproto.nullable) = false,
(gogoproto.stdduration) = true,
(gogoproto.moretags) = "json:\"authority_auction_reveals_duration\" yaml:\"authority_auction_reveals_duration\""
];
cosmos.base.v1beta1.Coin authority_auction_commit_fee = 9 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"authority_auction_commit_fee\" yaml:\"authority_auction_commit_fee\""
];
cosmos.base.v1beta1.Coin authority_auction_reveal_fee = 10 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"authority_auction_reveal_fee\" yaml:\"authority_auction_reveal_fee\""
];
cosmos.base.v1beta1.Coin authority_auction_minimum_bid = 11 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"authority_auction_minimum_bid\" yaml:\"authority_auction_minimum_bid\""
];
}
// Params defines the nameservice module records
message Record {
string id = 1 [
(gogoproto.moretags) = "json:\"id\" yaml:\"id\""
];
string bond_id = 2 [
(gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\""
];
string create_time = 3 [
(gogoproto.moretags) = "json:\"createTime\" yaml:\"createTime\""
];
string expiry_time = 4 [
(gogoproto.moretags) = "json:\"expiryTime\" yaml:\"expiryTime\""
];
bool deleted = 5;
repeated string owners = 6 [
(gogoproto.moretags) = "json:\"owners\" yaml:\"owners\""
];
string attributes = 7 [
(gogoproto.moretags) = "json:\"attributes\" yaml:\"attributes\""
];
repeated string names = 8 [
(gogoproto.moretags) = "json:\"names\" yaml:\"names\""
];
}
// AuthorityEntry defines the nameservice module AuthorityEntries
message AuthorityEntry{
string name = 1;
NameAuthority entry = 2;
}
// NameAuthority
message NameAuthority {
// Owner public key.
string owner_public_key = 1 [
(gogoproto.moretags) = "json:\"ownerPublicKey\" yaml:\"ownerPublicKey\""
];
// Owner address.
string owner_address = 2 [
(gogoproto.moretags) = "json:\"ownerAddress\" yaml:\"ownerAddress\""
];
// height at which name/authority was created.
uint64 height = 3;
string status = 4;
string auction_id = 5 [
(gogoproto.moretags) = "json:\"auctionID\" yaml:\"auctionID\""
];
string bond_id = 6 [
(gogoproto.moretags) = "json:\"bondID\" yaml:\"bondID\""
];
google.protobuf.Timestamp expiry_time = 7 [
(gogoproto.nullable) = false,
(gogoproto.stdtime) = true,
(gogoproto.moretags) = "json:\"expiryTime\" yaml:\"expiryTime\""
];
}
// NameEntry
message NameEntry{
string name = 1;
NameRecord entry = 2;
}
// NameRecord
message NameRecord {
NameRecordEntry latest = 1;
repeated NameRecordEntry history = 2;
}
// NameRecordEntry
message NameRecordEntry{
string id = 1;
uint64 height = 2;
}
// Signature
message Signature{
string sig = 1 [
(gogoproto.moretags) = "json:\"sig\" yaml:\"sig\""
];
string pub_key = 2 [
(gogoproto.moretags) = "json:\"pubKey\" yaml:\"pubKey\""
];
}
// BlockChangeSet
message BlockChangeSet{
int64 height = 1;
repeated string records = 2;
repeated string auctions = 3;
repeated AuctionBidInfo auction_bids = 4 [
(gogoproto.moretags) = "json:\"auctionBids\" yaml:\"auctionBids\""
];
repeated string authorities = 5;
repeated string names = 6;
}
// AuctionBidInfo
message AuctionBidInfo {
string auction_id = 1 [
(gogoproto.moretags) = "json:\"auctionID\" yaml:\"auctionID\""
];
string bidder_address = 2 [
(gogoproto.moretags) = "json:\"bidderAddress\" yaml:\"bidderAddress\""
];
}

View File

@ -1,231 +0,0 @@
syntax = "proto3";
package vulcanize.nameservice.v1beta1;
import "vulcanize/nameservice/v1beta1/nameservice.proto";
import "google/api/annotations.proto";
import "cosmos/base/query/v1beta1/pagination.proto";
import "gogoproto/gogo.proto";
import "cosmos/base/v1beta1/coin.proto";
option go_package = "github.com/tharsis/ethermint/x/nameservice/types";
// Query defines the gRPC querier service for nameservice module
service Query {
// Params queries the nameservice module params.
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
option (google.api.http).get = "/vulcanize/nameservice/v1beta1/params";
}
// List records
rpc ListRecords(QueryListRecordsRequest) returns (QueryListRecordsResponse){
option (google.api.http).get = "/vulcanize/nameservice/v1beta1/records";
}
// Get record by id
rpc GetRecord(QueryRecordByIdRequest) returns (QueryRecordByIdResponse){
option (google.api.http).get = "/vulcanize/nameservice/v1beta1/records/{id}";
}
// Get records by bond id
rpc GetRecordByBondId(QueryRecordByBondIdRequest) returns (QueryRecordByBondIdResponse){
option (google.api.http).get = "/vulcanize/nameservice/v1beta1/records-by-bond-id/{id}";
}
// Get nameservice module balance
rpc GetNameServiceModuleBalance(GetNameServiceModuleBalanceRequest) returns (GetNameServiceModuleBalanceResponse){
option (google.api.http).get = "/vulcanize/nameservice/v1beta1/balance";
}
// List name records
rpc ListNameRecords(QueryListNameRecordsRequest) returns (QueryListNameRecordsResponse){
option (google.api.http).get = "/vulcanize/nameservice/v1beta1/names";
}
// Whois method retrieve the name authority info
rpc Whois(QueryWhoisRequest) returns (QueryWhoisResponse){
option (google.api.http).get = "/vulcanize/nameservice/v1beta1/whois/{name}";
}
// LookupCrn
rpc LookupCrn(QueryLookupCrn) returns (QueryLookupCrnResponse){
option (google.api.http).get = "/vulcanize/nameservice/v1beta1/lookup";
}
// ResolveCrn
rpc ResolveCrn(QueryResolveCrn) returns (QueryResolveCrnResponse){
option (google.api.http).get = "/vulcanize/nameservice/v1beta1/resolve";
}
// GetRecordExpiryQueue
rpc GetRecordExpiryQueue(QueryGetRecordExpiryQueue) returns (QueryGetRecordExpiryQueueResponse){
option (google.api.http).get = "/vulcanize/nameservice/v1beta1/record-expiry";
}
// GetAuthorityExpiryQueue
rpc GetAuthorityExpiryQueue(QueryGetAuthorityExpiryQueue) returns (QueryGetAuthorityExpiryQueueResponse){
option (google.api.http).get = "/vulcanize/nameservice/v1beta1/authority-expiry";
}
}
// QueryParamsRequest is request type for nameservice params
message QueryParamsRequest{
}
// QueryParamsResponse is response type for nameservice params
message QueryParamsResponse{
Params params = 1;
}
// QueryListRecordsRequest is request type for nameservice records list
message QueryListRecordsRequest{
message ReferenceInput {
string id = 1;
}
message ValueInput {
string type = 1;
string string = 2;
int64 int = 3;
double float = 4;
bool boolean = 5;
ReferenceInput reference = 6;
repeated ValueInput values = 7;
}
message KeyValueInput {
string key = 1;
ValueInput value = 2;
}
repeated KeyValueInput attributes = 1;
bool all = 2;
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 3;
}
// QueryListRecordsResponse is response type for nameservice records list
message QueryListRecordsResponse{
repeated Record records = 1 [
(gogoproto.nullable) = false
];
// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
//QueryRecordByIdRequest is request type for nameservice records by id
message QueryRecordByIdRequest{
string id = 1 ;
}
// QueryRecordByIdResponse is response type for nameservice records by id
message QueryRecordByIdResponse{
Record record = 1[
(gogoproto.nullable) = false
];
}
// QueryRecordByBondIdRequest is request type for get the records by bond-id
message QueryRecordByBondIdRequest{
string id = 1;
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 2;
}
// QueryRecordByBondIdResponse is response type for records list by bond-id
message QueryRecordByBondIdResponse{
repeated Record records = 1 [
(gogoproto.nullable) = false
];
// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
// GetNameServiceModuleBalanceRequest is request type for nameservice module accounts balance
message GetNameServiceModuleBalanceRequest{
}
// GetNameServiceModuleBalanceResponse is response type for nameservice module accounts balance
message GetNameServiceModuleBalanceResponse{
repeated AccountBalance balances = 1;
}
// AccountBalance is nameservice module account balance
message AccountBalance {
string account_name = 1 [
(gogoproto.moretags) = "json:\"accountName\" yaml:\"accountName\""
];
repeated cosmos.base.v1beta1.Coin balance = 3 [
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
(gogoproto.moretags) = "json:\"balance\" yaml:\"balance\""
];
}
// QueryListNameRecordsRequest is request type for nameservice names records
message QueryListNameRecordsRequest{
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}
// QueryListNameRecordsResponse is response type for nameservice names records
message QueryListNameRecordsResponse{
repeated NameEntry names = 1 [
(gogoproto.nullable) = false
];
// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
// QueryWhoisRequest is request type for Get NameAuthority
message QueryWhoisRequest{
string name = 1;
}
// QueryWhoisResponse is response type for whois request
message QueryWhoisResponse{
NameAuthority name_authority = 1 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"nameAuthority\" yaml:\"nameAuthority\""
];
}
// QueryLookupCrn is request type for LookupCrn
message QueryLookupCrn{
string crn = 1;
}
// QueryLookupCrnResponse is response type for QueryLookupCrn
message QueryLookupCrnResponse{
NameRecord name = 1;
}
// QueryResolveCrn is request type for ResolveCrn
message QueryResolveCrn{
string crn = 1;
}
// QueryResolveCrnResponse is response type for QueryResolveCrn
message QueryResolveCrnResponse{
Record record = 1;
}
// QueryGetRecordExpiryQueue
message QueryGetRecordExpiryQueue{
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}
// QueryGetRecordExpiryQueueResponse
message QueryGetRecordExpiryQueueResponse{
repeated ExpiryQueueRecord records = 1;
// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
// ExpiryQueueRecord
message ExpiryQueueRecord{
string id = 1;
repeated string value = 2;
}
// QueryGetAuthorityExpiryQueue
message QueryGetAuthorityExpiryQueue{
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}
// QueryGetAuthorityExpiryQueueResponse
message QueryGetAuthorityExpiryQueueResponse{
repeated ExpiryQueueRecord authorities = 1;
// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

View File

@ -1,168 +0,0 @@
syntax = "proto3";
package vulcanize.nameservice.v1beta1;
import "gogoproto/gogo.proto";
import "vulcanize/nameservice/v1beta1/nameservice.proto";
option go_package = "github.com/tharsis/ethermint/x/nameservice/types";
// Msg
service Msg {
// SetRecord will records a new record with given payload and bond id
rpc SetRecord(MsgSetRecord) returns(MsgSetRecordResponse){}
// Renew Record will renew the expire record
rpc RenewRecord(MsgRenewRecord) returns (MsgRenewRecordResponse){}
// AssociateBond
rpc AssociateBond(MsgAssociateBond) returns (MsgAssociateBondResponse){}
// DissociateBond
rpc DissociateBond(MsgDissociateBond) returns (MsgDissociateBondResponse){}
// DissociateRecords
rpc DissociateRecords(MsgDissociateRecords) returns (MsgDissociateRecordsResponse){}
// ReAssociateRecords
rpc ReAssociateRecords(MsgReAssociateRecords) returns (MsgReAssociateRecordsResponse){}
// SetName will store the name with given crn and name
rpc SetName(MsgSetName) returns (MsgSetNameResponse){}
// Reserve name
rpc ReserveName(MsgReserveAuthority) returns (MsgReserveAuthorityResponse){}
// Delete Name method will remove authority name
rpc DeleteName(MsgDeleteNameAuthority) returns (MsgDeleteNameAuthorityResponse){}
// SetAuthorityBond
rpc SetAuthorityBond(MsgSetAuthorityBond) returns (MsgSetAuthorityBondResponse){}
}
// MsgSetRecord
message MsgSetRecord{
string bond_id = 1 [
(gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\""
];
string signer = 2;
Payload payload = 3 [
(gogoproto.nullable) = false
];
}
// MsgSetRecordResponse
message MsgSetRecordResponse{
string id = 1;
}
// Payload
message Payload {
Record record = 1;
repeated Signature signatures = 2 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"signatures\" yaml:\"signatures\""
];
}
// MsgSetName
message MsgSetName{
string crn = 1;
string cid = 2;
string signer = 3;
}
// MsgSetNameResponse
message MsgSetNameResponse{
}
// MsgReserveName
message MsgReserveAuthority{
string name = 1;
string signer = 2;
// if creating a sub-authority.
string owner = 3;
}
// MsgReserveNameResponse
message MsgReserveAuthorityResponse{
}
// MsgSetAuthorityBond is SDK message for SetAuthorityBond
message MsgSetAuthorityBond{
string name = 1;
string bond_id = 2 [
(gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\""
];
string signer = 3;
}
// MsgSetAuthorityBondResponse
message MsgSetAuthorityBondResponse{
}
// MsgDeleteNameAuthority is SDK message for DeleteNameAuthority
message MsgDeleteNameAuthority{
string crn = 1;
string signer = 2;
}
// MsgDeleteNameAuthorityResponse
message MsgDeleteNameAuthorityResponse{
}
//MsgRenewRecord is SDK message for Renew a record
message MsgRenewRecord{
string record_id = 1 [
(gogoproto.moretags) = "json:\"recordId\" yaml:\"recordId\""
];
string signer = 2;
}
// MsgRenewRecordResponse
message MsgRenewRecordResponse{
}
// MsgAssociateBond
message MsgAssociateBond{
string record_id = 1 [
(gogoproto.moretags) = "json:\"recordId\" yaml:\"recordId\""
];
string bond_id = 2 [
(gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\""
];
string signer = 3;
}
// MsgAssociateBondResponse
message MsgAssociateBondResponse{
}
// MsgDissociateBond is SDK message for Msg/DissociateBond
message MsgDissociateBond{
string record_id = 1 [
(gogoproto.moretags) = "json:\"recordId\" yaml:\"recordId\""
];
string signer = 2;
}
// MsgDissociateBondResponse is response type for MsgDissociateBond
message MsgDissociateBondResponse{
}
// MsgDissociateRecords is SDK message for Msg/DissociateRecords
message MsgDissociateRecords{
string bond_id = 1 [
(gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\""
];
string signer = 2;
}
// MsgDissociateRecordsResponse is response type for MsgDissociateRecords
message MsgDissociateRecordsResponse{
}
// MsgReAssociateRecords is SDK message for Msg/ReAssociateRecords
message MsgReAssociateRecords{
string new_bond_id = 1 [
(gogoproto.moretags) = "json:\"newBondId\" yaml:\"newBondId\""
];
string old_bond_id = 2 [
(gogoproto.moretags) = "json:\"oldBondId\" yaml:\"oldBondId\""
];
string signer = 3;
}
// MsgReAssociateRecordsResponse is response type for MsgReAssociateRecords
message MsgReAssociateRecordsResponse{
}

View File

@ -0,0 +1,21 @@
syntax = "proto3";
package vulcanize.registry.v1beta1;
import "gogoproto/gogo.proto";
import "vulcanize/registry/v1beta1/registry.proto";
option go_package = "github.com/cerc-io/laconicd/x/registry/types";
// GenesisState defines the registry module's genesis state.
message GenesisState {
// params defines all the params of registry module.
Params params = 1 [(gogoproto.nullable) = false];
// records
repeated Record records = 2
[(gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"records\" yaml:\"records\""];
// authorities
repeated AuthorityEntry authorities = 3
[(gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"authorities\" yaml:\"authorities\""];
// names
repeated NameEntry names = 4 [(gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"names\" yaml:\"names\""];
}

View File

@ -0,0 +1,225 @@
syntax = "proto3";
package vulcanize.registry.v1beta1;
import "vulcanize/registry/v1beta1/registry.proto";
import "google/api/annotations.proto";
import "cosmos/base/query/v1beta1/pagination.proto";
import "gogoproto/gogo.proto";
import "cosmos/base/v1beta1/coin.proto";
option go_package = "github.com/cerc-io/laconicd/x/registry/types";
// Query defines the gRPC querier service for registry module
service Query {
// Params queries the registry module params.
rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {
option (google.api.http).get = "/vulcanize/registry/v1beta1/params";
}
// List records
rpc ListRecords(QueryListRecordsRequest) returns (QueryListRecordsResponse) {
option (google.api.http).get = "/vulcanize/registry/v1beta1/records";
}
// Get record by id
rpc GetRecord(QueryRecordByIDRequest) returns (QueryRecordByIDResponse) {
option (google.api.http).get = "/vulcanize/registry/v1beta1/records/{id}";
}
// Get records by bond id
rpc GetRecordByBondID(QueryRecordByBondIDRequest) returns (QueryRecordByBondIDResponse) {
option (google.api.http).get = "/vulcanize/registry/v1beta1/records-by-bond-id/{id}";
}
// Get registry module balance
rpc GetRegistryModuleBalance(GetRegistryModuleBalanceRequest) returns (GetRegistryModuleBalanceResponse) {
option (google.api.http).get = "/vulcanize/registry/v1beta1/balance";
}
// List name records
rpc ListNameRecords(QueryListNameRecordsRequest) returns (QueryListNameRecordsResponse) {
option (google.api.http).get = "/vulcanize/registry/v1beta1/names";
}
// Whois method retrieve the name authority info
rpc Whois(QueryWhoisRequest) returns (QueryWhoisResponse) {
option (google.api.http).get = "/vulcanize/registry/v1beta1/whois/{name}";
}
// LookupCrn
rpc LookupCrn(QueryLookupCrn) returns (QueryLookupCrnResponse) {
option (google.api.http).get = "/vulcanize/registry/v1beta1/lookup";
}
// ResolveCrn
rpc ResolveCrn(QueryResolveCrn) returns (QueryResolveCrnResponse) {
option (google.api.http).get = "/vulcanize/registry/v1beta1/resolve";
}
// GetRecordExpiryQueue
rpc GetRecordExpiryQueue(QueryGetRecordExpiryQueue) returns (QueryGetRecordExpiryQueueResponse) {
option (google.api.http).get = "/vulcanize/registry/v1beta1/record-expiry";
}
// GetAuthorityExpiryQueue
rpc GetAuthorityExpiryQueue(QueryGetAuthorityExpiryQueue) returns (QueryGetAuthorityExpiryQueueResponse) {
option (google.api.http).get = "/vulcanize/registry/v1beta1/authority-expiry";
}
}
// QueryParamsRequest is request type for registry params
message QueryParamsRequest {}
// QueryParamsResponse is response type for registry params
message QueryParamsResponse {
Params params = 1;
}
// QueryListRecordsRequest is request type for registry records list
message QueryListRecordsRequest {
message LinkInput {
string id = 1;
}
message ArrayInput {
repeated ValueInput values = 1;
}
message MapInput {
map<string, ValueInput> values = 1;
}
message ValueInput {
oneof value {
string string = 1;
int64 int = 2;
double float = 3;
bool boolean = 4;
string link = 5;
ArrayInput array = 6;
MapInput map = 7;
}
}
message KeyValueInput {
string key = 1;
ValueInput value = 2;
}
repeated KeyValueInput attributes = 1;
bool all = 2;
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 3;
}
// QueryListRecordsResponse is response type for registry records list
message QueryListRecordsResponse {
repeated Record records = 1 [(gogoproto.nullable) = false];
// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
// QueryRecordByIDRequest is request type for registry records by id
message QueryRecordByIDRequest {
string id = 1;
}
// QueryRecordByIDResponse is response type for registry records by id
message QueryRecordByIDResponse {
Record record = 1 [(gogoproto.nullable) = false];
}
// QueryRecordByBondIdRequest is request type for get the records by bond-id
message QueryRecordByBondIDRequest {
string id = 1;
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 2;
}
// QueryRecordByBondIdResponse is response type for records list by bond-id
message QueryRecordByBondIDResponse {
repeated Record records = 1 [(gogoproto.nullable) = false];
// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
// GetRegistryModuleBalanceRequest is request type for registry module accounts balance
message GetRegistryModuleBalanceRequest {}
// GetRegistryModuleBalanceResponse is response type for registry module accounts balance
message GetRegistryModuleBalanceResponse {
repeated AccountBalance balances = 1;
}
// AccountBalance is registry module account balance
message AccountBalance {
string account_name = 1 [(gogoproto.moretags) = "json:\"accountName\" yaml:\"accountName\""];
repeated cosmos.base.v1beta1.Coin balance = 3 [
(gogoproto.nullable) = false,
(gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins",
(gogoproto.moretags) = "json:\"balance\" yaml:\"balance\""
];
}
// QueryListNameRecordsRequest is request type for registry names records
message QueryListNameRecordsRequest {
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}
// QueryListNameRecordsResponse is response type for registry names records
message QueryListNameRecordsResponse {
repeated NameEntry names = 1 [(gogoproto.nullable) = false];
// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
// QueryWhoisRequest is request type for Get NameAuthority
message QueryWhoisRequest {
string name = 1;
}
// QueryWhoisResponse is response type for whois request
message QueryWhoisResponse {
NameAuthority name_authority = 1
[(gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"nameAuthority\" yaml:\"nameAuthority\""];
}
// QueryLookupCrn is request type for LookupCrn
message QueryLookupCrn {
string crn = 1;
}
// QueryLookupCrnResponse is response type for QueryLookupCrn
message QueryLookupCrnResponse {
NameRecord name = 1;
}
// QueryResolveCrn is request type for ResolveCrn
message QueryResolveCrn {
string crn = 1;
}
// QueryResolveCrnResponse is response type for QueryResolveCrn
message QueryResolveCrnResponse {
Record record = 1;
}
// QueryGetRecordExpiryQueue
message QueryGetRecordExpiryQueue {
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}
// QueryGetRecordExpiryQueueResponse
message QueryGetRecordExpiryQueueResponse {
repeated ExpiryQueueRecord records = 1;
// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}
// ExpiryQueueRecord
message ExpiryQueueRecord {
string id = 1;
repeated string value = 2;
}
// QueryGetAuthorityExpiryQueue
message QueryGetAuthorityExpiryQueue {
// pagination defines an optional pagination for the request.
cosmos.base.query.v1beta1.PageRequest pagination = 1;
}
// QueryGetAuthorityExpiryQueueResponse
message QueryGetAuthorityExpiryQueueResponse {
repeated ExpiryQueueRecord authorities = 1;
// pagination defines the pagination in the response.
cosmos.base.query.v1beta1.PageResponse pagination = 2;
}

View File

@ -0,0 +1,133 @@
syntax = "proto3";
package vulcanize.registry.v1beta1;
import "google/protobuf/duration.proto";
import "google/protobuf/timestamp.proto";
import "gogoproto/gogo.proto";
import "cosmos/base/v1beta1/coin.proto";
option go_package = "github.com/cerc-io/laconicd/x/registry/types";
// Params defines the registry module parameters
message Params {
cosmos.base.v1beta1.Coin record_rent = 1
[(gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"record_rent\" yaml:\"record_rent\""];
google.protobuf.Duration record_rent_duration = 2 [
(gogoproto.nullable) = false,
(gogoproto.stdduration) = true,
(gogoproto.moretags) = "json:\"record_rent_duration\" yaml:\"record_rent_duration\""
];
cosmos.base.v1beta1.Coin authority_rent = 3
[(gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"authority_rent\" yaml:\"authority_rent\""];
google.protobuf.Duration authority_rent_duration = 4 [
(gogoproto.nullable) = false,
(gogoproto.stdduration) = true,
(gogoproto.moretags) = "json:\"authority_rent_duration\" yaml:\"authority_rent_duration\""
];
google.protobuf.Duration authority_grace_period = 5 [
(gogoproto.nullable) = false,
(gogoproto.stdduration) = true,
(gogoproto.moretags) = "json:\"authority_grace_period\" yaml:\"authority_grace_period\""
];
bool authority_auction_enabled = 6
[(gogoproto.moretags) = "json:\"authority_auction_enabled\" yaml:\"authority_auction_enabled\""];
google.protobuf.Duration authority_auction_commits_duration = 7 [
(gogoproto.nullable) = false,
(gogoproto.stdduration) = true,
(gogoproto.moretags) = "json:\"authority_auction_commits_duration\" yaml:\"authority_auction_commits_duration\""
];
google.protobuf.Duration authority_auction_reveals_duration = 8 [
(gogoproto.nullable) = false,
(gogoproto.stdduration) = true,
(gogoproto.moretags) = "json:\"authority_auction_reveals_duration\" yaml:\"authority_auction_reveals_duration\""
];
cosmos.base.v1beta1.Coin authority_auction_commit_fee = 9 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"authority_auction_commit_fee\" yaml:\"authority_auction_commit_fee\""
];
cosmos.base.v1beta1.Coin authority_auction_reveal_fee = 10 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"authority_auction_reveal_fee\" yaml:\"authority_auction_reveal_fee\""
];
cosmos.base.v1beta1.Coin authority_auction_minimum_bid = 11 [
(gogoproto.nullable) = false,
(gogoproto.moretags) = "json:\"authority_auction_minimum_bid\" yaml:\"authority_auction_minimum_bid\""
];
}
// Params defines the registry module records
message Record {
string id = 1 [(gogoproto.moretags) = "json:\"id\" yaml:\"id\""];
string bond_id = 2 [(gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\""];
string create_time = 3 [(gogoproto.moretags) = "json:\"createTime\" yaml:\"createTime\""];
string expiry_time = 4 [(gogoproto.moretags) = "json:\"expiryTime\" yaml:\"expiryTime\""];
bool deleted = 5;
repeated string owners = 6 [(gogoproto.moretags) = "json:\"owners\" yaml:\"owners\""];
bytes attributes = 7 [(gogoproto.moretags) = "json:\"attributes\" yaml:\"attributes\""];
repeated string names = 8 [(gogoproto.moretags) = "json:\"names\" yaml:\"names\""];
string type = 9 [(gogoproto.moretags) = "json:\"types\" yaml:\"types\""];
}
// AuthorityEntry defines the registry module AuthorityEntries
message AuthorityEntry {
string name = 1;
NameAuthority entry = 2;
}
// NameAuthority
message NameAuthority {
// Owner public key.
string owner_public_key = 1 [(gogoproto.moretags) = "json:\"ownerPublicKey\" yaml:\"ownerPublicKey\""];
// Owner address.
string owner_address = 2 [(gogoproto.moretags) = "json:\"ownerAddress\" yaml:\"ownerAddress\""];
// height at which name/authority was created.
uint64 height = 3;
string status = 4;
string auction_id = 5 [(gogoproto.moretags) = "json:\"auctionID\" yaml:\"auctionID\""];
string bond_id = 6 [(gogoproto.moretags) = "json:\"bondID\" yaml:\"bondID\""];
google.protobuf.Timestamp expiry_time = 7 [
(gogoproto.nullable) = false,
(gogoproto.stdtime) = true,
(gogoproto.moretags) = "json:\"expiryTime\" yaml:\"expiryTime\""
];
}
// NameEntry
message NameEntry {
string name = 1;
NameRecord entry = 2;
}
// NameRecord
message NameRecord {
NameRecordEntry latest = 1;
repeated NameRecordEntry history = 2;
}
// NameRecordEntry
message NameRecordEntry {
string id = 1;
uint64 height = 2;
}
// Signature
message Signature {
string sig = 1 [(gogoproto.moretags) = "json:\"sig\" yaml:\"sig\""];
string pub_key = 2 [(gogoproto.moretags) = "json:\"pubKey\" yaml:\"pubKey\""];
}
// BlockChangeSet
message BlockChangeSet {
int64 height = 1;
repeated string records = 2;
repeated string auctions = 3;
repeated AuctionBidInfo auction_bids = 4 [(gogoproto.moretags) = "json:\"auctionBids\" yaml:\"auctionBids\""];
repeated string authorities = 5;
repeated string names = 6;
}
// AuctionBidInfo
message AuctionBidInfo {
string auction_id = 1 [(gogoproto.moretags) = "json:\"auctionID\" yaml:\"auctionID\""];
string bidder_address = 2 [(gogoproto.moretags) = "json:\"bidderAddress\" yaml:\"bidderAddress\""];
}

View File

@ -0,0 +1,137 @@
syntax = "proto3";
package vulcanize.registry.v1beta1;
import "gogoproto/gogo.proto";
import "vulcanize/registry/v1beta1/registry.proto";
option go_package = "github.com/cerc-io/laconicd/x/registry/types";
// Msg
service Msg {
// SetRecord will records a new record with given payload and bond id
rpc SetRecord(MsgSetRecord) returns (MsgSetRecordResponse) {}
// Renew Record will renew the expire record
rpc RenewRecord(MsgRenewRecord) returns (MsgRenewRecordResponse) {}
// AssociateBond
rpc AssociateBond(MsgAssociateBond) returns (MsgAssociateBondResponse) {}
// DissociateBond
rpc DissociateBond(MsgDissociateBond) returns (MsgDissociateBondResponse) {}
// DissociateRecords
rpc DissociateRecords(MsgDissociateRecords) returns (MsgDissociateRecordsResponse) {}
// ReAssociateRecords
rpc ReAssociateRecords(MsgReAssociateRecords) returns (MsgReAssociateRecordsResponse) {}
// SetName will store the name with given crn and name
rpc SetName(MsgSetName) returns (MsgSetNameResponse) {}
// Reserve name
rpc ReserveName(MsgReserveAuthority) returns (MsgReserveAuthorityResponse) {}
// Delete Name method will remove authority name
rpc DeleteName(MsgDeleteNameAuthority) returns (MsgDeleteNameAuthorityResponse) {}
// SetAuthorityBond
rpc SetAuthorityBond(MsgSetAuthorityBond) returns (MsgSetAuthorityBondResponse) {}
}
// MsgSetRecord
message MsgSetRecord {
string bond_id = 1 [(gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\""];
string signer = 2;
Payload payload = 3 [(gogoproto.nullable) = false];
}
// MsgSetRecordResponse
message MsgSetRecordResponse {
string id = 1;
}
// Payload
message Payload {
Record record = 1;
repeated Signature signatures = 2
[(gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"signatures\" yaml:\"signatures\""];
}
// MsgSetName
message MsgSetName {
string crn = 1;
string cid = 2;
string signer = 3;
}
// MsgSetNameResponse
message MsgSetNameResponse {}
// MsgReserveName
message MsgReserveAuthority {
string name = 1;
string signer = 2;
// if creating a sub-authority.
string owner = 3;
}
// MsgReserveNameResponse
message MsgReserveAuthorityResponse {}
// MsgSetAuthorityBond is SDK message for SetAuthorityBond
message MsgSetAuthorityBond {
string name = 1;
string bond_id = 2 [(gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\""];
string signer = 3;
}
// MsgSetAuthorityBondResponse
message MsgSetAuthorityBondResponse {}
// MsgDeleteNameAuthority is SDK message for DeleteNameAuthority
message MsgDeleteNameAuthority {
string crn = 1;
string signer = 2;
}
// MsgDeleteNameAuthorityResponse
message MsgDeleteNameAuthorityResponse {}
// MsgRenewRecord is SDK message for Renew a record
message MsgRenewRecord {
string record_id = 1 [(gogoproto.moretags) = "json:\"recordId\" yaml:\"recordId\""];
string signer = 2;
}
// MsgRenewRecordResponse
message MsgRenewRecordResponse {}
// MsgAssociateBond
message MsgAssociateBond {
string record_id = 1 [(gogoproto.moretags) = "json:\"recordId\" yaml:\"recordId\""];
string bond_id = 2 [(gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\""];
string signer = 3;
}
// MsgAssociateBondResponse
message MsgAssociateBondResponse {}
// MsgDissociateBond is SDK message for Msg/DissociateBond
message MsgDissociateBond {
string record_id = 1 [(gogoproto.moretags) = "json:\"recordId\" yaml:\"recordId\""];
string signer = 2;
}
// MsgDissociateBondResponse is response type for MsgDissociateBond
message MsgDissociateBondResponse {}
// MsgDissociateRecords is SDK message for Msg/DissociateRecords
message MsgDissociateRecords {
string bond_id = 1 [(gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\""];
string signer = 2;
}
// MsgDissociateRecordsResponse is response type for MsgDissociateRecords
message MsgDissociateRecordsResponse {}
// MsgReAssociateRecords is SDK message for Msg/ReAssociateRecords
message MsgReAssociateRecords {
string new_bond_id = 1 [(gogoproto.moretags) = "json:\"newBondId\" yaml:\"newBondId\""];
string old_bond_id = 2 [(gogoproto.moretags) = "json:\"oldBondId\" yaml:\"oldBondId\""];
string signer = 3;
}
// MsgReAssociateRecordsResponse is response type for MsgReAssociateRecords
message MsgReAssociateRecordsResponse {}

View File

@ -0,0 +1,2 @@
#!/usr/bin/env bash
docker build -t cerc/laconic-sdk-tester:local -f Dockerfile .

View File

@ -1,12 +0,0 @@
#!/bin/bash
# NOTE: protoc is required
I=$(pwd)/proto
DEST_TS=$(pwd)/src/proto/
mkdir -p $DEST_TS
protoc \
--plugin=protoc-gen-ts=./node_modules/.bin/protoc-gen-ts \
--ts_out=$DEST_TS \
--proto_path=$I \
$(find $(pwd)/proto/vulcanize -iname "*.proto")

40
scripts/proto-gen.sh Executable file
View File

@ -0,0 +1,40 @@
#!/bin/bash
# NOTE: protoc is required
set -e
REPO_ROOT=$(pwd)
I=$REPO_ROOT/proto
DEST_TS=$REPO_ROOT/src/proto/
echo "Generating protobuf files"
mkdir -p $DEST_TS
protoc \
--plugin=protoc-gen-ts=$REPO_ROOT/node_modules/.bin/protoc-gen-ts \
--ts_out=$DEST_TS \
--proto_path=$I \
$(find $REPO_ROOT/proto/vulcanize -iname "*.proto")
SED='sed -i'
if [[ "$OSTYPE" == "darwin"* ]]; then
SED='sed -i ""'
fi
echo "Removing gRPC references..."
# https://github.com/tharsis/evmosjs/tree/main/packages/proto#note
for file in $(find $REPO_ROOT/src/proto -type f)
do
line=$(grep -n '@grpc/grpc-js' $file | cut -f1 -d':')
if [[ -n "$line" ]] && [[ "$line" -gt 0 ]]; then
echo "Processing file: $file"
$SED "${line}d" ${file}
functions=$(grep -n 'interface GrpcUnaryServiceInterface' $file | cut -f1 -d':')
$SED "${functions},\$d" ${file}
echo '}' >> $file
fi
$SED '1s#^#/* eslint-disable */\n#' $file
$SED '1s#^#// @ts-nocheck\n#' $file
done

View File

@ -1,16 +0,0 @@
#!/bin/bash
echo $PWD
for file in $(find src/proto -type f)
do
line=$(grep -n '@grpc/grpc-js' $file | cut -f1 -d':')
if [[ $line -gt 0 ]];
then
echo "Processing file... $file"
sed -i "${line}d" ${file}
functions=$(grep -n 'interface GrpcUnaryServiceInterface' $file | cut -f1 -d':')
sed -i "${functions},\$d" ${file}
echo '}' >> $file
fi
sed -i '1s#^#/* eslint-disable */\n#' $file
sed -i '1s#^#// @ts-nocheck\n#' $file
done

View File

@ -12,20 +12,10 @@ jest.setTimeout(90 * 1000);
const bondTests = () => { const bondTests = () => {
let registry: Registry; let registry: Registry;
let watcher: any;
let version1: string;
let version2: string;
let bondId1: string;
let bondId2: string;
let bondOwner: string;
const publishNewWatcherVersion = async (bondId: string) => { const publishNewWatcherVersion = async (bondId: string) => {
watcher = await ensureUpdatedConfig(WATCHER_YML_PATH); let watcher = await ensureUpdatedConfig(WATCHER_YML_PATH);
await registry.setRecord({ privateKey, record: watcher.record, bondId }, privateKey, fee); await registry.setRecord({ privateKey, record: watcher.record, bondId }, privateKey, fee);
return watcher.record.version; return watcher;
}; };
beforeAll(async () => { beforeAll(async () => {
@ -33,93 +23,119 @@ const bondTests = () => {
}); });
test('Create bond.', async () => { test('Create bond.', async () => {
bondId1 = await registry.getNextBondId(privateKey); let bondId = await registry.getNextBondId(privateKey);
expect(bondId).toBeDefined();
await registry.createBond({ denom: 'aphoton', amount: '1000000000' }, privateKey, fee);
});
describe('With bond created', () => {
let bond1: any
beforeAll(async () => {
let bondId1 = await registry.getNextBondId(privateKey);
expect(bondId1).toBeDefined(); expect(bondId1).toBeDefined();
await registry.createBond({ denom: 'aphoton', amount: '1000000000' }, privateKey, fee); await registry.createBond({ denom: 'aphoton', amount: '1000000000' }, privateKey, fee);
})
[bond1] = await registry.getBondsByIds([bondId1]);
expect(bond1).toBeDefined();
expect(bond1.id).toEqual(bondId1);
});
test('Get bond by ID.', async () => { test('Get bond by ID.', async () => {
const [bond] = await registry.getBondsByIds([bondId1]); const [bond] = await registry.getBondsByIds([bond1.id]);
expect(bond).toBeDefined(); expect(bond).toBeDefined();
expect(bond.id).toBe(bondId1); expect(bond.id).toBe(bond1.id);
expect(bond.balance).toHaveLength(1); expect(bond.balance).toHaveLength(1);
expect(bond.balance[0]).toEqual({ type: 'aphoton', quantity: '1000000000' }); expect(bond.balance[0]).toEqual({ type: 'aphoton', quantity: '1000000000' });
bondOwner = bond.owner;
}); });
test('Query bonds.', async () => { test('Query bonds.', async () => {
const bonds = await registry.queryBonds(); const bonds = await registry.queryBonds();
expect(bonds).toBeDefined(); expect(bonds).toBeDefined();
const bond = bonds.filter((bond: any) => bond.id === bondId1); const bond = bonds.filter((bond: any) => bond.id === bond1.id);
expect(bond).toBeDefined(); expect(bond).toBeDefined();
}); });
test('Query bonds by owner.', async () => { test('Query bonds by owner.', async () => {
const bonds = await registry.queryBonds({ owner: bondOwner }); const bonds = await registry.queryBonds({ owner: bond1.owner });
expect(bonds).toBeDefined(); expect(bonds).toBeDefined();
const bond = bonds.filter((bond: any) => bond.id === bondId1); const bond = bonds.filter((bond: any) => bond.id === bond1.id);
expect(bond).toBeDefined(); expect(bond).toBeDefined();
}); });
test('Refill bond.', async () => { test('Refill bond.', async () => {
await registry.refillBond({ id: bondId1, denom: 'aphoton', amount: '500' }, privateKey, fee); await registry.refillBond({ id: bond1.id, denom: 'aphoton', amount: '500' }, privateKey, fee);
const [bond] = await registry.getBondsByIds([bondId1]); const [bond] = await registry.getBondsByIds([bond1.id]);
expect(bond).toBeDefined(); expect(bond).toBeDefined();
expect(bond.id).toBe(bondId1); expect(bond.id).toBe(bond1.id);
expect(bond.balance).toHaveLength(1); expect(bond.balance).toHaveLength(1);
expect(bond.balance[0]).toEqual({ type: 'aphoton', quantity: '1000000500' }); expect(bond.balance[0]).toEqual({ type: 'aphoton', quantity: '1000000500' });
}); });
test('Withdraw bond.', async () => { test('Withdraw bond.', async () => {
await registry.withdrawBond({ id: bondId1, denom: 'aphoton', amount: '500' }, privateKey, fee); await registry.withdrawBond({ id: bond1.id, denom: 'aphoton', amount: '500' }, privateKey, fee);
const [bond] = await registry.getBondsByIds([bondId1]); const [bond] = await registry.getBondsByIds([bond1.id]);
expect(bond).toBeDefined(); expect(bond).toBeDefined();
expect(bond.id).toBe(bondId1); expect(bond.id).toBe(bond1.id);
expect(bond.balance).toHaveLength(1); expect(bond.balance).toHaveLength(1);
expect(bond.balance[0]).toEqual({ type: 'aphoton', quantity: '1000000000' }); expect(bond.balance[0]).toEqual({ type: 'aphoton', quantity: '1000000000' });
}); });
test('Cancel bond.', async () => { test('Cancel bond.', async () => {
await registry.cancelBond({ id: bondId1 }, privateKey, fee); await registry.cancelBond({ id: bond1.id }, privateKey, fee);
const [bond] = await registry.getBondsByIds([bondId1]); const [bond] = await registry.getBondsByIds([bond1.id]);
expect(bond.id).toBe(""); expect(bond.id).toBe("");
expect(bond.owner).toBe(""); expect(bond.owner).toBe("");
expect(bond.balance).toHaveLength(0); expect(bond.balance).toHaveLength(0);
}); });
});
test('Associate/Dissociate bond.', async () => { test('Associate/Dissociate bond.', async () => {
let bondId1: string;
bondId1 = await registry.getNextBondId(privateKey); bondId1 = await registry.getNextBondId(privateKey);
expect(bondId1).toBeDefined(); expect(bondId1).toBeDefined();
await registry.createBond({ denom: 'aphoton', amount: '1000000000' }, privateKey, fee); await registry.createBond({ denom: 'aphoton', amount: '1000000000' }, privateKey, fee);
// Create a new record. // Create a new record.
version1 = await publishNewWatcherVersion(bondId1); let watcher = await publishNewWatcherVersion(bondId1);
let [record1] = await registry.queryRecords({ type: watcher.record.type, name: watcher.record.name, version: version1 }, true); let query = { type: watcher.record.type, url: watcher.record.url, version: watcher.record.version };
let [record1] = await registry.queryRecords(query, true);
expect(record1.bondId).toBe(bondId1); expect(record1.bondId).toBe(bondId1);
// Dissociate record, query and confirm. // Dissociate record, query and confirm.
await registry.dissociateBond({ recordId: record1.id }, privateKey, fee); await registry.dissociateBond({ recordId: record1.id }, privateKey, fee);
[record1] = await registry.queryRecords({ type: watcher.record.type, name: watcher.record.name, version: version1 }, true); [record1] = await registry.queryRecords(query, true);
expect(record1.bondId).toBe(''); expect(record1.bondId).toBe('');
// Associate record with bond, query and confirm. // Associate record with bond, query and confirm.
await registry.associateBond({ recordId: record1.id, bondId: bondId1 }, privateKey, fee); await registry.associateBond({ recordId: record1.id, bondId: bondId1 }, privateKey, fee);
[record1] = await registry.queryRecords({ type: watcher.record.type, name: watcher.record.name, version: version1 }, true); [record1] = await registry.queryRecords(query, true);
expect(record1.bondId).toBe(bondId1); expect(record1.bondId).toBe(bondId1);
}); });
test('Reassociate/Dissociate records.', async () => { test('Reassociate/Dissociate records.', async () => {
let bondId1: string;
let bondId2: string;
bondId1 = await registry.getNextBondId(privateKey);
expect(bondId1).toBeDefined();
await registry.createBond({ denom: 'aphoton', amount: '1000000000' }, privateKey, fee);
// Create a new record version. // Create a new record version.
version2 = await publishNewWatcherVersion(bondId1); let watcher = await publishNewWatcherVersion(bondId1);
let queryv1 = { type: watcher.record.type, url: watcher.record.url, version: watcher.record.version };
let queryv2 = { type: watcher.record.type, url: watcher.record.url, version: watcher.record.version };
// Check version1, version2 as associated with bondId1. // Check version1, version2 as associated with bondId1.
let records; let records;
records = await registry.queryRecords({ type: watcher.record.type, name: watcher.record.name, version: version1 }, true); records = await registry.queryRecords(queryv1, true);
expect(records[0].bondId).toBe(bondId1); expect(records[0].bondId).toBe(bondId1);
records = await registry.queryRecords({ type: watcher.record.type, name: watcher.record.name, version: version2 }, true); records = await registry.queryRecords(queryv2, true);
expect(records[0].bondId).toBe(bondId1); expect(records[0].bondId).toBe(bondId1);
// Create another bond. // Create another bond.
@ -131,16 +147,16 @@ const bondTests = () => {
// Reassociate records from bondId1 to bondId2, verify change. // Reassociate records from bondId1 to bondId2, verify change.
await registry.reassociateRecords({ oldBondId: bondId1, newBondId: bondId2 }, privateKey, fee); await registry.reassociateRecords({ oldBondId: bondId1, newBondId: bondId2 }, privateKey, fee);
records = await registry.queryRecords({ type: watcher.record.type, name: watcher.record.name, version: version1 }, true); records = await registry.queryRecords(queryv1, true);
expect(records[0].bondId).toBe(bondId2); expect(records[0].bondId).toBe(bondId2);
records = await registry.queryRecords({ type: watcher.record.type, name: watcher.record.name, version: version2 }, true); records = await registry.queryRecords(queryv2, true);
expect(records[0].bondId).toBe(bondId2); expect(records[0].bondId).toBe(bondId2);
// Dissociate all records from bond, verify change. // Dissociate all records from bond, verify change.
await registry.dissociateRecords({ bondId: bondId2 }, privateKey, fee); await registry.dissociateRecords({ bondId: bondId2 }, privateKey, fee);
records = await registry.queryRecords({ type: watcher.record.type, name: watcher.record.name, version: version1 }, true); records = await registry.queryRecords(queryv1, true);
expect(records[0].bondId).toBe(''); expect(records[0].bondId).toBe('');
records = await registry.queryRecords({ type: watcher.record.type, name: watcher.record.name, version: version2 }, true); records = await registry.queryRecords(queryv2, true);
expect(records[0].bondId).toBe(''); expect(records[0].bondId).toBe('');
}); });
}; };

View File

@ -1,4 +1,3 @@
import isUrl from 'is-url';
import { sha256 } from 'js-sha256'; import { sha256 } from 'js-sha256';
import { generatePostBodyBroadcast, BroadcastMode } from '@tharsis/provider'; import { generatePostBodyBroadcast, BroadcastMode } from '@tharsis/provider';
import { import {
@ -45,7 +44,7 @@ import {
MessageMsgSetRecord, MessageMsgSetRecord,
NAMESERVICE_ERRORS, NAMESERVICE_ERRORS,
parseMsgSetRecordResponse parseMsgSetRecordResponse
} from './messages/nameservice'; } from './messages/registry';
import { import {
createTxMsgCommitBid, createTxMsgCommitBid,
createTxMsgRevealBid, createTxMsgRevealBid,
@ -55,7 +54,7 @@ import {
export const DEFAULT_CHAIN_ID = 'laconic_9000-1'; export const DEFAULT_CHAIN_ID = 'laconic_9000-1';
const DEFAULT_WRITE_ERROR = 'Unable to write to laconicd.'; const DEFAULT_WRITE_ERROR = 'Unable to write to laconicd';
// Parse Tx response from cosmos-sdk. // Parse Tx response from cosmos-sdk.
export const parseTxResponse = (result: any, parseResponse?: (data: string) => any) => { export const parseTxResponse = (result: any, parseResponse?: (data: string) => any) => {
@ -118,17 +117,11 @@ export class Registry {
console.error(error) console.error(error)
} }
return errorMessage || DEFAULT_WRITE_ERROR; const [lastErrorLine] = error.split("\n").slice(-1);
return `${errorMessage || DEFAULT_WRITE_ERROR}: ${lastErrorLine}`;
} }
constructor(gqlUrl: string, restUrl: string = "", chainId: string = DEFAULT_CHAIN_ID) { constructor(gqlUrl: string, restUrl: string = "", chainId: string = DEFAULT_CHAIN_ID) {
if (!isUrl(gqlUrl)) {
throw new Error('Path to a GQL endpoint should be provided.');
}
if (restUrl && !isUrl(restUrl)) {
throw new Error('REST endpoint is not a URL string.');
}
this._endpoints = { this._endpoints = {
rest: restUrl, rest: restUrl,

View File

@ -8,7 +8,7 @@ import {
} from '@tharsis/transactions' } from '@tharsis/transactions'
import * as bondTx from '../proto/vulcanize/bond/v1beta1/tx' import * as bondTx from '../proto/vulcanize/bond/v1beta1/tx'
import * as nameserviceTx from '../proto/vulcanize/nameservice/v1beta1/tx' import * as registryTx from '../proto/vulcanize/registry/v1beta1/tx'
import * as coin from '../proto/cosmos/base/v1beta1/coin' import * as coin from '../proto/cosmos/base/v1beta1/coin'
import { createTx } from './util' import { createTx } from './util'
@ -475,7 +475,7 @@ function createMsgAssociateBond(
signer: string signer: string
) { ) {
return { return {
type: 'nameservice/AssociateBond', type: 'registry/AssociateBond',
value: { value: {
record_id: recordId, record_id: recordId,
bond_id: bondId, bond_id: bondId,
@ -489,7 +489,7 @@ const protoCreateMsgAssociateBond = (
bondId: string, bondId: string,
signer: string signer: string
) => { ) => {
const associateBondMessage = new nameserviceTx.vulcanize.nameservice.v1beta1.MsgAssociateBond({ const associateBondMessage = new registryTx.vulcanize.registry.v1beta1.MsgAssociateBond({
record_id: recordId, record_id: recordId,
bond_id: bondId, bond_id: bondId,
signer signer
@ -497,7 +497,7 @@ const protoCreateMsgAssociateBond = (
return { return {
message: associateBondMessage, message: associateBondMessage,
path: 'vulcanize.nameservice.v1beta1.MsgAssociateBond', path: 'vulcanize.registry.v1beta1.MsgAssociateBond',
} }
} }
@ -506,7 +506,7 @@ function createMsgDissociateBond(
signer: string signer: string
) { ) {
return { return {
type: 'nameservice/DissociateBond', type: 'registry/DissociateBond',
value: { value: {
record_id: recordId, record_id: recordId,
signer signer
@ -518,14 +518,14 @@ const protoCreateMsgDissociateBond = (
recordId: string, recordId: string,
signer: string signer: string
) => { ) => {
const dissociateBondMessage = new nameserviceTx.vulcanize.nameservice.v1beta1.MsgDissociateBond({ const dissociateBondMessage = new registryTx.vulcanize.registry.v1beta1.MsgDissociateBond({
record_id: recordId, record_id: recordId,
signer signer
}) })
return { return {
message: dissociateBondMessage, message: dissociateBondMessage,
path: 'vulcanize.nameservice.v1beta1.MsgDissociateBond', path: 'vulcanize.registry.v1beta1.MsgDissociateBond',
} }
} }
@ -534,7 +534,7 @@ function createMsgDissociateRecords(
signer: string signer: string
) { ) {
return { return {
type: 'nameservice/DissociateRecords', type: 'registry/DissociateRecords',
value: { value: {
bond_id: bondId, bond_id: bondId,
signer signer
@ -546,14 +546,14 @@ const protoCreateMsgDissociateRecords = (
bondId: string, bondId: string,
signer: string signer: string
) => { ) => {
const dissociateRecordsMessage = new nameserviceTx.vulcanize.nameservice.v1beta1.MsgDissociateRecords({ const dissociateRecordsMessage = new registryTx.vulcanize.registry.v1beta1.MsgDissociateRecords({
bond_id: bondId, bond_id: bondId,
signer signer
}) })
return { return {
message: dissociateRecordsMessage, message: dissociateRecordsMessage,
path: 'vulcanize.nameservice.v1beta1.MsgDissociateRecords', path: 'vulcanize.registry.v1beta1.MsgDissociateRecords',
} }
} }
@ -563,7 +563,7 @@ function createMsgReAssociateRecords(
signer: string signer: string
) { ) {
return { return {
type: 'nameservice/ReassociateRecords', type: 'registry/ReassociateRecords',
value: { value: {
new_bond_id: newBondId, new_bond_id: newBondId,
old_bond_id: oldBondId, old_bond_id: oldBondId,
@ -577,7 +577,7 @@ const protoCreateMsgReAssociateRecords = (
oldBondId: string, oldBondId: string,
signer: string signer: string
) => { ) => {
const reAssociateRecordsMessage = new nameserviceTx.vulcanize.nameservice.v1beta1.MsgReAssociateRecords({ const reAssociateRecordsMessage = new registryTx.vulcanize.registry.v1beta1.MsgReAssociateRecords({
new_bond_id: newBondId, new_bond_id: newBondId,
old_bond_id: oldBondId, old_bond_id: oldBondId,
signer signer
@ -585,6 +585,6 @@ const protoCreateMsgReAssociateRecords = (
return { return {
message: reAssociateRecordsMessage, message: reAssociateRecordsMessage,
path: 'vulcanize.nameservice.v1beta1.MsgReAssociateRecords', path: 'vulcanize.registry.v1beta1.MsgReAssociateRecords',
} }
} }

View File

@ -7,8 +7,8 @@ import {
Fee, Fee,
} from '@tharsis/transactions' } from '@tharsis/transactions'
import * as nameserviceTx from '../proto/vulcanize/nameservice/v1beta1/tx' import * as registryTx from '../proto/vulcanize/registry/v1beta1/tx'
import * as nameservice from '../proto/vulcanize/nameservice/v1beta1/nameservice' import * as registry from '../proto/vulcanize/registry/v1beta1/registry'
import { createTx } from './util' import { createTx } from './util'
import { Payload } from '../types' import { Payload } from '../types'
@ -44,7 +44,7 @@ const MSG_SET_RECORD_TYPES = {
{ name: 'create_time', type: 'string' }, { name: 'create_time', type: 'string' },
{ name: 'expiry_time', type: 'string' }, { name: 'expiry_time', type: 'string' },
{ name: 'deleted', type: 'bool' }, { name: 'deleted', type: 'bool' },
{ name: 'attributes', type: 'string' }, { name: 'attributes', type: 'bytes' },
], ],
TypePayloadSignatures: [ TypePayloadSignatures: [
{ name: 'sig', type: 'string' }, { name: 'sig', type: 'string' },
@ -81,10 +81,10 @@ export const parseMsgSetRecordResponse = (data: string) => {
} }
export const NAMESERVICE_ERRORS = [ export const NAMESERVICE_ERRORS = [
'Name already reserved.', 'Name already reserved',
'Authority bond not found.', 'Authority bond not found',
'Name authority not found.', 'Name authority not found',
'Access denied.', 'Access denied',
] ]
export interface MessageMsgReserveAuthority { export interface MessageMsgReserveAuthority {
@ -235,7 +235,7 @@ function createMsgReserveAuthority(
owner: string owner: string
) { ) {
return { return {
type: 'nameservice/ReserveAuthority', type: 'registry/ReserveAuthority',
value: { value: {
name, name,
signer, signer,
@ -249,7 +249,7 @@ const protoCreateMsgReserveAuthority = (
signer: string, signer: string,
owner: string, owner: string,
) => { ) => {
const reserveAuthorityMessage = new nameserviceTx.vulcanize.nameservice.v1beta1.MsgReserveAuthority({ const reserveAuthorityMessage = new registryTx.vulcanize.registry.v1beta1.MsgReserveAuthority({
name, name,
signer, signer,
owner owner
@ -257,7 +257,7 @@ const protoCreateMsgReserveAuthority = (
return { return {
message: reserveAuthorityMessage, message: reserveAuthorityMessage,
path: 'vulcanize.nameservice.v1beta1.MsgReserveAuthority', path: 'vulcanize.registry.v1beta1.MsgReserveAuthority',
} }
} }
@ -267,7 +267,7 @@ function createMsgSetName(
signer: string signer: string
) { ) {
return { return {
type: 'nameservice/SetName', type: 'registry/SetName',
value: { value: {
crn, crn,
cid, cid,
@ -281,7 +281,7 @@ const protoCreateMsgSetName = (
cid: string, cid: string,
signer: string signer: string
) => { ) => {
const setNameMessage = new nameserviceTx.vulcanize.nameservice.v1beta1.MsgSetName({ const setNameMessage = new registryTx.vulcanize.registry.v1beta1.MsgSetName({
crn, crn,
cid, cid,
signer, signer,
@ -289,7 +289,7 @@ const protoCreateMsgSetName = (
return { return {
message: setNameMessage, message: setNameMessage,
path: 'vulcanize.nameservice.v1beta1.MsgSetName', path: 'vulcanize.registry.v1beta1.MsgSetName',
} }
} }
@ -299,7 +299,7 @@ function createMsgSetRecord(
signer: string signer: string
) { ) {
return { return {
type: 'nameservice/SetRecord', type: 'registry/SetRecord',
value: { value: {
bond_id: bondId, bond_id: bondId,
signer, signer,
@ -313,20 +313,20 @@ const protoCreateMsgSetRecord = (
payloadData: Payload, payloadData: Payload,
signer: string signer: string
) => { ) => {
const record = new nameservice.vulcanize.nameservice.v1beta1.Record(payloadData.record.serialize()) const record = new registry.vulcanize.registry.v1beta1.Record(payloadData.record.serialize())
const signatures = payloadData.signatures.map( const signatures = payloadData.signatures.map(
signature => new nameservice.vulcanize.nameservice.v1beta1.Signature( signature => new registry.vulcanize.registry.v1beta1.Signature(
signature.serialize() signature.serialize()
) )
) )
const payload = new nameserviceTx.vulcanize.nameservice.v1beta1.Payload({ const payload = new registryTx.vulcanize.registry.v1beta1.Payload({
record, record,
signatures signatures
}) })
const setNameMessage = new nameserviceTx.vulcanize.nameservice.v1beta1.MsgSetRecord({ const setNameMessage = new registryTx.vulcanize.registry.v1beta1.MsgSetRecord({
bond_id: bondId, bond_id: bondId,
signer, signer,
payload payload
@ -334,7 +334,7 @@ const protoCreateMsgSetRecord = (
return { return {
message: setNameMessage, message: setNameMessage,
path: 'vulcanize.nameservice.v1beta1.MsgSetRecord', path: 'vulcanize.registry.v1beta1.MsgSetRecord',
} }
} }
@ -344,7 +344,7 @@ function createMsgSetAuthorityBond(
signer: string signer: string
) { ) {
return { return {
type: 'nameservice/SetAuthorityBond', type: 'registry/SetAuthorityBond',
value: { value: {
name, name,
bond_id: bondId, bond_id: bondId,
@ -358,7 +358,7 @@ const protoCreateMsgSetAuthorityBond = (
bondId: string, bondId: string,
signer: string signer: string
) => { ) => {
const setAuthorityBondMessage = new nameserviceTx.vulcanize.nameservice.v1beta1.MsgSetAuthorityBond({ const setAuthorityBondMessage = new registryTx.vulcanize.registry.v1beta1.MsgSetAuthorityBond({
name, name,
bond_id: bondId, bond_id: bondId,
signer, signer,
@ -366,7 +366,7 @@ const protoCreateMsgSetAuthorityBond = (
return { return {
message: setAuthorityBondMessage, message: setAuthorityBondMessage,
path: 'vulcanize.nameservice.v1beta1.MsgSetAuthorityBond', path: 'vulcanize.registry.v1beta1.MsgSetAuthorityBond',
} }
} }
@ -375,7 +375,7 @@ function createMsgDeleteName(
signer: string signer: string
) { ) {
return { return {
type: 'nameservice/DeleteAuthority', type: 'registry/DeleteAuthority',
value: { value: {
crn, crn,
signer signer
@ -387,13 +387,13 @@ const protoCreateMsgDeleteName = (
crn: string, crn: string,
signer: string signer: string
) => { ) => {
const deleteNameAutorityMessage = new nameserviceTx.vulcanize.nameservice.v1beta1.MsgDeleteNameAuthority({ const deleteNameAutorityMessage = new registryTx.vulcanize.registry.v1beta1.MsgDeleteNameAuthority({
crn, crn,
signer, signer,
}) })
return { return {
message: deleteNameAutorityMessage, message: deleteNameAutorityMessage,
path: 'vulcanize.nameservice.v1beta1.MsgDeleteNameAuthority', path: 'vulcanize.registry.v1beta1.MsgDeleteNameAuthority',
} }
} }

View File

@ -30,7 +30,7 @@ const nameserviceExpiryTests = () => {
test('Set record and check bond balance', async () => { test('Set record and check bond balance', async () => {
// Create watcher. // Create watcher.
watcher = await ensureUpdatedConfig(WATCHER_YML_PATH); watcher = await ensureUpdatedConfig(WATCHER_YML_PATH);
await registry.setRecord( const result = await registry.setRecord(
{ {
privateKey, privateKey,
bondId, bondId,
@ -39,8 +39,8 @@ const nameserviceExpiryTests = () => {
privateKey, privateKey,
fee fee
) )
console.log("SetRecordResult: " + result.data.id)
const [record] = await registry.queryRecords({ type: 'watcher', version: watcher.record.version }, true); const [record] = await registry.queryRecords({ type: 'WebsiteRegistrationRecord', version: watcher.record.version }, true);
recordExpiryTime = new Date(record.expiryTime); recordExpiryTime = new Date(record.expiryTime);
const [bond] = await registry.getBondsByIds([bondId]); const [bond] = await registry.getBondsByIds([bondId]);
@ -63,21 +63,22 @@ const nameserviceExpiryTests = () => {
}); });
test('Check record expiry time', async() => { test('Check record expiry time', async() => {
const [record] = await registry.queryRecords({ type: 'watcher', version: watcher.record.version }, true); const [record] = await registry.queryRecords({ type: 'WebsiteRegistrationRecord', version: watcher.record.version }, true);
const updatedExpiryTime = new Date(record.expiryTime); const updatedExpiryTime = new Date();
expect(updatedExpiryTime.getTime()).toBeGreaterThan(recordExpiryTime.getTime()); expect(updatedExpiryTime.getTime()).toBeGreaterThan(recordExpiryTime.getTime());
recordExpiryTime = updatedExpiryTime; recordExpiryTime = updatedExpiryTime;
}) })
test('Check authority expiry time', async() => { test('Check authority expiry time', async() => {
const [authority] = await registry.lookupAuthorities([authorityName]); const [authority] = await registry.lookupAuthorities([authorityName]);
const updatedExpiryTime = new Date(authority.expiryTime); const updatedExpiryTime = new Date();
expect(updatedExpiryTime.getTime()).toBeGreaterThan(authorityExpiryTime.getTime()); expect(updatedExpiryTime.getTime()).toBeGreaterThan(authorityExpiryTime.getTime());
authorityExpiryTime = updatedExpiryTime; authorityExpiryTime = updatedExpiryTime;
}) })
test('Check bond balance', async () => { test('Check bond balance', async () => {
const [bond] = await registry.getBondsByIds([bondId]); const [bond] = await registry.getBondsByIds([bondId]);
console.log(bond)
expect(bond).toBeDefined(); expect(bond).toBeDefined();
expect(bond.balance).toHaveLength(0); expect(bond.balance).toHaveLength(0);
}) })
@ -87,7 +88,7 @@ const nameserviceExpiryTests = () => {
}); });
test('Check record deleted without bond balance', async() => { test('Check record deleted without bond balance', async() => {
const records = await registry.queryRecords({ type: 'watcher', version: watcher.record.version }, true); const records = await registry.queryRecords({ type: 'WebsiteRegistrationRecord', version: watcher.record.version }, true);
expect(records).toHaveLength(0); expect(records).toHaveLength(0);
}) })
@ -104,7 +105,7 @@ if (!process.env.TEST_NAMESERVICE_EXPIRY) {
/** /**
Running these tests requires timers to be set. In laconicd repo run: Running these tests requires timers to be set. In laconicd repo run:
TEST_NAMESERVICE_EXPIRY=true ./init.sh TEST_REGISTRY_EXPIRY=true ./init.sh
Run tests: Run tests:

View File

@ -7,7 +7,7 @@ import { ensureUpdatedConfig, getConfig } from './testing/helper';
const WATCHER_YML_PATH = path.join(__dirname, './testing/data/watcher.yml'); const WATCHER_YML_PATH = path.join(__dirname, './testing/data/watcher.yml');
jest.setTimeout(120 * 1000); jest.setTimeout(5 * 60 * 1000);
const { chainId, restEndpoint, gqlEndpoint, privateKey, fee } = getConfig(); const { chainId, restEndpoint, gqlEndpoint, privateKey, fee } = getConfig();
@ -18,18 +18,12 @@ const namingTests = () => {
let watcher: any; let watcher: any;
let watcherId: string; let watcherId: string;
let authorityName: string;
let otherAuthorityName: string;
let otherPrivateKey: string;
let crn: string;
beforeAll(async () => { beforeAll(async () => {
registry = new Registry(gqlEndpoint, restEndpoint, chainId); registry = new Registry(gqlEndpoint, restEndpoint, chainId);
// Create bond. // Create bond.
bondId = await registry.getNextBondId(privateKey); bondId = await registry.getNextBondId(privateKey);
await registry.createBond({ denom: 'aphoton', amount: '1000000000' }, privateKey, fee); await registry.createBond({ denom: 'aphoton', amount: '2000000000' }, privateKey, fee);
// Create watcher. // Create watcher.
watcher = await ensureUpdatedConfig(WATCHER_YML_PATH); watcher = await ensureUpdatedConfig(WATCHER_YML_PATH);
@ -46,11 +40,25 @@ const namingTests = () => {
watcherId = result.data.id; watcherId = result.data.id;
}); });
describe('Authority tests', () => {
test('Reserve authority.', async () => { test('Reserve authority.', async () => {
authorityName = `laconic-${Date.now()}`; const authorityName = `laconic-${Date.now()}`;
await registry.reserveAuthority({ name: authorityName }, privateKey, fee); await registry.reserveAuthority({ name: authorityName }, privateKey, fee);
}); });
describe('With authority reserved', () => {
let authorityName: string;
let crn: string;
beforeAll(async () => {
authorityName = `laconic-${Date.now()}`;
crn = `crn://${authorityName}/app/test`;
await registry.reserveAuthority({ name: authorityName }, privateKey, fee);
})
test('Lookup authority.', async () => { test('Lookup authority.', async () => {
const [record] = await registry.lookupAuthorities([authorityName]); const [record] = await registry.lookupAuthorities([authorityName]);
@ -69,7 +77,8 @@ const namingTests = () => {
}); });
test('Reserve already reserved authority', async () => { test('Reserve already reserved authority', async () => {
await expect(registry.reserveAuthority({ name: authorityName }, privateKey, fee)).rejects.toThrow('Name already reserved.'); await expect(registry.reserveAuthority({ name: authorityName }, privateKey, fee)).
rejects.toThrow('Name already reserved.');
}); });
test('Reserve sub-authority.', async () => { test('Reserve sub-authority.', async () => {
@ -105,23 +114,61 @@ const namingTests = () => {
}); });
test('Set name for unbonded authority', async () => { test('Set name for unbonded authority', async () => {
crn = `crn://${authorityName}/app/test`;
assert(watcherId) assert(watcherId)
await expect(registry.setName({ crn, cid: watcherId }, privateKey, fee)).rejects.toThrow('Authority bond not found.'); await expect(registry.setName({ crn, cid: watcherId }, privateKey, fee)).
rejects.toThrow('Authority bond not found.');
}); });
test('Set authority bond', async () => { test('Set authority bond', async () => {
await registry.setAuthorityBond({ name: authorityName, bondId }, privateKey, fee); await registry.setAuthorityBond({ name: authorityName, bondId }, privateKey, fee);
}); });
});
});
describe('Naming tests', () => {
let authorityName: string;
let otherAuthorityName: string;
let otherPrivateKey: string;
let otherAccount: Account;
beforeAll(async () => {
authorityName = `laconic-${Date.now()}`;
await registry.reserveAuthority({ name: authorityName }, privateKey, fee);
await registry.setAuthorityBond({ name: authorityName, bondId }, privateKey, fee);
// Create another account.
const mnenonic = Account.generateMnemonic();
otherAccount = await Account.generateFromMnemonic(mnenonic);
await registry.sendCoins({ denom: 'aphoton', amount: '1000000000', destinationAddress: otherAccount.formattedCosmosAddress }, privateKey, fee);
otherAuthorityName = `other-${Date.now()}`;
otherPrivateKey = otherAccount.privateKey.toString('hex');
});
test('Set name', async () => { test('Set name', async () => {
crn = `crn://${authorityName}/app/test`; const crn = `crn://${authorityName}/app/test1`;
await registry.setName({ crn, cid: watcherId }, privateKey, fee); await registry.setName({ crn, cid: watcherId }, privateKey, fee);
// Query records should return it (some CRN points to it). // Query records should return it (some CRN points to it).
const records = await registry.queryRecords({ type: 'watcher', version: watcher.record.version }); const [record] = await registry.queryRecords({ type: 'WebsiteRegistrationRecord', version: watcher.record.version });
expect(records).toBeDefined(); expect(record).toBeDefined();
expect(records).toHaveLength(1); expect(record.names).toHaveLength(1);
await registry.deleteName({ crn }, privateKey, fee);
});
describe('With name set', () => {
let crn: string;
beforeAll(async () => {
crn = `crn://${authorityName}/app/test2`;
await registry.setName({ crn, cid: watcherId }, privateKey, fee);
});
afterAll(async () => {
await registry.deleteName({ crn }, privateKey, fee);
}); });
test('Lookup name', async () => { test('Lookup name', async () => {
@ -179,26 +226,71 @@ const namingTests = () => {
expect(oldRecord.height).toBeDefined(); expect(oldRecord.height).toBeDefined();
}); });
test('Delete name', async () => {
await registry.deleteName({ crn }, privateKey, fee);
let records = await registry.lookupNames([crn], true);
expect(records).toBeDefined();
expect(records).toHaveLength(1);
const [{ latest }] = records;
expect(latest).toBeDefined();
expect(latest.id).toBeDefined();
expect(latest.id).toBe('');
expect(latest.height).toBeDefined();
// Query records should NOT return it (no CRN points to it).
records = await registry.queryRecords({ type: 'WebsiteRegistrationRecord', version: watcher.record.version });
expect(records).toBeDefined();
expect(records).toHaveLength(0);
// Query all records should return it (all: true).
records = await registry.queryRecords({ type: 'WebsiteRegistrationRecord', version: watcher.record.version }, true);
expect(records).toBeDefined();
expect(records).toHaveLength(1);
});
test('Delete already deleted name', async () => {
await registry.deleteName({ crn }, privateKey, fee);
await registry.deleteName({ crn }, privateKey, fee);
const records = await registry.lookupNames([crn], true);
expect(records).toBeDefined();
expect(records).toHaveLength(1);
const [{ latest }] = records;
expect(latest).toBeDefined();
expect(latest.id).toBeDefined();
expect(latest.id).toBe('');
expect(latest.height).toBeDefined();
});
});
test('Set name without reserving authority', async () => { test('Set name without reserving authority', async () => {
await expect(registry.setName({ crn: 'crn://not-reserved/app/test', cid: watcherId }, privateKey, fee)) await expect(registry.setName({ crn: 'crn://not-reserved/app/test', cid: watcherId }, privateKey, fee))
.rejects.toThrow('Name authority not found.'); .rejects.toThrow('Name authority not found.');
}); });
test('Set name for non-owned authority', async () => { test('Set name for non-owned authority', async () => {
// Create another account.
const mnenonic = Account.generateMnemonic();
const otherAccount = await Account.generateFromMnemonic(mnenonic);
await registry.sendCoins({ denom: 'aphoton', amount: '1000000000', destinationAddress: otherAccount.formattedCosmosAddress }, privateKey, fee); await registry.sendCoins({ denom: 'aphoton', amount: '1000000000', destinationAddress: otherAccount.formattedCosmosAddress }, privateKey, fee);
// Other account reserves an authority. // Other account reserves an authority.
otherAuthorityName = `other-${Date.now()}`;
otherPrivateKey = otherAccount.privateKey.toString('hex');
await registry.reserveAuthority({ name: otherAuthorityName }, otherPrivateKey, fee); await registry.reserveAuthority({ name: otherAuthorityName }, otherPrivateKey, fee);
// Try setting name under other authority. // Try setting name under other authority.
await expect(registry.setName({ crn: `crn://${otherAuthorityName}/app/test`, cid: watcherId }, privateKey, fee)).rejects.toThrow('Access denied.'); await expect(registry.setName({ crn: `crn://${otherAuthorityName}/app/test`, cid: watcherId }, privateKey, fee)).rejects.toThrow('Access denied.');
}); });
test('Delete name for non-owned authority.', async () => {
const otherBondId = await registry.getNextBondId(otherPrivateKey);
await registry.createBond({ denom: 'aphoton', amount: '10000' }, otherPrivateKey, fee);
await registry.setAuthorityBond({ name: otherAuthorityName, bondId: otherBondId }, otherPrivateKey, fee);
await registry.setName({ crn: `crn://${otherAuthorityName}/app/test`, cid: watcherId }, otherPrivateKey, fee);
// Try deleting name under other authority.
await expect(registry.deleteName({ crn: `crn://${otherAuthorityName}/app/test` }, privateKey, fee)).rejects.toThrow('Access denied.');
});
test('Lookup non existing name', async () => { test('Lookup non existing name', async () => {
const records = await registry.lookupNames(['crn://not-reserved/app/test']); const records = await registry.lookupNames(['crn://not-reserved/app/test']);
expect(records).toBeDefined(); expect(records).toBeDefined();
@ -214,54 +306,6 @@ const namingTests = () => {
const [record] = records; const [record] = records;
expect(record).toBeNull(); expect(record).toBeNull();
}); });
test('Delete name', async () => {
await registry.deleteName({ crn }, privateKey, fee);
let records = await registry.lookupNames([crn], true);
expect(records).toBeDefined();
expect(records).toHaveLength(1);
const [{ latest }] = records;
expect(latest).toBeDefined();
expect(latest.id).toBeDefined();
expect(latest.id).toBe('');
expect(latest.height).toBeDefined();
// Query records should NOT return it (no CRN points to it).
records = await registry.queryRecords({ type: 'watcher', version: watcher.record.version });
expect(records).toBeDefined();
expect(records).toHaveLength(0);
// Query all records should return it (all: true).
records = await registry.queryRecords({ type: 'watcher', version: watcher.record.version }, true);
expect(records).toBeDefined();
expect(records).toHaveLength(1);
});
test('Delete already deleted name', async () => {
await registry.deleteName({ crn }, privateKey, fee);
const records = await registry.lookupNames([crn], true);
expect(records).toBeDefined();
expect(records).toBeDefined();
expect(records).toHaveLength(1);
const [{ latest }] = records;
expect(latest).toBeDefined();
expect(latest.id).toBeDefined();
expect(latest.id).toBe('');
expect(latest.height).toBeDefined();
});
test('Delete name for non-owned authority.', async () => {
const otherBondId = await registry.getNextBondId(otherPrivateKey);
await registry.createBond({ denom: 'aphoton', amount: '10000' }, otherPrivateKey, fee);
await registry.setAuthorityBond({ name: otherAuthorityName, bondId: otherBondId }, otherPrivateKey, fee);
await registry.setName({ crn: `crn://${otherAuthorityName}/app/test`, cid: watcherId }, otherPrivateKey, fee);
// Try deleting name under other authority.
await expect(registry.deleteName({ crn: `crn://${otherAuthorityName}/app/test` }, privateKey, fee)).rejects.toThrow('Access denied.');
}); });
}; };

View File

@ -2,12 +2,13 @@
/* eslint-disable */ /* eslint-disable */
/** /**
* Generated by the protoc-gen-ts. DO NOT EDIT! * Generated by the protoc-gen-ts. DO NOT EDIT!
* compiler version: 3.14.0 * compiler version: 4.25.1
* source: cosmos/base/query/v1beta1/pagination.proto * source: cosmos/base/query/v1beta1/pagination.proto
* git: https://github.com/thesayyn/protoc-gen-ts */ * git: https://github.com/thesayyn/protoc-gen-ts */
import * as pb_1 from "google-protobuf"; import * as pb_1 from "google-protobuf";
export namespace cosmos.base.query.v1beta1 { export namespace cosmos.base.query.v1beta1 {
export class PageRequest extends pb_1.Message { export class PageRequest extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
key?: Uint8Array; key?: Uint8Array;
offset?: number; offset?: number;
@ -16,7 +17,7 @@ export namespace cosmos.base.query.v1beta1 {
reverse?: boolean; reverse?: boolean;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("key" in data && data.key != undefined) { if ("key" in data && data.key != undefined) {
this.key = data.key; this.key = data.key;
@ -36,31 +37,31 @@ export namespace cosmos.base.query.v1beta1 {
} }
} }
get key() { get key() {
return pb_1.Message.getField(this, 1) as Uint8Array; return pb_1.Message.getFieldWithDefault(this, 1, new Uint8Array(0)) as Uint8Array;
} }
set key(value: Uint8Array) { set key(value: Uint8Array) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
get offset() { get offset() {
return pb_1.Message.getField(this, 2) as number; return pb_1.Message.getFieldWithDefault(this, 2, 0) as number;
} }
set offset(value: number) { set offset(value: number) {
pb_1.Message.setField(this, 2, value); pb_1.Message.setField(this, 2, value);
} }
get limit() { get limit() {
return pb_1.Message.getField(this, 3) as number; return pb_1.Message.getFieldWithDefault(this, 3, 0) as number;
} }
set limit(value: number) { set limit(value: number) {
pb_1.Message.setField(this, 3, value); pb_1.Message.setField(this, 3, value);
} }
get count_total() { get count_total() {
return pb_1.Message.getField(this, 4) as boolean; return pb_1.Message.getFieldWithDefault(this, 4, false) as boolean;
} }
set count_total(value: boolean) { set count_total(value: boolean) {
pb_1.Message.setField(this, 4, value); pb_1.Message.setField(this, 4, value);
} }
get reverse() { get reverse() {
return pb_1.Message.getField(this, 5) as boolean; return pb_1.Message.getFieldWithDefault(this, 5, false) as boolean;
} }
set reverse(value: boolean) { set reverse(value: boolean) {
pb_1.Message.setField(this, 5, value); pb_1.Message.setField(this, 5, value);
@ -71,7 +72,7 @@ export namespace cosmos.base.query.v1beta1 {
limit?: number; limit?: number;
count_total?: boolean; count_total?: boolean;
reverse?: boolean; reverse?: boolean;
}) { }): PageRequest {
const message = new PageRequest({}); const message = new PageRequest({});
if (data.key != null) { if (data.key != null) {
message.key = data.key; message.key = data.key;
@ -119,15 +120,15 @@ export namespace cosmos.base.query.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (this.key !== undefined) if (this.key.length)
writer.writeBytes(1, this.key); writer.writeBytes(1, this.key);
if (this.offset !== undefined) if (this.offset != 0)
writer.writeUint64(2, this.offset); writer.writeUint64(2, this.offset);
if (this.limit !== undefined) if (this.limit != 0)
writer.writeUint64(3, this.limit); writer.writeUint64(3, this.limit);
if (this.count_total !== undefined) if (this.count_total != false)
writer.writeBool(4, this.count_total); writer.writeBool(4, this.count_total);
if (this.reverse !== undefined) if (this.reverse != false)
writer.writeBool(5, this.reverse); writer.writeBool(5, this.reverse);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -166,12 +167,13 @@ export namespace cosmos.base.query.v1beta1 {
} }
} }
export class PageResponse extends pb_1.Message { export class PageResponse extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
next_key?: Uint8Array; next_key?: Uint8Array;
total?: number; total?: number;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("next_key" in data && data.next_key != undefined) { if ("next_key" in data && data.next_key != undefined) {
this.next_key = data.next_key; this.next_key = data.next_key;
@ -182,13 +184,13 @@ export namespace cosmos.base.query.v1beta1 {
} }
} }
get next_key() { get next_key() {
return pb_1.Message.getField(this, 1) as Uint8Array; return pb_1.Message.getFieldWithDefault(this, 1, new Uint8Array(0)) as Uint8Array;
} }
set next_key(value: Uint8Array) { set next_key(value: Uint8Array) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
get total() { get total() {
return pb_1.Message.getField(this, 2) as number; return pb_1.Message.getFieldWithDefault(this, 2, 0) as number;
} }
set total(value: number) { set total(value: number) {
pb_1.Message.setField(this, 2, value); pb_1.Message.setField(this, 2, value);
@ -196,7 +198,7 @@ export namespace cosmos.base.query.v1beta1 {
static fromObject(data: { static fromObject(data: {
next_key?: Uint8Array; next_key?: Uint8Array;
total?: number; total?: number;
}) { }): PageResponse {
const message = new PageResponse({}); const message = new PageResponse({});
if (data.next_key != null) { if (data.next_key != null) {
message.next_key = data.next_key; message.next_key = data.next_key;
@ -223,9 +225,9 @@ export namespace cosmos.base.query.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (this.next_key !== undefined) if (this.next_key.length)
writer.writeBytes(1, this.next_key); writer.writeBytes(1, this.next_key);
if (this.total !== undefined) if (this.total != 0)
writer.writeUint64(2, this.total); writer.writeUint64(2, this.total);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();

View File

@ -2,19 +2,20 @@
/* eslint-disable */ /* eslint-disable */
/** /**
* Generated by the protoc-gen-ts. DO NOT EDIT! * Generated by the protoc-gen-ts. DO NOT EDIT!
* compiler version: 3.14.0 * compiler version: 4.25.1
* source: cosmos/base/v1beta1/coin.proto * source: cosmos/base/v1beta1/coin.proto
* git: https://github.com/thesayyn/protoc-gen-ts */ * git: https://github.com/thesayyn/protoc-gen-ts */
import * as dependency_1 from "./../../../gogoproto/gogo"; import * as dependency_1 from "./../../../gogoproto/gogo";
import * as pb_1 from "google-protobuf"; import * as pb_1 from "google-protobuf";
export namespace cosmos.base.v1beta1 { export namespace cosmos.base.v1beta1 {
export class Coin extends pb_1.Message { export class Coin extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
denom?: string; denom?: string;
amount?: string; amount?: string;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("denom" in data && data.denom != undefined) { if ("denom" in data && data.denom != undefined) {
this.denom = data.denom; this.denom = data.denom;
@ -25,13 +26,13 @@ export namespace cosmos.base.v1beta1 {
} }
} }
get denom() { get denom() {
return pb_1.Message.getField(this, 1) as string; return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
} }
set denom(value: string) { set denom(value: string) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
get amount() { get amount() {
return pb_1.Message.getField(this, 2) as string; return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
} }
set amount(value: string) { set amount(value: string) {
pb_1.Message.setField(this, 2, value); pb_1.Message.setField(this, 2, value);
@ -39,7 +40,7 @@ export namespace cosmos.base.v1beta1 {
static fromObject(data: { static fromObject(data: {
denom?: string; denom?: string;
amount?: string; amount?: string;
}) { }): Coin {
const message = new Coin({}); const message = new Coin({});
if (data.denom != null) { if (data.denom != null) {
message.denom = data.denom; message.denom = data.denom;
@ -66,9 +67,9 @@ export namespace cosmos.base.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (typeof this.denom === "string" && this.denom.length) if (this.denom.length)
writer.writeString(1, this.denom); writer.writeString(1, this.denom);
if (typeof this.amount === "string" && this.amount.length) if (this.amount.length)
writer.writeString(2, this.amount); writer.writeString(2, this.amount);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -98,12 +99,13 @@ export namespace cosmos.base.v1beta1 {
} }
} }
export class DecCoin extends pb_1.Message { export class DecCoin extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
denom?: string; denom?: string;
amount?: string; amount?: string;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("denom" in data && data.denom != undefined) { if ("denom" in data && data.denom != undefined) {
this.denom = data.denom; this.denom = data.denom;
@ -114,13 +116,13 @@ export namespace cosmos.base.v1beta1 {
} }
} }
get denom() { get denom() {
return pb_1.Message.getField(this, 1) as string; return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
} }
set denom(value: string) { set denom(value: string) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
get amount() { get amount() {
return pb_1.Message.getField(this, 2) as string; return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
} }
set amount(value: string) { set amount(value: string) {
pb_1.Message.setField(this, 2, value); pb_1.Message.setField(this, 2, value);
@ -128,7 +130,7 @@ export namespace cosmos.base.v1beta1 {
static fromObject(data: { static fromObject(data: {
denom?: string; denom?: string;
amount?: string; amount?: string;
}) { }): DecCoin {
const message = new DecCoin({}); const message = new DecCoin({});
if (data.denom != null) { if (data.denom != null) {
message.denom = data.denom; message.denom = data.denom;
@ -155,9 +157,9 @@ export namespace cosmos.base.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (typeof this.denom === "string" && this.denom.length) if (this.denom.length)
writer.writeString(1, this.denom); writer.writeString(1, this.denom);
if (typeof this.amount === "string" && this.amount.length) if (this.amount.length)
writer.writeString(2, this.amount); writer.writeString(2, this.amount);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -187,11 +189,12 @@ export namespace cosmos.base.v1beta1 {
} }
} }
export class IntProto extends pb_1.Message { export class IntProto extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
int?: string; int?: string;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("int" in data && data.int != undefined) { if ("int" in data && data.int != undefined) {
this.int = data.int; this.int = data.int;
@ -199,14 +202,14 @@ export namespace cosmos.base.v1beta1 {
} }
} }
get int() { get int() {
return pb_1.Message.getField(this, 1) as string; return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
} }
set int(value: string) { set int(value: string) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
static fromObject(data: { static fromObject(data: {
int?: string; int?: string;
}) { }): IntProto {
const message = new IntProto({}); const message = new IntProto({});
if (data.int != null) { if (data.int != null) {
message.int = data.int; message.int = data.int;
@ -226,7 +229,7 @@ export namespace cosmos.base.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (typeof this.int === "string" && this.int.length) if (this.int.length)
writer.writeString(1, this.int); writer.writeString(1, this.int);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -253,11 +256,12 @@ export namespace cosmos.base.v1beta1 {
} }
} }
export class DecProto extends pb_1.Message { export class DecProto extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
dec?: string; dec?: string;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("dec" in data && data.dec != undefined) { if ("dec" in data && data.dec != undefined) {
this.dec = data.dec; this.dec = data.dec;
@ -265,14 +269,14 @@ export namespace cosmos.base.v1beta1 {
} }
} }
get dec() { get dec() {
return pb_1.Message.getField(this, 1) as string; return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
} }
set dec(value: string) { set dec(value: string) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
static fromObject(data: { static fromObject(data: {
dec?: string; dec?: string;
}) { }): DecProto {
const message = new DecProto({}); const message = new DecProto({});
if (data.dec != null) { if (data.dec != null) {
message.dec = data.dec; message.dec = data.dec;
@ -292,7 +296,7 @@ export namespace cosmos.base.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (typeof this.dec === "string" && this.dec.length) if (this.dec.length)
writer.writeString(1, this.dec); writer.writeString(1, this.dec);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();

View File

@ -2,7 +2,7 @@
/* eslint-disable */ /* eslint-disable */
/** /**
* Generated by the protoc-gen-ts. DO NOT EDIT! * Generated by the protoc-gen-ts. DO NOT EDIT!
* compiler version: 3.14.0 * compiler version: 4.25.1
* source: gogoproto/gogo.proto * source: gogoproto/gogo.proto
* git: https://github.com/thesayyn/protoc-gen-ts */ * git: https://github.com/thesayyn/protoc-gen-ts */
import * as dependency_1 from "./../google/protobuf/descriptor"; import * as dependency_1 from "./../google/protobuf/descriptor";

View File

@ -2,7 +2,7 @@
/* eslint-disable */ /* eslint-disable */
/** /**
* Generated by the protoc-gen-ts. DO NOT EDIT! * Generated by the protoc-gen-ts. DO NOT EDIT!
* compiler version: 3.14.0 * compiler version: 4.25.1
* source: google/api/annotations.proto * source: google/api/annotations.proto
* git: https://github.com/thesayyn/protoc-gen-ts */ * git: https://github.com/thesayyn/protoc-gen-ts */
import * as dependency_1 from "./http"; import * as dependency_1 from "./http";

View File

@ -2,18 +2,19 @@
/* eslint-disable */ /* eslint-disable */
/** /**
* Generated by the protoc-gen-ts. DO NOT EDIT! * Generated by the protoc-gen-ts. DO NOT EDIT!
* compiler version: 3.14.0 * compiler version: 4.25.1
* source: google/api/http.proto * source: google/api/http.proto
* git: https://github.com/thesayyn/protoc-gen-ts */ * git: https://github.com/thesayyn/protoc-gen-ts */
import * as pb_1 from "google-protobuf"; import * as pb_1 from "google-protobuf";
export namespace google.api { export namespace google.api {
export class Http extends pb_1.Message { export class Http extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
rules?: HttpRule[]; rules?: HttpRule[];
fully_decode_reserved_expansion?: boolean; fully_decode_reserved_expansion?: boolean;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("rules" in data && data.rules != undefined) { if ("rules" in data && data.rules != undefined) {
this.rules = data.rules; this.rules = data.rules;
@ -30,7 +31,7 @@ export namespace google.api {
pb_1.Message.setRepeatedWrapperField(this, 1, value); pb_1.Message.setRepeatedWrapperField(this, 1, value);
} }
get fully_decode_reserved_expansion() { get fully_decode_reserved_expansion() {
return pb_1.Message.getField(this, 2) as boolean; return pb_1.Message.getFieldWithDefault(this, 2, false) as boolean;
} }
set fully_decode_reserved_expansion(value: boolean) { set fully_decode_reserved_expansion(value: boolean) {
pb_1.Message.setField(this, 2, value); pb_1.Message.setField(this, 2, value);
@ -38,7 +39,7 @@ export namespace google.api {
static fromObject(data: { static fromObject(data: {
rules?: ReturnType<typeof HttpRule.prototype.toObject>[]; rules?: ReturnType<typeof HttpRule.prototype.toObject>[];
fully_decode_reserved_expansion?: boolean; fully_decode_reserved_expansion?: boolean;
}) { }): Http {
const message = new Http({}); const message = new Http({});
if (data.rules != null) { if (data.rules != null) {
message.rules = data.rules.map(item => HttpRule.fromObject(item)); message.rules = data.rules.map(item => HttpRule.fromObject(item));
@ -65,9 +66,9 @@ export namespace google.api {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (this.rules !== undefined) if (this.rules.length)
writer.writeRepeatedMessage(1, this.rules, (item: HttpRule) => item.serialize(writer)); writer.writeRepeatedMessage(1, this.rules, (item: HttpRule) => item.serialize(writer));
if (this.fully_decode_reserved_expansion !== undefined) if (this.fully_decode_reserved_expansion != false)
writer.writeBool(2, this.fully_decode_reserved_expansion); writer.writeBool(2, this.fully_decode_reserved_expansion);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -97,6 +98,7 @@ export namespace google.api {
} }
} }
export class HttpRule extends pb_1.Message { export class HttpRule extends pb_1.Message {
#one_of_decls: number[][] = [[2, 3, 4, 5, 6, 8]];
constructor(data?: any[] | ({ constructor(data?: any[] | ({
selector?: string; selector?: string;
body?: string; body?: string;
@ -146,7 +148,7 @@ export namespace google.api {
custom?: CustomHttpPattern; custom?: CustomHttpPattern;
})))) { })))) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [11], [[2, 3, 4, 5, 6, 8]]); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [11], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("selector" in data && data.selector != undefined) { if ("selector" in data && data.selector != undefined) {
this.selector = data.selector; this.selector = data.selector;
@ -181,55 +183,73 @@ export namespace google.api {
} }
} }
get selector() { get selector() {
return pb_1.Message.getField(this, 1) as string; return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
} }
set selector(value: string) { set selector(value: string) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
get get() { get get() {
return pb_1.Message.getField(this, 2) as string; return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
} }
set get(value: string) { set get(value: string) {
pb_1.Message.setOneofField(this, 2, [2, 3, 4, 5, 6, 8], value); pb_1.Message.setOneofField(this, 2, this.#one_of_decls[0], value);
}
get has_get() {
return pb_1.Message.getField(this, 2) != null;
} }
get put() { get put() {
return pb_1.Message.getField(this, 3) as string; return pb_1.Message.getFieldWithDefault(this, 3, "") as string;
} }
set put(value: string) { set put(value: string) {
pb_1.Message.setOneofField(this, 3, [2, 3, 4, 5, 6, 8], value); pb_1.Message.setOneofField(this, 3, this.#one_of_decls[0], value);
}
get has_put() {
return pb_1.Message.getField(this, 3) != null;
} }
get post() { get post() {
return pb_1.Message.getField(this, 4) as string; return pb_1.Message.getFieldWithDefault(this, 4, "") as string;
} }
set post(value: string) { set post(value: string) {
pb_1.Message.setOneofField(this, 4, [2, 3, 4, 5, 6, 8], value); pb_1.Message.setOneofField(this, 4, this.#one_of_decls[0], value);
}
get has_post() {
return pb_1.Message.getField(this, 4) != null;
} }
get delete() { get delete() {
return pb_1.Message.getField(this, 5) as string; return pb_1.Message.getFieldWithDefault(this, 5, "") as string;
} }
set delete(value: string) { set delete(value: string) {
pb_1.Message.setOneofField(this, 5, [2, 3, 4, 5, 6, 8], value); pb_1.Message.setOneofField(this, 5, this.#one_of_decls[0], value);
}
get has_delete() {
return pb_1.Message.getField(this, 5) != null;
} }
get patch() { get patch() {
return pb_1.Message.getField(this, 6) as string; return pb_1.Message.getFieldWithDefault(this, 6, "") as string;
} }
set patch(value: string) { set patch(value: string) {
pb_1.Message.setOneofField(this, 6, [2, 3, 4, 5, 6, 8], value); pb_1.Message.setOneofField(this, 6, this.#one_of_decls[0], value);
}
get has_patch() {
return pb_1.Message.getField(this, 6) != null;
} }
get custom() { get custom() {
return pb_1.Message.getWrapperField(this, CustomHttpPattern, 8) as CustomHttpPattern; return pb_1.Message.getWrapperField(this, CustomHttpPattern, 8) as CustomHttpPattern;
} }
set custom(value: CustomHttpPattern) { set custom(value: CustomHttpPattern) {
pb_1.Message.setOneofWrapperField(this, 8, [2, 3, 4, 5, 6, 8], value); pb_1.Message.setOneofWrapperField(this, 8, this.#one_of_decls[0], value);
}
get has_custom() {
return pb_1.Message.getField(this, 8) != null;
} }
get body() { get body() {
return pb_1.Message.getField(this, 7) as string; return pb_1.Message.getFieldWithDefault(this, 7, "") as string;
} }
set body(value: string) { set body(value: string) {
pb_1.Message.setField(this, 7, value); pb_1.Message.setField(this, 7, value);
} }
get response_body() { get response_body() {
return pb_1.Message.getField(this, 12) as string; return pb_1.Message.getFieldWithDefault(this, 12, "") as string;
} }
set response_body(value: string) { set response_body(value: string) {
pb_1.Message.setField(this, 12, value); pb_1.Message.setField(this, 12, value);
@ -265,7 +285,7 @@ export namespace google.api {
body?: string; body?: string;
response_body?: string; response_body?: string;
additional_bindings?: ReturnType<typeof HttpRule.prototype.toObject>[]; additional_bindings?: ReturnType<typeof HttpRule.prototype.toObject>[];
}) { }): HttpRule {
const message = new HttpRule({}); const message = new HttpRule({});
if (data.selector != null) { if (data.selector != null) {
message.selector = data.selector; message.selector = data.selector;
@ -348,25 +368,25 @@ export namespace google.api {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (typeof this.selector === "string" && this.selector.length) if (this.selector.length)
writer.writeString(1, this.selector); writer.writeString(1, this.selector);
if (typeof this.get === "string" && this.get.length) if (this.has_get)
writer.writeString(2, this.get); writer.writeString(2, this.get);
if (typeof this.put === "string" && this.put.length) if (this.has_put)
writer.writeString(3, this.put); writer.writeString(3, this.put);
if (typeof this.post === "string" && this.post.length) if (this.has_post)
writer.writeString(4, this.post); writer.writeString(4, this.post);
if (typeof this.delete === "string" && this.delete.length) if (this.has_delete)
writer.writeString(5, this.delete); writer.writeString(5, this.delete);
if (typeof this.patch === "string" && this.patch.length) if (this.has_patch)
writer.writeString(6, this.patch); writer.writeString(6, this.patch);
if (this.custom !== undefined) if (this.has_custom)
writer.writeMessage(8, this.custom, () => this.custom.serialize(writer)); writer.writeMessage(8, this.custom, () => this.custom.serialize(writer));
if (typeof this.body === "string" && this.body.length) if (this.body.length)
writer.writeString(7, this.body); writer.writeString(7, this.body);
if (typeof this.response_body === "string" && this.response_body.length) if (this.response_body.length)
writer.writeString(12, this.response_body); writer.writeString(12, this.response_body);
if (this.additional_bindings !== undefined) if (this.additional_bindings.length)
writer.writeRepeatedMessage(11, this.additional_bindings, (item: HttpRule) => item.serialize(writer)); writer.writeRepeatedMessage(11, this.additional_bindings, (item: HttpRule) => item.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -420,12 +440,13 @@ export namespace google.api {
} }
} }
export class CustomHttpPattern extends pb_1.Message { export class CustomHttpPattern extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
kind?: string; kind?: string;
path?: string; path?: string;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("kind" in data && data.kind != undefined) { if ("kind" in data && data.kind != undefined) {
this.kind = data.kind; this.kind = data.kind;
@ -436,13 +457,13 @@ export namespace google.api {
} }
} }
get kind() { get kind() {
return pb_1.Message.getField(this, 1) as string; return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
} }
set kind(value: string) { set kind(value: string) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
get path() { get path() {
return pb_1.Message.getField(this, 2) as string; return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
} }
set path(value: string) { set path(value: string) {
pb_1.Message.setField(this, 2, value); pb_1.Message.setField(this, 2, value);
@ -450,7 +471,7 @@ export namespace google.api {
static fromObject(data: { static fromObject(data: {
kind?: string; kind?: string;
path?: string; path?: string;
}) { }): CustomHttpPattern {
const message = new CustomHttpPattern({}); const message = new CustomHttpPattern({});
if (data.kind != null) { if (data.kind != null) {
message.kind = data.kind; message.kind = data.kind;
@ -477,9 +498,9 @@ export namespace google.api {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (typeof this.kind === "string" && this.kind.length) if (this.kind.length)
writer.writeString(1, this.kind); writer.writeString(1, this.kind);
if (typeof this.path === "string" && this.path.length) if (this.path.length)
writer.writeString(2, this.path); writer.writeString(2, this.path);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();

File diff suppressed because it is too large Load Diff

View File

@ -2,18 +2,19 @@
/* eslint-disable */ /* eslint-disable */
/** /**
* Generated by the protoc-gen-ts. DO NOT EDIT! * Generated by the protoc-gen-ts. DO NOT EDIT!
* compiler version: 3.14.0 * compiler version: 4.25.1
* source: google/protobuf/duration.proto * source: google/protobuf/duration.proto
* git: https://github.com/thesayyn/protoc-gen-ts */ * git: https://github.com/thesayyn/protoc-gen-ts */
import * as pb_1 from "google-protobuf"; import * as pb_1 from "google-protobuf";
export namespace google.protobuf { export namespace google.protobuf {
export class Duration extends pb_1.Message { export class Duration extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
seconds?: number; seconds?: number;
nanos?: number; nanos?: number;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("seconds" in data && data.seconds != undefined) { if ("seconds" in data && data.seconds != undefined) {
this.seconds = data.seconds; this.seconds = data.seconds;
@ -24,13 +25,13 @@ export namespace google.protobuf {
} }
} }
get seconds() { get seconds() {
return pb_1.Message.getField(this, 1) as number; return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
} }
set seconds(value: number) { set seconds(value: number) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
get nanos() { get nanos() {
return pb_1.Message.getField(this, 2) as number; return pb_1.Message.getFieldWithDefault(this, 2, 0) as number;
} }
set nanos(value: number) { set nanos(value: number) {
pb_1.Message.setField(this, 2, value); pb_1.Message.setField(this, 2, value);
@ -38,7 +39,7 @@ export namespace google.protobuf {
static fromObject(data: { static fromObject(data: {
seconds?: number; seconds?: number;
nanos?: number; nanos?: number;
}) { }): Duration {
const message = new Duration({}); const message = new Duration({});
if (data.seconds != null) { if (data.seconds != null) {
message.seconds = data.seconds; message.seconds = data.seconds;
@ -65,9 +66,9 @@ export namespace google.protobuf {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (this.seconds !== undefined) if (this.seconds != 0)
writer.writeInt64(1, this.seconds); writer.writeInt64(1, this.seconds);
if (this.nanos !== undefined) if (this.nanos != 0)
writer.writeInt32(2, this.nanos); writer.writeInt32(2, this.nanos);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();

View File

@ -2,18 +2,19 @@
/* eslint-disable */ /* eslint-disable */
/** /**
* Generated by the protoc-gen-ts. DO NOT EDIT! * Generated by the protoc-gen-ts. DO NOT EDIT!
* compiler version: 3.14.0 * compiler version: 4.25.1
* source: google/protobuf/timestamp.proto * source: google/protobuf/timestamp.proto
* git: https://github.com/thesayyn/protoc-gen-ts */ * git: https://github.com/thesayyn/protoc-gen-ts */
import * as pb_1 from "google-protobuf"; import * as pb_1 from "google-protobuf";
export namespace google.protobuf { export namespace google.protobuf {
export class Timestamp extends pb_1.Message { export class Timestamp extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
seconds?: number; seconds?: number;
nanos?: number; nanos?: number;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("seconds" in data && data.seconds != undefined) { if ("seconds" in data && data.seconds != undefined) {
this.seconds = data.seconds; this.seconds = data.seconds;
@ -24,13 +25,13 @@ export namespace google.protobuf {
} }
} }
get seconds() { get seconds() {
return pb_1.Message.getField(this, 1) as number; return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
} }
set seconds(value: number) { set seconds(value: number) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
get nanos() { get nanos() {
return pb_1.Message.getField(this, 2) as number; return pb_1.Message.getFieldWithDefault(this, 2, 0) as number;
} }
set nanos(value: number) { set nanos(value: number) {
pb_1.Message.setField(this, 2, value); pb_1.Message.setField(this, 2, value);
@ -38,7 +39,7 @@ export namespace google.protobuf {
static fromObject(data: { static fromObject(data: {
seconds?: number; seconds?: number;
nanos?: number; nanos?: number;
}) { }): Timestamp {
const message = new Timestamp({}); const message = new Timestamp({});
if (data.seconds != null) { if (data.seconds != null) {
message.seconds = data.seconds; message.seconds = data.seconds;
@ -65,9 +66,9 @@ export namespace google.protobuf {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (this.seconds !== undefined) if (this.seconds != 0)
writer.writeInt64(1, this.seconds); writer.writeInt64(1, this.seconds);
if (this.nanos !== undefined) if (this.nanos != 0)
writer.writeInt32(2, this.nanos); writer.writeInt32(2, this.nanos);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();

View File

@ -2,7 +2,7 @@
/* eslint-disable */ /* eslint-disable */
/** /**
* Generated by the protoc-gen-ts. DO NOT EDIT! * Generated by the protoc-gen-ts. DO NOT EDIT!
* compiler version: 3.14.0 * compiler version: 4.25.1
* source: vulcanize/auction/v1beta1/genesis.proto * source: vulcanize/auction/v1beta1/genesis.proto
* git: https://github.com/thesayyn/protoc-gen-ts */ * git: https://github.com/thesayyn/protoc-gen-ts */
import * as dependency_1 from "./../../../gogoproto/gogo"; import * as dependency_1 from "./../../../gogoproto/gogo";
@ -10,12 +10,13 @@ import * as dependency_2 from "./types";
import * as pb_1 from "google-protobuf"; import * as pb_1 from "google-protobuf";
export namespace vulcanize.auction.v1beta1 { export namespace vulcanize.auction.v1beta1 {
export class GenesisState extends pb_1.Message { export class GenesisState extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
params?: dependency_2.vulcanize.auction.v1beta1.Params; params?: dependency_2.vulcanize.auction.v1beta1.Params;
auctions?: dependency_2.vulcanize.auction.v1beta1.Auction[]; auctions?: dependency_2.vulcanize.auction.v1beta1.Auction[];
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("params" in data && data.params != undefined) { if ("params" in data && data.params != undefined) {
this.params = data.params; this.params = data.params;
@ -31,6 +32,9 @@ export namespace vulcanize.auction.v1beta1 {
set params(value: dependency_2.vulcanize.auction.v1beta1.Params) { set params(value: dependency_2.vulcanize.auction.v1beta1.Params) {
pb_1.Message.setWrapperField(this, 1, value); pb_1.Message.setWrapperField(this, 1, value);
} }
get has_params() {
return pb_1.Message.getField(this, 1) != null;
}
get auctions() { get auctions() {
return pb_1.Message.getRepeatedWrapperField(this, dependency_2.vulcanize.auction.v1beta1.Auction, 2) as dependency_2.vulcanize.auction.v1beta1.Auction[]; return pb_1.Message.getRepeatedWrapperField(this, dependency_2.vulcanize.auction.v1beta1.Auction, 2) as dependency_2.vulcanize.auction.v1beta1.Auction[];
} }
@ -40,7 +44,7 @@ export namespace vulcanize.auction.v1beta1 {
static fromObject(data: { static fromObject(data: {
params?: ReturnType<typeof dependency_2.vulcanize.auction.v1beta1.Params.prototype.toObject>; params?: ReturnType<typeof dependency_2.vulcanize.auction.v1beta1.Params.prototype.toObject>;
auctions?: ReturnType<typeof dependency_2.vulcanize.auction.v1beta1.Auction.prototype.toObject>[]; auctions?: ReturnType<typeof dependency_2.vulcanize.auction.v1beta1.Auction.prototype.toObject>[];
}) { }): GenesisState {
const message = new GenesisState({}); const message = new GenesisState({});
if (data.params != null) { if (data.params != null) {
message.params = dependency_2.vulcanize.auction.v1beta1.Params.fromObject(data.params); message.params = dependency_2.vulcanize.auction.v1beta1.Params.fromObject(data.params);
@ -67,9 +71,9 @@ export namespace vulcanize.auction.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (this.params !== undefined) if (this.has_params)
writer.writeMessage(1, this.params, () => this.params.serialize(writer)); writer.writeMessage(1, this.params, () => this.params.serialize(writer));
if (this.auctions !== undefined) if (this.auctions.length)
writer.writeRepeatedMessage(2, this.auctions, (item: dependency_2.vulcanize.auction.v1beta1.Auction) => item.serialize(writer)); writer.writeRepeatedMessage(2, this.auctions, (item: dependency_2.vulcanize.auction.v1beta1.Auction) => item.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();

View File

@ -2,7 +2,7 @@
/* eslint-disable */ /* eslint-disable */
/** /**
* Generated by the protoc-gen-ts. DO NOT EDIT! * Generated by the protoc-gen-ts. DO NOT EDIT!
* compiler version: 3.14.0 * compiler version: 4.25.1
* source: vulcanize/auction/v1beta1/query.proto * source: vulcanize/auction/v1beta1/query.proto
* git: https://github.com/thesayyn/protoc-gen-ts */ * git: https://github.com/thesayyn/protoc-gen-ts */
import * as dependency_1 from "./../../../gogoproto/gogo"; import * as dependency_1 from "./../../../gogoproto/gogo";
@ -13,11 +13,12 @@ import * as dependency_5 from "./types";
import * as pb_1 from "google-protobuf"; import * as pb_1 from "google-protobuf";
export namespace vulcanize.auction.v1beta1 { export namespace vulcanize.auction.v1beta1 {
export class AuctionsRequest extends pb_1.Message { export class AuctionsRequest extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
pagination?: dependency_3.cosmos.base.query.v1beta1.PageRequest; pagination?: dependency_3.cosmos.base.query.v1beta1.PageRequest;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("pagination" in data && data.pagination != undefined) { if ("pagination" in data && data.pagination != undefined) {
this.pagination = data.pagination; this.pagination = data.pagination;
@ -30,9 +31,12 @@ export namespace vulcanize.auction.v1beta1 {
set pagination(value: dependency_3.cosmos.base.query.v1beta1.PageRequest) { set pagination(value: dependency_3.cosmos.base.query.v1beta1.PageRequest) {
pb_1.Message.setWrapperField(this, 1, value); pb_1.Message.setWrapperField(this, 1, value);
} }
get has_pagination() {
return pb_1.Message.getField(this, 1) != null;
}
static fromObject(data: { static fromObject(data: {
pagination?: ReturnType<typeof dependency_3.cosmos.base.query.v1beta1.PageRequest.prototype.toObject>; pagination?: ReturnType<typeof dependency_3.cosmos.base.query.v1beta1.PageRequest.prototype.toObject>;
}) { }): AuctionsRequest {
const message = new AuctionsRequest({}); const message = new AuctionsRequest({});
if (data.pagination != null) { if (data.pagination != null) {
message.pagination = dependency_3.cosmos.base.query.v1beta1.PageRequest.fromObject(data.pagination); message.pagination = dependency_3.cosmos.base.query.v1beta1.PageRequest.fromObject(data.pagination);
@ -52,7 +56,7 @@ export namespace vulcanize.auction.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (this.pagination !== undefined) if (this.has_pagination)
writer.writeMessage(1, this.pagination, () => this.pagination.serialize(writer)); writer.writeMessage(1, this.pagination, () => this.pagination.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -79,12 +83,13 @@ export namespace vulcanize.auction.v1beta1 {
} }
} }
export class AuctionsResponse extends pb_1.Message { export class AuctionsResponse extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
auctions?: dependency_5.vulcanize.auction.v1beta1.Auctions; auctions?: dependency_5.vulcanize.auction.v1beta1.Auctions;
pagination?: dependency_3.cosmos.base.query.v1beta1.PageRequest; pagination?: dependency_3.cosmos.base.query.v1beta1.PageRequest;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("auctions" in data && data.auctions != undefined) { if ("auctions" in data && data.auctions != undefined) {
this.auctions = data.auctions; this.auctions = data.auctions;
@ -100,16 +105,22 @@ export namespace vulcanize.auction.v1beta1 {
set auctions(value: dependency_5.vulcanize.auction.v1beta1.Auctions) { set auctions(value: dependency_5.vulcanize.auction.v1beta1.Auctions) {
pb_1.Message.setWrapperField(this, 1, value); pb_1.Message.setWrapperField(this, 1, value);
} }
get has_auctions() {
return pb_1.Message.getField(this, 1) != null;
}
get pagination() { get pagination() {
return pb_1.Message.getWrapperField(this, dependency_3.cosmos.base.query.v1beta1.PageRequest, 2) as dependency_3.cosmos.base.query.v1beta1.PageRequest; return pb_1.Message.getWrapperField(this, dependency_3.cosmos.base.query.v1beta1.PageRequest, 2) as dependency_3.cosmos.base.query.v1beta1.PageRequest;
} }
set pagination(value: dependency_3.cosmos.base.query.v1beta1.PageRequest) { set pagination(value: dependency_3.cosmos.base.query.v1beta1.PageRequest) {
pb_1.Message.setWrapperField(this, 2, value); pb_1.Message.setWrapperField(this, 2, value);
} }
get has_pagination() {
return pb_1.Message.getField(this, 2) != null;
}
static fromObject(data: { static fromObject(data: {
auctions?: ReturnType<typeof dependency_5.vulcanize.auction.v1beta1.Auctions.prototype.toObject>; auctions?: ReturnType<typeof dependency_5.vulcanize.auction.v1beta1.Auctions.prototype.toObject>;
pagination?: ReturnType<typeof dependency_3.cosmos.base.query.v1beta1.PageRequest.prototype.toObject>; pagination?: ReturnType<typeof dependency_3.cosmos.base.query.v1beta1.PageRequest.prototype.toObject>;
}) { }): AuctionsResponse {
const message = new AuctionsResponse({}); const message = new AuctionsResponse({});
if (data.auctions != null) { if (data.auctions != null) {
message.auctions = dependency_5.vulcanize.auction.v1beta1.Auctions.fromObject(data.auctions); message.auctions = dependency_5.vulcanize.auction.v1beta1.Auctions.fromObject(data.auctions);
@ -136,9 +147,9 @@ export namespace vulcanize.auction.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (this.auctions !== undefined) if (this.has_auctions)
writer.writeMessage(1, this.auctions, () => this.auctions.serialize(writer)); writer.writeMessage(1, this.auctions, () => this.auctions.serialize(writer));
if (this.pagination !== undefined) if (this.has_pagination)
writer.writeMessage(2, this.pagination, () => this.pagination.serialize(writer)); writer.writeMessage(2, this.pagination, () => this.pagination.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -168,11 +179,12 @@ export namespace vulcanize.auction.v1beta1 {
} }
} }
export class AuctionRequest extends pb_1.Message { export class AuctionRequest extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
id?: string; id?: string;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("id" in data && data.id != undefined) { if ("id" in data && data.id != undefined) {
this.id = data.id; this.id = data.id;
@ -180,14 +192,14 @@ export namespace vulcanize.auction.v1beta1 {
} }
} }
get id() { get id() {
return pb_1.Message.getField(this, 1) as string; return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
} }
set id(value: string) { set id(value: string) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
static fromObject(data: { static fromObject(data: {
id?: string; id?: string;
}) { }): AuctionRequest {
const message = new AuctionRequest({}); const message = new AuctionRequest({});
if (data.id != null) { if (data.id != null) {
message.id = data.id; message.id = data.id;
@ -207,7 +219,7 @@ export namespace vulcanize.auction.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (typeof this.id === "string" && this.id.length) if (this.id.length)
writer.writeString(1, this.id); writer.writeString(1, this.id);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -234,11 +246,12 @@ export namespace vulcanize.auction.v1beta1 {
} }
} }
export class AuctionResponse extends pb_1.Message { export class AuctionResponse extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
auction?: dependency_5.vulcanize.auction.v1beta1.Auction; auction?: dependency_5.vulcanize.auction.v1beta1.Auction;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("auction" in data && data.auction != undefined) { if ("auction" in data && data.auction != undefined) {
this.auction = data.auction; this.auction = data.auction;
@ -251,9 +264,12 @@ export namespace vulcanize.auction.v1beta1 {
set auction(value: dependency_5.vulcanize.auction.v1beta1.Auction) { set auction(value: dependency_5.vulcanize.auction.v1beta1.Auction) {
pb_1.Message.setWrapperField(this, 1, value); pb_1.Message.setWrapperField(this, 1, value);
} }
get has_auction() {
return pb_1.Message.getField(this, 1) != null;
}
static fromObject(data: { static fromObject(data: {
auction?: ReturnType<typeof dependency_5.vulcanize.auction.v1beta1.Auction.prototype.toObject>; auction?: ReturnType<typeof dependency_5.vulcanize.auction.v1beta1.Auction.prototype.toObject>;
}) { }): AuctionResponse {
const message = new AuctionResponse({}); const message = new AuctionResponse({});
if (data.auction != null) { if (data.auction != null) {
message.auction = dependency_5.vulcanize.auction.v1beta1.Auction.fromObject(data.auction); message.auction = dependency_5.vulcanize.auction.v1beta1.Auction.fromObject(data.auction);
@ -273,7 +289,7 @@ export namespace vulcanize.auction.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (this.auction !== undefined) if (this.has_auction)
writer.writeMessage(1, this.auction, () => this.auction.serialize(writer)); writer.writeMessage(1, this.auction, () => this.auction.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -300,12 +316,13 @@ export namespace vulcanize.auction.v1beta1 {
} }
} }
export class BidRequest extends pb_1.Message { export class BidRequest extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
auction_id?: string; auction_id?: string;
bidder?: string; bidder?: string;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("auction_id" in data && data.auction_id != undefined) { if ("auction_id" in data && data.auction_id != undefined) {
this.auction_id = data.auction_id; this.auction_id = data.auction_id;
@ -316,13 +333,13 @@ export namespace vulcanize.auction.v1beta1 {
} }
} }
get auction_id() { get auction_id() {
return pb_1.Message.getField(this, 1) as string; return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
} }
set auction_id(value: string) { set auction_id(value: string) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
get bidder() { get bidder() {
return pb_1.Message.getField(this, 2) as string; return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
} }
set bidder(value: string) { set bidder(value: string) {
pb_1.Message.setField(this, 2, value); pb_1.Message.setField(this, 2, value);
@ -330,7 +347,7 @@ export namespace vulcanize.auction.v1beta1 {
static fromObject(data: { static fromObject(data: {
auction_id?: string; auction_id?: string;
bidder?: string; bidder?: string;
}) { }): BidRequest {
const message = new BidRequest({}); const message = new BidRequest({});
if (data.auction_id != null) { if (data.auction_id != null) {
message.auction_id = data.auction_id; message.auction_id = data.auction_id;
@ -357,9 +374,9 @@ export namespace vulcanize.auction.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (typeof this.auction_id === "string" && this.auction_id.length) if (this.auction_id.length)
writer.writeString(1, this.auction_id); writer.writeString(1, this.auction_id);
if (typeof this.bidder === "string" && this.bidder.length) if (this.bidder.length)
writer.writeString(2, this.bidder); writer.writeString(2, this.bidder);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -389,11 +406,12 @@ export namespace vulcanize.auction.v1beta1 {
} }
} }
export class BidResponse extends pb_1.Message { export class BidResponse extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
bid?: dependency_5.vulcanize.auction.v1beta1.Bid; bid?: dependency_5.vulcanize.auction.v1beta1.Bid;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("bid" in data && data.bid != undefined) { if ("bid" in data && data.bid != undefined) {
this.bid = data.bid; this.bid = data.bid;
@ -406,9 +424,12 @@ export namespace vulcanize.auction.v1beta1 {
set bid(value: dependency_5.vulcanize.auction.v1beta1.Bid) { set bid(value: dependency_5.vulcanize.auction.v1beta1.Bid) {
pb_1.Message.setWrapperField(this, 1, value); pb_1.Message.setWrapperField(this, 1, value);
} }
get has_bid() {
return pb_1.Message.getField(this, 1) != null;
}
static fromObject(data: { static fromObject(data: {
bid?: ReturnType<typeof dependency_5.vulcanize.auction.v1beta1.Bid.prototype.toObject>; bid?: ReturnType<typeof dependency_5.vulcanize.auction.v1beta1.Bid.prototype.toObject>;
}) { }): BidResponse {
const message = new BidResponse({}); const message = new BidResponse({});
if (data.bid != null) { if (data.bid != null) {
message.bid = dependency_5.vulcanize.auction.v1beta1.Bid.fromObject(data.bid); message.bid = dependency_5.vulcanize.auction.v1beta1.Bid.fromObject(data.bid);
@ -428,7 +449,7 @@ export namespace vulcanize.auction.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (this.bid !== undefined) if (this.has_bid)
writer.writeMessage(1, this.bid, () => this.bid.serialize(writer)); writer.writeMessage(1, this.bid, () => this.bid.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -455,11 +476,12 @@ export namespace vulcanize.auction.v1beta1 {
} }
} }
export class BidsRequest extends pb_1.Message { export class BidsRequest extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
auction_id?: string; auction_id?: string;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("auction_id" in data && data.auction_id != undefined) { if ("auction_id" in data && data.auction_id != undefined) {
this.auction_id = data.auction_id; this.auction_id = data.auction_id;
@ -467,14 +489,14 @@ export namespace vulcanize.auction.v1beta1 {
} }
} }
get auction_id() { get auction_id() {
return pb_1.Message.getField(this, 1) as string; return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
} }
set auction_id(value: string) { set auction_id(value: string) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
static fromObject(data: { static fromObject(data: {
auction_id?: string; auction_id?: string;
}) { }): BidsRequest {
const message = new BidsRequest({}); const message = new BidsRequest({});
if (data.auction_id != null) { if (data.auction_id != null) {
message.auction_id = data.auction_id; message.auction_id = data.auction_id;
@ -494,7 +516,7 @@ export namespace vulcanize.auction.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (typeof this.auction_id === "string" && this.auction_id.length) if (this.auction_id.length)
writer.writeString(1, this.auction_id); writer.writeString(1, this.auction_id);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -521,11 +543,12 @@ export namespace vulcanize.auction.v1beta1 {
} }
} }
export class BidsResponse extends pb_1.Message { export class BidsResponse extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
bids?: dependency_5.vulcanize.auction.v1beta1.Bid[]; bids?: dependency_5.vulcanize.auction.v1beta1.Bid[];
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("bids" in data && data.bids != undefined) { if ("bids" in data && data.bids != undefined) {
this.bids = data.bids; this.bids = data.bids;
@ -540,7 +563,7 @@ export namespace vulcanize.auction.v1beta1 {
} }
static fromObject(data: { static fromObject(data: {
bids?: ReturnType<typeof dependency_5.vulcanize.auction.v1beta1.Bid.prototype.toObject>[]; bids?: ReturnType<typeof dependency_5.vulcanize.auction.v1beta1.Bid.prototype.toObject>[];
}) { }): BidsResponse {
const message = new BidsResponse({}); const message = new BidsResponse({});
if (data.bids != null) { if (data.bids != null) {
message.bids = data.bids.map(item => dependency_5.vulcanize.auction.v1beta1.Bid.fromObject(item)); message.bids = data.bids.map(item => dependency_5.vulcanize.auction.v1beta1.Bid.fromObject(item));
@ -560,7 +583,7 @@ export namespace vulcanize.auction.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (this.bids !== undefined) if (this.bids.length)
writer.writeRepeatedMessage(1, this.bids, (item: dependency_5.vulcanize.auction.v1beta1.Bid) => item.serialize(writer)); writer.writeRepeatedMessage(1, this.bids, (item: dependency_5.vulcanize.auction.v1beta1.Bid) => item.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -587,11 +610,12 @@ export namespace vulcanize.auction.v1beta1 {
} }
} }
export class AuctionsByBidderRequest extends pb_1.Message { export class AuctionsByBidderRequest extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
bidder_address?: string; bidder_address?: string;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("bidder_address" in data && data.bidder_address != undefined) { if ("bidder_address" in data && data.bidder_address != undefined) {
this.bidder_address = data.bidder_address; this.bidder_address = data.bidder_address;
@ -599,14 +623,14 @@ export namespace vulcanize.auction.v1beta1 {
} }
} }
get bidder_address() { get bidder_address() {
return pb_1.Message.getField(this, 1) as string; return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
} }
set bidder_address(value: string) { set bidder_address(value: string) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
static fromObject(data: { static fromObject(data: {
bidder_address?: string; bidder_address?: string;
}) { }): AuctionsByBidderRequest {
const message = new AuctionsByBidderRequest({}); const message = new AuctionsByBidderRequest({});
if (data.bidder_address != null) { if (data.bidder_address != null) {
message.bidder_address = data.bidder_address; message.bidder_address = data.bidder_address;
@ -626,7 +650,7 @@ export namespace vulcanize.auction.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (typeof this.bidder_address === "string" && this.bidder_address.length) if (this.bidder_address.length)
writer.writeString(1, this.bidder_address); writer.writeString(1, this.bidder_address);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -653,11 +677,12 @@ export namespace vulcanize.auction.v1beta1 {
} }
} }
export class AuctionsByBidderResponse extends pb_1.Message { export class AuctionsByBidderResponse extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
auctions?: dependency_5.vulcanize.auction.v1beta1.Auctions; auctions?: dependency_5.vulcanize.auction.v1beta1.Auctions;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("auctions" in data && data.auctions != undefined) { if ("auctions" in data && data.auctions != undefined) {
this.auctions = data.auctions; this.auctions = data.auctions;
@ -670,9 +695,12 @@ export namespace vulcanize.auction.v1beta1 {
set auctions(value: dependency_5.vulcanize.auction.v1beta1.Auctions) { set auctions(value: dependency_5.vulcanize.auction.v1beta1.Auctions) {
pb_1.Message.setWrapperField(this, 1, value); pb_1.Message.setWrapperField(this, 1, value);
} }
get has_auctions() {
return pb_1.Message.getField(this, 1) != null;
}
static fromObject(data: { static fromObject(data: {
auctions?: ReturnType<typeof dependency_5.vulcanize.auction.v1beta1.Auctions.prototype.toObject>; auctions?: ReturnType<typeof dependency_5.vulcanize.auction.v1beta1.Auctions.prototype.toObject>;
}) { }): AuctionsByBidderResponse {
const message = new AuctionsByBidderResponse({}); const message = new AuctionsByBidderResponse({});
if (data.auctions != null) { if (data.auctions != null) {
message.auctions = dependency_5.vulcanize.auction.v1beta1.Auctions.fromObject(data.auctions); message.auctions = dependency_5.vulcanize.auction.v1beta1.Auctions.fromObject(data.auctions);
@ -692,7 +720,7 @@ export namespace vulcanize.auction.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (this.auctions !== undefined) if (this.has_auctions)
writer.writeMessage(1, this.auctions, () => this.auctions.serialize(writer)); writer.writeMessage(1, this.auctions, () => this.auctions.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -719,11 +747,12 @@ export namespace vulcanize.auction.v1beta1 {
} }
} }
export class AuctionsByOwnerRequest extends pb_1.Message { export class AuctionsByOwnerRequest extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
owner_address?: string; owner_address?: string;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("owner_address" in data && data.owner_address != undefined) { if ("owner_address" in data && data.owner_address != undefined) {
this.owner_address = data.owner_address; this.owner_address = data.owner_address;
@ -731,14 +760,14 @@ export namespace vulcanize.auction.v1beta1 {
} }
} }
get owner_address() { get owner_address() {
return pb_1.Message.getField(this, 1) as string; return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
} }
set owner_address(value: string) { set owner_address(value: string) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
static fromObject(data: { static fromObject(data: {
owner_address?: string; owner_address?: string;
}) { }): AuctionsByOwnerRequest {
const message = new AuctionsByOwnerRequest({}); const message = new AuctionsByOwnerRequest({});
if (data.owner_address != null) { if (data.owner_address != null) {
message.owner_address = data.owner_address; message.owner_address = data.owner_address;
@ -758,7 +787,7 @@ export namespace vulcanize.auction.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (typeof this.owner_address === "string" && this.owner_address.length) if (this.owner_address.length)
writer.writeString(1, this.owner_address); writer.writeString(1, this.owner_address);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -785,11 +814,12 @@ export namespace vulcanize.auction.v1beta1 {
} }
} }
export class AuctionsByOwnerResponse extends pb_1.Message { export class AuctionsByOwnerResponse extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
auctions?: dependency_5.vulcanize.auction.v1beta1.Auctions; auctions?: dependency_5.vulcanize.auction.v1beta1.Auctions;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("auctions" in data && data.auctions != undefined) { if ("auctions" in data && data.auctions != undefined) {
this.auctions = data.auctions; this.auctions = data.auctions;
@ -802,9 +832,12 @@ export namespace vulcanize.auction.v1beta1 {
set auctions(value: dependency_5.vulcanize.auction.v1beta1.Auctions) { set auctions(value: dependency_5.vulcanize.auction.v1beta1.Auctions) {
pb_1.Message.setWrapperField(this, 1, value); pb_1.Message.setWrapperField(this, 1, value);
} }
get has_auctions() {
return pb_1.Message.getField(this, 1) != null;
}
static fromObject(data: { static fromObject(data: {
auctions?: ReturnType<typeof dependency_5.vulcanize.auction.v1beta1.Auctions.prototype.toObject>; auctions?: ReturnType<typeof dependency_5.vulcanize.auction.v1beta1.Auctions.prototype.toObject>;
}) { }): AuctionsByOwnerResponse {
const message = new AuctionsByOwnerResponse({}); const message = new AuctionsByOwnerResponse({});
if (data.auctions != null) { if (data.auctions != null) {
message.auctions = dependency_5.vulcanize.auction.v1beta1.Auctions.fromObject(data.auctions); message.auctions = dependency_5.vulcanize.auction.v1beta1.Auctions.fromObject(data.auctions);
@ -824,7 +857,7 @@ export namespace vulcanize.auction.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (this.auctions !== undefined) if (this.has_auctions)
writer.writeMessage(1, this.auctions, () => this.auctions.serialize(writer)); writer.writeMessage(1, this.auctions, () => this.auctions.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -851,12 +884,13 @@ export namespace vulcanize.auction.v1beta1 {
} }
} }
export class QueryParamsRequest extends pb_1.Message { export class QueryParamsRequest extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {}) { constructor(data?: any[] | {}) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { } if (!Array.isArray(data) && typeof data == "object") { }
} }
static fromObject(data: {}) { static fromObject(data: {}): QueryParamsRequest {
const message = new QueryParamsRequest({}); const message = new QueryParamsRequest({});
return message; return message;
} }
@ -890,11 +924,12 @@ export namespace vulcanize.auction.v1beta1 {
} }
} }
export class QueryParamsResponse extends pb_1.Message { export class QueryParamsResponse extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
params?: dependency_5.vulcanize.auction.v1beta1.Params; params?: dependency_5.vulcanize.auction.v1beta1.Params;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("params" in data && data.params != undefined) { if ("params" in data && data.params != undefined) {
this.params = data.params; this.params = data.params;
@ -907,9 +942,12 @@ export namespace vulcanize.auction.v1beta1 {
set params(value: dependency_5.vulcanize.auction.v1beta1.Params) { set params(value: dependency_5.vulcanize.auction.v1beta1.Params) {
pb_1.Message.setWrapperField(this, 1, value); pb_1.Message.setWrapperField(this, 1, value);
} }
get has_params() {
return pb_1.Message.getField(this, 1) != null;
}
static fromObject(data: { static fromObject(data: {
params?: ReturnType<typeof dependency_5.vulcanize.auction.v1beta1.Params.prototype.toObject>; params?: ReturnType<typeof dependency_5.vulcanize.auction.v1beta1.Params.prototype.toObject>;
}) { }): QueryParamsResponse {
const message = new QueryParamsResponse({}); const message = new QueryParamsResponse({});
if (data.params != null) { if (data.params != null) {
message.params = dependency_5.vulcanize.auction.v1beta1.Params.fromObject(data.params); message.params = dependency_5.vulcanize.auction.v1beta1.Params.fromObject(data.params);
@ -929,7 +967,7 @@ export namespace vulcanize.auction.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (this.params !== undefined) if (this.has_params)
writer.writeMessage(1, this.params, () => this.params.serialize(writer)); writer.writeMessage(1, this.params, () => this.params.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -956,12 +994,13 @@ export namespace vulcanize.auction.v1beta1 {
} }
} }
export class BalanceRequest extends pb_1.Message { export class BalanceRequest extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {}) { constructor(data?: any[] | {}) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { } if (!Array.isArray(data) && typeof data == "object") { }
} }
static fromObject(data: {}) { static fromObject(data: {}): BalanceRequest {
const message = new BalanceRequest({}); const message = new BalanceRequest({});
return message; return message;
} }
@ -995,11 +1034,12 @@ export namespace vulcanize.auction.v1beta1 {
} }
} }
export class BalanceResponse extends pb_1.Message { export class BalanceResponse extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
balance?: dependency_4.cosmos.base.v1beta1.Coin[]; balance?: dependency_4.cosmos.base.v1beta1.Coin[];
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("balance" in data && data.balance != undefined) { if ("balance" in data && data.balance != undefined) {
this.balance = data.balance; this.balance = data.balance;
@ -1014,7 +1054,7 @@ export namespace vulcanize.auction.v1beta1 {
} }
static fromObject(data: { static fromObject(data: {
balance?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>[]; balance?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>[];
}) { }): BalanceResponse {
const message = new BalanceResponse({}); const message = new BalanceResponse({});
if (data.balance != null) { if (data.balance != null) {
message.balance = data.balance.map(item => dependency_4.cosmos.base.v1beta1.Coin.fromObject(item)); message.balance = data.balance.map(item => dependency_4.cosmos.base.v1beta1.Coin.fromObject(item));
@ -1034,7 +1074,7 @@ export namespace vulcanize.auction.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (this.balance !== undefined) if (this.balance.length)
writer.writeRepeatedMessage(1, this.balance, (item: dependency_4.cosmos.base.v1beta1.Coin) => item.serialize(writer)); writer.writeRepeatedMessage(1, this.balance, (item: dependency_4.cosmos.base.v1beta1.Coin) => item.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();

View File

@ -2,7 +2,7 @@
/* eslint-disable */ /* eslint-disable */
/** /**
* Generated by the protoc-gen-ts. DO NOT EDIT! * Generated by the protoc-gen-ts. DO NOT EDIT!
* compiler version: 3.14.0 * compiler version: 4.25.1
* source: vulcanize/auction/v1beta1/tx.proto * source: vulcanize/auction/v1beta1/tx.proto
* git: https://github.com/thesayyn/protoc-gen-ts */ * git: https://github.com/thesayyn/protoc-gen-ts */
import * as dependency_1 from "./../../../gogoproto/gogo"; import * as dependency_1 from "./../../../gogoproto/gogo";
@ -12,6 +12,7 @@ import * as dependency_4 from "./types";
import * as pb_1 from "google-protobuf"; import * as pb_1 from "google-protobuf";
export namespace vulcanize.auction.v1beta1 { export namespace vulcanize.auction.v1beta1 {
export class MsgCreateAuction extends pb_1.Message { export class MsgCreateAuction extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
commits_duration?: dependency_2.google.protobuf.Duration; commits_duration?: dependency_2.google.protobuf.Duration;
reveals_duration?: dependency_2.google.protobuf.Duration; reveals_duration?: dependency_2.google.protobuf.Duration;
@ -21,7 +22,7 @@ export namespace vulcanize.auction.v1beta1 {
signer?: string; signer?: string;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("commits_duration" in data && data.commits_duration != undefined) { if ("commits_duration" in data && data.commits_duration != undefined) {
this.commits_duration = data.commits_duration; this.commits_duration = data.commits_duration;
@ -49,32 +50,47 @@ export namespace vulcanize.auction.v1beta1 {
set commits_duration(value: dependency_2.google.protobuf.Duration) { set commits_duration(value: dependency_2.google.protobuf.Duration) {
pb_1.Message.setWrapperField(this, 1, value); pb_1.Message.setWrapperField(this, 1, value);
} }
get has_commits_duration() {
return pb_1.Message.getField(this, 1) != null;
}
get reveals_duration() { get reveals_duration() {
return pb_1.Message.getWrapperField(this, dependency_2.google.protobuf.Duration, 2) as dependency_2.google.protobuf.Duration; return pb_1.Message.getWrapperField(this, dependency_2.google.protobuf.Duration, 2) as dependency_2.google.protobuf.Duration;
} }
set reveals_duration(value: dependency_2.google.protobuf.Duration) { set reveals_duration(value: dependency_2.google.protobuf.Duration) {
pb_1.Message.setWrapperField(this, 2, value); pb_1.Message.setWrapperField(this, 2, value);
} }
get has_reveals_duration() {
return pb_1.Message.getField(this, 2) != null;
}
get commit_fee() { get commit_fee() {
return pb_1.Message.getWrapperField(this, dependency_3.cosmos.base.v1beta1.Coin, 3) as dependency_3.cosmos.base.v1beta1.Coin; return pb_1.Message.getWrapperField(this, dependency_3.cosmos.base.v1beta1.Coin, 3) as dependency_3.cosmos.base.v1beta1.Coin;
} }
set commit_fee(value: dependency_3.cosmos.base.v1beta1.Coin) { set commit_fee(value: dependency_3.cosmos.base.v1beta1.Coin) {
pb_1.Message.setWrapperField(this, 3, value); pb_1.Message.setWrapperField(this, 3, value);
} }
get has_commit_fee() {
return pb_1.Message.getField(this, 3) != null;
}
get reveal_fee() { get reveal_fee() {
return pb_1.Message.getWrapperField(this, dependency_3.cosmos.base.v1beta1.Coin, 4) as dependency_3.cosmos.base.v1beta1.Coin; return pb_1.Message.getWrapperField(this, dependency_3.cosmos.base.v1beta1.Coin, 4) as dependency_3.cosmos.base.v1beta1.Coin;
} }
set reveal_fee(value: dependency_3.cosmos.base.v1beta1.Coin) { set reveal_fee(value: dependency_3.cosmos.base.v1beta1.Coin) {
pb_1.Message.setWrapperField(this, 4, value); pb_1.Message.setWrapperField(this, 4, value);
} }
get has_reveal_fee() {
return pb_1.Message.getField(this, 4) != null;
}
get minimum_bid() { get minimum_bid() {
return pb_1.Message.getWrapperField(this, dependency_3.cosmos.base.v1beta1.Coin, 5) as dependency_3.cosmos.base.v1beta1.Coin; return pb_1.Message.getWrapperField(this, dependency_3.cosmos.base.v1beta1.Coin, 5) as dependency_3.cosmos.base.v1beta1.Coin;
} }
set minimum_bid(value: dependency_3.cosmos.base.v1beta1.Coin) { set minimum_bid(value: dependency_3.cosmos.base.v1beta1.Coin) {
pb_1.Message.setWrapperField(this, 5, value); pb_1.Message.setWrapperField(this, 5, value);
} }
get has_minimum_bid() {
return pb_1.Message.getField(this, 5) != null;
}
get signer() { get signer() {
return pb_1.Message.getField(this, 6) as string; return pb_1.Message.getFieldWithDefault(this, 6, "") as string;
} }
set signer(value: string) { set signer(value: string) {
pb_1.Message.setField(this, 6, value); pb_1.Message.setField(this, 6, value);
@ -86,7 +102,7 @@ export namespace vulcanize.auction.v1beta1 {
reveal_fee?: ReturnType<typeof dependency_3.cosmos.base.v1beta1.Coin.prototype.toObject>; reveal_fee?: ReturnType<typeof dependency_3.cosmos.base.v1beta1.Coin.prototype.toObject>;
minimum_bid?: ReturnType<typeof dependency_3.cosmos.base.v1beta1.Coin.prototype.toObject>; minimum_bid?: ReturnType<typeof dependency_3.cosmos.base.v1beta1.Coin.prototype.toObject>;
signer?: string; signer?: string;
}) { }): MsgCreateAuction {
const message = new MsgCreateAuction({}); const message = new MsgCreateAuction({});
if (data.commits_duration != null) { if (data.commits_duration != null) {
message.commits_duration = dependency_2.google.protobuf.Duration.fromObject(data.commits_duration); message.commits_duration = dependency_2.google.protobuf.Duration.fromObject(data.commits_duration);
@ -141,17 +157,17 @@ export namespace vulcanize.auction.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (this.commits_duration !== undefined) if (this.has_commits_duration)
writer.writeMessage(1, this.commits_duration, () => this.commits_duration.serialize(writer)); writer.writeMessage(1, this.commits_duration, () => this.commits_duration.serialize(writer));
if (this.reveals_duration !== undefined) if (this.has_reveals_duration)
writer.writeMessage(2, this.reveals_duration, () => this.reveals_duration.serialize(writer)); writer.writeMessage(2, this.reveals_duration, () => this.reveals_duration.serialize(writer));
if (this.commit_fee !== undefined) if (this.has_commit_fee)
writer.writeMessage(3, this.commit_fee, () => this.commit_fee.serialize(writer)); writer.writeMessage(3, this.commit_fee, () => this.commit_fee.serialize(writer));
if (this.reveal_fee !== undefined) if (this.has_reveal_fee)
writer.writeMessage(4, this.reveal_fee, () => this.reveal_fee.serialize(writer)); writer.writeMessage(4, this.reveal_fee, () => this.reveal_fee.serialize(writer));
if (this.minimum_bid !== undefined) if (this.has_minimum_bid)
writer.writeMessage(5, this.minimum_bid, () => this.minimum_bid.serialize(writer)); writer.writeMessage(5, this.minimum_bid, () => this.minimum_bid.serialize(writer));
if (typeof this.signer === "string" && this.signer.length) if (this.signer.length)
writer.writeString(6, this.signer); writer.writeString(6, this.signer);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -193,11 +209,12 @@ export namespace vulcanize.auction.v1beta1 {
} }
} }
export class MsgCreateAuctionResponse extends pb_1.Message { export class MsgCreateAuctionResponse extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
auction?: dependency_4.vulcanize.auction.v1beta1.Auction; auction?: dependency_4.vulcanize.auction.v1beta1.Auction;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("auction" in data && data.auction != undefined) { if ("auction" in data && data.auction != undefined) {
this.auction = data.auction; this.auction = data.auction;
@ -210,9 +227,12 @@ export namespace vulcanize.auction.v1beta1 {
set auction(value: dependency_4.vulcanize.auction.v1beta1.Auction) { set auction(value: dependency_4.vulcanize.auction.v1beta1.Auction) {
pb_1.Message.setWrapperField(this, 1, value); pb_1.Message.setWrapperField(this, 1, value);
} }
get has_auction() {
return pb_1.Message.getField(this, 1) != null;
}
static fromObject(data: { static fromObject(data: {
auction?: ReturnType<typeof dependency_4.vulcanize.auction.v1beta1.Auction.prototype.toObject>; auction?: ReturnType<typeof dependency_4.vulcanize.auction.v1beta1.Auction.prototype.toObject>;
}) { }): MsgCreateAuctionResponse {
const message = new MsgCreateAuctionResponse({}); const message = new MsgCreateAuctionResponse({});
if (data.auction != null) { if (data.auction != null) {
message.auction = dependency_4.vulcanize.auction.v1beta1.Auction.fromObject(data.auction); message.auction = dependency_4.vulcanize.auction.v1beta1.Auction.fromObject(data.auction);
@ -232,7 +252,7 @@ export namespace vulcanize.auction.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (this.auction !== undefined) if (this.has_auction)
writer.writeMessage(1, this.auction, () => this.auction.serialize(writer)); writer.writeMessage(1, this.auction, () => this.auction.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -259,13 +279,14 @@ export namespace vulcanize.auction.v1beta1 {
} }
} }
export class MsgCommitBid extends pb_1.Message { export class MsgCommitBid extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
auction_id?: string; auction_id?: string;
commit_hash?: string; commit_hash?: string;
signer?: string; signer?: string;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("auction_id" in data && data.auction_id != undefined) { if ("auction_id" in data && data.auction_id != undefined) {
this.auction_id = data.auction_id; this.auction_id = data.auction_id;
@ -279,19 +300,19 @@ export namespace vulcanize.auction.v1beta1 {
} }
} }
get auction_id() { get auction_id() {
return pb_1.Message.getField(this, 1) as string; return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
} }
set auction_id(value: string) { set auction_id(value: string) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
get commit_hash() { get commit_hash() {
return pb_1.Message.getField(this, 2) as string; return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
} }
set commit_hash(value: string) { set commit_hash(value: string) {
pb_1.Message.setField(this, 2, value); pb_1.Message.setField(this, 2, value);
} }
get signer() { get signer() {
return pb_1.Message.getField(this, 3) as string; return pb_1.Message.getFieldWithDefault(this, 3, "") as string;
} }
set signer(value: string) { set signer(value: string) {
pb_1.Message.setField(this, 3, value); pb_1.Message.setField(this, 3, value);
@ -300,7 +321,7 @@ export namespace vulcanize.auction.v1beta1 {
auction_id?: string; auction_id?: string;
commit_hash?: string; commit_hash?: string;
signer?: string; signer?: string;
}) { }): MsgCommitBid {
const message = new MsgCommitBid({}); const message = new MsgCommitBid({});
if (data.auction_id != null) { if (data.auction_id != null) {
message.auction_id = data.auction_id; message.auction_id = data.auction_id;
@ -334,11 +355,11 @@ export namespace vulcanize.auction.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (typeof this.auction_id === "string" && this.auction_id.length) if (this.auction_id.length)
writer.writeString(1, this.auction_id); writer.writeString(1, this.auction_id);
if (typeof this.commit_hash === "string" && this.commit_hash.length) if (this.commit_hash.length)
writer.writeString(2, this.commit_hash); writer.writeString(2, this.commit_hash);
if (typeof this.signer === "string" && this.signer.length) if (this.signer.length)
writer.writeString(3, this.signer); writer.writeString(3, this.signer);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -371,13 +392,14 @@ export namespace vulcanize.auction.v1beta1 {
} }
} }
export class MsgRevealBid extends pb_1.Message { export class MsgRevealBid extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
auction_id?: string; auction_id?: string;
reveal?: string; reveal?: string;
signer?: string; signer?: string;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("auction_id" in data && data.auction_id != undefined) { if ("auction_id" in data && data.auction_id != undefined) {
this.auction_id = data.auction_id; this.auction_id = data.auction_id;
@ -391,19 +413,19 @@ export namespace vulcanize.auction.v1beta1 {
} }
} }
get auction_id() { get auction_id() {
return pb_1.Message.getField(this, 1) as string; return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
} }
set auction_id(value: string) { set auction_id(value: string) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
get reveal() { get reveal() {
return pb_1.Message.getField(this, 2) as string; return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
} }
set reveal(value: string) { set reveal(value: string) {
pb_1.Message.setField(this, 2, value); pb_1.Message.setField(this, 2, value);
} }
get signer() { get signer() {
return pb_1.Message.getField(this, 3) as string; return pb_1.Message.getFieldWithDefault(this, 3, "") as string;
} }
set signer(value: string) { set signer(value: string) {
pb_1.Message.setField(this, 3, value); pb_1.Message.setField(this, 3, value);
@ -412,7 +434,7 @@ export namespace vulcanize.auction.v1beta1 {
auction_id?: string; auction_id?: string;
reveal?: string; reveal?: string;
signer?: string; signer?: string;
}) { }): MsgRevealBid {
const message = new MsgRevealBid({}); const message = new MsgRevealBid({});
if (data.auction_id != null) { if (data.auction_id != null) {
message.auction_id = data.auction_id; message.auction_id = data.auction_id;
@ -446,11 +468,11 @@ export namespace vulcanize.auction.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (typeof this.auction_id === "string" && this.auction_id.length) if (this.auction_id.length)
writer.writeString(1, this.auction_id); writer.writeString(1, this.auction_id);
if (typeof this.reveal === "string" && this.reveal.length) if (this.reveal.length)
writer.writeString(2, this.reveal); writer.writeString(2, this.reveal);
if (typeof this.signer === "string" && this.signer.length) if (this.signer.length)
writer.writeString(3, this.signer); writer.writeString(3, this.signer);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -483,11 +505,12 @@ export namespace vulcanize.auction.v1beta1 {
} }
} }
export class MsgCommitBidResponse extends pb_1.Message { export class MsgCommitBidResponse extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
bid?: dependency_4.vulcanize.auction.v1beta1.Bid; bid?: dependency_4.vulcanize.auction.v1beta1.Bid;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("bid" in data && data.bid != undefined) { if ("bid" in data && data.bid != undefined) {
this.bid = data.bid; this.bid = data.bid;
@ -500,9 +523,12 @@ export namespace vulcanize.auction.v1beta1 {
set bid(value: dependency_4.vulcanize.auction.v1beta1.Bid) { set bid(value: dependency_4.vulcanize.auction.v1beta1.Bid) {
pb_1.Message.setWrapperField(this, 1, value); pb_1.Message.setWrapperField(this, 1, value);
} }
get has_bid() {
return pb_1.Message.getField(this, 1) != null;
}
static fromObject(data: { static fromObject(data: {
bid?: ReturnType<typeof dependency_4.vulcanize.auction.v1beta1.Bid.prototype.toObject>; bid?: ReturnType<typeof dependency_4.vulcanize.auction.v1beta1.Bid.prototype.toObject>;
}) { }): MsgCommitBidResponse {
const message = new MsgCommitBidResponse({}); const message = new MsgCommitBidResponse({});
if (data.bid != null) { if (data.bid != null) {
message.bid = dependency_4.vulcanize.auction.v1beta1.Bid.fromObject(data.bid); message.bid = dependency_4.vulcanize.auction.v1beta1.Bid.fromObject(data.bid);
@ -522,7 +548,7 @@ export namespace vulcanize.auction.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (this.bid !== undefined) if (this.has_bid)
writer.writeMessage(1, this.bid, () => this.bid.serialize(writer)); writer.writeMessage(1, this.bid, () => this.bid.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -549,11 +575,12 @@ export namespace vulcanize.auction.v1beta1 {
} }
} }
export class MsgRevealBidResponse extends pb_1.Message { export class MsgRevealBidResponse extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
auction?: dependency_4.vulcanize.auction.v1beta1.Auction; auction?: dependency_4.vulcanize.auction.v1beta1.Auction;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("auction" in data && data.auction != undefined) { if ("auction" in data && data.auction != undefined) {
this.auction = data.auction; this.auction = data.auction;
@ -566,9 +593,12 @@ export namespace vulcanize.auction.v1beta1 {
set auction(value: dependency_4.vulcanize.auction.v1beta1.Auction) { set auction(value: dependency_4.vulcanize.auction.v1beta1.Auction) {
pb_1.Message.setWrapperField(this, 1, value); pb_1.Message.setWrapperField(this, 1, value);
} }
get has_auction() {
return pb_1.Message.getField(this, 1) != null;
}
static fromObject(data: { static fromObject(data: {
auction?: ReturnType<typeof dependency_4.vulcanize.auction.v1beta1.Auction.prototype.toObject>; auction?: ReturnType<typeof dependency_4.vulcanize.auction.v1beta1.Auction.prototype.toObject>;
}) { }): MsgRevealBidResponse {
const message = new MsgRevealBidResponse({}); const message = new MsgRevealBidResponse({});
if (data.auction != null) { if (data.auction != null) {
message.auction = dependency_4.vulcanize.auction.v1beta1.Auction.fromObject(data.auction); message.auction = dependency_4.vulcanize.auction.v1beta1.Auction.fromObject(data.auction);
@ -588,7 +618,7 @@ export namespace vulcanize.auction.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (this.auction !== undefined) if (this.has_auction)
writer.writeMessage(1, this.auction, () => this.auction.serialize(writer)); writer.writeMessage(1, this.auction, () => this.auction.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();

View File

@ -2,7 +2,7 @@
/* eslint-disable */ /* eslint-disable */
/** /**
* Generated by the protoc-gen-ts. DO NOT EDIT! * Generated by the protoc-gen-ts. DO NOT EDIT!
* compiler version: 3.14.0 * compiler version: 4.25.1
* source: vulcanize/auction/v1beta1/types.proto * source: vulcanize/auction/v1beta1/types.proto
* git: https://github.com/thesayyn/protoc-gen-ts */ * git: https://github.com/thesayyn/protoc-gen-ts */
import * as dependency_1 from "./../../../gogoproto/gogo"; import * as dependency_1 from "./../../../gogoproto/gogo";
@ -12,6 +12,7 @@ import * as dependency_4 from "./../../../cosmos/base/v1beta1/coin";
import * as pb_1 from "google-protobuf"; import * as pb_1 from "google-protobuf";
export namespace vulcanize.auction.v1beta1 { export namespace vulcanize.auction.v1beta1 {
export class Params extends pb_1.Message { export class Params extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
commits_duration?: dependency_2.google.protobuf.Duration; commits_duration?: dependency_2.google.protobuf.Duration;
reveals_duration?: dependency_2.google.protobuf.Duration; reveals_duration?: dependency_2.google.protobuf.Duration;
@ -20,7 +21,7 @@ export namespace vulcanize.auction.v1beta1 {
minimum_bid?: dependency_4.cosmos.base.v1beta1.Coin; minimum_bid?: dependency_4.cosmos.base.v1beta1.Coin;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("commits_duration" in data && data.commits_duration != undefined) { if ("commits_duration" in data && data.commits_duration != undefined) {
this.commits_duration = data.commits_duration; this.commits_duration = data.commits_duration;
@ -45,37 +46,52 @@ export namespace vulcanize.auction.v1beta1 {
set commits_duration(value: dependency_2.google.protobuf.Duration) { set commits_duration(value: dependency_2.google.protobuf.Duration) {
pb_1.Message.setWrapperField(this, 1, value); pb_1.Message.setWrapperField(this, 1, value);
} }
get has_commits_duration() {
return pb_1.Message.getField(this, 1) != null;
}
get reveals_duration() { get reveals_duration() {
return pb_1.Message.getWrapperField(this, dependency_2.google.protobuf.Duration, 2) as dependency_2.google.protobuf.Duration; return pb_1.Message.getWrapperField(this, dependency_2.google.protobuf.Duration, 2) as dependency_2.google.protobuf.Duration;
} }
set reveals_duration(value: dependency_2.google.protobuf.Duration) { set reveals_duration(value: dependency_2.google.protobuf.Duration) {
pb_1.Message.setWrapperField(this, 2, value); pb_1.Message.setWrapperField(this, 2, value);
} }
get has_reveals_duration() {
return pb_1.Message.getField(this, 2) != null;
}
get commit_fee() { get commit_fee() {
return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 3) as dependency_4.cosmos.base.v1beta1.Coin; return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 3) as dependency_4.cosmos.base.v1beta1.Coin;
} }
set commit_fee(value: dependency_4.cosmos.base.v1beta1.Coin) { set commit_fee(value: dependency_4.cosmos.base.v1beta1.Coin) {
pb_1.Message.setWrapperField(this, 3, value); pb_1.Message.setWrapperField(this, 3, value);
} }
get has_commit_fee() {
return pb_1.Message.getField(this, 3) != null;
}
get reveal_fee() { get reveal_fee() {
return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 4) as dependency_4.cosmos.base.v1beta1.Coin; return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 4) as dependency_4.cosmos.base.v1beta1.Coin;
} }
set reveal_fee(value: dependency_4.cosmos.base.v1beta1.Coin) { set reveal_fee(value: dependency_4.cosmos.base.v1beta1.Coin) {
pb_1.Message.setWrapperField(this, 4, value); pb_1.Message.setWrapperField(this, 4, value);
} }
get has_reveal_fee() {
return pb_1.Message.getField(this, 4) != null;
}
get minimum_bid() { get minimum_bid() {
return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 5) as dependency_4.cosmos.base.v1beta1.Coin; return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 5) as dependency_4.cosmos.base.v1beta1.Coin;
} }
set minimum_bid(value: dependency_4.cosmos.base.v1beta1.Coin) { set minimum_bid(value: dependency_4.cosmos.base.v1beta1.Coin) {
pb_1.Message.setWrapperField(this, 5, value); pb_1.Message.setWrapperField(this, 5, value);
} }
get has_minimum_bid() {
return pb_1.Message.getField(this, 5) != null;
}
static fromObject(data: { static fromObject(data: {
commits_duration?: ReturnType<typeof dependency_2.google.protobuf.Duration.prototype.toObject>; commits_duration?: ReturnType<typeof dependency_2.google.protobuf.Duration.prototype.toObject>;
reveals_duration?: ReturnType<typeof dependency_2.google.protobuf.Duration.prototype.toObject>; reveals_duration?: ReturnType<typeof dependency_2.google.protobuf.Duration.prototype.toObject>;
commit_fee?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>; commit_fee?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>;
reveal_fee?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>; reveal_fee?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>;
minimum_bid?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>; minimum_bid?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>;
}) { }): Params {
const message = new Params({}); const message = new Params({});
if (data.commits_duration != null) { if (data.commits_duration != null) {
message.commits_duration = dependency_2.google.protobuf.Duration.fromObject(data.commits_duration); message.commits_duration = dependency_2.google.protobuf.Duration.fromObject(data.commits_duration);
@ -123,15 +139,15 @@ export namespace vulcanize.auction.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (this.commits_duration !== undefined) if (this.has_commits_duration)
writer.writeMessage(1, this.commits_duration, () => this.commits_duration.serialize(writer)); writer.writeMessage(1, this.commits_duration, () => this.commits_duration.serialize(writer));
if (this.reveals_duration !== undefined) if (this.has_reveals_duration)
writer.writeMessage(2, this.reveals_duration, () => this.reveals_duration.serialize(writer)); writer.writeMessage(2, this.reveals_duration, () => this.reveals_duration.serialize(writer));
if (this.commit_fee !== undefined) if (this.has_commit_fee)
writer.writeMessage(3, this.commit_fee, () => this.commit_fee.serialize(writer)); writer.writeMessage(3, this.commit_fee, () => this.commit_fee.serialize(writer));
if (this.reveal_fee !== undefined) if (this.has_reveal_fee)
writer.writeMessage(4, this.reveal_fee, () => this.reveal_fee.serialize(writer)); writer.writeMessage(4, this.reveal_fee, () => this.reveal_fee.serialize(writer));
if (this.minimum_bid !== undefined) if (this.has_minimum_bid)
writer.writeMessage(5, this.minimum_bid, () => this.minimum_bid.serialize(writer)); writer.writeMessage(5, this.minimum_bid, () => this.minimum_bid.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -170,6 +186,7 @@ export namespace vulcanize.auction.v1beta1 {
} }
} }
export class Auction extends pb_1.Message { export class Auction extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
id?: string; id?: string;
status?: string; status?: string;
@ -185,7 +202,7 @@ export namespace vulcanize.auction.v1beta1 {
winning_price?: dependency_4.cosmos.base.v1beta1.Coin; winning_price?: dependency_4.cosmos.base.v1beta1.Coin;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("id" in data && data.id != undefined) { if ("id" in data && data.id != undefined) {
this.id = data.id; this.id = data.id;
@ -226,19 +243,19 @@ export namespace vulcanize.auction.v1beta1 {
} }
} }
get id() { get id() {
return pb_1.Message.getField(this, 1) as string; return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
} }
set id(value: string) { set id(value: string) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
get status() { get status() {
return pb_1.Message.getField(this, 2) as string; return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
} }
set status(value: string) { set status(value: string) {
pb_1.Message.setField(this, 2, value); pb_1.Message.setField(this, 2, value);
} }
get owner_address() { get owner_address() {
return pb_1.Message.getField(this, 3) as string; return pb_1.Message.getFieldWithDefault(this, 3, "") as string;
} }
set owner_address(value: string) { set owner_address(value: string) {
pb_1.Message.setField(this, 3, value); pb_1.Message.setField(this, 3, value);
@ -249,38 +266,56 @@ export namespace vulcanize.auction.v1beta1 {
set create_time(value: dependency_3.google.protobuf.Timestamp) { set create_time(value: dependency_3.google.protobuf.Timestamp) {
pb_1.Message.setWrapperField(this, 4, value); pb_1.Message.setWrapperField(this, 4, value);
} }
get has_create_time() {
return pb_1.Message.getField(this, 4) != null;
}
get commits_end_time() { get commits_end_time() {
return pb_1.Message.getWrapperField(this, dependency_3.google.protobuf.Timestamp, 5) as dependency_3.google.protobuf.Timestamp; return pb_1.Message.getWrapperField(this, dependency_3.google.protobuf.Timestamp, 5) as dependency_3.google.protobuf.Timestamp;
} }
set commits_end_time(value: dependency_3.google.protobuf.Timestamp) { set commits_end_time(value: dependency_3.google.protobuf.Timestamp) {
pb_1.Message.setWrapperField(this, 5, value); pb_1.Message.setWrapperField(this, 5, value);
} }
get has_commits_end_time() {
return pb_1.Message.getField(this, 5) != null;
}
get reveals_end_time() { get reveals_end_time() {
return pb_1.Message.getWrapperField(this, dependency_3.google.protobuf.Timestamp, 6) as dependency_3.google.protobuf.Timestamp; return pb_1.Message.getWrapperField(this, dependency_3.google.protobuf.Timestamp, 6) as dependency_3.google.protobuf.Timestamp;
} }
set reveals_end_time(value: dependency_3.google.protobuf.Timestamp) { set reveals_end_time(value: dependency_3.google.protobuf.Timestamp) {
pb_1.Message.setWrapperField(this, 6, value); pb_1.Message.setWrapperField(this, 6, value);
} }
get has_reveals_end_time() {
return pb_1.Message.getField(this, 6) != null;
}
get commit_fee() { get commit_fee() {
return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 7) as dependency_4.cosmos.base.v1beta1.Coin; return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 7) as dependency_4.cosmos.base.v1beta1.Coin;
} }
set commit_fee(value: dependency_4.cosmos.base.v1beta1.Coin) { set commit_fee(value: dependency_4.cosmos.base.v1beta1.Coin) {
pb_1.Message.setWrapperField(this, 7, value); pb_1.Message.setWrapperField(this, 7, value);
} }
get has_commit_fee() {
return pb_1.Message.getField(this, 7) != null;
}
get reveal_fee() { get reveal_fee() {
return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 8) as dependency_4.cosmos.base.v1beta1.Coin; return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 8) as dependency_4.cosmos.base.v1beta1.Coin;
} }
set reveal_fee(value: dependency_4.cosmos.base.v1beta1.Coin) { set reveal_fee(value: dependency_4.cosmos.base.v1beta1.Coin) {
pb_1.Message.setWrapperField(this, 8, value); pb_1.Message.setWrapperField(this, 8, value);
} }
get has_reveal_fee() {
return pb_1.Message.getField(this, 8) != null;
}
get minimum_bid() { get minimum_bid() {
return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 9) as dependency_4.cosmos.base.v1beta1.Coin; return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 9) as dependency_4.cosmos.base.v1beta1.Coin;
} }
set minimum_bid(value: dependency_4.cosmos.base.v1beta1.Coin) { set minimum_bid(value: dependency_4.cosmos.base.v1beta1.Coin) {
pb_1.Message.setWrapperField(this, 9, value); pb_1.Message.setWrapperField(this, 9, value);
} }
get has_minimum_bid() {
return pb_1.Message.getField(this, 9) != null;
}
get winner_address() { get winner_address() {
return pb_1.Message.getField(this, 10) as string; return pb_1.Message.getFieldWithDefault(this, 10, "") as string;
} }
set winner_address(value: string) { set winner_address(value: string) {
pb_1.Message.setField(this, 10, value); pb_1.Message.setField(this, 10, value);
@ -291,12 +326,18 @@ export namespace vulcanize.auction.v1beta1 {
set winning_bid(value: dependency_4.cosmos.base.v1beta1.Coin) { set winning_bid(value: dependency_4.cosmos.base.v1beta1.Coin) {
pb_1.Message.setWrapperField(this, 11, value); pb_1.Message.setWrapperField(this, 11, value);
} }
get has_winning_bid() {
return pb_1.Message.getField(this, 11) != null;
}
get winning_price() { get winning_price() {
return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 12) as dependency_4.cosmos.base.v1beta1.Coin; return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 12) as dependency_4.cosmos.base.v1beta1.Coin;
} }
set winning_price(value: dependency_4.cosmos.base.v1beta1.Coin) { set winning_price(value: dependency_4.cosmos.base.v1beta1.Coin) {
pb_1.Message.setWrapperField(this, 12, value); pb_1.Message.setWrapperField(this, 12, value);
} }
get has_winning_price() {
return pb_1.Message.getField(this, 12) != null;
}
static fromObject(data: { static fromObject(data: {
id?: string; id?: string;
status?: string; status?: string;
@ -310,7 +351,7 @@ export namespace vulcanize.auction.v1beta1 {
winner_address?: string; winner_address?: string;
winning_bid?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>; winning_bid?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>;
winning_price?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>; winning_price?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>;
}) { }): Auction {
const message = new Auction({}); const message = new Auction({});
if (data.id != null) { if (data.id != null) {
message.id = data.id; message.id = data.id;
@ -407,29 +448,29 @@ export namespace vulcanize.auction.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (typeof this.id === "string" && this.id.length) if (this.id.length)
writer.writeString(1, this.id); writer.writeString(1, this.id);
if (typeof this.status === "string" && this.status.length) if (this.status.length)
writer.writeString(2, this.status); writer.writeString(2, this.status);
if (typeof this.owner_address === "string" && this.owner_address.length) if (this.owner_address.length)
writer.writeString(3, this.owner_address); writer.writeString(3, this.owner_address);
if (this.create_time !== undefined) if (this.has_create_time)
writer.writeMessage(4, this.create_time, () => this.create_time.serialize(writer)); writer.writeMessage(4, this.create_time, () => this.create_time.serialize(writer));
if (this.commits_end_time !== undefined) if (this.has_commits_end_time)
writer.writeMessage(5, this.commits_end_time, () => this.commits_end_time.serialize(writer)); writer.writeMessage(5, this.commits_end_time, () => this.commits_end_time.serialize(writer));
if (this.reveals_end_time !== undefined) if (this.has_reveals_end_time)
writer.writeMessage(6, this.reveals_end_time, () => this.reveals_end_time.serialize(writer)); writer.writeMessage(6, this.reveals_end_time, () => this.reveals_end_time.serialize(writer));
if (this.commit_fee !== undefined) if (this.has_commit_fee)
writer.writeMessage(7, this.commit_fee, () => this.commit_fee.serialize(writer)); writer.writeMessage(7, this.commit_fee, () => this.commit_fee.serialize(writer));
if (this.reveal_fee !== undefined) if (this.has_reveal_fee)
writer.writeMessage(8, this.reveal_fee, () => this.reveal_fee.serialize(writer)); writer.writeMessage(8, this.reveal_fee, () => this.reveal_fee.serialize(writer));
if (this.minimum_bid !== undefined) if (this.has_minimum_bid)
writer.writeMessage(9, this.minimum_bid, () => this.minimum_bid.serialize(writer)); writer.writeMessage(9, this.minimum_bid, () => this.minimum_bid.serialize(writer));
if (typeof this.winner_address === "string" && this.winner_address.length) if (this.winner_address.length)
writer.writeString(10, this.winner_address); writer.writeString(10, this.winner_address);
if (this.winning_bid !== undefined) if (this.has_winning_bid)
writer.writeMessage(11, this.winning_bid, () => this.winning_bid.serialize(writer)); writer.writeMessage(11, this.winning_bid, () => this.winning_bid.serialize(writer));
if (this.winning_price !== undefined) if (this.has_winning_price)
writer.writeMessage(12, this.winning_price, () => this.winning_price.serialize(writer)); writer.writeMessage(12, this.winning_price, () => this.winning_price.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -489,11 +530,12 @@ export namespace vulcanize.auction.v1beta1 {
} }
} }
export class Auctions extends pb_1.Message { export class Auctions extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
auctions?: Auction[]; auctions?: Auction[];
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("auctions" in data && data.auctions != undefined) { if ("auctions" in data && data.auctions != undefined) {
this.auctions = data.auctions; this.auctions = data.auctions;
@ -508,7 +550,7 @@ export namespace vulcanize.auction.v1beta1 {
} }
static fromObject(data: { static fromObject(data: {
auctions?: ReturnType<typeof Auction.prototype.toObject>[]; auctions?: ReturnType<typeof Auction.prototype.toObject>[];
}) { }): Auctions {
const message = new Auctions({}); const message = new Auctions({});
if (data.auctions != null) { if (data.auctions != null) {
message.auctions = data.auctions.map(item => Auction.fromObject(item)); message.auctions = data.auctions.map(item => Auction.fromObject(item));
@ -528,7 +570,7 @@ export namespace vulcanize.auction.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (this.auctions !== undefined) if (this.auctions.length)
writer.writeRepeatedMessage(1, this.auctions, (item: Auction) => item.serialize(writer)); writer.writeRepeatedMessage(1, this.auctions, (item: Auction) => item.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -555,6 +597,7 @@ export namespace vulcanize.auction.v1beta1 {
} }
} }
export class Bid extends pb_1.Message { export class Bid extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
auction_id?: string; auction_id?: string;
bidder_address?: string; bidder_address?: string;
@ -567,7 +610,7 @@ export namespace vulcanize.auction.v1beta1 {
bid_amount?: dependency_4.cosmos.base.v1beta1.Coin; bid_amount?: dependency_4.cosmos.base.v1beta1.Coin;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("auction_id" in data && data.auction_id != undefined) { if ("auction_id" in data && data.auction_id != undefined) {
this.auction_id = data.auction_id; this.auction_id = data.auction_id;
@ -599,25 +642,25 @@ export namespace vulcanize.auction.v1beta1 {
} }
} }
get auction_id() { get auction_id() {
return pb_1.Message.getField(this, 1) as string; return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
} }
set auction_id(value: string) { set auction_id(value: string) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
get bidder_address() { get bidder_address() {
return pb_1.Message.getField(this, 2) as string; return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
} }
set bidder_address(value: string) { set bidder_address(value: string) {
pb_1.Message.setField(this, 2, value); pb_1.Message.setField(this, 2, value);
} }
get status() { get status() {
return pb_1.Message.getField(this, 3) as string; return pb_1.Message.getFieldWithDefault(this, 3, "") as string;
} }
set status(value: string) { set status(value: string) {
pb_1.Message.setField(this, 3, value); pb_1.Message.setField(this, 3, value);
} }
get commit_hash() { get commit_hash() {
return pb_1.Message.getField(this, 4) as string; return pb_1.Message.getFieldWithDefault(this, 4, "") as string;
} }
set commit_hash(value: string) { set commit_hash(value: string) {
pb_1.Message.setField(this, 4, value); pb_1.Message.setField(this, 4, value);
@ -628,30 +671,45 @@ export namespace vulcanize.auction.v1beta1 {
set commit_time(value: dependency_3.google.protobuf.Timestamp) { set commit_time(value: dependency_3.google.protobuf.Timestamp) {
pb_1.Message.setWrapperField(this, 5, value); pb_1.Message.setWrapperField(this, 5, value);
} }
get has_commit_time() {
return pb_1.Message.getField(this, 5) != null;
}
get commit_fee() { get commit_fee() {
return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 6) as dependency_4.cosmos.base.v1beta1.Coin; return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 6) as dependency_4.cosmos.base.v1beta1.Coin;
} }
set commit_fee(value: dependency_4.cosmos.base.v1beta1.Coin) { set commit_fee(value: dependency_4.cosmos.base.v1beta1.Coin) {
pb_1.Message.setWrapperField(this, 6, value); pb_1.Message.setWrapperField(this, 6, value);
} }
get has_commit_fee() {
return pb_1.Message.getField(this, 6) != null;
}
get reveal_time() { get reveal_time() {
return pb_1.Message.getWrapperField(this, dependency_3.google.protobuf.Timestamp, 7) as dependency_3.google.protobuf.Timestamp; return pb_1.Message.getWrapperField(this, dependency_3.google.protobuf.Timestamp, 7) as dependency_3.google.protobuf.Timestamp;
} }
set reveal_time(value: dependency_3.google.protobuf.Timestamp) { set reveal_time(value: dependency_3.google.protobuf.Timestamp) {
pb_1.Message.setWrapperField(this, 7, value); pb_1.Message.setWrapperField(this, 7, value);
} }
get has_reveal_time() {
return pb_1.Message.getField(this, 7) != null;
}
get reveal_fee() { get reveal_fee() {
return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 8) as dependency_4.cosmos.base.v1beta1.Coin; return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 8) as dependency_4.cosmos.base.v1beta1.Coin;
} }
set reveal_fee(value: dependency_4.cosmos.base.v1beta1.Coin) { set reveal_fee(value: dependency_4.cosmos.base.v1beta1.Coin) {
pb_1.Message.setWrapperField(this, 8, value); pb_1.Message.setWrapperField(this, 8, value);
} }
get has_reveal_fee() {
return pb_1.Message.getField(this, 8) != null;
}
get bid_amount() { get bid_amount() {
return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 9) as dependency_4.cosmos.base.v1beta1.Coin; return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 9) as dependency_4.cosmos.base.v1beta1.Coin;
} }
set bid_amount(value: dependency_4.cosmos.base.v1beta1.Coin) { set bid_amount(value: dependency_4.cosmos.base.v1beta1.Coin) {
pb_1.Message.setWrapperField(this, 9, value); pb_1.Message.setWrapperField(this, 9, value);
} }
get has_bid_amount() {
return pb_1.Message.getField(this, 9) != null;
}
static fromObject(data: { static fromObject(data: {
auction_id?: string; auction_id?: string;
bidder_address?: string; bidder_address?: string;
@ -662,7 +720,7 @@ export namespace vulcanize.auction.v1beta1 {
reveal_time?: ReturnType<typeof dependency_3.google.protobuf.Timestamp.prototype.toObject>; reveal_time?: ReturnType<typeof dependency_3.google.protobuf.Timestamp.prototype.toObject>;
reveal_fee?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>; reveal_fee?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>;
bid_amount?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>; bid_amount?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>;
}) { }): Bid {
const message = new Bid({}); const message = new Bid({});
if (data.auction_id != null) { if (data.auction_id != null) {
message.auction_id = data.auction_id; message.auction_id = data.auction_id;
@ -738,23 +796,23 @@ export namespace vulcanize.auction.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (typeof this.auction_id === "string" && this.auction_id.length) if (this.auction_id.length)
writer.writeString(1, this.auction_id); writer.writeString(1, this.auction_id);
if (typeof this.bidder_address === "string" && this.bidder_address.length) if (this.bidder_address.length)
writer.writeString(2, this.bidder_address); writer.writeString(2, this.bidder_address);
if (typeof this.status === "string" && this.status.length) if (this.status.length)
writer.writeString(3, this.status); writer.writeString(3, this.status);
if (typeof this.commit_hash === "string" && this.commit_hash.length) if (this.commit_hash.length)
writer.writeString(4, this.commit_hash); writer.writeString(4, this.commit_hash);
if (this.commit_time !== undefined) if (this.has_commit_time)
writer.writeMessage(5, this.commit_time, () => this.commit_time.serialize(writer)); writer.writeMessage(5, this.commit_time, () => this.commit_time.serialize(writer));
if (this.commit_fee !== undefined) if (this.has_commit_fee)
writer.writeMessage(6, this.commit_fee, () => this.commit_fee.serialize(writer)); writer.writeMessage(6, this.commit_fee, () => this.commit_fee.serialize(writer));
if (this.reveal_time !== undefined) if (this.has_reveal_time)
writer.writeMessage(7, this.reveal_time, () => this.reveal_time.serialize(writer)); writer.writeMessage(7, this.reveal_time, () => this.reveal_time.serialize(writer));
if (this.reveal_fee !== undefined) if (this.has_reveal_fee)
writer.writeMessage(8, this.reveal_fee, () => this.reveal_fee.serialize(writer)); writer.writeMessage(8, this.reveal_fee, () => this.reveal_fee.serialize(writer));
if (this.bid_amount !== undefined) if (this.has_bid_amount)
writer.writeMessage(9, this.bid_amount, () => this.bid_amount.serialize(writer)); writer.writeMessage(9, this.bid_amount, () => this.bid_amount.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();

View File

@ -2,7 +2,7 @@
/* eslint-disable */ /* eslint-disable */
/** /**
* Generated by the protoc-gen-ts. DO NOT EDIT! * Generated by the protoc-gen-ts. DO NOT EDIT!
* compiler version: 3.14.0 * compiler version: 4.25.1
* source: vulcanize/bond/v1beta1/bond.proto * source: vulcanize/bond/v1beta1/bond.proto
* git: https://github.com/thesayyn/protoc-gen-ts */ * git: https://github.com/thesayyn/protoc-gen-ts */
import * as dependency_1 from "./../../../gogoproto/gogo"; import * as dependency_1 from "./../../../gogoproto/gogo";
@ -10,11 +10,12 @@ import * as dependency_2 from "./../../../cosmos/base/v1beta1/coin";
import * as pb_1 from "google-protobuf"; import * as pb_1 from "google-protobuf";
export namespace vulcanize.bond.v1beta1 { export namespace vulcanize.bond.v1beta1 {
export class Params extends pb_1.Message { export class Params extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
max_bond_amount?: dependency_2.cosmos.base.v1beta1.Coin; max_bond_amount?: dependency_2.cosmos.base.v1beta1.Coin;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("max_bond_amount" in data && data.max_bond_amount != undefined) { if ("max_bond_amount" in data && data.max_bond_amount != undefined) {
this.max_bond_amount = data.max_bond_amount; this.max_bond_amount = data.max_bond_amount;
@ -27,9 +28,12 @@ export namespace vulcanize.bond.v1beta1 {
set max_bond_amount(value: dependency_2.cosmos.base.v1beta1.Coin) { set max_bond_amount(value: dependency_2.cosmos.base.v1beta1.Coin) {
pb_1.Message.setWrapperField(this, 1, value); pb_1.Message.setWrapperField(this, 1, value);
} }
get has_max_bond_amount() {
return pb_1.Message.getField(this, 1) != null;
}
static fromObject(data: { static fromObject(data: {
max_bond_amount?: ReturnType<typeof dependency_2.cosmos.base.v1beta1.Coin.prototype.toObject>; max_bond_amount?: ReturnType<typeof dependency_2.cosmos.base.v1beta1.Coin.prototype.toObject>;
}) { }): Params {
const message = new Params({}); const message = new Params({});
if (data.max_bond_amount != null) { if (data.max_bond_amount != null) {
message.max_bond_amount = dependency_2.cosmos.base.v1beta1.Coin.fromObject(data.max_bond_amount); message.max_bond_amount = dependency_2.cosmos.base.v1beta1.Coin.fromObject(data.max_bond_amount);
@ -49,7 +53,7 @@ export namespace vulcanize.bond.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (this.max_bond_amount !== undefined) if (this.has_max_bond_amount)
writer.writeMessage(1, this.max_bond_amount, () => this.max_bond_amount.serialize(writer)); writer.writeMessage(1, this.max_bond_amount, () => this.max_bond_amount.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -76,13 +80,14 @@ export namespace vulcanize.bond.v1beta1 {
} }
} }
export class Bond extends pb_1.Message { export class Bond extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
id?: string; id?: string;
owner?: string; owner?: string;
balance?: dependency_2.cosmos.base.v1beta1.Coin[]; balance?: dependency_2.cosmos.base.v1beta1.Coin[];
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("id" in data && data.id != undefined) { if ("id" in data && data.id != undefined) {
this.id = data.id; this.id = data.id;
@ -96,13 +101,13 @@ export namespace vulcanize.bond.v1beta1 {
} }
} }
get id() { get id() {
return pb_1.Message.getField(this, 1) as string; return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
} }
set id(value: string) { set id(value: string) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
get owner() { get owner() {
return pb_1.Message.getField(this, 2) as string; return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
} }
set owner(value: string) { set owner(value: string) {
pb_1.Message.setField(this, 2, value); pb_1.Message.setField(this, 2, value);
@ -117,7 +122,7 @@ export namespace vulcanize.bond.v1beta1 {
id?: string; id?: string;
owner?: string; owner?: string;
balance?: ReturnType<typeof dependency_2.cosmos.base.v1beta1.Coin.prototype.toObject>[]; balance?: ReturnType<typeof dependency_2.cosmos.base.v1beta1.Coin.prototype.toObject>[];
}) { }): Bond {
const message = new Bond({}); const message = new Bond({});
if (data.id != null) { if (data.id != null) {
message.id = data.id; message.id = data.id;
@ -151,11 +156,11 @@ export namespace vulcanize.bond.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (typeof this.id === "string" && this.id.length) if (this.id.length)
writer.writeString(1, this.id); writer.writeString(1, this.id);
if (typeof this.owner === "string" && this.owner.length) if (this.owner.length)
writer.writeString(2, this.owner); writer.writeString(2, this.owner);
if (this.balance !== undefined) if (this.balance.length)
writer.writeRepeatedMessage(3, this.balance, (item: dependency_2.cosmos.base.v1beta1.Coin) => item.serialize(writer)); writer.writeRepeatedMessage(3, this.balance, (item: dependency_2.cosmos.base.v1beta1.Coin) => item.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();

View File

@ -2,7 +2,7 @@
/* eslint-disable */ /* eslint-disable */
/** /**
* Generated by the protoc-gen-ts. DO NOT EDIT! * Generated by the protoc-gen-ts. DO NOT EDIT!
* compiler version: 3.14.0 * compiler version: 4.25.1
* source: vulcanize/bond/v1beta1/genesis.proto * source: vulcanize/bond/v1beta1/genesis.proto
* git: https://github.com/thesayyn/protoc-gen-ts */ * git: https://github.com/thesayyn/protoc-gen-ts */
import * as dependency_1 from "./../../../gogoproto/gogo"; import * as dependency_1 from "./../../../gogoproto/gogo";
@ -10,12 +10,13 @@ import * as dependency_2 from "./bond";
import * as pb_1 from "google-protobuf"; import * as pb_1 from "google-protobuf";
export namespace vulcanize.bond.v1beta1 { export namespace vulcanize.bond.v1beta1 {
export class GenesisState extends pb_1.Message { export class GenesisState extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
params?: dependency_2.vulcanize.bond.v1beta1.Params; params?: dependency_2.vulcanize.bond.v1beta1.Params;
bonds?: dependency_2.vulcanize.bond.v1beta1.Bond[]; bonds?: dependency_2.vulcanize.bond.v1beta1.Bond[];
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("params" in data && data.params != undefined) { if ("params" in data && data.params != undefined) {
this.params = data.params; this.params = data.params;
@ -31,6 +32,9 @@ export namespace vulcanize.bond.v1beta1 {
set params(value: dependency_2.vulcanize.bond.v1beta1.Params) { set params(value: dependency_2.vulcanize.bond.v1beta1.Params) {
pb_1.Message.setWrapperField(this, 1, value); pb_1.Message.setWrapperField(this, 1, value);
} }
get has_params() {
return pb_1.Message.getField(this, 1) != null;
}
get bonds() { get bonds() {
return pb_1.Message.getRepeatedWrapperField(this, dependency_2.vulcanize.bond.v1beta1.Bond, 2) as dependency_2.vulcanize.bond.v1beta1.Bond[]; return pb_1.Message.getRepeatedWrapperField(this, dependency_2.vulcanize.bond.v1beta1.Bond, 2) as dependency_2.vulcanize.bond.v1beta1.Bond[];
} }
@ -40,7 +44,7 @@ export namespace vulcanize.bond.v1beta1 {
static fromObject(data: { static fromObject(data: {
params?: ReturnType<typeof dependency_2.vulcanize.bond.v1beta1.Params.prototype.toObject>; params?: ReturnType<typeof dependency_2.vulcanize.bond.v1beta1.Params.prototype.toObject>;
bonds?: ReturnType<typeof dependency_2.vulcanize.bond.v1beta1.Bond.prototype.toObject>[]; bonds?: ReturnType<typeof dependency_2.vulcanize.bond.v1beta1.Bond.prototype.toObject>[];
}) { }): GenesisState {
const message = new GenesisState({}); const message = new GenesisState({});
if (data.params != null) { if (data.params != null) {
message.params = dependency_2.vulcanize.bond.v1beta1.Params.fromObject(data.params); message.params = dependency_2.vulcanize.bond.v1beta1.Params.fromObject(data.params);
@ -67,9 +71,9 @@ export namespace vulcanize.bond.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (this.params !== undefined) if (this.has_params)
writer.writeMessage(1, this.params, () => this.params.serialize(writer)); writer.writeMessage(1, this.params, () => this.params.serialize(writer));
if (this.bonds !== undefined) if (this.bonds.length)
writer.writeRepeatedMessage(2, this.bonds, (item: dependency_2.vulcanize.bond.v1beta1.Bond) => item.serialize(writer)); writer.writeRepeatedMessage(2, this.bonds, (item: dependency_2.vulcanize.bond.v1beta1.Bond) => item.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();

View File

@ -2,7 +2,7 @@
/* eslint-disable */ /* eslint-disable */
/** /**
* Generated by the protoc-gen-ts. DO NOT EDIT! * Generated by the protoc-gen-ts. DO NOT EDIT!
* compiler version: 3.14.0 * compiler version: 4.25.1
* source: vulcanize/bond/v1beta1/query.proto * source: vulcanize/bond/v1beta1/query.proto
* git: https://github.com/thesayyn/protoc-gen-ts */ * git: https://github.com/thesayyn/protoc-gen-ts */
import * as dependency_1 from "./../../../gogoproto/gogo"; import * as dependency_1 from "./../../../gogoproto/gogo";
@ -13,12 +13,13 @@ import * as dependency_5 from "./../../../cosmos/base/v1beta1/coin";
import * as pb_1 from "google-protobuf"; import * as pb_1 from "google-protobuf";
export namespace vulcanize.bond.v1beta1 { export namespace vulcanize.bond.v1beta1 {
export class QueryParamsRequest extends pb_1.Message { export class QueryParamsRequest extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {}) { constructor(data?: any[] | {}) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { } if (!Array.isArray(data) && typeof data == "object") { }
} }
static fromObject(data: {}) { static fromObject(data: {}): QueryParamsRequest {
const message = new QueryParamsRequest({}); const message = new QueryParamsRequest({});
return message; return message;
} }
@ -52,11 +53,12 @@ export namespace vulcanize.bond.v1beta1 {
} }
} }
export class QueryParamsResponse extends pb_1.Message { export class QueryParamsResponse extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
params?: dependency_2.vulcanize.bond.v1beta1.Params; params?: dependency_2.vulcanize.bond.v1beta1.Params;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("params" in data && data.params != undefined) { if ("params" in data && data.params != undefined) {
this.params = data.params; this.params = data.params;
@ -69,9 +71,12 @@ export namespace vulcanize.bond.v1beta1 {
set params(value: dependency_2.vulcanize.bond.v1beta1.Params) { set params(value: dependency_2.vulcanize.bond.v1beta1.Params) {
pb_1.Message.setWrapperField(this, 1, value); pb_1.Message.setWrapperField(this, 1, value);
} }
get has_params() {
return pb_1.Message.getField(this, 1) != null;
}
static fromObject(data: { static fromObject(data: {
params?: ReturnType<typeof dependency_2.vulcanize.bond.v1beta1.Params.prototype.toObject>; params?: ReturnType<typeof dependency_2.vulcanize.bond.v1beta1.Params.prototype.toObject>;
}) { }): QueryParamsResponse {
const message = new QueryParamsResponse({}); const message = new QueryParamsResponse({});
if (data.params != null) { if (data.params != null) {
message.params = dependency_2.vulcanize.bond.v1beta1.Params.fromObject(data.params); message.params = dependency_2.vulcanize.bond.v1beta1.Params.fromObject(data.params);
@ -91,7 +96,7 @@ export namespace vulcanize.bond.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (this.params !== undefined) if (this.has_params)
writer.writeMessage(1, this.params, () => this.params.serialize(writer)); writer.writeMessage(1, this.params, () => this.params.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -118,11 +123,12 @@ export namespace vulcanize.bond.v1beta1 {
} }
} }
export class QueryGetBondsRequest extends pb_1.Message { export class QueryGetBondsRequest extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
pagination?: dependency_4.cosmos.base.query.v1beta1.PageRequest; pagination?: dependency_4.cosmos.base.query.v1beta1.PageRequest;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("pagination" in data && data.pagination != undefined) { if ("pagination" in data && data.pagination != undefined) {
this.pagination = data.pagination; this.pagination = data.pagination;
@ -135,9 +141,12 @@ export namespace vulcanize.bond.v1beta1 {
set pagination(value: dependency_4.cosmos.base.query.v1beta1.PageRequest) { set pagination(value: dependency_4.cosmos.base.query.v1beta1.PageRequest) {
pb_1.Message.setWrapperField(this, 1, value); pb_1.Message.setWrapperField(this, 1, value);
} }
get has_pagination() {
return pb_1.Message.getField(this, 1) != null;
}
static fromObject(data: { static fromObject(data: {
pagination?: ReturnType<typeof dependency_4.cosmos.base.query.v1beta1.PageRequest.prototype.toObject>; pagination?: ReturnType<typeof dependency_4.cosmos.base.query.v1beta1.PageRequest.prototype.toObject>;
}) { }): QueryGetBondsRequest {
const message = new QueryGetBondsRequest({}); const message = new QueryGetBondsRequest({});
if (data.pagination != null) { if (data.pagination != null) {
message.pagination = dependency_4.cosmos.base.query.v1beta1.PageRequest.fromObject(data.pagination); message.pagination = dependency_4.cosmos.base.query.v1beta1.PageRequest.fromObject(data.pagination);
@ -157,7 +166,7 @@ export namespace vulcanize.bond.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (this.pagination !== undefined) if (this.has_pagination)
writer.writeMessage(1, this.pagination, () => this.pagination.serialize(writer)); writer.writeMessage(1, this.pagination, () => this.pagination.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -184,12 +193,13 @@ export namespace vulcanize.bond.v1beta1 {
} }
} }
export class QueryGetBondsResponse extends pb_1.Message { export class QueryGetBondsResponse extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
bonds?: dependency_2.vulcanize.bond.v1beta1.Bond[]; bonds?: dependency_2.vulcanize.bond.v1beta1.Bond[];
pagination?: dependency_4.cosmos.base.query.v1beta1.PageResponse; pagination?: dependency_4.cosmos.base.query.v1beta1.PageResponse;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("bonds" in data && data.bonds != undefined) { if ("bonds" in data && data.bonds != undefined) {
this.bonds = data.bonds; this.bonds = data.bonds;
@ -211,10 +221,13 @@ export namespace vulcanize.bond.v1beta1 {
set pagination(value: dependency_4.cosmos.base.query.v1beta1.PageResponse) { set pagination(value: dependency_4.cosmos.base.query.v1beta1.PageResponse) {
pb_1.Message.setWrapperField(this, 2, value); pb_1.Message.setWrapperField(this, 2, value);
} }
get has_pagination() {
return pb_1.Message.getField(this, 2) != null;
}
static fromObject(data: { static fromObject(data: {
bonds?: ReturnType<typeof dependency_2.vulcanize.bond.v1beta1.Bond.prototype.toObject>[]; bonds?: ReturnType<typeof dependency_2.vulcanize.bond.v1beta1.Bond.prototype.toObject>[];
pagination?: ReturnType<typeof dependency_4.cosmos.base.query.v1beta1.PageResponse.prototype.toObject>; pagination?: ReturnType<typeof dependency_4.cosmos.base.query.v1beta1.PageResponse.prototype.toObject>;
}) { }): QueryGetBondsResponse {
const message = new QueryGetBondsResponse({}); const message = new QueryGetBondsResponse({});
if (data.bonds != null) { if (data.bonds != null) {
message.bonds = data.bonds.map(item => dependency_2.vulcanize.bond.v1beta1.Bond.fromObject(item)); message.bonds = data.bonds.map(item => dependency_2.vulcanize.bond.v1beta1.Bond.fromObject(item));
@ -241,9 +254,9 @@ export namespace vulcanize.bond.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (this.bonds !== undefined) if (this.bonds.length)
writer.writeRepeatedMessage(1, this.bonds, (item: dependency_2.vulcanize.bond.v1beta1.Bond) => item.serialize(writer)); writer.writeRepeatedMessage(1, this.bonds, (item: dependency_2.vulcanize.bond.v1beta1.Bond) => item.serialize(writer));
if (this.pagination !== undefined) if (this.has_pagination)
writer.writeMessage(2, this.pagination, () => this.pagination.serialize(writer)); writer.writeMessage(2, this.pagination, () => this.pagination.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -273,11 +286,12 @@ export namespace vulcanize.bond.v1beta1 {
} }
} }
export class QueryGetBondByIdRequest extends pb_1.Message { export class QueryGetBondByIdRequest extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
id?: string; id?: string;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("id" in data && data.id != undefined) { if ("id" in data && data.id != undefined) {
this.id = data.id; this.id = data.id;
@ -285,14 +299,14 @@ export namespace vulcanize.bond.v1beta1 {
} }
} }
get id() { get id() {
return pb_1.Message.getField(this, 1) as string; return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
} }
set id(value: string) { set id(value: string) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
static fromObject(data: { static fromObject(data: {
id?: string; id?: string;
}) { }): QueryGetBondByIdRequest {
const message = new QueryGetBondByIdRequest({}); const message = new QueryGetBondByIdRequest({});
if (data.id != null) { if (data.id != null) {
message.id = data.id; message.id = data.id;
@ -312,7 +326,7 @@ export namespace vulcanize.bond.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (typeof this.id === "string" && this.id.length) if (this.id.length)
writer.writeString(1, this.id); writer.writeString(1, this.id);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -339,11 +353,12 @@ export namespace vulcanize.bond.v1beta1 {
} }
} }
export class QueryGetBondByIdResponse extends pb_1.Message { export class QueryGetBondByIdResponse extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
bond?: dependency_2.vulcanize.bond.v1beta1.Bond; bond?: dependency_2.vulcanize.bond.v1beta1.Bond;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("bond" in data && data.bond != undefined) { if ("bond" in data && data.bond != undefined) {
this.bond = data.bond; this.bond = data.bond;
@ -356,9 +371,12 @@ export namespace vulcanize.bond.v1beta1 {
set bond(value: dependency_2.vulcanize.bond.v1beta1.Bond) { set bond(value: dependency_2.vulcanize.bond.v1beta1.Bond) {
pb_1.Message.setWrapperField(this, 1, value); pb_1.Message.setWrapperField(this, 1, value);
} }
get has_bond() {
return pb_1.Message.getField(this, 1) != null;
}
static fromObject(data: { static fromObject(data: {
bond?: ReturnType<typeof dependency_2.vulcanize.bond.v1beta1.Bond.prototype.toObject>; bond?: ReturnType<typeof dependency_2.vulcanize.bond.v1beta1.Bond.prototype.toObject>;
}) { }): QueryGetBondByIdResponse {
const message = new QueryGetBondByIdResponse({}); const message = new QueryGetBondByIdResponse({});
if (data.bond != null) { if (data.bond != null) {
message.bond = dependency_2.vulcanize.bond.v1beta1.Bond.fromObject(data.bond); message.bond = dependency_2.vulcanize.bond.v1beta1.Bond.fromObject(data.bond);
@ -378,7 +396,7 @@ export namespace vulcanize.bond.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (this.bond !== undefined) if (this.has_bond)
writer.writeMessage(1, this.bond, () => this.bond.serialize(writer)); writer.writeMessage(1, this.bond, () => this.bond.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -405,12 +423,13 @@ export namespace vulcanize.bond.v1beta1 {
} }
} }
export class QueryGetBondsByOwnerRequest extends pb_1.Message { export class QueryGetBondsByOwnerRequest extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
owner?: string; owner?: string;
pagination?: dependency_4.cosmos.base.query.v1beta1.PageResponse; pagination?: dependency_4.cosmos.base.query.v1beta1.PageResponse;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("owner" in data && data.owner != undefined) { if ("owner" in data && data.owner != undefined) {
this.owner = data.owner; this.owner = data.owner;
@ -421,7 +440,7 @@ export namespace vulcanize.bond.v1beta1 {
} }
} }
get owner() { get owner() {
return pb_1.Message.getField(this, 1) as string; return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
} }
set owner(value: string) { set owner(value: string) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
@ -432,10 +451,13 @@ export namespace vulcanize.bond.v1beta1 {
set pagination(value: dependency_4.cosmos.base.query.v1beta1.PageResponse) { set pagination(value: dependency_4.cosmos.base.query.v1beta1.PageResponse) {
pb_1.Message.setWrapperField(this, 2, value); pb_1.Message.setWrapperField(this, 2, value);
} }
get has_pagination() {
return pb_1.Message.getField(this, 2) != null;
}
static fromObject(data: { static fromObject(data: {
owner?: string; owner?: string;
pagination?: ReturnType<typeof dependency_4.cosmos.base.query.v1beta1.PageResponse.prototype.toObject>; pagination?: ReturnType<typeof dependency_4.cosmos.base.query.v1beta1.PageResponse.prototype.toObject>;
}) { }): QueryGetBondsByOwnerRequest {
const message = new QueryGetBondsByOwnerRequest({}); const message = new QueryGetBondsByOwnerRequest({});
if (data.owner != null) { if (data.owner != null) {
message.owner = data.owner; message.owner = data.owner;
@ -462,9 +484,9 @@ export namespace vulcanize.bond.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (typeof this.owner === "string" && this.owner.length) if (this.owner.length)
writer.writeString(1, this.owner); writer.writeString(1, this.owner);
if (this.pagination !== undefined) if (this.has_pagination)
writer.writeMessage(2, this.pagination, () => this.pagination.serialize(writer)); writer.writeMessage(2, this.pagination, () => this.pagination.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -494,12 +516,13 @@ export namespace vulcanize.bond.v1beta1 {
} }
} }
export class QueryGetBondsByOwnerResponse extends pb_1.Message { export class QueryGetBondsByOwnerResponse extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
bonds?: dependency_2.vulcanize.bond.v1beta1.Bond[]; bonds?: dependency_2.vulcanize.bond.v1beta1.Bond[];
pagination?: dependency_4.cosmos.base.query.v1beta1.PageResponse; pagination?: dependency_4.cosmos.base.query.v1beta1.PageResponse;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("bonds" in data && data.bonds != undefined) { if ("bonds" in data && data.bonds != undefined) {
this.bonds = data.bonds; this.bonds = data.bonds;
@ -521,10 +544,13 @@ export namespace vulcanize.bond.v1beta1 {
set pagination(value: dependency_4.cosmos.base.query.v1beta1.PageResponse) { set pagination(value: dependency_4.cosmos.base.query.v1beta1.PageResponse) {
pb_1.Message.setWrapperField(this, 2, value); pb_1.Message.setWrapperField(this, 2, value);
} }
get has_pagination() {
return pb_1.Message.getField(this, 2) != null;
}
static fromObject(data: { static fromObject(data: {
bonds?: ReturnType<typeof dependency_2.vulcanize.bond.v1beta1.Bond.prototype.toObject>[]; bonds?: ReturnType<typeof dependency_2.vulcanize.bond.v1beta1.Bond.prototype.toObject>[];
pagination?: ReturnType<typeof dependency_4.cosmos.base.query.v1beta1.PageResponse.prototype.toObject>; pagination?: ReturnType<typeof dependency_4.cosmos.base.query.v1beta1.PageResponse.prototype.toObject>;
}) { }): QueryGetBondsByOwnerResponse {
const message = new QueryGetBondsByOwnerResponse({}); const message = new QueryGetBondsByOwnerResponse({});
if (data.bonds != null) { if (data.bonds != null) {
message.bonds = data.bonds.map(item => dependency_2.vulcanize.bond.v1beta1.Bond.fromObject(item)); message.bonds = data.bonds.map(item => dependency_2.vulcanize.bond.v1beta1.Bond.fromObject(item));
@ -551,9 +577,9 @@ export namespace vulcanize.bond.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (this.bonds !== undefined) if (this.bonds.length)
writer.writeRepeatedMessage(1, this.bonds, (item: dependency_2.vulcanize.bond.v1beta1.Bond) => item.serialize(writer)); writer.writeRepeatedMessage(1, this.bonds, (item: dependency_2.vulcanize.bond.v1beta1.Bond) => item.serialize(writer));
if (this.pagination !== undefined) if (this.has_pagination)
writer.writeMessage(2, this.pagination, () => this.pagination.serialize(writer)); writer.writeMessage(2, this.pagination, () => this.pagination.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -583,12 +609,13 @@ export namespace vulcanize.bond.v1beta1 {
} }
} }
export class QueryGetBondModuleBalanceRequest extends pb_1.Message { export class QueryGetBondModuleBalanceRequest extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {}) { constructor(data?: any[] | {}) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { } if (!Array.isArray(data) && typeof data == "object") { }
} }
static fromObject(data: {}) { static fromObject(data: {}): QueryGetBondModuleBalanceRequest {
const message = new QueryGetBondModuleBalanceRequest({}); const message = new QueryGetBondModuleBalanceRequest({});
return message; return message;
} }
@ -622,11 +649,12 @@ export namespace vulcanize.bond.v1beta1 {
} }
} }
export class QueryGetBondModuleBalanceResponse extends pb_1.Message { export class QueryGetBondModuleBalanceResponse extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
balance?: dependency_5.cosmos.base.v1beta1.Coin[]; balance?: dependency_5.cosmos.base.v1beta1.Coin[];
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("balance" in data && data.balance != undefined) { if ("balance" in data && data.balance != undefined) {
this.balance = data.balance; this.balance = data.balance;
@ -641,7 +669,7 @@ export namespace vulcanize.bond.v1beta1 {
} }
static fromObject(data: { static fromObject(data: {
balance?: ReturnType<typeof dependency_5.cosmos.base.v1beta1.Coin.prototype.toObject>[]; balance?: ReturnType<typeof dependency_5.cosmos.base.v1beta1.Coin.prototype.toObject>[];
}) { }): QueryGetBondModuleBalanceResponse {
const message = new QueryGetBondModuleBalanceResponse({}); const message = new QueryGetBondModuleBalanceResponse({});
if (data.balance != null) { if (data.balance != null) {
message.balance = data.balance.map(item => dependency_5.cosmos.base.v1beta1.Coin.fromObject(item)); message.balance = data.balance.map(item => dependency_5.cosmos.base.v1beta1.Coin.fromObject(item));
@ -661,7 +689,7 @@ export namespace vulcanize.bond.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (this.balance !== undefined) if (this.balance.length)
writer.writeRepeatedMessage(2, this.balance, (item: dependency_5.cosmos.base.v1beta1.Coin) => item.serialize(writer)); writer.writeRepeatedMessage(2, this.balance, (item: dependency_5.cosmos.base.v1beta1.Coin) => item.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();

View File

@ -2,7 +2,7 @@
/* eslint-disable */ /* eslint-disable */
/** /**
* Generated by the protoc-gen-ts. DO NOT EDIT! * Generated by the protoc-gen-ts. DO NOT EDIT!
* compiler version: 3.14.0 * compiler version: 4.25.1
* source: vulcanize/bond/v1beta1/tx.proto * source: vulcanize/bond/v1beta1/tx.proto
* git: https://github.com/thesayyn/protoc-gen-ts */ * git: https://github.com/thesayyn/protoc-gen-ts */
import * as dependency_1 from "./../../../gogoproto/gogo"; import * as dependency_1 from "./../../../gogoproto/gogo";
@ -10,12 +10,13 @@ import * as dependency_2 from "./../../../cosmos/base/v1beta1/coin";
import * as pb_1 from "google-protobuf"; import * as pb_1 from "google-protobuf";
export namespace vulcanize.bond.v1beta1 { export namespace vulcanize.bond.v1beta1 {
export class MsgCreateBond extends pb_1.Message { export class MsgCreateBond extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
signer?: string; signer?: string;
coins?: dependency_2.cosmos.base.v1beta1.Coin[]; coins?: dependency_2.cosmos.base.v1beta1.Coin[];
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("signer" in data && data.signer != undefined) { if ("signer" in data && data.signer != undefined) {
this.signer = data.signer; this.signer = data.signer;
@ -26,7 +27,7 @@ export namespace vulcanize.bond.v1beta1 {
} }
} }
get signer() { get signer() {
return pb_1.Message.getField(this, 1) as string; return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
} }
set signer(value: string) { set signer(value: string) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
@ -40,7 +41,7 @@ export namespace vulcanize.bond.v1beta1 {
static fromObject(data: { static fromObject(data: {
signer?: string; signer?: string;
coins?: ReturnType<typeof dependency_2.cosmos.base.v1beta1.Coin.prototype.toObject>[]; coins?: ReturnType<typeof dependency_2.cosmos.base.v1beta1.Coin.prototype.toObject>[];
}) { }): MsgCreateBond {
const message = new MsgCreateBond({}); const message = new MsgCreateBond({});
if (data.signer != null) { if (data.signer != null) {
message.signer = data.signer; message.signer = data.signer;
@ -67,9 +68,9 @@ export namespace vulcanize.bond.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (typeof this.signer === "string" && this.signer.length) if (this.signer.length)
writer.writeString(1, this.signer); writer.writeString(1, this.signer);
if (this.coins !== undefined) if (this.coins.length)
writer.writeRepeatedMessage(2, this.coins, (item: dependency_2.cosmos.base.v1beta1.Coin) => item.serialize(writer)); writer.writeRepeatedMessage(2, this.coins, (item: dependency_2.cosmos.base.v1beta1.Coin) => item.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -99,11 +100,12 @@ export namespace vulcanize.bond.v1beta1 {
} }
} }
export class MsgCreateBondResponse extends pb_1.Message { export class MsgCreateBondResponse extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
id?: string; id?: string;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("id" in data && data.id != undefined) { if ("id" in data && data.id != undefined) {
this.id = data.id; this.id = data.id;
@ -111,14 +113,14 @@ export namespace vulcanize.bond.v1beta1 {
} }
} }
get id() { get id() {
return pb_1.Message.getField(this, 1) as string; return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
} }
set id(value: string) { set id(value: string) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
static fromObject(data: { static fromObject(data: {
id?: string; id?: string;
}) { }): MsgCreateBondResponse {
const message = new MsgCreateBondResponse({}); const message = new MsgCreateBondResponse({});
if (data.id != null) { if (data.id != null) {
message.id = data.id; message.id = data.id;
@ -138,7 +140,7 @@ export namespace vulcanize.bond.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (typeof this.id === "string" && this.id.length) if (this.id.length)
writer.writeString(1, this.id); writer.writeString(1, this.id);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -165,13 +167,14 @@ export namespace vulcanize.bond.v1beta1 {
} }
} }
export class MsgRefillBond extends pb_1.Message { export class MsgRefillBond extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
id?: string; id?: string;
signer?: string; signer?: string;
coins?: dependency_2.cosmos.base.v1beta1.Coin[]; coins?: dependency_2.cosmos.base.v1beta1.Coin[];
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("id" in data && data.id != undefined) { if ("id" in data && data.id != undefined) {
this.id = data.id; this.id = data.id;
@ -185,13 +188,13 @@ export namespace vulcanize.bond.v1beta1 {
} }
} }
get id() { get id() {
return pb_1.Message.getField(this, 1) as string; return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
} }
set id(value: string) { set id(value: string) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
get signer() { get signer() {
return pb_1.Message.getField(this, 2) as string; return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
} }
set signer(value: string) { set signer(value: string) {
pb_1.Message.setField(this, 2, value); pb_1.Message.setField(this, 2, value);
@ -206,7 +209,7 @@ export namespace vulcanize.bond.v1beta1 {
id?: string; id?: string;
signer?: string; signer?: string;
coins?: ReturnType<typeof dependency_2.cosmos.base.v1beta1.Coin.prototype.toObject>[]; coins?: ReturnType<typeof dependency_2.cosmos.base.v1beta1.Coin.prototype.toObject>[];
}) { }): MsgRefillBond {
const message = new MsgRefillBond({}); const message = new MsgRefillBond({});
if (data.id != null) { if (data.id != null) {
message.id = data.id; message.id = data.id;
@ -240,11 +243,11 @@ export namespace vulcanize.bond.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (typeof this.id === "string" && this.id.length) if (this.id.length)
writer.writeString(1, this.id); writer.writeString(1, this.id);
if (typeof this.signer === "string" && this.signer.length) if (this.signer.length)
writer.writeString(2, this.signer); writer.writeString(2, this.signer);
if (this.coins !== undefined) if (this.coins.length)
writer.writeRepeatedMessage(3, this.coins, (item: dependency_2.cosmos.base.v1beta1.Coin) => item.serialize(writer)); writer.writeRepeatedMessage(3, this.coins, (item: dependency_2.cosmos.base.v1beta1.Coin) => item.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -277,12 +280,13 @@ export namespace vulcanize.bond.v1beta1 {
} }
} }
export class MsgRefillBondResponse extends pb_1.Message { export class MsgRefillBondResponse extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {}) { constructor(data?: any[] | {}) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { } if (!Array.isArray(data) && typeof data == "object") { }
} }
static fromObject(data: {}) { static fromObject(data: {}): MsgRefillBondResponse {
const message = new MsgRefillBondResponse({}); const message = new MsgRefillBondResponse({});
return message; return message;
} }
@ -316,13 +320,14 @@ export namespace vulcanize.bond.v1beta1 {
} }
} }
export class MsgWithdrawBond extends pb_1.Message { export class MsgWithdrawBond extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
id?: string; id?: string;
signer?: string; signer?: string;
coins?: dependency_2.cosmos.base.v1beta1.Coin[]; coins?: dependency_2.cosmos.base.v1beta1.Coin[];
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("id" in data && data.id != undefined) { if ("id" in data && data.id != undefined) {
this.id = data.id; this.id = data.id;
@ -336,13 +341,13 @@ export namespace vulcanize.bond.v1beta1 {
} }
} }
get id() { get id() {
return pb_1.Message.getField(this, 1) as string; return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
} }
set id(value: string) { set id(value: string) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
get signer() { get signer() {
return pb_1.Message.getField(this, 2) as string; return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
} }
set signer(value: string) { set signer(value: string) {
pb_1.Message.setField(this, 2, value); pb_1.Message.setField(this, 2, value);
@ -357,7 +362,7 @@ export namespace vulcanize.bond.v1beta1 {
id?: string; id?: string;
signer?: string; signer?: string;
coins?: ReturnType<typeof dependency_2.cosmos.base.v1beta1.Coin.prototype.toObject>[]; coins?: ReturnType<typeof dependency_2.cosmos.base.v1beta1.Coin.prototype.toObject>[];
}) { }): MsgWithdrawBond {
const message = new MsgWithdrawBond({}); const message = new MsgWithdrawBond({});
if (data.id != null) { if (data.id != null) {
message.id = data.id; message.id = data.id;
@ -391,11 +396,11 @@ export namespace vulcanize.bond.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (typeof this.id === "string" && this.id.length) if (this.id.length)
writer.writeString(1, this.id); writer.writeString(1, this.id);
if (typeof this.signer === "string" && this.signer.length) if (this.signer.length)
writer.writeString(2, this.signer); writer.writeString(2, this.signer);
if (this.coins !== undefined) if (this.coins.length)
writer.writeRepeatedMessage(3, this.coins, (item: dependency_2.cosmos.base.v1beta1.Coin) => item.serialize(writer)); writer.writeRepeatedMessage(3, this.coins, (item: dependency_2.cosmos.base.v1beta1.Coin) => item.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -428,12 +433,13 @@ export namespace vulcanize.bond.v1beta1 {
} }
} }
export class MsgWithdrawBondResponse extends pb_1.Message { export class MsgWithdrawBondResponse extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {}) { constructor(data?: any[] | {}) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { } if (!Array.isArray(data) && typeof data == "object") { }
} }
static fromObject(data: {}) { static fromObject(data: {}): MsgWithdrawBondResponse {
const message = new MsgWithdrawBondResponse({}); const message = new MsgWithdrawBondResponse({});
return message; return message;
} }
@ -467,12 +473,13 @@ export namespace vulcanize.bond.v1beta1 {
} }
} }
export class MsgCancelBond extends pb_1.Message { export class MsgCancelBond extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
id?: string; id?: string;
signer?: string; signer?: string;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("id" in data && data.id != undefined) { if ("id" in data && data.id != undefined) {
this.id = data.id; this.id = data.id;
@ -483,13 +490,13 @@ export namespace vulcanize.bond.v1beta1 {
} }
} }
get id() { get id() {
return pb_1.Message.getField(this, 1) as string; return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
} }
set id(value: string) { set id(value: string) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
get signer() { get signer() {
return pb_1.Message.getField(this, 2) as string; return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
} }
set signer(value: string) { set signer(value: string) {
pb_1.Message.setField(this, 2, value); pb_1.Message.setField(this, 2, value);
@ -497,7 +504,7 @@ export namespace vulcanize.bond.v1beta1 {
static fromObject(data: { static fromObject(data: {
id?: string; id?: string;
signer?: string; signer?: string;
}) { }): MsgCancelBond {
const message = new MsgCancelBond({}); const message = new MsgCancelBond({});
if (data.id != null) { if (data.id != null) {
message.id = data.id; message.id = data.id;
@ -524,9 +531,9 @@ export namespace vulcanize.bond.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (typeof this.id === "string" && this.id.length) if (this.id.length)
writer.writeString(1, this.id); writer.writeString(1, this.id);
if (typeof this.signer === "string" && this.signer.length) if (this.signer.length)
writer.writeString(2, this.signer); writer.writeString(2, this.signer);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -556,12 +563,13 @@ export namespace vulcanize.bond.v1beta1 {
} }
} }
export class MsgCancelBondResponse extends pb_1.Message { export class MsgCancelBondResponse extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {}) { constructor(data?: any[] | {}) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { } if (!Array.isArray(data) && typeof data == "object") { }
} }
static fromObject(data: {}) { static fromObject(data: {}): MsgCancelBondResponse {
const message = new MsgCancelBondResponse({}); const message = new MsgCancelBondResponse({});
return message; return message;
} }

View File

@ -2,22 +2,23 @@
/* eslint-disable */ /* eslint-disable */
/** /**
* Generated by the protoc-gen-ts. DO NOT EDIT! * Generated by the protoc-gen-ts. DO NOT EDIT!
* compiler version: 3.14.0 * compiler version: 4.25.1
* source: vulcanize/nameservice/v1beta1/genesis.proto * source: vulcanize/registry/v1beta1/genesis.proto
* git: https://github.com/thesayyn/protoc-gen-ts */ * git: https://github.com/thesayyn/protoc-gen-ts */
import * as dependency_1 from "./../../../gogoproto/gogo"; import * as dependency_1 from "./../../../gogoproto/gogo";
import * as dependency_2 from "./nameservice"; import * as dependency_2 from "./registry";
import * as pb_1 from "google-protobuf"; import * as pb_1 from "google-protobuf";
export namespace vulcanize.nameservice.v1beta1 { export namespace vulcanize.registry.v1beta1 {
export class GenesisState extends pb_1.Message { export class GenesisState extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
params?: dependency_2.vulcanize.nameservice.v1beta1.Params; params?: dependency_2.vulcanize.registry.v1beta1.Params;
records?: dependency_2.vulcanize.nameservice.v1beta1.Record[]; records?: dependency_2.vulcanize.registry.v1beta1.Record[];
authorities?: dependency_2.vulcanize.nameservice.v1beta1.AuthorityEntry[]; authorities?: dependency_2.vulcanize.registry.v1beta1.AuthorityEntry[];
names?: dependency_2.vulcanize.nameservice.v1beta1.NameEntry[]; names?: dependency_2.vulcanize.registry.v1beta1.NameEntry[];
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2, 3, 4], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2, 3, 4], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("params" in data && data.params != undefined) { if ("params" in data && data.params != undefined) {
this.params = data.params; this.params = data.params;
@ -34,68 +35,71 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
get params() { get params() {
return pb_1.Message.getWrapperField(this, dependency_2.vulcanize.nameservice.v1beta1.Params, 1) as dependency_2.vulcanize.nameservice.v1beta1.Params; return pb_1.Message.getWrapperField(this, dependency_2.vulcanize.registry.v1beta1.Params, 1) as dependency_2.vulcanize.registry.v1beta1.Params;
} }
set params(value: dependency_2.vulcanize.nameservice.v1beta1.Params) { set params(value: dependency_2.vulcanize.registry.v1beta1.Params) {
pb_1.Message.setWrapperField(this, 1, value); pb_1.Message.setWrapperField(this, 1, value);
} }
get records() { get has_params() {
return pb_1.Message.getRepeatedWrapperField(this, dependency_2.vulcanize.nameservice.v1beta1.Record, 2) as dependency_2.vulcanize.nameservice.v1beta1.Record[]; return pb_1.Message.getField(this, 1) != null;
} }
set records(value: dependency_2.vulcanize.nameservice.v1beta1.Record[]) { get records() {
return pb_1.Message.getRepeatedWrapperField(this, dependency_2.vulcanize.registry.v1beta1.Record, 2) as dependency_2.vulcanize.registry.v1beta1.Record[];
}
set records(value: dependency_2.vulcanize.registry.v1beta1.Record[]) {
pb_1.Message.setRepeatedWrapperField(this, 2, value); pb_1.Message.setRepeatedWrapperField(this, 2, value);
} }
get authorities() { get authorities() {
return pb_1.Message.getRepeatedWrapperField(this, dependency_2.vulcanize.nameservice.v1beta1.AuthorityEntry, 3) as dependency_2.vulcanize.nameservice.v1beta1.AuthorityEntry[]; return pb_1.Message.getRepeatedWrapperField(this, dependency_2.vulcanize.registry.v1beta1.AuthorityEntry, 3) as dependency_2.vulcanize.registry.v1beta1.AuthorityEntry[];
} }
set authorities(value: dependency_2.vulcanize.nameservice.v1beta1.AuthorityEntry[]) { set authorities(value: dependency_2.vulcanize.registry.v1beta1.AuthorityEntry[]) {
pb_1.Message.setRepeatedWrapperField(this, 3, value); pb_1.Message.setRepeatedWrapperField(this, 3, value);
} }
get names() { get names() {
return pb_1.Message.getRepeatedWrapperField(this, dependency_2.vulcanize.nameservice.v1beta1.NameEntry, 4) as dependency_2.vulcanize.nameservice.v1beta1.NameEntry[]; return pb_1.Message.getRepeatedWrapperField(this, dependency_2.vulcanize.registry.v1beta1.NameEntry, 4) as dependency_2.vulcanize.registry.v1beta1.NameEntry[];
} }
set names(value: dependency_2.vulcanize.nameservice.v1beta1.NameEntry[]) { set names(value: dependency_2.vulcanize.registry.v1beta1.NameEntry[]) {
pb_1.Message.setRepeatedWrapperField(this, 4, value); pb_1.Message.setRepeatedWrapperField(this, 4, value);
} }
static fromObject(data: { static fromObject(data: {
params?: ReturnType<typeof dependency_2.vulcanize.nameservice.v1beta1.Params.prototype.toObject>; params?: ReturnType<typeof dependency_2.vulcanize.registry.v1beta1.Params.prototype.toObject>;
records?: ReturnType<typeof dependency_2.vulcanize.nameservice.v1beta1.Record.prototype.toObject>[]; records?: ReturnType<typeof dependency_2.vulcanize.registry.v1beta1.Record.prototype.toObject>[];
authorities?: ReturnType<typeof dependency_2.vulcanize.nameservice.v1beta1.AuthorityEntry.prototype.toObject>[]; authorities?: ReturnType<typeof dependency_2.vulcanize.registry.v1beta1.AuthorityEntry.prototype.toObject>[];
names?: ReturnType<typeof dependency_2.vulcanize.nameservice.v1beta1.NameEntry.prototype.toObject>[]; names?: ReturnType<typeof dependency_2.vulcanize.registry.v1beta1.NameEntry.prototype.toObject>[];
}) { }): GenesisState {
const message = new GenesisState({}); const message = new GenesisState({});
if (data.params != null) { if (data.params != null) {
message.params = dependency_2.vulcanize.nameservice.v1beta1.Params.fromObject(data.params); message.params = dependency_2.vulcanize.registry.v1beta1.Params.fromObject(data.params);
} }
if (data.records != null) { if (data.records != null) {
message.records = data.records.map(item => dependency_2.vulcanize.nameservice.v1beta1.Record.fromObject(item)); message.records = data.records.map(item => dependency_2.vulcanize.registry.v1beta1.Record.fromObject(item));
} }
if (data.authorities != null) { if (data.authorities != null) {
message.authorities = data.authorities.map(item => dependency_2.vulcanize.nameservice.v1beta1.AuthorityEntry.fromObject(item)); message.authorities = data.authorities.map(item => dependency_2.vulcanize.registry.v1beta1.AuthorityEntry.fromObject(item));
} }
if (data.names != null) { if (data.names != null) {
message.names = data.names.map(item => dependency_2.vulcanize.nameservice.v1beta1.NameEntry.fromObject(item)); message.names = data.names.map(item => dependency_2.vulcanize.registry.v1beta1.NameEntry.fromObject(item));
} }
return message; return message;
} }
toObject() { toObject() {
const data: { const data: {
params?: ReturnType<typeof dependency_2.vulcanize.nameservice.v1beta1.Params.prototype.toObject>; params?: ReturnType<typeof dependency_2.vulcanize.registry.v1beta1.Params.prototype.toObject>;
records?: ReturnType<typeof dependency_2.vulcanize.nameservice.v1beta1.Record.prototype.toObject>[]; records?: ReturnType<typeof dependency_2.vulcanize.registry.v1beta1.Record.prototype.toObject>[];
authorities?: ReturnType<typeof dependency_2.vulcanize.nameservice.v1beta1.AuthorityEntry.prototype.toObject>[]; authorities?: ReturnType<typeof dependency_2.vulcanize.registry.v1beta1.AuthorityEntry.prototype.toObject>[];
names?: ReturnType<typeof dependency_2.vulcanize.nameservice.v1beta1.NameEntry.prototype.toObject>[]; names?: ReturnType<typeof dependency_2.vulcanize.registry.v1beta1.NameEntry.prototype.toObject>[];
} = {}; } = {};
if (this.params != null) { if (this.params != null) {
data.params = this.params.toObject(); data.params = this.params.toObject();
} }
if (this.records != null) { if (this.records != null) {
data.records = this.records.map((item: dependency_2.vulcanize.nameservice.v1beta1.Record) => item.toObject()); data.records = this.records.map((item: dependency_2.vulcanize.registry.v1beta1.Record) => item.toObject());
} }
if (this.authorities != null) { if (this.authorities != null) {
data.authorities = this.authorities.map((item: dependency_2.vulcanize.nameservice.v1beta1.AuthorityEntry) => item.toObject()); data.authorities = this.authorities.map((item: dependency_2.vulcanize.registry.v1beta1.AuthorityEntry) => item.toObject());
} }
if (this.names != null) { if (this.names != null) {
data.names = this.names.map((item: dependency_2.vulcanize.nameservice.v1beta1.NameEntry) => item.toObject()); data.names = this.names.map((item: dependency_2.vulcanize.registry.v1beta1.NameEntry) => item.toObject());
} }
return data; return data;
} }
@ -103,14 +107,14 @@ export namespace vulcanize.nameservice.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (this.params !== undefined) if (this.has_params)
writer.writeMessage(1, this.params, () => this.params.serialize(writer)); writer.writeMessage(1, this.params, () => this.params.serialize(writer));
if (this.records !== undefined) if (this.records.length)
writer.writeRepeatedMessage(2, this.records, (item: dependency_2.vulcanize.nameservice.v1beta1.Record) => item.serialize(writer)); writer.writeRepeatedMessage(2, this.records, (item: dependency_2.vulcanize.registry.v1beta1.Record) => item.serialize(writer));
if (this.authorities !== undefined) if (this.authorities.length)
writer.writeRepeatedMessage(3, this.authorities, (item: dependency_2.vulcanize.nameservice.v1beta1.AuthorityEntry) => item.serialize(writer)); writer.writeRepeatedMessage(3, this.authorities, (item: dependency_2.vulcanize.registry.v1beta1.AuthorityEntry) => item.serialize(writer));
if (this.names !== undefined) if (this.names.length)
writer.writeRepeatedMessage(4, this.names, (item: dependency_2.vulcanize.nameservice.v1beta1.NameEntry) => item.serialize(writer)); writer.writeRepeatedMessage(4, this.names, (item: dependency_2.vulcanize.registry.v1beta1.NameEntry) => item.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
} }
@ -121,16 +125,16 @@ export namespace vulcanize.nameservice.v1beta1 {
break; break;
switch (reader.getFieldNumber()) { switch (reader.getFieldNumber()) {
case 1: case 1:
reader.readMessage(message.params, () => message.params = dependency_2.vulcanize.nameservice.v1beta1.Params.deserialize(reader)); reader.readMessage(message.params, () => message.params = dependency_2.vulcanize.registry.v1beta1.Params.deserialize(reader));
break; break;
case 2: case 2:
reader.readMessage(message.records, () => pb_1.Message.addToRepeatedWrapperField(message, 2, dependency_2.vulcanize.nameservice.v1beta1.Record.deserialize(reader), dependency_2.vulcanize.nameservice.v1beta1.Record)); reader.readMessage(message.records, () => pb_1.Message.addToRepeatedWrapperField(message, 2, dependency_2.vulcanize.registry.v1beta1.Record.deserialize(reader), dependency_2.vulcanize.registry.v1beta1.Record));
break; break;
case 3: case 3:
reader.readMessage(message.authorities, () => pb_1.Message.addToRepeatedWrapperField(message, 3, dependency_2.vulcanize.nameservice.v1beta1.AuthorityEntry.deserialize(reader), dependency_2.vulcanize.nameservice.v1beta1.AuthorityEntry)); reader.readMessage(message.authorities, () => pb_1.Message.addToRepeatedWrapperField(message, 3, dependency_2.vulcanize.registry.v1beta1.AuthorityEntry.deserialize(reader), dependency_2.vulcanize.registry.v1beta1.AuthorityEntry));
break; break;
case 4: case 4:
reader.readMessage(message.names, () => pb_1.Message.addToRepeatedWrapperField(message, 4, dependency_2.vulcanize.nameservice.v1beta1.NameEntry.deserialize(reader), dependency_2.vulcanize.nameservice.v1beta1.NameEntry)); reader.readMessage(message.names, () => pb_1.Message.addToRepeatedWrapperField(message, 4, dependency_2.vulcanize.registry.v1beta1.NameEntry.deserialize(reader), dependency_2.vulcanize.registry.v1beta1.NameEntry));
break; break;
default: reader.skipField(); default: reader.skipField();
} }

View File

@ -2,16 +2,17 @@
/* eslint-disable */ /* eslint-disable */
/** /**
* Generated by the protoc-gen-ts. DO NOT EDIT! * Generated by the protoc-gen-ts. DO NOT EDIT!
* compiler version: 3.14.0 * compiler version: 4.25.1
* source: vulcanize/nameservice/v1beta1/nameservice.proto * source: vulcanize/registry/v1beta1/registry.proto
* git: https://github.com/thesayyn/protoc-gen-ts */ * git: https://github.com/thesayyn/protoc-gen-ts */
import * as dependency_1 from "./../../../google/protobuf/duration"; import * as dependency_1 from "./../../../google/protobuf/duration";
import * as dependency_2 from "./../../../google/protobuf/timestamp"; import * as dependency_2 from "./../../../google/protobuf/timestamp";
import * as dependency_3 from "./../../../gogoproto/gogo"; import * as dependency_3 from "./../../../gogoproto/gogo";
import * as dependency_4 from "./../../../cosmos/base/v1beta1/coin"; import * as dependency_4 from "./../../../cosmos/base/v1beta1/coin";
import * as pb_1 from "google-protobuf"; import * as pb_1 from "google-protobuf";
export namespace vulcanize.nameservice.v1beta1 { export namespace vulcanize.registry.v1beta1 {
export class Params extends pb_1.Message { export class Params extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
record_rent?: dependency_4.cosmos.base.v1beta1.Coin; record_rent?: dependency_4.cosmos.base.v1beta1.Coin;
record_rent_duration?: dependency_1.google.protobuf.Duration; record_rent_duration?: dependency_1.google.protobuf.Duration;
@ -26,7 +27,7 @@ export namespace vulcanize.nameservice.v1beta1 {
authority_auction_minimum_bid?: dependency_4.cosmos.base.v1beta1.Coin; authority_auction_minimum_bid?: dependency_4.cosmos.base.v1beta1.Coin;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("record_rent" in data && data.record_rent != undefined) { if ("record_rent" in data && data.record_rent != undefined) {
this.record_rent = data.record_rent; this.record_rent = data.record_rent;
@ -69,32 +70,47 @@ export namespace vulcanize.nameservice.v1beta1 {
set record_rent(value: dependency_4.cosmos.base.v1beta1.Coin) { set record_rent(value: dependency_4.cosmos.base.v1beta1.Coin) {
pb_1.Message.setWrapperField(this, 1, value); pb_1.Message.setWrapperField(this, 1, value);
} }
get has_record_rent() {
return pb_1.Message.getField(this, 1) != null;
}
get record_rent_duration() { get record_rent_duration() {
return pb_1.Message.getWrapperField(this, dependency_1.google.protobuf.Duration, 2) as dependency_1.google.protobuf.Duration; return pb_1.Message.getWrapperField(this, dependency_1.google.protobuf.Duration, 2) as dependency_1.google.protobuf.Duration;
} }
set record_rent_duration(value: dependency_1.google.protobuf.Duration) { set record_rent_duration(value: dependency_1.google.protobuf.Duration) {
pb_1.Message.setWrapperField(this, 2, value); pb_1.Message.setWrapperField(this, 2, value);
} }
get has_record_rent_duration() {
return pb_1.Message.getField(this, 2) != null;
}
get authority_rent() { get authority_rent() {
return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 3) as dependency_4.cosmos.base.v1beta1.Coin; return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 3) as dependency_4.cosmos.base.v1beta1.Coin;
} }
set authority_rent(value: dependency_4.cosmos.base.v1beta1.Coin) { set authority_rent(value: dependency_4.cosmos.base.v1beta1.Coin) {
pb_1.Message.setWrapperField(this, 3, value); pb_1.Message.setWrapperField(this, 3, value);
} }
get has_authority_rent() {
return pb_1.Message.getField(this, 3) != null;
}
get authority_rent_duration() { get authority_rent_duration() {
return pb_1.Message.getWrapperField(this, dependency_1.google.protobuf.Duration, 4) as dependency_1.google.protobuf.Duration; return pb_1.Message.getWrapperField(this, dependency_1.google.protobuf.Duration, 4) as dependency_1.google.protobuf.Duration;
} }
set authority_rent_duration(value: dependency_1.google.protobuf.Duration) { set authority_rent_duration(value: dependency_1.google.protobuf.Duration) {
pb_1.Message.setWrapperField(this, 4, value); pb_1.Message.setWrapperField(this, 4, value);
} }
get has_authority_rent_duration() {
return pb_1.Message.getField(this, 4) != null;
}
get authority_grace_period() { get authority_grace_period() {
return pb_1.Message.getWrapperField(this, dependency_1.google.protobuf.Duration, 5) as dependency_1.google.protobuf.Duration; return pb_1.Message.getWrapperField(this, dependency_1.google.protobuf.Duration, 5) as dependency_1.google.protobuf.Duration;
} }
set authority_grace_period(value: dependency_1.google.protobuf.Duration) { set authority_grace_period(value: dependency_1.google.protobuf.Duration) {
pb_1.Message.setWrapperField(this, 5, value); pb_1.Message.setWrapperField(this, 5, value);
} }
get has_authority_grace_period() {
return pb_1.Message.getField(this, 5) != null;
}
get authority_auction_enabled() { get authority_auction_enabled() {
return pb_1.Message.getField(this, 6) as boolean; return pb_1.Message.getFieldWithDefault(this, 6, false) as boolean;
} }
set authority_auction_enabled(value: boolean) { set authority_auction_enabled(value: boolean) {
pb_1.Message.setField(this, 6, value); pb_1.Message.setField(this, 6, value);
@ -105,30 +121,45 @@ export namespace vulcanize.nameservice.v1beta1 {
set authority_auction_commits_duration(value: dependency_1.google.protobuf.Duration) { set authority_auction_commits_duration(value: dependency_1.google.protobuf.Duration) {
pb_1.Message.setWrapperField(this, 7, value); pb_1.Message.setWrapperField(this, 7, value);
} }
get has_authority_auction_commits_duration() {
return pb_1.Message.getField(this, 7) != null;
}
get authority_auction_reveals_duration() { get authority_auction_reveals_duration() {
return pb_1.Message.getWrapperField(this, dependency_1.google.protobuf.Duration, 8) as dependency_1.google.protobuf.Duration; return pb_1.Message.getWrapperField(this, dependency_1.google.protobuf.Duration, 8) as dependency_1.google.protobuf.Duration;
} }
set authority_auction_reveals_duration(value: dependency_1.google.protobuf.Duration) { set authority_auction_reveals_duration(value: dependency_1.google.protobuf.Duration) {
pb_1.Message.setWrapperField(this, 8, value); pb_1.Message.setWrapperField(this, 8, value);
} }
get has_authority_auction_reveals_duration() {
return pb_1.Message.getField(this, 8) != null;
}
get authority_auction_commit_fee() { get authority_auction_commit_fee() {
return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 9) as dependency_4.cosmos.base.v1beta1.Coin; return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 9) as dependency_4.cosmos.base.v1beta1.Coin;
} }
set authority_auction_commit_fee(value: dependency_4.cosmos.base.v1beta1.Coin) { set authority_auction_commit_fee(value: dependency_4.cosmos.base.v1beta1.Coin) {
pb_1.Message.setWrapperField(this, 9, value); pb_1.Message.setWrapperField(this, 9, value);
} }
get has_authority_auction_commit_fee() {
return pb_1.Message.getField(this, 9) != null;
}
get authority_auction_reveal_fee() { get authority_auction_reveal_fee() {
return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 10) as dependency_4.cosmos.base.v1beta1.Coin; return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 10) as dependency_4.cosmos.base.v1beta1.Coin;
} }
set authority_auction_reveal_fee(value: dependency_4.cosmos.base.v1beta1.Coin) { set authority_auction_reveal_fee(value: dependency_4.cosmos.base.v1beta1.Coin) {
pb_1.Message.setWrapperField(this, 10, value); pb_1.Message.setWrapperField(this, 10, value);
} }
get has_authority_auction_reveal_fee() {
return pb_1.Message.getField(this, 10) != null;
}
get authority_auction_minimum_bid() { get authority_auction_minimum_bid() {
return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 11) as dependency_4.cosmos.base.v1beta1.Coin; return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 11) as dependency_4.cosmos.base.v1beta1.Coin;
} }
set authority_auction_minimum_bid(value: dependency_4.cosmos.base.v1beta1.Coin) { set authority_auction_minimum_bid(value: dependency_4.cosmos.base.v1beta1.Coin) {
pb_1.Message.setWrapperField(this, 11, value); pb_1.Message.setWrapperField(this, 11, value);
} }
get has_authority_auction_minimum_bid() {
return pb_1.Message.getField(this, 11) != null;
}
static fromObject(data: { static fromObject(data: {
record_rent?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>; record_rent?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>;
record_rent_duration?: ReturnType<typeof dependency_1.google.protobuf.Duration.prototype.toObject>; record_rent_duration?: ReturnType<typeof dependency_1.google.protobuf.Duration.prototype.toObject>;
@ -141,7 +172,7 @@ export namespace vulcanize.nameservice.v1beta1 {
authority_auction_commit_fee?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>; authority_auction_commit_fee?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>;
authority_auction_reveal_fee?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>; authority_auction_reveal_fee?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>;
authority_auction_minimum_bid?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>; authority_auction_minimum_bid?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>;
}) { }): Params {
const message = new Params({}); const message = new Params({});
if (data.record_rent != null) { if (data.record_rent != null) {
message.record_rent = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.record_rent); message.record_rent = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.record_rent);
@ -231,27 +262,27 @@ export namespace vulcanize.nameservice.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (this.record_rent !== undefined) if (this.has_record_rent)
writer.writeMessage(1, this.record_rent, () => this.record_rent.serialize(writer)); writer.writeMessage(1, this.record_rent, () => this.record_rent.serialize(writer));
if (this.record_rent_duration !== undefined) if (this.has_record_rent_duration)
writer.writeMessage(2, this.record_rent_duration, () => this.record_rent_duration.serialize(writer)); writer.writeMessage(2, this.record_rent_duration, () => this.record_rent_duration.serialize(writer));
if (this.authority_rent !== undefined) if (this.has_authority_rent)
writer.writeMessage(3, this.authority_rent, () => this.authority_rent.serialize(writer)); writer.writeMessage(3, this.authority_rent, () => this.authority_rent.serialize(writer));
if (this.authority_rent_duration !== undefined) if (this.has_authority_rent_duration)
writer.writeMessage(4, this.authority_rent_duration, () => this.authority_rent_duration.serialize(writer)); writer.writeMessage(4, this.authority_rent_duration, () => this.authority_rent_duration.serialize(writer));
if (this.authority_grace_period !== undefined) if (this.has_authority_grace_period)
writer.writeMessage(5, this.authority_grace_period, () => this.authority_grace_period.serialize(writer)); writer.writeMessage(5, this.authority_grace_period, () => this.authority_grace_period.serialize(writer));
if (this.authority_auction_enabled !== undefined) if (this.authority_auction_enabled != false)
writer.writeBool(6, this.authority_auction_enabled); writer.writeBool(6, this.authority_auction_enabled);
if (this.authority_auction_commits_duration !== undefined) if (this.has_authority_auction_commits_duration)
writer.writeMessage(7, this.authority_auction_commits_duration, () => this.authority_auction_commits_duration.serialize(writer)); writer.writeMessage(7, this.authority_auction_commits_duration, () => this.authority_auction_commits_duration.serialize(writer));
if (this.authority_auction_reveals_duration !== undefined) if (this.has_authority_auction_reveals_duration)
writer.writeMessage(8, this.authority_auction_reveals_duration, () => this.authority_auction_reveals_duration.serialize(writer)); writer.writeMessage(8, this.authority_auction_reveals_duration, () => this.authority_auction_reveals_duration.serialize(writer));
if (this.authority_auction_commit_fee !== undefined) if (this.has_authority_auction_commit_fee)
writer.writeMessage(9, this.authority_auction_commit_fee, () => this.authority_auction_commit_fee.serialize(writer)); writer.writeMessage(9, this.authority_auction_commit_fee, () => this.authority_auction_commit_fee.serialize(writer));
if (this.authority_auction_reveal_fee !== undefined) if (this.has_authority_auction_reveal_fee)
writer.writeMessage(10, this.authority_auction_reveal_fee, () => this.authority_auction_reveal_fee.serialize(writer)); writer.writeMessage(10, this.authority_auction_reveal_fee, () => this.authority_auction_reveal_fee.serialize(writer));
if (this.authority_auction_minimum_bid !== undefined) if (this.has_authority_auction_minimum_bid)
writer.writeMessage(11, this.authority_auction_minimum_bid, () => this.authority_auction_minimum_bid.serialize(writer)); writer.writeMessage(11, this.authority_auction_minimum_bid, () => this.authority_auction_minimum_bid.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -308,6 +339,7 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
export class Record extends pb_1.Message { export class Record extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
id?: string; id?: string;
bond_id?: string; bond_id?: string;
@ -315,11 +347,12 @@ export namespace vulcanize.nameservice.v1beta1 {
expiry_time?: string; expiry_time?: string;
deleted?: boolean; deleted?: boolean;
owners?: string[]; owners?: string[];
attributes?: string; attributes?: Uint8Array;
names?: string[]; names?: string[];
type?: string;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [6, 8], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [6, 8], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("id" in data && data.id != undefined) { if ("id" in data && data.id != undefined) {
this.id = data.id; this.id = data.id;
@ -345,56 +378,65 @@ export namespace vulcanize.nameservice.v1beta1 {
if ("names" in data && data.names != undefined) { if ("names" in data && data.names != undefined) {
this.names = data.names; this.names = data.names;
} }
if ("type" in data && data.type != undefined) {
this.type = data.type;
}
} }
} }
get id() { get id() {
return pb_1.Message.getField(this, 1) as string; return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
} }
set id(value: string) { set id(value: string) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
get bond_id() { get bond_id() {
return pb_1.Message.getField(this, 2) as string; return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
} }
set bond_id(value: string) { set bond_id(value: string) {
pb_1.Message.setField(this, 2, value); pb_1.Message.setField(this, 2, value);
} }
get create_time() { get create_time() {
return pb_1.Message.getField(this, 3) as string; return pb_1.Message.getFieldWithDefault(this, 3, "") as string;
} }
set create_time(value: string) { set create_time(value: string) {
pb_1.Message.setField(this, 3, value); pb_1.Message.setField(this, 3, value);
} }
get expiry_time() { get expiry_time() {
return pb_1.Message.getField(this, 4) as string; return pb_1.Message.getFieldWithDefault(this, 4, "") as string;
} }
set expiry_time(value: string) { set expiry_time(value: string) {
pb_1.Message.setField(this, 4, value); pb_1.Message.setField(this, 4, value);
} }
get deleted() { get deleted() {
return pb_1.Message.getField(this, 5) as boolean; return pb_1.Message.getFieldWithDefault(this, 5, false) as boolean;
} }
set deleted(value: boolean) { set deleted(value: boolean) {
pb_1.Message.setField(this, 5, value); pb_1.Message.setField(this, 5, value);
} }
get owners() { get owners() {
return pb_1.Message.getField(this, 6) as string[]; return pb_1.Message.getFieldWithDefault(this, 6, []) as string[];
} }
set owners(value: string[]) { set owners(value: string[]) {
pb_1.Message.setField(this, 6, value); pb_1.Message.setField(this, 6, value);
} }
get attributes() { get attributes() {
return pb_1.Message.getField(this, 7) as string; return pb_1.Message.getFieldWithDefault(this, 7, new Uint8Array(0)) as Uint8Array;
} }
set attributes(value: string) { set attributes(value: Uint8Array) {
pb_1.Message.setField(this, 7, value); pb_1.Message.setField(this, 7, value);
} }
get names() { get names() {
return pb_1.Message.getField(this, 8) as string[]; return pb_1.Message.getFieldWithDefault(this, 8, []) as string[];
} }
set names(value: string[]) { set names(value: string[]) {
pb_1.Message.setField(this, 8, value); pb_1.Message.setField(this, 8, value);
} }
get type() {
return pb_1.Message.getFieldWithDefault(this, 9, "") as string;
}
set type(value: string) {
pb_1.Message.setField(this, 9, value);
}
static fromObject(data: { static fromObject(data: {
id?: string; id?: string;
bond_id?: string; bond_id?: string;
@ -402,9 +444,10 @@ export namespace vulcanize.nameservice.v1beta1 {
expiry_time?: string; expiry_time?: string;
deleted?: boolean; deleted?: boolean;
owners?: string[]; owners?: string[];
attributes?: string; attributes?: Uint8Array;
names?: string[]; names?: string[];
}) { type?: string;
}): Record {
const message = new Record({}); const message = new Record({});
if (data.id != null) { if (data.id != null) {
message.id = data.id; message.id = data.id;
@ -430,6 +473,9 @@ export namespace vulcanize.nameservice.v1beta1 {
if (data.names != null) { if (data.names != null) {
message.names = data.names; message.names = data.names;
} }
if (data.type != null) {
message.type = data.type;
}
return message; return message;
} }
toObject() { toObject() {
@ -440,8 +486,9 @@ export namespace vulcanize.nameservice.v1beta1 {
expiry_time?: string; expiry_time?: string;
deleted?: boolean; deleted?: boolean;
owners?: string[]; owners?: string[];
attributes?: string; attributes?: Uint8Array;
names?: string[]; names?: string[];
type?: string;
} = {}; } = {};
if (this.id != null) { if (this.id != null) {
data.id = this.id; data.id = this.id;
@ -467,28 +514,33 @@ export namespace vulcanize.nameservice.v1beta1 {
if (this.names != null) { if (this.names != null) {
data.names = this.names; data.names = this.names;
} }
if (this.type != null) {
data.type = this.type;
}
return data; return data;
} }
serialize(): Uint8Array; serialize(): Uint8Array;
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (typeof this.id === "string" && this.id.length) if (this.id.length)
writer.writeString(1, this.id); writer.writeString(1, this.id);
if (typeof this.bond_id === "string" && this.bond_id.length) if (this.bond_id.length)
writer.writeString(2, this.bond_id); writer.writeString(2, this.bond_id);
if (typeof this.create_time === "string" && this.create_time.length) if (this.create_time.length)
writer.writeString(3, this.create_time); writer.writeString(3, this.create_time);
if (typeof this.expiry_time === "string" && this.expiry_time.length) if (this.expiry_time.length)
writer.writeString(4, this.expiry_time); writer.writeString(4, this.expiry_time);
if (this.deleted !== undefined) if (this.deleted != false)
writer.writeBool(5, this.deleted); writer.writeBool(5, this.deleted);
if (this.owners !== undefined) if (this.owners.length)
writer.writeRepeatedString(6, this.owners); writer.writeRepeatedString(6, this.owners);
if (typeof this.attributes === "string" && this.attributes.length) if (this.attributes.length)
writer.writeString(7, this.attributes); writer.writeBytes(7, this.attributes);
if (this.names !== undefined) if (this.names.length)
writer.writeRepeatedString(8, this.names); writer.writeRepeatedString(8, this.names);
if (this.type.length)
writer.writeString(9, this.type);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
} }
@ -517,11 +569,14 @@ export namespace vulcanize.nameservice.v1beta1 {
pb_1.Message.addToRepeatedField(message, 6, reader.readString()); pb_1.Message.addToRepeatedField(message, 6, reader.readString());
break; break;
case 7: case 7:
message.attributes = reader.readString(); message.attributes = reader.readBytes();
break; break;
case 8: case 8:
pb_1.Message.addToRepeatedField(message, 8, reader.readString()); pb_1.Message.addToRepeatedField(message, 8, reader.readString());
break; break;
case 9:
message.type = reader.readString();
break;
default: reader.skipField(); default: reader.skipField();
} }
} }
@ -535,12 +590,13 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
export class AuthorityEntry extends pb_1.Message { export class AuthorityEntry extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
name?: string; name?: string;
entry?: NameAuthority; entry?: NameAuthority;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("name" in data && data.name != undefined) { if ("name" in data && data.name != undefined) {
this.name = data.name; this.name = data.name;
@ -551,7 +607,7 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
get name() { get name() {
return pb_1.Message.getField(this, 1) as string; return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
} }
set name(value: string) { set name(value: string) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
@ -562,10 +618,13 @@ export namespace vulcanize.nameservice.v1beta1 {
set entry(value: NameAuthority) { set entry(value: NameAuthority) {
pb_1.Message.setWrapperField(this, 2, value); pb_1.Message.setWrapperField(this, 2, value);
} }
get has_entry() {
return pb_1.Message.getField(this, 2) != null;
}
static fromObject(data: { static fromObject(data: {
name?: string; name?: string;
entry?: ReturnType<typeof NameAuthority.prototype.toObject>; entry?: ReturnType<typeof NameAuthority.prototype.toObject>;
}) { }): AuthorityEntry {
const message = new AuthorityEntry({}); const message = new AuthorityEntry({});
if (data.name != null) { if (data.name != null) {
message.name = data.name; message.name = data.name;
@ -592,9 +651,9 @@ export namespace vulcanize.nameservice.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (typeof this.name === "string" && this.name.length) if (this.name.length)
writer.writeString(1, this.name); writer.writeString(1, this.name);
if (this.entry !== undefined) if (this.has_entry)
writer.writeMessage(2, this.entry, () => this.entry.serialize(writer)); writer.writeMessage(2, this.entry, () => this.entry.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -624,6 +683,7 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
export class NameAuthority extends pb_1.Message { export class NameAuthority extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
owner_public_key?: string; owner_public_key?: string;
owner_address?: string; owner_address?: string;
@ -634,7 +694,7 @@ export namespace vulcanize.nameservice.v1beta1 {
expiry_time?: dependency_2.google.protobuf.Timestamp; expiry_time?: dependency_2.google.protobuf.Timestamp;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("owner_public_key" in data && data.owner_public_key != undefined) { if ("owner_public_key" in data && data.owner_public_key != undefined) {
this.owner_public_key = data.owner_public_key; this.owner_public_key = data.owner_public_key;
@ -660,37 +720,37 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
get owner_public_key() { get owner_public_key() {
return pb_1.Message.getField(this, 1) as string; return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
} }
set owner_public_key(value: string) { set owner_public_key(value: string) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
get owner_address() { get owner_address() {
return pb_1.Message.getField(this, 2) as string; return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
} }
set owner_address(value: string) { set owner_address(value: string) {
pb_1.Message.setField(this, 2, value); pb_1.Message.setField(this, 2, value);
} }
get height() { get height() {
return pb_1.Message.getField(this, 3) as number; return pb_1.Message.getFieldWithDefault(this, 3, 0) as number;
} }
set height(value: number) { set height(value: number) {
pb_1.Message.setField(this, 3, value); pb_1.Message.setField(this, 3, value);
} }
get status() { get status() {
return pb_1.Message.getField(this, 4) as string; return pb_1.Message.getFieldWithDefault(this, 4, "") as string;
} }
set status(value: string) { set status(value: string) {
pb_1.Message.setField(this, 4, value); pb_1.Message.setField(this, 4, value);
} }
get auction_id() { get auction_id() {
return pb_1.Message.getField(this, 5) as string; return pb_1.Message.getFieldWithDefault(this, 5, "") as string;
} }
set auction_id(value: string) { set auction_id(value: string) {
pb_1.Message.setField(this, 5, value); pb_1.Message.setField(this, 5, value);
} }
get bond_id() { get bond_id() {
return pb_1.Message.getField(this, 6) as string; return pb_1.Message.getFieldWithDefault(this, 6, "") as string;
} }
set bond_id(value: string) { set bond_id(value: string) {
pb_1.Message.setField(this, 6, value); pb_1.Message.setField(this, 6, value);
@ -701,6 +761,9 @@ export namespace vulcanize.nameservice.v1beta1 {
set expiry_time(value: dependency_2.google.protobuf.Timestamp) { set expiry_time(value: dependency_2.google.protobuf.Timestamp) {
pb_1.Message.setWrapperField(this, 7, value); pb_1.Message.setWrapperField(this, 7, value);
} }
get has_expiry_time() {
return pb_1.Message.getField(this, 7) != null;
}
static fromObject(data: { static fromObject(data: {
owner_public_key?: string; owner_public_key?: string;
owner_address?: string; owner_address?: string;
@ -709,7 +772,7 @@ export namespace vulcanize.nameservice.v1beta1 {
auction_id?: string; auction_id?: string;
bond_id?: string; bond_id?: string;
expiry_time?: ReturnType<typeof dependency_2.google.protobuf.Timestamp.prototype.toObject>; expiry_time?: ReturnType<typeof dependency_2.google.protobuf.Timestamp.prototype.toObject>;
}) { }): NameAuthority {
const message = new NameAuthority({}); const message = new NameAuthority({});
if (data.owner_public_key != null) { if (data.owner_public_key != null) {
message.owner_public_key = data.owner_public_key; message.owner_public_key = data.owner_public_key;
@ -771,19 +834,19 @@ export namespace vulcanize.nameservice.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (typeof this.owner_public_key === "string" && this.owner_public_key.length) if (this.owner_public_key.length)
writer.writeString(1, this.owner_public_key); writer.writeString(1, this.owner_public_key);
if (typeof this.owner_address === "string" && this.owner_address.length) if (this.owner_address.length)
writer.writeString(2, this.owner_address); writer.writeString(2, this.owner_address);
if (this.height !== undefined) if (this.height != 0)
writer.writeUint64(3, this.height); writer.writeUint64(3, this.height);
if (typeof this.status === "string" && this.status.length) if (this.status.length)
writer.writeString(4, this.status); writer.writeString(4, this.status);
if (typeof this.auction_id === "string" && this.auction_id.length) if (this.auction_id.length)
writer.writeString(5, this.auction_id); writer.writeString(5, this.auction_id);
if (typeof this.bond_id === "string" && this.bond_id.length) if (this.bond_id.length)
writer.writeString(6, this.bond_id); writer.writeString(6, this.bond_id);
if (this.expiry_time !== undefined) if (this.has_expiry_time)
writer.writeMessage(7, this.expiry_time, () => this.expiry_time.serialize(writer)); writer.writeMessage(7, this.expiry_time, () => this.expiry_time.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -828,12 +891,13 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
export class NameEntry extends pb_1.Message { export class NameEntry extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
name?: string; name?: string;
entry?: NameRecord; entry?: NameRecord;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("name" in data && data.name != undefined) { if ("name" in data && data.name != undefined) {
this.name = data.name; this.name = data.name;
@ -844,7 +908,7 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
get name() { get name() {
return pb_1.Message.getField(this, 1) as string; return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
} }
set name(value: string) { set name(value: string) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
@ -855,10 +919,13 @@ export namespace vulcanize.nameservice.v1beta1 {
set entry(value: NameRecord) { set entry(value: NameRecord) {
pb_1.Message.setWrapperField(this, 2, value); pb_1.Message.setWrapperField(this, 2, value);
} }
get has_entry() {
return pb_1.Message.getField(this, 2) != null;
}
static fromObject(data: { static fromObject(data: {
name?: string; name?: string;
entry?: ReturnType<typeof NameRecord.prototype.toObject>; entry?: ReturnType<typeof NameRecord.prototype.toObject>;
}) { }): NameEntry {
const message = new NameEntry({}); const message = new NameEntry({});
if (data.name != null) { if (data.name != null) {
message.name = data.name; message.name = data.name;
@ -885,9 +952,9 @@ export namespace vulcanize.nameservice.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (typeof this.name === "string" && this.name.length) if (this.name.length)
writer.writeString(1, this.name); writer.writeString(1, this.name);
if (this.entry !== undefined) if (this.has_entry)
writer.writeMessage(2, this.entry, () => this.entry.serialize(writer)); writer.writeMessage(2, this.entry, () => this.entry.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -917,12 +984,13 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
export class NameRecord extends pb_1.Message { export class NameRecord extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
latest?: NameRecordEntry; latest?: NameRecordEntry;
history?: NameRecordEntry[]; history?: NameRecordEntry[];
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("latest" in data && data.latest != undefined) { if ("latest" in data && data.latest != undefined) {
this.latest = data.latest; this.latest = data.latest;
@ -938,6 +1006,9 @@ export namespace vulcanize.nameservice.v1beta1 {
set latest(value: NameRecordEntry) { set latest(value: NameRecordEntry) {
pb_1.Message.setWrapperField(this, 1, value); pb_1.Message.setWrapperField(this, 1, value);
} }
get has_latest() {
return pb_1.Message.getField(this, 1) != null;
}
get history() { get history() {
return pb_1.Message.getRepeatedWrapperField(this, NameRecordEntry, 2) as NameRecordEntry[]; return pb_1.Message.getRepeatedWrapperField(this, NameRecordEntry, 2) as NameRecordEntry[];
} }
@ -947,7 +1018,7 @@ export namespace vulcanize.nameservice.v1beta1 {
static fromObject(data: { static fromObject(data: {
latest?: ReturnType<typeof NameRecordEntry.prototype.toObject>; latest?: ReturnType<typeof NameRecordEntry.prototype.toObject>;
history?: ReturnType<typeof NameRecordEntry.prototype.toObject>[]; history?: ReturnType<typeof NameRecordEntry.prototype.toObject>[];
}) { }): NameRecord {
const message = new NameRecord({}); const message = new NameRecord({});
if (data.latest != null) { if (data.latest != null) {
message.latest = NameRecordEntry.fromObject(data.latest); message.latest = NameRecordEntry.fromObject(data.latest);
@ -974,9 +1045,9 @@ export namespace vulcanize.nameservice.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (this.latest !== undefined) if (this.has_latest)
writer.writeMessage(1, this.latest, () => this.latest.serialize(writer)); writer.writeMessage(1, this.latest, () => this.latest.serialize(writer));
if (this.history !== undefined) if (this.history.length)
writer.writeRepeatedMessage(2, this.history, (item: NameRecordEntry) => item.serialize(writer)); writer.writeRepeatedMessage(2, this.history, (item: NameRecordEntry) => item.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -1006,12 +1077,13 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
export class NameRecordEntry extends pb_1.Message { export class NameRecordEntry extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
id?: string; id?: string;
height?: number; height?: number;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("id" in data && data.id != undefined) { if ("id" in data && data.id != undefined) {
this.id = data.id; this.id = data.id;
@ -1022,13 +1094,13 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
get id() { get id() {
return pb_1.Message.getField(this, 1) as string; return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
} }
set id(value: string) { set id(value: string) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
get height() { get height() {
return pb_1.Message.getField(this, 2) as number; return pb_1.Message.getFieldWithDefault(this, 2, 0) as number;
} }
set height(value: number) { set height(value: number) {
pb_1.Message.setField(this, 2, value); pb_1.Message.setField(this, 2, value);
@ -1036,7 +1108,7 @@ export namespace vulcanize.nameservice.v1beta1 {
static fromObject(data: { static fromObject(data: {
id?: string; id?: string;
height?: number; height?: number;
}) { }): NameRecordEntry {
const message = new NameRecordEntry({}); const message = new NameRecordEntry({});
if (data.id != null) { if (data.id != null) {
message.id = data.id; message.id = data.id;
@ -1063,9 +1135,9 @@ export namespace vulcanize.nameservice.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (typeof this.id === "string" && this.id.length) if (this.id.length)
writer.writeString(1, this.id); writer.writeString(1, this.id);
if (this.height !== undefined) if (this.height != 0)
writer.writeUint64(2, this.height); writer.writeUint64(2, this.height);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -1095,12 +1167,13 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
export class Signature extends pb_1.Message { export class Signature extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
sig?: string; sig?: string;
pub_key?: string; pub_key?: string;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("sig" in data && data.sig != undefined) { if ("sig" in data && data.sig != undefined) {
this.sig = data.sig; this.sig = data.sig;
@ -1111,13 +1184,13 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
get sig() { get sig() {
return pb_1.Message.getField(this, 1) as string; return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
} }
set sig(value: string) { set sig(value: string) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
get pub_key() { get pub_key() {
return pb_1.Message.getField(this, 2) as string; return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
} }
set pub_key(value: string) { set pub_key(value: string) {
pb_1.Message.setField(this, 2, value); pb_1.Message.setField(this, 2, value);
@ -1125,7 +1198,7 @@ export namespace vulcanize.nameservice.v1beta1 {
static fromObject(data: { static fromObject(data: {
sig?: string; sig?: string;
pub_key?: string; pub_key?: string;
}) { }): Signature {
const message = new Signature({}); const message = new Signature({});
if (data.sig != null) { if (data.sig != null) {
message.sig = data.sig; message.sig = data.sig;
@ -1152,9 +1225,9 @@ export namespace vulcanize.nameservice.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (typeof this.sig === "string" && this.sig.length) if (this.sig.length)
writer.writeString(1, this.sig); writer.writeString(1, this.sig);
if (typeof this.pub_key === "string" && this.pub_key.length) if (this.pub_key.length)
writer.writeString(2, this.pub_key); writer.writeString(2, this.pub_key);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -1184,6 +1257,7 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
export class BlockChangeSet extends pb_1.Message { export class BlockChangeSet extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
height?: number; height?: number;
records?: string[]; records?: string[];
@ -1193,7 +1267,7 @@ export namespace vulcanize.nameservice.v1beta1 {
names?: string[]; names?: string[];
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2, 3, 4, 5, 6], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2, 3, 4, 5, 6], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("height" in data && data.height != undefined) { if ("height" in data && data.height != undefined) {
this.height = data.height; this.height = data.height;
@ -1216,19 +1290,19 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
get height() { get height() {
return pb_1.Message.getField(this, 1) as number; return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
} }
set height(value: number) { set height(value: number) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
get records() { get records() {
return pb_1.Message.getField(this, 2) as string[]; return pb_1.Message.getFieldWithDefault(this, 2, []) as string[];
} }
set records(value: string[]) { set records(value: string[]) {
pb_1.Message.setField(this, 2, value); pb_1.Message.setField(this, 2, value);
} }
get auctions() { get auctions() {
return pb_1.Message.getField(this, 3) as string[]; return pb_1.Message.getFieldWithDefault(this, 3, []) as string[];
} }
set auctions(value: string[]) { set auctions(value: string[]) {
pb_1.Message.setField(this, 3, value); pb_1.Message.setField(this, 3, value);
@ -1240,13 +1314,13 @@ export namespace vulcanize.nameservice.v1beta1 {
pb_1.Message.setRepeatedWrapperField(this, 4, value); pb_1.Message.setRepeatedWrapperField(this, 4, value);
} }
get authorities() { get authorities() {
return pb_1.Message.getField(this, 5) as string[]; return pb_1.Message.getFieldWithDefault(this, 5, []) as string[];
} }
set authorities(value: string[]) { set authorities(value: string[]) {
pb_1.Message.setField(this, 5, value); pb_1.Message.setField(this, 5, value);
} }
get names() { get names() {
return pb_1.Message.getField(this, 6) as string[]; return pb_1.Message.getFieldWithDefault(this, 6, []) as string[];
} }
set names(value: string[]) { set names(value: string[]) {
pb_1.Message.setField(this, 6, value); pb_1.Message.setField(this, 6, value);
@ -1258,7 +1332,7 @@ export namespace vulcanize.nameservice.v1beta1 {
auction_bids?: ReturnType<typeof AuctionBidInfo.prototype.toObject>[]; auction_bids?: ReturnType<typeof AuctionBidInfo.prototype.toObject>[];
authorities?: string[]; authorities?: string[];
names?: string[]; names?: string[];
}) { }): BlockChangeSet {
const message = new BlockChangeSet({}); const message = new BlockChangeSet({});
if (data.height != null) { if (data.height != null) {
message.height = data.height; message.height = data.height;
@ -1313,17 +1387,17 @@ export namespace vulcanize.nameservice.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (this.height !== undefined) if (this.height != 0)
writer.writeInt64(1, this.height); writer.writeInt64(1, this.height);
if (this.records !== undefined) if (this.records.length)
writer.writeRepeatedString(2, this.records); writer.writeRepeatedString(2, this.records);
if (this.auctions !== undefined) if (this.auctions.length)
writer.writeRepeatedString(3, this.auctions); writer.writeRepeatedString(3, this.auctions);
if (this.auction_bids !== undefined) if (this.auction_bids.length)
writer.writeRepeatedMessage(4, this.auction_bids, (item: AuctionBidInfo) => item.serialize(writer)); writer.writeRepeatedMessage(4, this.auction_bids, (item: AuctionBidInfo) => item.serialize(writer));
if (this.authorities !== undefined) if (this.authorities.length)
writer.writeRepeatedString(5, this.authorities); writer.writeRepeatedString(5, this.authorities);
if (this.names !== undefined) if (this.names.length)
writer.writeRepeatedString(6, this.names); writer.writeRepeatedString(6, this.names);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -1365,12 +1439,13 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
export class AuctionBidInfo extends pb_1.Message { export class AuctionBidInfo extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
auction_id?: string; auction_id?: string;
bidder_address?: string; bidder_address?: string;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("auction_id" in data && data.auction_id != undefined) { if ("auction_id" in data && data.auction_id != undefined) {
this.auction_id = data.auction_id; this.auction_id = data.auction_id;
@ -1381,13 +1456,13 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
get auction_id() { get auction_id() {
return pb_1.Message.getField(this, 1) as string; return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
} }
set auction_id(value: string) { set auction_id(value: string) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
get bidder_address() { get bidder_address() {
return pb_1.Message.getField(this, 2) as string; return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
} }
set bidder_address(value: string) { set bidder_address(value: string) {
pb_1.Message.setField(this, 2, value); pb_1.Message.setField(this, 2, value);
@ -1395,7 +1470,7 @@ export namespace vulcanize.nameservice.v1beta1 {
static fromObject(data: { static fromObject(data: {
auction_id?: string; auction_id?: string;
bidder_address?: string; bidder_address?: string;
}) { }): AuctionBidInfo {
const message = new AuctionBidInfo({}); const message = new AuctionBidInfo({});
if (data.auction_id != null) { if (data.auction_id != null) {
message.auction_id = data.auction_id; message.auction_id = data.auction_id;
@ -1422,9 +1497,9 @@ export namespace vulcanize.nameservice.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (typeof this.auction_id === "string" && this.auction_id.length) if (this.auction_id.length)
writer.writeString(1, this.auction_id); writer.writeString(1, this.auction_id);
if (typeof this.bidder_address === "string" && this.bidder_address.length) if (this.bidder_address.length)
writer.writeString(2, this.bidder_address); writer.writeString(2, this.bidder_address);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();

View File

@ -2,21 +2,22 @@
/* eslint-disable */ /* eslint-disable */
/** /**
* Generated by the protoc-gen-ts. DO NOT EDIT! * Generated by the protoc-gen-ts. DO NOT EDIT!
* compiler version: 3.14.0 * compiler version: 4.25.1
* source: vulcanize/nameservice/v1beta1/tx.proto * source: vulcanize/registry/v1beta1/tx.proto
* git: https://github.com/thesayyn/protoc-gen-ts */ * git: https://github.com/thesayyn/protoc-gen-ts */
import * as dependency_1 from "./../../../gogoproto/gogo"; import * as dependency_1 from "./../../../gogoproto/gogo";
import * as dependency_2 from "./nameservice"; import * as dependency_2 from "./registry";
import * as pb_1 from "google-protobuf"; import * as pb_1 from "google-protobuf";
export namespace vulcanize.nameservice.v1beta1 { export namespace vulcanize.registry.v1beta1 {
export class MsgSetRecord extends pb_1.Message { export class MsgSetRecord extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
bond_id?: string; bond_id?: string;
signer?: string; signer?: string;
payload?: Payload; payload?: Payload;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("bond_id" in data && data.bond_id != undefined) { if ("bond_id" in data && data.bond_id != undefined) {
this.bond_id = data.bond_id; this.bond_id = data.bond_id;
@ -30,13 +31,13 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
get bond_id() { get bond_id() {
return pb_1.Message.getField(this, 1) as string; return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
} }
set bond_id(value: string) { set bond_id(value: string) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
get signer() { get signer() {
return pb_1.Message.getField(this, 2) as string; return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
} }
set signer(value: string) { set signer(value: string) {
pb_1.Message.setField(this, 2, value); pb_1.Message.setField(this, 2, value);
@ -47,11 +48,14 @@ export namespace vulcanize.nameservice.v1beta1 {
set payload(value: Payload) { set payload(value: Payload) {
pb_1.Message.setWrapperField(this, 3, value); pb_1.Message.setWrapperField(this, 3, value);
} }
get has_payload() {
return pb_1.Message.getField(this, 3) != null;
}
static fromObject(data: { static fromObject(data: {
bond_id?: string; bond_id?: string;
signer?: string; signer?: string;
payload?: ReturnType<typeof Payload.prototype.toObject>; payload?: ReturnType<typeof Payload.prototype.toObject>;
}) { }): MsgSetRecord {
const message = new MsgSetRecord({}); const message = new MsgSetRecord({});
if (data.bond_id != null) { if (data.bond_id != null) {
message.bond_id = data.bond_id; message.bond_id = data.bond_id;
@ -85,11 +89,11 @@ export namespace vulcanize.nameservice.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (typeof this.bond_id === "string" && this.bond_id.length) if (this.bond_id.length)
writer.writeString(1, this.bond_id); writer.writeString(1, this.bond_id);
if (typeof this.signer === "string" && this.signer.length) if (this.signer.length)
writer.writeString(2, this.signer); writer.writeString(2, this.signer);
if (this.payload !== undefined) if (this.has_payload)
writer.writeMessage(3, this.payload, () => this.payload.serialize(writer)); writer.writeMessage(3, this.payload, () => this.payload.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -122,11 +126,12 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
export class MsgSetRecordResponse extends pb_1.Message { export class MsgSetRecordResponse extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
id?: string; id?: string;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("id" in data && data.id != undefined) { if ("id" in data && data.id != undefined) {
this.id = data.id; this.id = data.id;
@ -134,14 +139,14 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
get id() { get id() {
return pb_1.Message.getField(this, 1) as string; return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
} }
set id(value: string) { set id(value: string) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
static fromObject(data: { static fromObject(data: {
id?: string; id?: string;
}) { }): MsgSetRecordResponse {
const message = new MsgSetRecordResponse({}); const message = new MsgSetRecordResponse({});
if (data.id != null) { if (data.id != null) {
message.id = data.id; message.id = data.id;
@ -161,7 +166,7 @@ export namespace vulcanize.nameservice.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (typeof this.id === "string" && this.id.length) if (this.id.length)
writer.writeString(1, this.id); writer.writeString(1, this.id);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -188,12 +193,13 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
export class Payload extends pb_1.Message { export class Payload extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
record?: dependency_2.vulcanize.nameservice.v1beta1.Record; record?: dependency_2.vulcanize.registry.v1beta1.Record;
signatures?: dependency_2.vulcanize.nameservice.v1beta1.Signature[]; signatures?: dependency_2.vulcanize.registry.v1beta1.Signature[];
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("record" in data && data.record != undefined) { if ("record" in data && data.record != undefined) {
this.record = data.record; this.record = data.record;
@ -204,40 +210,43 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
get record() { get record() {
return pb_1.Message.getWrapperField(this, dependency_2.vulcanize.nameservice.v1beta1.Record, 1) as dependency_2.vulcanize.nameservice.v1beta1.Record; return pb_1.Message.getWrapperField(this, dependency_2.vulcanize.registry.v1beta1.Record, 1) as dependency_2.vulcanize.registry.v1beta1.Record;
} }
set record(value: dependency_2.vulcanize.nameservice.v1beta1.Record) { set record(value: dependency_2.vulcanize.registry.v1beta1.Record) {
pb_1.Message.setWrapperField(this, 1, value); pb_1.Message.setWrapperField(this, 1, value);
} }
get signatures() { get has_record() {
return pb_1.Message.getRepeatedWrapperField(this, dependency_2.vulcanize.nameservice.v1beta1.Signature, 2) as dependency_2.vulcanize.nameservice.v1beta1.Signature[]; return pb_1.Message.getField(this, 1) != null;
} }
set signatures(value: dependency_2.vulcanize.nameservice.v1beta1.Signature[]) { get signatures() {
return pb_1.Message.getRepeatedWrapperField(this, dependency_2.vulcanize.registry.v1beta1.Signature, 2) as dependency_2.vulcanize.registry.v1beta1.Signature[];
}
set signatures(value: dependency_2.vulcanize.registry.v1beta1.Signature[]) {
pb_1.Message.setRepeatedWrapperField(this, 2, value); pb_1.Message.setRepeatedWrapperField(this, 2, value);
} }
static fromObject(data: { static fromObject(data: {
record?: ReturnType<typeof dependency_2.vulcanize.nameservice.v1beta1.Record.prototype.toObject>; record?: ReturnType<typeof dependency_2.vulcanize.registry.v1beta1.Record.prototype.toObject>;
signatures?: ReturnType<typeof dependency_2.vulcanize.nameservice.v1beta1.Signature.prototype.toObject>[]; signatures?: ReturnType<typeof dependency_2.vulcanize.registry.v1beta1.Signature.prototype.toObject>[];
}) { }): Payload {
const message = new Payload({}); const message = new Payload({});
if (data.record != null) { if (data.record != null) {
message.record = dependency_2.vulcanize.nameservice.v1beta1.Record.fromObject(data.record); message.record = dependency_2.vulcanize.registry.v1beta1.Record.fromObject(data.record);
} }
if (data.signatures != null) { if (data.signatures != null) {
message.signatures = data.signatures.map(item => dependency_2.vulcanize.nameservice.v1beta1.Signature.fromObject(item)); message.signatures = data.signatures.map(item => dependency_2.vulcanize.registry.v1beta1.Signature.fromObject(item));
} }
return message; return message;
} }
toObject() { toObject() {
const data: { const data: {
record?: ReturnType<typeof dependency_2.vulcanize.nameservice.v1beta1.Record.prototype.toObject>; record?: ReturnType<typeof dependency_2.vulcanize.registry.v1beta1.Record.prototype.toObject>;
signatures?: ReturnType<typeof dependency_2.vulcanize.nameservice.v1beta1.Signature.prototype.toObject>[]; signatures?: ReturnType<typeof dependency_2.vulcanize.registry.v1beta1.Signature.prototype.toObject>[];
} = {}; } = {};
if (this.record != null) { if (this.record != null) {
data.record = this.record.toObject(); data.record = this.record.toObject();
} }
if (this.signatures != null) { if (this.signatures != null) {
data.signatures = this.signatures.map((item: dependency_2.vulcanize.nameservice.v1beta1.Signature) => item.toObject()); data.signatures = this.signatures.map((item: dependency_2.vulcanize.registry.v1beta1.Signature) => item.toObject());
} }
return data; return data;
} }
@ -245,10 +254,10 @@ export namespace vulcanize.nameservice.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (this.record !== undefined) if (this.has_record)
writer.writeMessage(1, this.record, () => this.record.serialize(writer)); writer.writeMessage(1, this.record, () => this.record.serialize(writer));
if (this.signatures !== undefined) if (this.signatures.length)
writer.writeRepeatedMessage(2, this.signatures, (item: dependency_2.vulcanize.nameservice.v1beta1.Signature) => item.serialize(writer)); writer.writeRepeatedMessage(2, this.signatures, (item: dependency_2.vulcanize.registry.v1beta1.Signature) => item.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
} }
@ -259,10 +268,10 @@ export namespace vulcanize.nameservice.v1beta1 {
break; break;
switch (reader.getFieldNumber()) { switch (reader.getFieldNumber()) {
case 1: case 1:
reader.readMessage(message.record, () => message.record = dependency_2.vulcanize.nameservice.v1beta1.Record.deserialize(reader)); reader.readMessage(message.record, () => message.record = dependency_2.vulcanize.registry.v1beta1.Record.deserialize(reader));
break; break;
case 2: case 2:
reader.readMessage(message.signatures, () => pb_1.Message.addToRepeatedWrapperField(message, 2, dependency_2.vulcanize.nameservice.v1beta1.Signature.deserialize(reader), dependency_2.vulcanize.nameservice.v1beta1.Signature)); reader.readMessage(message.signatures, () => pb_1.Message.addToRepeatedWrapperField(message, 2, dependency_2.vulcanize.registry.v1beta1.Signature.deserialize(reader), dependency_2.vulcanize.registry.v1beta1.Signature));
break; break;
default: reader.skipField(); default: reader.skipField();
} }
@ -277,13 +286,14 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
export class MsgSetName extends pb_1.Message { export class MsgSetName extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
crn?: string; crn?: string;
cid?: string; cid?: string;
signer?: string; signer?: string;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("crn" in data && data.crn != undefined) { if ("crn" in data && data.crn != undefined) {
this.crn = data.crn; this.crn = data.crn;
@ -297,19 +307,19 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
get crn() { get crn() {
return pb_1.Message.getField(this, 1) as string; return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
} }
set crn(value: string) { set crn(value: string) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
get cid() { get cid() {
return pb_1.Message.getField(this, 2) as string; return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
} }
set cid(value: string) { set cid(value: string) {
pb_1.Message.setField(this, 2, value); pb_1.Message.setField(this, 2, value);
} }
get signer() { get signer() {
return pb_1.Message.getField(this, 3) as string; return pb_1.Message.getFieldWithDefault(this, 3, "") as string;
} }
set signer(value: string) { set signer(value: string) {
pb_1.Message.setField(this, 3, value); pb_1.Message.setField(this, 3, value);
@ -318,7 +328,7 @@ export namespace vulcanize.nameservice.v1beta1 {
crn?: string; crn?: string;
cid?: string; cid?: string;
signer?: string; signer?: string;
}) { }): MsgSetName {
const message = new MsgSetName({}); const message = new MsgSetName({});
if (data.crn != null) { if (data.crn != null) {
message.crn = data.crn; message.crn = data.crn;
@ -352,11 +362,11 @@ export namespace vulcanize.nameservice.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (typeof this.crn === "string" && this.crn.length) if (this.crn.length)
writer.writeString(1, this.crn); writer.writeString(1, this.crn);
if (typeof this.cid === "string" && this.cid.length) if (this.cid.length)
writer.writeString(2, this.cid); writer.writeString(2, this.cid);
if (typeof this.signer === "string" && this.signer.length) if (this.signer.length)
writer.writeString(3, this.signer); writer.writeString(3, this.signer);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -389,12 +399,13 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
export class MsgSetNameResponse extends pb_1.Message { export class MsgSetNameResponse extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {}) { constructor(data?: any[] | {}) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { } if (!Array.isArray(data) && typeof data == "object") { }
} }
static fromObject(data: {}) { static fromObject(data: {}): MsgSetNameResponse {
const message = new MsgSetNameResponse({}); const message = new MsgSetNameResponse({});
return message; return message;
} }
@ -428,13 +439,14 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
export class MsgReserveAuthority extends pb_1.Message { export class MsgReserveAuthority extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
name?: string; name?: string;
signer?: string; signer?: string;
owner?: string; owner?: string;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("name" in data && data.name != undefined) { if ("name" in data && data.name != undefined) {
this.name = data.name; this.name = data.name;
@ -448,19 +460,19 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
get name() { get name() {
return pb_1.Message.getField(this, 1) as string; return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
} }
set name(value: string) { set name(value: string) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
get signer() { get signer() {
return pb_1.Message.getField(this, 2) as string; return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
} }
set signer(value: string) { set signer(value: string) {
pb_1.Message.setField(this, 2, value); pb_1.Message.setField(this, 2, value);
} }
get owner() { get owner() {
return pb_1.Message.getField(this, 3) as string; return pb_1.Message.getFieldWithDefault(this, 3, "") as string;
} }
set owner(value: string) { set owner(value: string) {
pb_1.Message.setField(this, 3, value); pb_1.Message.setField(this, 3, value);
@ -469,7 +481,7 @@ export namespace vulcanize.nameservice.v1beta1 {
name?: string; name?: string;
signer?: string; signer?: string;
owner?: string; owner?: string;
}) { }): MsgReserveAuthority {
const message = new MsgReserveAuthority({}); const message = new MsgReserveAuthority({});
if (data.name != null) { if (data.name != null) {
message.name = data.name; message.name = data.name;
@ -503,11 +515,11 @@ export namespace vulcanize.nameservice.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (typeof this.name === "string" && this.name.length) if (this.name.length)
writer.writeString(1, this.name); writer.writeString(1, this.name);
if (typeof this.signer === "string" && this.signer.length) if (this.signer.length)
writer.writeString(2, this.signer); writer.writeString(2, this.signer);
if (typeof this.owner === "string" && this.owner.length) if (this.owner.length)
writer.writeString(3, this.owner); writer.writeString(3, this.owner);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -540,12 +552,13 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
export class MsgReserveAuthorityResponse extends pb_1.Message { export class MsgReserveAuthorityResponse extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {}) { constructor(data?: any[] | {}) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { } if (!Array.isArray(data) && typeof data == "object") { }
} }
static fromObject(data: {}) { static fromObject(data: {}): MsgReserveAuthorityResponse {
const message = new MsgReserveAuthorityResponse({}); const message = new MsgReserveAuthorityResponse({});
return message; return message;
} }
@ -579,13 +592,14 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
export class MsgSetAuthorityBond extends pb_1.Message { export class MsgSetAuthorityBond extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
name?: string; name?: string;
bond_id?: string; bond_id?: string;
signer?: string; signer?: string;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("name" in data && data.name != undefined) { if ("name" in data && data.name != undefined) {
this.name = data.name; this.name = data.name;
@ -599,19 +613,19 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
get name() { get name() {
return pb_1.Message.getField(this, 1) as string; return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
} }
set name(value: string) { set name(value: string) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
get bond_id() { get bond_id() {
return pb_1.Message.getField(this, 2) as string; return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
} }
set bond_id(value: string) { set bond_id(value: string) {
pb_1.Message.setField(this, 2, value); pb_1.Message.setField(this, 2, value);
} }
get signer() { get signer() {
return pb_1.Message.getField(this, 3) as string; return pb_1.Message.getFieldWithDefault(this, 3, "") as string;
} }
set signer(value: string) { set signer(value: string) {
pb_1.Message.setField(this, 3, value); pb_1.Message.setField(this, 3, value);
@ -620,7 +634,7 @@ export namespace vulcanize.nameservice.v1beta1 {
name?: string; name?: string;
bond_id?: string; bond_id?: string;
signer?: string; signer?: string;
}) { }): MsgSetAuthorityBond {
const message = new MsgSetAuthorityBond({}); const message = new MsgSetAuthorityBond({});
if (data.name != null) { if (data.name != null) {
message.name = data.name; message.name = data.name;
@ -654,11 +668,11 @@ export namespace vulcanize.nameservice.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (typeof this.name === "string" && this.name.length) if (this.name.length)
writer.writeString(1, this.name); writer.writeString(1, this.name);
if (typeof this.bond_id === "string" && this.bond_id.length) if (this.bond_id.length)
writer.writeString(2, this.bond_id); writer.writeString(2, this.bond_id);
if (typeof this.signer === "string" && this.signer.length) if (this.signer.length)
writer.writeString(3, this.signer); writer.writeString(3, this.signer);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -691,12 +705,13 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
export class MsgSetAuthorityBondResponse extends pb_1.Message { export class MsgSetAuthorityBondResponse extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {}) { constructor(data?: any[] | {}) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { } if (!Array.isArray(data) && typeof data == "object") { }
} }
static fromObject(data: {}) { static fromObject(data: {}): MsgSetAuthorityBondResponse {
const message = new MsgSetAuthorityBondResponse({}); const message = new MsgSetAuthorityBondResponse({});
return message; return message;
} }
@ -730,12 +745,13 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
export class MsgDeleteNameAuthority extends pb_1.Message { export class MsgDeleteNameAuthority extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
crn?: string; crn?: string;
signer?: string; signer?: string;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("crn" in data && data.crn != undefined) { if ("crn" in data && data.crn != undefined) {
this.crn = data.crn; this.crn = data.crn;
@ -746,13 +762,13 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
get crn() { get crn() {
return pb_1.Message.getField(this, 1) as string; return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
} }
set crn(value: string) { set crn(value: string) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
get signer() { get signer() {
return pb_1.Message.getField(this, 2) as string; return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
} }
set signer(value: string) { set signer(value: string) {
pb_1.Message.setField(this, 2, value); pb_1.Message.setField(this, 2, value);
@ -760,7 +776,7 @@ export namespace vulcanize.nameservice.v1beta1 {
static fromObject(data: { static fromObject(data: {
crn?: string; crn?: string;
signer?: string; signer?: string;
}) { }): MsgDeleteNameAuthority {
const message = new MsgDeleteNameAuthority({}); const message = new MsgDeleteNameAuthority({});
if (data.crn != null) { if (data.crn != null) {
message.crn = data.crn; message.crn = data.crn;
@ -787,9 +803,9 @@ export namespace vulcanize.nameservice.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (typeof this.crn === "string" && this.crn.length) if (this.crn.length)
writer.writeString(1, this.crn); writer.writeString(1, this.crn);
if (typeof this.signer === "string" && this.signer.length) if (this.signer.length)
writer.writeString(2, this.signer); writer.writeString(2, this.signer);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -819,12 +835,13 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
export class MsgDeleteNameAuthorityResponse extends pb_1.Message { export class MsgDeleteNameAuthorityResponse extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {}) { constructor(data?: any[] | {}) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { } if (!Array.isArray(data) && typeof data == "object") { }
} }
static fromObject(data: {}) { static fromObject(data: {}): MsgDeleteNameAuthorityResponse {
const message = new MsgDeleteNameAuthorityResponse({}); const message = new MsgDeleteNameAuthorityResponse({});
return message; return message;
} }
@ -858,12 +875,13 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
export class MsgRenewRecord extends pb_1.Message { export class MsgRenewRecord extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
record_id?: string; record_id?: string;
signer?: string; signer?: string;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("record_id" in data && data.record_id != undefined) { if ("record_id" in data && data.record_id != undefined) {
this.record_id = data.record_id; this.record_id = data.record_id;
@ -874,13 +892,13 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
get record_id() { get record_id() {
return pb_1.Message.getField(this, 1) as string; return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
} }
set record_id(value: string) { set record_id(value: string) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
get signer() { get signer() {
return pb_1.Message.getField(this, 2) as string; return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
} }
set signer(value: string) { set signer(value: string) {
pb_1.Message.setField(this, 2, value); pb_1.Message.setField(this, 2, value);
@ -888,7 +906,7 @@ export namespace vulcanize.nameservice.v1beta1 {
static fromObject(data: { static fromObject(data: {
record_id?: string; record_id?: string;
signer?: string; signer?: string;
}) { }): MsgRenewRecord {
const message = new MsgRenewRecord({}); const message = new MsgRenewRecord({});
if (data.record_id != null) { if (data.record_id != null) {
message.record_id = data.record_id; message.record_id = data.record_id;
@ -915,9 +933,9 @@ export namespace vulcanize.nameservice.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (typeof this.record_id === "string" && this.record_id.length) if (this.record_id.length)
writer.writeString(1, this.record_id); writer.writeString(1, this.record_id);
if (typeof this.signer === "string" && this.signer.length) if (this.signer.length)
writer.writeString(2, this.signer); writer.writeString(2, this.signer);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -947,12 +965,13 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
export class MsgRenewRecordResponse extends pb_1.Message { export class MsgRenewRecordResponse extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {}) { constructor(data?: any[] | {}) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { } if (!Array.isArray(data) && typeof data == "object") { }
} }
static fromObject(data: {}) { static fromObject(data: {}): MsgRenewRecordResponse {
const message = new MsgRenewRecordResponse({}); const message = new MsgRenewRecordResponse({});
return message; return message;
} }
@ -986,13 +1005,14 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
export class MsgAssociateBond extends pb_1.Message { export class MsgAssociateBond extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
record_id?: string; record_id?: string;
bond_id?: string; bond_id?: string;
signer?: string; signer?: string;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("record_id" in data && data.record_id != undefined) { if ("record_id" in data && data.record_id != undefined) {
this.record_id = data.record_id; this.record_id = data.record_id;
@ -1006,19 +1026,19 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
get record_id() { get record_id() {
return pb_1.Message.getField(this, 1) as string; return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
} }
set record_id(value: string) { set record_id(value: string) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
get bond_id() { get bond_id() {
return pb_1.Message.getField(this, 2) as string; return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
} }
set bond_id(value: string) { set bond_id(value: string) {
pb_1.Message.setField(this, 2, value); pb_1.Message.setField(this, 2, value);
} }
get signer() { get signer() {
return pb_1.Message.getField(this, 3) as string; return pb_1.Message.getFieldWithDefault(this, 3, "") as string;
} }
set signer(value: string) { set signer(value: string) {
pb_1.Message.setField(this, 3, value); pb_1.Message.setField(this, 3, value);
@ -1027,7 +1047,7 @@ export namespace vulcanize.nameservice.v1beta1 {
record_id?: string; record_id?: string;
bond_id?: string; bond_id?: string;
signer?: string; signer?: string;
}) { }): MsgAssociateBond {
const message = new MsgAssociateBond({}); const message = new MsgAssociateBond({});
if (data.record_id != null) { if (data.record_id != null) {
message.record_id = data.record_id; message.record_id = data.record_id;
@ -1061,11 +1081,11 @@ export namespace vulcanize.nameservice.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (typeof this.record_id === "string" && this.record_id.length) if (this.record_id.length)
writer.writeString(1, this.record_id); writer.writeString(1, this.record_id);
if (typeof this.bond_id === "string" && this.bond_id.length) if (this.bond_id.length)
writer.writeString(2, this.bond_id); writer.writeString(2, this.bond_id);
if (typeof this.signer === "string" && this.signer.length) if (this.signer.length)
writer.writeString(3, this.signer); writer.writeString(3, this.signer);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -1098,12 +1118,13 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
export class MsgAssociateBondResponse extends pb_1.Message { export class MsgAssociateBondResponse extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {}) { constructor(data?: any[] | {}) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { } if (!Array.isArray(data) && typeof data == "object") { }
} }
static fromObject(data: {}) { static fromObject(data: {}): MsgAssociateBondResponse {
const message = new MsgAssociateBondResponse({}); const message = new MsgAssociateBondResponse({});
return message; return message;
} }
@ -1137,12 +1158,13 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
export class MsgDissociateBond extends pb_1.Message { export class MsgDissociateBond extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
record_id?: string; record_id?: string;
signer?: string; signer?: string;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("record_id" in data && data.record_id != undefined) { if ("record_id" in data && data.record_id != undefined) {
this.record_id = data.record_id; this.record_id = data.record_id;
@ -1153,13 +1175,13 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
get record_id() { get record_id() {
return pb_1.Message.getField(this, 1) as string; return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
} }
set record_id(value: string) { set record_id(value: string) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
get signer() { get signer() {
return pb_1.Message.getField(this, 2) as string; return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
} }
set signer(value: string) { set signer(value: string) {
pb_1.Message.setField(this, 2, value); pb_1.Message.setField(this, 2, value);
@ -1167,7 +1189,7 @@ export namespace vulcanize.nameservice.v1beta1 {
static fromObject(data: { static fromObject(data: {
record_id?: string; record_id?: string;
signer?: string; signer?: string;
}) { }): MsgDissociateBond {
const message = new MsgDissociateBond({}); const message = new MsgDissociateBond({});
if (data.record_id != null) { if (data.record_id != null) {
message.record_id = data.record_id; message.record_id = data.record_id;
@ -1194,9 +1216,9 @@ export namespace vulcanize.nameservice.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (typeof this.record_id === "string" && this.record_id.length) if (this.record_id.length)
writer.writeString(1, this.record_id); writer.writeString(1, this.record_id);
if (typeof this.signer === "string" && this.signer.length) if (this.signer.length)
writer.writeString(2, this.signer); writer.writeString(2, this.signer);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -1226,12 +1248,13 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
export class MsgDissociateBondResponse extends pb_1.Message { export class MsgDissociateBondResponse extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {}) { constructor(data?: any[] | {}) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { } if (!Array.isArray(data) && typeof data == "object") { }
} }
static fromObject(data: {}) { static fromObject(data: {}): MsgDissociateBondResponse {
const message = new MsgDissociateBondResponse({}); const message = new MsgDissociateBondResponse({});
return message; return message;
} }
@ -1265,12 +1288,13 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
export class MsgDissociateRecords extends pb_1.Message { export class MsgDissociateRecords extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
bond_id?: string; bond_id?: string;
signer?: string; signer?: string;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("bond_id" in data && data.bond_id != undefined) { if ("bond_id" in data && data.bond_id != undefined) {
this.bond_id = data.bond_id; this.bond_id = data.bond_id;
@ -1281,13 +1305,13 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
get bond_id() { get bond_id() {
return pb_1.Message.getField(this, 1) as string; return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
} }
set bond_id(value: string) { set bond_id(value: string) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
get signer() { get signer() {
return pb_1.Message.getField(this, 2) as string; return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
} }
set signer(value: string) { set signer(value: string) {
pb_1.Message.setField(this, 2, value); pb_1.Message.setField(this, 2, value);
@ -1295,7 +1319,7 @@ export namespace vulcanize.nameservice.v1beta1 {
static fromObject(data: { static fromObject(data: {
bond_id?: string; bond_id?: string;
signer?: string; signer?: string;
}) { }): MsgDissociateRecords {
const message = new MsgDissociateRecords({}); const message = new MsgDissociateRecords({});
if (data.bond_id != null) { if (data.bond_id != null) {
message.bond_id = data.bond_id; message.bond_id = data.bond_id;
@ -1322,9 +1346,9 @@ export namespace vulcanize.nameservice.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (typeof this.bond_id === "string" && this.bond_id.length) if (this.bond_id.length)
writer.writeString(1, this.bond_id); writer.writeString(1, this.bond_id);
if (typeof this.signer === "string" && this.signer.length) if (this.signer.length)
writer.writeString(2, this.signer); writer.writeString(2, this.signer);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -1354,12 +1378,13 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
export class MsgDissociateRecordsResponse extends pb_1.Message { export class MsgDissociateRecordsResponse extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {}) { constructor(data?: any[] | {}) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { } if (!Array.isArray(data) && typeof data == "object") { }
} }
static fromObject(data: {}) { static fromObject(data: {}): MsgDissociateRecordsResponse {
const message = new MsgDissociateRecordsResponse({}); const message = new MsgDissociateRecordsResponse({});
return message; return message;
} }
@ -1393,13 +1418,14 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
export class MsgReAssociateRecords extends pb_1.Message { export class MsgReAssociateRecords extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | { constructor(data?: any[] | {
new_bond_id?: string; new_bond_id?: string;
old_bond_id?: string; old_bond_id?: string;
signer?: string; signer?: string;
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("new_bond_id" in data && data.new_bond_id != undefined) { if ("new_bond_id" in data && data.new_bond_id != undefined) {
this.new_bond_id = data.new_bond_id; this.new_bond_id = data.new_bond_id;
@ -1413,19 +1439,19 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
get new_bond_id() { get new_bond_id() {
return pb_1.Message.getField(this, 1) as string; return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
} }
set new_bond_id(value: string) { set new_bond_id(value: string) {
pb_1.Message.setField(this, 1, value); pb_1.Message.setField(this, 1, value);
} }
get old_bond_id() { get old_bond_id() {
return pb_1.Message.getField(this, 2) as string; return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
} }
set old_bond_id(value: string) { set old_bond_id(value: string) {
pb_1.Message.setField(this, 2, value); pb_1.Message.setField(this, 2, value);
} }
get signer() { get signer() {
return pb_1.Message.getField(this, 3) as string; return pb_1.Message.getFieldWithDefault(this, 3, "") as string;
} }
set signer(value: string) { set signer(value: string) {
pb_1.Message.setField(this, 3, value); pb_1.Message.setField(this, 3, value);
@ -1434,7 +1460,7 @@ export namespace vulcanize.nameservice.v1beta1 {
new_bond_id?: string; new_bond_id?: string;
old_bond_id?: string; old_bond_id?: string;
signer?: string; signer?: string;
}) { }): MsgReAssociateRecords {
const message = new MsgReAssociateRecords({}); const message = new MsgReAssociateRecords({});
if (data.new_bond_id != null) { if (data.new_bond_id != null) {
message.new_bond_id = data.new_bond_id; message.new_bond_id = data.new_bond_id;
@ -1468,11 +1494,11 @@ export namespace vulcanize.nameservice.v1beta1 {
serialize(w: pb_1.BinaryWriter): void; serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void { serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter(); const writer = w || new pb_1.BinaryWriter();
if (typeof this.new_bond_id === "string" && this.new_bond_id.length) if (this.new_bond_id.length)
writer.writeString(1, this.new_bond_id); writer.writeString(1, this.new_bond_id);
if (typeof this.old_bond_id === "string" && this.old_bond_id.length) if (this.old_bond_id.length)
writer.writeString(2, this.old_bond_id); writer.writeString(2, this.old_bond_id);
if (typeof this.signer === "string" && this.signer.length) if (this.signer.length)
writer.writeString(3, this.signer); writer.writeString(3, this.signer);
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
@ -1505,12 +1531,13 @@ export namespace vulcanize.nameservice.v1beta1 {
} }
} }
export class MsgReAssociateRecordsResponse extends pb_1.Message { export class MsgReAssociateRecordsResponse extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(data?: any[] | {}) { constructor(data?: any[] | {}) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], []); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { } if (!Array.isArray(data) && typeof data == "object") { }
} }
static fromObject(data: {}) { static fromObject(data: {}): MsgReAssociateRecordsResponse {
const message = new MsgReAssociateRecordsResponse({}); const message = new MsgReAssociateRecordsResponse({});
return message; return message;
} }

View File

@ -10,16 +10,24 @@ const attributeField = `
attributes { attributes {
key key
value { value {
null ... on BooleanValue { bool: value }
int ... on IntValue { int: value }
float ... on FloatValue { float: value }
string ... on StringValue { string: value }
boolean ... on BytesValue { bytes: value }
json ... on LinkValue { link: value }
reference { ... on ArrayValue {
id array: value {
... on BooleanValue { bool: value }
... on IntValue { int: value }
... on FloatValue { float: value }
... on StringValue { string: value }
... on BytesValue { bytes: value }
... on LinkValue { link: value }
} }
} }
... on MapValue { map: value { key mapping: value { __typename } } }
}
} }
`; `;

View File

@ -45,23 +45,23 @@ describe('Querying', () => {
}); });
test('Query records by reference.', async () => { test('Query records by reference.', async () => {
const { protocol } = watcher.record; const { repo_registration_record_cid } = watcher.record;
const records = await registry.queryRecords({ protocol }, true); const records = await registry.queryRecords({ repo_registration_record_cid }, true);
expect(records.length).toBeGreaterThanOrEqual(1); expect(records.length).toBeGreaterThanOrEqual(1);
const { attributes: { protocol: recordProtocol } } = records[0]; const { attributes: { repo_registration_record_cid: record_repo_registration_record_cid } } = records[0];
expect(protocol['/']).toBe(recordProtocol['/']); expect(repo_registration_record_cid).toStrictEqual(record_repo_registration_record_cid);
}); });
test('Query records by attributes.', async () => { test('Query records by attributes.', async () => {
const { version, name } = watcher.record; const { version, url } = watcher.record;
const records = await registry.queryRecords({ version, name }, true); const records = await registry.queryRecords({ version, url, type: undefined }, true);
expect(records.length).toBe(1); expect(records.length).toBe(1);
[ watcher ] = records; [ watcher ] = records;
const { attributes: { version: recordVersion, name: recordName } } = watcher; const { attributes: { version: recordVersion, url: recordName } } = watcher;
expect(recordVersion).toBe(version); expect(recordVersion).toBe(version);
expect(recordName).toBe(name); expect(recordName).toBe(url);
}); });
test('Query records by id.', async () => { test('Query records by id.', async () => {
@ -73,7 +73,9 @@ describe('Querying', () => {
test('Query records passing refs true.', async () => { test('Query records passing refs true.', async () => {
const [record] = await registry.getRecordsByIds([watcher.id], true); const [record] = await registry.getRecordsByIds([watcher.id], true);
expect(record.id).toBe(watcher.id); expect(record.id).toBe(watcher.id);
expect(record.references).toBeDefined(); // temp fix
expect(record.references).toHaveLength(1); expect(record.attributes.repo_registration_record_cid).toBeDefined();
expect(record.attributes.repo_registration_record_cid).toHaveProperty("/");
expect(record.attributes.repo_registration_record_cid["/"]).toHaveLength(46);
}); });
}); });

View File

@ -1,6 +1,10 @@
record: record:
type: watcher type: WebsiteRegistrationRecord
name: ERC20 Watcher url: 'https://cerc.io'
version: 1.0.0 repo_registration_record_cid:
protocol: /: QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D
/: QmdeazkS38aCrqG6qKwaio2fQnShE6RGpmNdqStLkkZcQN build_artifact_cid:
/: QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9
tls_cert_cid:
/: QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR
version: 1.0.23

View File

@ -24,13 +24,18 @@ export const getBaseConfig = async (path: string) => {
* Provision a bond for record registration. * Provision a bond for record registration.
*/ */
export const provisionBondId = async (registry: Registry, privateKey: string, fee: Fee) => { export const provisionBondId = async (registry: Registry, privateKey: string, fee: Fee) => {
let bonds = await registry.queryBonds(); // let bonds = await registry.queryBonds();
if (!bonds.length) { // console.log("found bonds: " + bonds.length)
// if (!bonds.length) {
// await registry.createBond({ denom: 'aphoton', amount: '1000000000' }, privateKey, fee);
// bonds = await registry.queryBonds();
// console.log("created bond and got back: " + bonds.length)
// }
let bondId: string;
bondId = await registry.getNextBondId(privateKey);
await registry.createBond({ denom: 'aphoton', amount: '1000000000' }, privateKey, fee); await registry.createBond({ denom: 'aphoton', amount: '1000000000' }, privateKey, fee);
bonds = await registry.queryBonds(); return bondId
} //return bonds[0].id;
return bonds[0].id;
}; };
export const getConfig = () => { export const getConfig = () => {
@ -42,9 +47,9 @@ export const getConfig = () => {
restEndpoint: process.env.LACONICD_REST_ENDPOINT || 'http://localhost:1317', restEndpoint: process.env.LACONICD_REST_ENDPOINT || 'http://localhost:1317',
gqlEndpoint: process.env.LACONICD_GQL_ENDPOINT || 'http://localhost:9473/api', gqlEndpoint: process.env.LACONICD_GQL_ENDPOINT || 'http://localhost:9473/api',
fee: { fee: {
amount: '30', amount: '40',
denom: 'aphoton', denom: 'aphoton',
gas: '300000', gas: '400000',
} }
} }
}; };

View File

@ -27,7 +27,7 @@ export class Record {
} }
get attributes() { get attributes() {
return Buffer.from(JSON.stringify(this._record), 'binary').toString('base64') return Buffer.from(JSON.stringify(this._record), 'binary')
} }
/** /**

View File

@ -10,21 +10,21 @@ export class Util {
/** /**
* Sorts JSON object. * Sorts JSON object.
*/ */
static sortJSON(object: any) { static sortJSON(obj: any) {
if (object instanceof Array) { if (obj instanceof Array) {
for (let i = 0; i < object.length; i++) { for (let i = 0; i < obj.length; i++) {
object[i] = Util.sortJSON(object[i]); obj[i] = Util.sortJSON(obj[i]);
} }
return object; return obj;
} }
if (typeof object !== 'object' || object === null) return object; if (typeof obj !== 'object' || obj === null) return obj;
let keys = Object.keys(object); let keys = Object.keys(obj);
keys = keys.sort(); keys = keys.sort();
const newObject: {[key: string]: any} = {}; const newObject: {[key: string]: any} = {};
for (let i = 0; i < keys.length; i++) { for (let i = 0; i < keys.length; i++) {
newObject[keys[i]] = Util.sortJSON(object[keys[i]]); newObject[keys[i]] = Util.sortJSON(obj[keys[i]]);
} }
return newObject; return newObject;
} }
@ -32,31 +32,46 @@ export class Util {
/** /**
* Marshal object into gql 'attributes' variable. * Marshal object into gql 'attributes' variable.
*/ */
static toGQLAttributes(object: any) { static toGQLAttributes(obj: any) {
const vars: any[] = []; const vars: any[] = [];
Object.keys(obj).forEach(key => {
const value = this.toGQLValue(obj[key]);
Object.keys(object).forEach(key => { if (value !== undefined) {
let type: string = typeof object[key]; vars.push({ key, value });
if (object[key] === null) {
vars.push({ key, value: { 'null': true } });
} else if (type === 'number') {
type = (object[key] % 1 === 0) ? 'int' : 'float';
vars.push({ key, value: { [type]: object[key] } });
} else if (type === 'string') {
vars.push({ key, value: { 'string': object[key] } });
} else if (type === 'boolean') {
vars.push({ key, value: { 'boolean': object[key] } });
} else if (type === 'object') {
const nestedObject = object[key];
if (nestedObject['/'] !== undefined) {
vars.push({ key, value: { 'reference': { id: nestedObject['/'] } } });
}
} }
}); });
return vars; return vars;
} }
static toGQLValue(obj: any) {
if (obj === null) {
return null;
}
let type: string = typeof obj;
switch (type) {
case 'number':
type = (obj % 1 === 0) ? 'int' : 'float';
return { [type]: obj };
case 'string':
return { 'string': obj };
case 'boolean':
return { 'boolean': obj };
case 'object':
if (obj['/'] !== undefined) {
return { 'link': obj['/'] };
}
if (obj instanceof Array) {
return { 'array': obj };
}
return { 'map': obj };
case 'undefined':
return undefined;
default:
throw new Error(`Unknown object type '${type}': ${obj}`);
}
}
/** /**
* Unmarshal attributes array to object. * Unmarshal attributes array to object.
*/ */
@ -64,24 +79,29 @@ export class Util {
const res: {[key: string]: any} = {}; const res: {[key: string]: any} = {};
attributes.forEach(attr => { attributes.forEach(attr => {
if (attr.value.null) { res[attr.key] = (attr.value === null) ? null : this.fromGQLValue(attr.value);
res[attr.key] = null;
} else if (attr.value.json) {
res[attr.key] = JSON.parse(attr.value.json);
} else if (attr.value.reference) {
// Convert GQL reference to IPLD style link.
const ref = attr.value.reference;
res[attr.key] = { '/': ref.id };
} else {
const { values, null: n, ...types } = attr.value;
const value = Object.values(types).find(v => v !== null);
res[attr.key] = value;
}
}); });
return res; return res;
} }
static fromGQLValue(obj: any) {
// Get first non-null key
const present = Object.keys(obj).find(k => obj[k] !== null);
if (present === undefined) {
throw new Error('Object has no non-null values');
}
// Create an array if array type attribute
if (present === 'array') {
return obj[present].map((e: any) => {
return this.fromGQLValue(e);
});
}
return obj[present];
}
/** /**
* Get record content ID. * Get record content ID.
*/ */

2629
yarn.lock

File diff suppressed because it is too large Load Diff