forked from cerc-io/registry-sdk
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3a828b47ae | ||
|
|
022c55268c | ||
|
|
2757281e5b | ||
|
|
25651a8e7a | ||
|
|
ad07856267 |
No files matched your search
+1
-1
@@ -1,4 +1,4 @@
|
||||
PRIVATE_KEY=
|
||||
COSMOS_CHAIN_ID=laconic_9000-1
|
||||
LACONICD_GQL_ENDPOINT=http://localhost:9473/api
|
||||
LACONICD_REST_ENDPOINT=http://127.0.0.1:26657
|
||||
LACONICD_RPC_ENDPOINT=http://127.0.0.1:26657
|
||||
@@ -0,0 +1,27 @@
|
||||
name: Lint & Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
lint_and_build:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [20.x]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- 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 }}
|
||||
registry-url: 'https://npm.pkg.github.com'
|
||||
- run: yarn
|
||||
- name: Run lint
|
||||
run: yarn lint
|
||||
- name: Run build
|
||||
run: yarn build
|
||||
+21
-12
@@ -16,11 +16,11 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Checkout laconic2d
|
||||
- name: Checkout laconicd
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
path: "./laconic2d/"
|
||||
repository: cerc-io/laconic2d
|
||||
path: "./laconicd/"
|
||||
repository: cerc-io/laconicd
|
||||
fetch-depth: 0
|
||||
ref: main
|
||||
- name: Environment
|
||||
@@ -31,33 +31,42 @@ jobs:
|
||||
dockerd -H $DOCKER_HOST --userland-proxy=false &
|
||||
sleep 5
|
||||
|
||||
- name: Build laconic2d container
|
||||
working-directory: laconic2d/tests/sdk_tests
|
||||
run: ./build-laconic2d-container.sh
|
||||
- name: Build laconicd container
|
||||
working-directory: laconicd/tests/sdk_tests
|
||||
run: ./build-laconicd-container.sh
|
||||
- name: Build sdk container
|
||||
run: ./scripts/build-sdk-test-container.sh
|
||||
|
||||
- name: Start containers
|
||||
working-directory: laconic2d/tests/sdk_tests
|
||||
working-directory: laconicd/tests/sdk_tests
|
||||
run: docker compose up -d
|
||||
- name: Run tests
|
||||
working-directory: laconic2d/tests/sdk_tests
|
||||
working-directory: laconicd/tests/sdk_tests
|
||||
run: ./run-tests.sh
|
||||
|
||||
- name: Start containers (auctions enabled)
|
||||
working-directory: laconic2d/tests/sdk_tests
|
||||
working-directory: laconicd/tests/sdk_tests
|
||||
env:
|
||||
TEST_AUCTION_ENABLED: true
|
||||
run: docker compose up -d
|
||||
- name: Run auction tests
|
||||
working-directory: laconic2d/tests/sdk_tests
|
||||
working-directory: laconicd/tests/sdk_tests
|
||||
run: ./run-tests.sh test:auctions
|
||||
|
||||
- name: Start containers (expiry enabled)
|
||||
working-directory: laconic2d/tests/sdk_tests
|
||||
working-directory: laconicd/tests/sdk_tests
|
||||
env:
|
||||
TEST_REGISTRY_EXPIRY: true
|
||||
run: docker compose up -d
|
||||
- name: Run nameservice expiry tests
|
||||
working-directory: laconic2d/tests/sdk_tests
|
||||
working-directory: laconicd/tests/sdk_tests
|
||||
run: ./run-tests.sh test:nameservice-expiry
|
||||
|
||||
- name: Start containers (onboarding enabled)
|
||||
working-directory: laconicd/tests/sdk_tests
|
||||
env:
|
||||
ONBOARDING_ENABLED: true
|
||||
run: docker compose up -d
|
||||
- name: Run participants onboarding tests
|
||||
working-directory: laconicd/tests/sdk_tests
|
||||
run: ./run-tests.sh test:onboarding
|
||||
@@ -0,0 +1,23 @@
|
||||
name: Lint & Build
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
lint_and_build:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [20.x]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
registry-url: 'https://npm.pkg.github.com'
|
||||
- run: yarn
|
||||
- name: Run lint
|
||||
run: yarn lint
|
||||
- name: Run build
|
||||
run: yarn build
|
||||
@@ -51,3 +51,12 @@ jobs:
|
||||
- name: Run nameservice expiry tests
|
||||
working-directory: laconicd/tests/sdk_tests
|
||||
run: ./run-tests.sh test:nameservice-expiry
|
||||
|
||||
- name: Start containers (onboarding enabled)
|
||||
working-directory: laconicd/tests/sdk_tests
|
||||
env:
|
||||
ONBOARDING_ENABLED: true
|
||||
run: docker compose up -d
|
||||
- name: Run participants onboarding tests
|
||||
working-directory: laconicd/tests/sdk_tests
|
||||
run: ./run-tests.sh test:onboarding
|
||||
+9
-8
@@ -4,13 +4,14 @@
|
||||
|
||||
Run following scripts when [proto files](./proto/) are updated.
|
||||
|
||||
1. Install dependencies
|
||||
```bash
|
||||
yarn
|
||||
```
|
||||
* Install dependencies:
|
||||
|
||||
2. Generate typescript code for the proto files
|
||||
```bash
|
||||
yarn
|
||||
```
|
||||
|
||||
```bash
|
||||
./scripts/proto-gen.sh
|
||||
```
|
||||
* Generate typescript bindings for the proto files:
|
||||
|
||||
```bash
|
||||
./scripts/proto-gen.sh
|
||||
```
|
||||
@@ -1,6 +1,6 @@
|
||||
# registry-sdk
|
||||
|
||||
Client library used by TS/JS applications to communicate with laconic2d.
|
||||
Client library used by TS/JS applications to communicate with laconicd.
|
||||
|
||||
## Tests
|
||||
|
||||
@@ -18,14 +18,14 @@ Follow these steps to run the tests:
|
||||
cp .env.example .env
|
||||
```
|
||||
|
||||
- Clone the [laconic2d repo](https://git.vdb.to/cerc-io/laconic2d) and change to repo directory.
|
||||
- Clone the [laconicd repo](https://git.vdb.to/cerc-io/laconicd) and change to repo directory.
|
||||
|
||||
- Run the chain using `./scripts/init.sh`.
|
||||
|
||||
- Export the private key using:
|
||||
|
||||
```bash
|
||||
laconic2d keys export alice --keyring-backend test --unarmored-hex --unsafe
|
||||
laconicd keys export alice --keyring-backend test --unarmored-hex --unsafe
|
||||
```
|
||||
|
||||
- Copy the private key and assign it to variable `PRIVATE_KEY` in the `.env` file.
|
||||
@@ -38,7 +38,7 @@ Follow these steps to run the tests:
|
||||
|
||||
- Run the tests with auctions enabled
|
||||
|
||||
- In laconic2d repo run:
|
||||
- In laconicd repo run:
|
||||
|
||||
```bash
|
||||
TEST_AUCTION_ENABLED=true ./scripts/init.sh clean
|
||||
@@ -47,7 +47,7 @@ Follow these steps to run the tests:
|
||||
- Export the private key and change it in `.env` file again using:
|
||||
|
||||
```bash
|
||||
laconic2d keys export alice --keyring-backend test --unarmored-hex --unsafe
|
||||
laconicd keys export alice --keyring-backend test --unarmored-hex --unsafe
|
||||
```
|
||||
|
||||
- Run tests:
|
||||
@@ -58,7 +58,7 @@ Follow these steps to run the tests:
|
||||
|
||||
- Run the tests for record and authority expiry
|
||||
|
||||
- In laconic2d repo run:
|
||||
- In laconicd repo run:
|
||||
|
||||
```bash
|
||||
TEST_REGISTRY_EXPIRY=true ./scripts/init.sh clean
|
||||
@@ -67,7 +67,7 @@ Follow these steps to run the tests:
|
||||
- Export the private key and change it in `.env` file again using:
|
||||
|
||||
```bash
|
||||
laconic2d keys export alice --keyring-backend test --unarmored-hex --unsafe
|
||||
laconicd keys export alice --keyring-backend test --unarmored-hex --unsafe
|
||||
```
|
||||
|
||||
- Run tests:
|
||||
@@ -87,7 +87,7 @@ Follow these steps to run the tests:
|
||||
failed to execute message; message index: 0: Invalid signature.: unauthorized
|
||||
```
|
||||
|
||||
- When sending `setRecord` message, an integer value passed in watcher attributes is parsed as float type in laconic2d while [unmarshalling json](https://pkg.go.dev/encoding/json#Unmarshal).
|
||||
- When sending `setRecord` message, an integer value passed in watcher attributes is parsed as float type in laconicd while [unmarshalling json](https://pkg.go.dev/encoding/json#Unmarshal).
|
||||
|
||||
- `setRecord` message throws error when fileds in [Record](./src/types.ts) message are not assigned.
|
||||
```
|
||||
|
||||
+2
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@cerc-io/registry-sdk",
|
||||
"version": "0.2.0",
|
||||
"version": "0.2.3",
|
||||
"main": "dist/index.js",
|
||||
"types": "dist/index.d.ts",
|
||||
"repository": "git@github.com:cerc-io/registry-sdk.git",
|
||||
@@ -64,6 +64,7 @@
|
||||
"test": "jest --runInBand --verbose --testPathPattern=src",
|
||||
"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:onboarding": "ONBOARDING_ENABLED=1 jest --runInBand --verbose src/onboarding.test.ts",
|
||||
"build": "tsc",
|
||||
"lint": "eslint .",
|
||||
"prepare": "husky"
|
||||
|
||||
@@ -8,6 +8,6 @@ import "cosmos/app/v1alpha1/module.proto";
|
||||
// Learn more: https://docs.cosmos.network/main/building-modules/depinject
|
||||
message Module {
|
||||
option (cosmos.app.v1alpha1.module) = {
|
||||
go_import : "git.vdb.to/cerc-io/laconic2d/x/auction"
|
||||
go_import : "git.vdb.to/cerc-io/laconicd/x/auction"
|
||||
};
|
||||
}
|
||||
@@ -7,7 +7,7 @@ import "google/protobuf/duration.proto";
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "cosmos/base/v1beta1/coin.proto";
|
||||
|
||||
option go_package = "git.vdb.to/cerc-io/laconic2d/x/auction";
|
||||
option go_package = "git.vdb.to/cerc-io/laconicd/x/auction";
|
||||
|
||||
// Params defines the auction module parameters
|
||||
message Params {
|
||||
|
||||
@@ -5,7 +5,7 @@ package cerc.auction.v1;
|
||||
import "gogoproto/gogo.proto";
|
||||
import "cerc/auction/v1/auction.proto";
|
||||
|
||||
option go_package = "git.vdb.to/cerc-io/laconic2d/x/auction";
|
||||
option go_package = "git.vdb.to/cerc-io/laconicd/x/auction";
|
||||
|
||||
// GenesisState defines the genesis state of the auction module
|
||||
message GenesisState {
|
||||
|
||||
@@ -8,7 +8,7 @@ import "cosmos/base/query/v1beta1/pagination.proto";
|
||||
import "cosmos/base/v1beta1/coin.proto";
|
||||
import "cerc/auction/v1/auction.proto";
|
||||
|
||||
option go_package = "git.vdb.to/cerc-io/laconic2d/x/auction";
|
||||
option go_package = "git.vdb.to/cerc-io/laconicd/x/auction";
|
||||
|
||||
// Query defines the gRPC querier interface for the auction module
|
||||
service Query {
|
||||
|
||||
@@ -9,7 +9,7 @@ import "google/protobuf/duration.proto";
|
||||
import "cosmos/base/v1beta1/coin.proto";
|
||||
import "cerc/auction/v1/auction.proto";
|
||||
|
||||
option go_package = "git.vdb.to/cerc-io/laconic2d/x/auction";
|
||||
option go_package = "git.vdb.to/cerc-io/laconicd/x/auction";
|
||||
|
||||
// Tx defines the gRPC tx interface
|
||||
service Msg {
|
||||
|
||||
@@ -8,6 +8,6 @@ import "cosmos/app/v1alpha1/module.proto";
|
||||
// Learn more: https://docs.cosmos.network/main/building-modules/depinject
|
||||
message Module {
|
||||
option (cosmos.app.v1alpha1.module) = {
|
||||
go_import : "git.vdb.to/cerc-io/laconic2d/x/bond"
|
||||
go_import : "git.vdb.to/cerc-io/laconicd/x/bond"
|
||||
};
|
||||
}
|
||||
@@ -5,7 +5,7 @@ package cerc.bond.v1;
|
||||
import "gogoproto/gogo.proto";
|
||||
import "cosmos/base/v1beta1/coin.proto";
|
||||
|
||||
option go_package = "git.vdb.to/cerc-io/laconic2d/x/bond";
|
||||
option go_package = "git.vdb.to/cerc-io/laconicd/x/bond";
|
||||
|
||||
// Params defines the parameters of the bond module.
|
||||
message Params {
|
||||
|
||||
@@ -5,7 +5,7 @@ package cerc.bond.v1;
|
||||
import "gogoproto/gogo.proto";
|
||||
import "cerc/bond/v1/bond.proto";
|
||||
|
||||
option go_package = "git.vdb.to/cerc-io/laconic2d/x/bond";
|
||||
option go_package = "git.vdb.to/cerc-io/laconicd/x/bond";
|
||||
|
||||
// GenesisState defines the bond module's genesis state.
|
||||
message GenesisState {
|
||||
|
||||
@@ -9,7 +9,7 @@ import "cosmos/base/v1beta1/coin.proto";
|
||||
import "cerc/bond/v1/bond.proto";
|
||||
// import "cosmos/query/v1/query.proto";
|
||||
|
||||
option go_package = "git.vdb.to/cerc-io/laconic2d/x/bond";
|
||||
option go_package = "git.vdb.to/cerc-io/laconicd/x/bond";
|
||||
|
||||
// Query defines the gRPC querier service for bond module
|
||||
service Query {
|
||||
|
||||
@@ -7,7 +7,7 @@ import "gogoproto/gogo.proto";
|
||||
import "google/api/annotations.proto";
|
||||
import "cosmos/base/v1beta1/coin.proto";
|
||||
|
||||
option go_package = "git.vdb.to/cerc-io/laconic2d/x/bond";
|
||||
option go_package = "git.vdb.to/cerc-io/laconicd/x/bond";
|
||||
|
||||
// Msg defines the bond Msg service.
|
||||
service Msg {
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package cerc.onboarding.module.v1;
|
||||
|
||||
import "cosmos/app/v1alpha1/module.proto";
|
||||
|
||||
// Module is the app config object of the module.
|
||||
// Learn more: https://docs.cosmos.network/main/building-modules/depinject
|
||||
message Module {
|
||||
option (cosmos.app.v1alpha1.module) = {
|
||||
go_import : "git.vdb.to/cerc-io/laconicd/x/onboarding"
|
||||
};
|
||||
|
||||
string authority = 1;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package cerc.onboarding.v1;
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
import "cerc/onboarding/v1/onboarding.proto";
|
||||
|
||||
option go_package = "git.vdb.to/cerc-io/laconicd/x/onboarding";
|
||||
|
||||
// GenesisState defines the onboarding module's genesis state.
|
||||
message GenesisState {
|
||||
// params defines all the parameters of the module.
|
||||
Params params = 1 [ (gogoproto.nullable) = false ];
|
||||
// participants defines all the participants
|
||||
repeated Participant participants = 2 [ (gogoproto.nullable) = false ];
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package cerc.onboarding.v1;
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
|
||||
option go_package = "git.vdb.to/cerc-io/laconicd/x/onboarding";
|
||||
|
||||
// Params defines the parameters of the onboarding module.
|
||||
message Params {
|
||||
bool onboarding_enabled = 1
|
||||
[ (gogoproto.moretags) =
|
||||
"json:\"onboarding_enabled\" yaml:\"onboarding_enabled\"" ];
|
||||
}
|
||||
|
||||
// Participant defines the data that will be stored for each enrolled
|
||||
// participant
|
||||
message Participant {
|
||||
// participant's cosmos (laconic) address
|
||||
string cosmos_address = 1
|
||||
[ (gogoproto.moretags) =
|
||||
"json:\"cosmos_address\" yaml:\"cosmos_address\"" ];
|
||||
|
||||
// participant's Nitro address
|
||||
string nitro_address = 2
|
||||
[ (gogoproto.moretags) =
|
||||
"json:\"nitro_address\" yaml:\"nitro_address\"" ];
|
||||
|
||||
// participant's role (participant | validator)
|
||||
string role = 3 [ (gogoproto.moretags) = "json:\"role\" yaml:\"role\"" ];
|
||||
|
||||
// participant's KYC receipt ID
|
||||
string kyc_id = 4
|
||||
[ (gogoproto.moretags) = "json:\"kyc_id\" yaml:\"kyc_id\"" ];
|
||||
}
|
||||
|
||||
// EthPayload defines the payload that is signed by the ethereum private key
|
||||
message EthPayload {
|
||||
string address = 1
|
||||
[ (gogoproto.moretags) = "json:\"address\" yaml:\"address\"" ];
|
||||
|
||||
string msg = 2 [ (gogoproto.moretags) = "json:\"msg\" yaml:\"msg\"" ];
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package cerc.onboarding.v1;
|
||||
|
||||
import "gogoproto/gogo.proto";
|
||||
import "cosmos/base/query/v1beta1/pagination.proto";
|
||||
import "cerc/onboarding/v1/onboarding.proto";
|
||||
import "google/api/annotations.proto";
|
||||
|
||||
option go_package = "git.vdb.to/cerc-io/laconicd/x/onboarding";
|
||||
|
||||
// Query defines the gRPC querier service for onboarding module
|
||||
service Query {
|
||||
// Participants queries Participants list
|
||||
rpc Participants(QueryParticipantsRequest)
|
||||
returns (QueryParticipantsResponse) {
|
||||
option (google.api.http).get = "/cerc/onboarding/v1/participants";
|
||||
}
|
||||
}
|
||||
|
||||
// QueryParticipantsRequest queries participants
|
||||
message QueryParticipantsRequest {
|
||||
// pagination defines an optional pagination for the request.
|
||||
cosmos.base.query.v1beta1.PageRequest pagination = 1;
|
||||
}
|
||||
|
||||
// QueryParticipantsResponse is response type for get the participants
|
||||
message QueryParticipantsResponse {
|
||||
repeated Participant participants = 1
|
||||
[ (gogoproto.moretags) = "json:\"participants\" yaml:\"participants\"" ];
|
||||
|
||||
// pagination defines the pagination in the response.
|
||||
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package cerc.onboarding.v1;
|
||||
|
||||
import "cosmos/msg/v1/msg.proto";
|
||||
import "google/api/annotations.proto";
|
||||
import "gogoproto/gogo.proto";
|
||||
import "cerc/onboarding/v1/onboarding.proto";
|
||||
|
||||
option go_package = "git.vdb.to/cerc-io/laconicd/x/onboarding";
|
||||
|
||||
// Msg defines the onboarding Msg service.
|
||||
service Msg {
|
||||
option (cosmos.msg.v1.service) = true;
|
||||
|
||||
// OnboardParticipant defines a method for enrolling a new validator.
|
||||
rpc OnboardParticipant(MsgOnboardParticipant)
|
||||
returns (MsgOnboardParticipantResponse) {
|
||||
option (google.api.http).post = "/cerc/onboarding/v1/onboard_participant";
|
||||
};
|
||||
}
|
||||
|
||||
// MsgOnboardParticipant defines a SDK message for enrolling a new validator.
|
||||
message MsgOnboardParticipant {
|
||||
option (cosmos.msg.v1.signer) = "participant";
|
||||
|
||||
// Participant is the msg sender
|
||||
string participant = 1;
|
||||
EthPayload eth_payload = 2 [ (gogoproto.nullable) = false ];
|
||||
string eth_signature = 3;
|
||||
string role = 4;
|
||||
string kyc_id = 5;
|
||||
}
|
||||
|
||||
// MsgOnboardParticipantResponse defines the Msg/OnboardParticipant response
|
||||
// type.
|
||||
message MsgOnboardParticipantResponse {}
|
||||
@@ -8,6 +8,6 @@ import "cosmos/app/v1alpha1/module.proto";
|
||||
// Learn more: https://docs.cosmos.network/main/building-modules/depinject
|
||||
message Module {
|
||||
option (cosmos.app.v1alpha1.module) = {
|
||||
go_import : "git.vdb.to/cerc-io/laconic2d/x/registry"
|
||||
go_import : "git.vdb.to/cerc-io/laconicd/x/registry"
|
||||
};
|
||||
}
|
||||
@@ -5,7 +5,7 @@ package cerc.registry.v1;
|
||||
import "gogoproto/gogo.proto";
|
||||
import "cerc/registry/v1/registry.proto";
|
||||
|
||||
option go_package = "git.vdb.to/cerc-io/laconic2d/x/registry";
|
||||
option go_package = "git.vdb.to/cerc-io/laconicd/x/registry";
|
||||
|
||||
// GenesisState defines the registry module's genesis state.
|
||||
message GenesisState {
|
||||
|
||||
@@ -8,7 +8,7 @@ import "gogoproto/gogo.proto";
|
||||
import "cosmos/base/v1beta1/coin.proto";
|
||||
import "cerc/registry/v1/registry.proto";
|
||||
|
||||
option go_package = "git.vdb.to/cerc-io/laconic2d/x/registry";
|
||||
option go_package = "git.vdb.to/cerc-io/laconicd/x/registry";
|
||||
|
||||
// Query defines the gRPC querier service for registry module
|
||||
service Query {
|
||||
@@ -58,6 +58,11 @@ service Query {
|
||||
returns (QueryGetRegistryModuleBalanceResponse) {
|
||||
option (google.api.http).get = "/cerc/registry/v1/balance";
|
||||
}
|
||||
|
||||
// Authorities queries all authorities
|
||||
rpc Authorities(QueryAuthoritiesRequest) returns (QueryAuthoritiesResponse) {
|
||||
option (google.api.http).get = "/cerc/registry/v1/authorities";
|
||||
}
|
||||
}
|
||||
|
||||
// QueryParamsRequest is request type for registry params
|
||||
@@ -152,6 +157,16 @@ message QueryWhoisResponse {
|
||||
];
|
||||
}
|
||||
|
||||
// QueryAuthoritiesRequest is request type to get all authorities
|
||||
message QueryAuthoritiesRequest { string owner = 1; }
|
||||
|
||||
// QueryAuthoritiesResponse is response type for authorities request
|
||||
message QueryAuthoritiesResponse {
|
||||
repeated AuthorityEntry authorities = 1 [ (gogoproto.nullable) = false ];
|
||||
// pagination defines the pagination in the response.
|
||||
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
||||
}
|
||||
|
||||
// QueryLookupLrnRequest is request type for LookupLrn
|
||||
message QueryLookupLrnRequest { string lrn = 1; }
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@ import "google/protobuf/timestamp.proto";
|
||||
import "gogoproto/gogo.proto";
|
||||
import "cosmos/base/v1beta1/coin.proto";
|
||||
|
||||
option go_package = "git.vdb.to/cerc-io/laconic2d/x/registry";
|
||||
option go_package = "git.vdb.to/cerc-io/laconicd/x/registry";
|
||||
|
||||
// Params defines the registry module parameters
|
||||
message Params {
|
||||
|
||||
@@ -7,7 +7,7 @@ import "gogoproto/gogo.proto";
|
||||
import "cosmos/msg/v1/msg.proto";
|
||||
import "cerc/registry/v1/registry.proto";
|
||||
|
||||
option go_package = "git.vdb.to/cerc-io/laconic2d/x/registry";
|
||||
option go_package = "git.vdb.to/cerc-io/laconicd/x/registry";
|
||||
|
||||
// Msg is a service which exposes the registry functionality
|
||||
service Msg {
|
||||
|
||||
@@ -5,7 +5,7 @@ set -e
|
||||
|
||||
REPO_ROOT=$(pwd)
|
||||
I=$REPO_ROOT/proto
|
||||
DEST_TS=$REPO_ROOT/src/proto2/
|
||||
DEST_TS=$REPO_ROOT/src/proto/
|
||||
|
||||
echo "Generating protobuf files"
|
||||
|
||||
|
||||
+3
-3
@@ -3,7 +3,7 @@ import { getConfig } from './testing/helper';
|
||||
import { DENOM } from './constants';
|
||||
|
||||
jest.setTimeout(30 * 60 * 1000);
|
||||
const { chainId, restEndpoint, gqlEndpoint, privateKey, fee } = getConfig();
|
||||
const { chainId, rpcEndpoint, gqlEndpoint, privateKey, fee } = getConfig();
|
||||
|
||||
const auctionTests = (numBidders = 3) => {
|
||||
let registry: Registry;
|
||||
@@ -16,7 +16,7 @@ const auctionTests = (numBidders = 3) => {
|
||||
beforeAll(async () => {
|
||||
console.log('Running auction tests with num bidders', numBidders);
|
||||
|
||||
registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||
registry = new Registry(gqlEndpoint, rpcEndpoint, chainId);
|
||||
});
|
||||
|
||||
test('Setup bidder accounts', async () => {
|
||||
@@ -115,7 +115,7 @@ if (!process.env.TEST_AUCTIONS_ENABLED) {
|
||||
test('skipping auction tests', () => {});
|
||||
} else {
|
||||
/**
|
||||
Running these tests requires name auctions enabled. In laconic2d repo run:
|
||||
Running these tests requires name auctions enabled. In laconicd repo run:
|
||||
|
||||
TEST_AUCTION_ENABLED=true ./init.sh
|
||||
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@ import { DENOM } from './constants';
|
||||
const WATCHER_YML_PATH = path.join(__dirname, './testing/data/watcher.yml');
|
||||
|
||||
const BOND_AMOUNT = '1000000000';
|
||||
const { chainId, restEndpoint, gqlEndpoint, privateKey, fee } = getConfig();
|
||||
const { chainId, rpcEndpoint, gqlEndpoint, privateKey, fee } = getConfig();
|
||||
|
||||
jest.setTimeout(90 * 1000);
|
||||
|
||||
@@ -21,7 +21,7 @@ const bondTests = () => {
|
||||
};
|
||||
|
||||
beforeAll(async () => {
|
||||
registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||
registry = new Registry(gqlEndpoint, rpcEndpoint, chainId);
|
||||
});
|
||||
|
||||
test('Create bond.', async () => {
|
||||
|
||||
+2
-2
@@ -3,7 +3,7 @@ import { DENOM } from './constants';
|
||||
import { Registry } from './index';
|
||||
import { getConfig } from './testing/helper';
|
||||
|
||||
const { chainId, restEndpoint, gqlEndpoint, privateKey, fee } = getConfig();
|
||||
const { chainId, rpcEndpoint, gqlEndpoint, privateKey, fee } = getConfig();
|
||||
|
||||
jest.setTimeout(90 * 1000);
|
||||
|
||||
@@ -11,7 +11,7 @@ const registryTests = () => {
|
||||
let registry: Registry;
|
||||
|
||||
beforeAll(async () => {
|
||||
registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||
registry = new Registry(gqlEndpoint, rpcEndpoint, chainId);
|
||||
});
|
||||
|
||||
test('Get account info.', async () => {
|
||||
|
||||
+40
-10
@@ -24,11 +24,13 @@ import {
|
||||
MessageMsgCommitBid,
|
||||
MessageMsgRevealBid
|
||||
} from './types/cerc/auction/message';
|
||||
import { LaconicClient } from './laconic-client';
|
||||
import { MsgCancelBondResponse, MsgCreateBondResponse, MsgRefillBondResponse, MsgWithdrawBondResponse } from './proto2/cerc/bond/v1/tx';
|
||||
import { Coin } from './proto2/cosmos/base/v1beta1/coin';
|
||||
import { MsgSendResponse } from './proto2/cosmos/bank/v1beta1/tx';
|
||||
import { MessageMsgSendCoins } from './types/cosmos/bank/message';
|
||||
import { MessageMsgOnboardParticipant } from './types/cerc/onboarding/message';
|
||||
import { LaconicClient } from './laconic-client';
|
||||
import { Coin } from './proto/cosmos/base/v1beta1/coin';
|
||||
import { MsgCancelBondResponse, MsgCreateBondResponse, MsgRefillBondResponse, MsgWithdrawBondResponse } from './proto/cerc/bond/v1/tx';
|
||||
import { MsgOnboardParticipantResponse } from './proto/cerc/onboarding/v1/tx';
|
||||
import { MsgSendResponse } from './proto/cosmos/bank/v1beta1/tx';
|
||||
|
||||
export const DEFAULT_CHAIN_ID = 'laconic_9000-1';
|
||||
|
||||
@@ -59,17 +61,17 @@ export const createBid = async (chainId: string, auctionId: string, bidderAddres
|
||||
};
|
||||
|
||||
export class Registry {
|
||||
_endpoints: {[key: string]: string};
|
||||
_endpoints: { [key: string]: string };
|
||||
_chainID: string;
|
||||
_client: RegistryClient;
|
||||
|
||||
constructor (gqlUrl: string, restUrl = '', chainId: string = DEFAULT_CHAIN_ID) {
|
||||
constructor (gqlUrl: string, rpcUrl = '', chainId: string = DEFAULT_CHAIN_ID) {
|
||||
this._endpoints = {
|
||||
rest: restUrl,
|
||||
rpc: rpcUrl,
|
||||
gql: gqlUrl
|
||||
};
|
||||
|
||||
this._client = new RegistryClient(gqlUrl, restUrl);
|
||||
this._client = new RegistryClient(gqlUrl, rpcUrl);
|
||||
this._chainID = chainId;
|
||||
}
|
||||
|
||||
@@ -105,7 +107,7 @@ export class Registry {
|
||||
/**
|
||||
* Get records by attributes.
|
||||
*/
|
||||
async queryRecords (attributes: {[key: string]: any}, all = false, refs = false) {
|
||||
async queryRecords (attributes: { [key: string]: any }, all = false, refs = false) {
|
||||
return this._client.queryRecords(attributes, all, refs);
|
||||
}
|
||||
|
||||
@@ -432,8 +434,36 @@ export class Registry {
|
||||
}
|
||||
|
||||
async getLaconicClient (account: Account) {
|
||||
return LaconicClient.connectWithSigner(this._endpoints.rest, account.wallet);
|
||||
return LaconicClient.connectWithSigner(this._endpoints.rpc, account.wallet);
|
||||
}
|
||||
|
||||
/**
|
||||
* Onboard participant.
|
||||
*/
|
||||
async onboardParticipant ({ ethPayload, ethSignature, role, kycId }: MessageMsgOnboardParticipant, privateKey: string, fee: StdFee): Promise<MsgOnboardParticipantResponse> {
|
||||
const account = new Account(Buffer.from(privateKey, 'hex'));
|
||||
await account.init();
|
||||
const laconicClient = await this.getLaconicClient(account);
|
||||
|
||||
return laconicClient.onboardParticipant(
|
||||
account.address,
|
||||
ethPayload,
|
||||
ethSignature,
|
||||
role,
|
||||
kycId,
|
||||
fee
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Query participants.
|
||||
*/
|
||||
async getParticipants () {
|
||||
return this._client.getParticipants();
|
||||
}
|
||||
}
|
||||
|
||||
export { Account };
|
||||
export { LaconicClient };
|
||||
export * from './types/cerc/bond/message';
|
||||
export * from './types/cerc/onboarding/message';
|
||||
+36
-8
@@ -10,25 +10,29 @@ import {
|
||||
import { Comet38Client } from '@cosmjs/tendermint-rpc';
|
||||
|
||||
import { MsgCancelBondEncodeObject, MsgCreateBondEncodeObject, MsgRefillBondEncodeObject, MsgWithdrawBondEncodeObject, bondTypes, typeUrlMsgCancelBond, typeUrlMsgCreateBond, typeUrlMsgRefillBond, typeUrlMsgWithdrawBond } from './types/cerc/bond/message';
|
||||
import { Coin } from './proto2/cosmos/base/v1beta1/coin';
|
||||
import { Coin } from './proto/cosmos/base/v1beta1/coin';
|
||||
import { MsgAssociateBondEncodeObject, MsgDeleteNameEncodeObject, MsgDissociateBondEncodeObject, MsgDissociateRecordsEncodeObject, MsgReassociateRecordsEncodeObject, MsgReserveAuthorityEncodeObject, MsgSetAuthorityBondEncodeObject, MsgSetNameEncodeObject, MsgSetRecordEncodeObject, registryTypes, typeUrlMsgAssociateBond, typeUrlMsgDeleteName, typeUrlMsgDissociateBond, typeUrlMsgDissociateRecords, typeUrlMsgReassociateRecords, typeUrlMsgReserveAuthority, typeUrlMsgSetAuthorityBond, typeUrlMsgSetName, typeUrlMsgSetRecord, NAMESERVICE_ERRORS } from './types/cerc/registry/message';
|
||||
import { MsgCommitBidEncodeObject, MsgRevealBidEncodeObject, auctionTypes, typeUrlMsgCommitBid, typeUrlMsgRevealBid } from './types/cerc/auction/message';
|
||||
import { MsgAssociateBondResponse, MsgDeleteNameResponse, MsgDissociateBondResponse, MsgDissociateRecordsResponse, MsgReassociateRecordsResponse, MsgReserveAuthorityResponse, MsgSetAuthorityBondResponse, MsgSetNameResponse, MsgSetRecordResponse, Payload } from './proto2/cerc/registry/v1/tx';
|
||||
import { Record, Signature } from './proto2/cerc/registry/v1/registry';
|
||||
import { MsgOnboardParticipantEncodeObject, onboardingTypes, typeUrlMsgOnboardParticipant } from './types/cerc/onboarding/message';
|
||||
import { MsgAssociateBondResponse, MsgDeleteNameResponse, MsgDissociateBondResponse, MsgDissociateRecordsResponse, MsgReassociateRecordsResponse, MsgReserveAuthorityResponse, MsgSetAuthorityBondResponse, MsgSetNameResponse, MsgSetRecordResponse, Payload } from './proto/cerc/registry/v1/tx';
|
||||
import { Record, Signature } from './proto/cerc/registry/v1/registry';
|
||||
import { Account } from './account';
|
||||
import { Util } from './util';
|
||||
import { MsgCommitBidResponse, MsgRevealBidResponse } from './proto2/cerc/auction/v1/tx';
|
||||
import { MsgCancelBondResponse, MsgCreateBondResponse, MsgRefillBondResponse, MsgWithdrawBondResponse } from './proto2/cerc/bond/v1/tx';
|
||||
import { MsgCommitBidResponse, MsgRevealBidResponse } from './proto/cerc/auction/v1/tx';
|
||||
import { MsgCancelBondResponse, MsgCreateBondResponse, MsgRefillBondResponse, MsgWithdrawBondResponse } from './proto/cerc/bond/v1/tx';
|
||||
import { MsgOnboardParticipantResponse } from './proto/cerc/onboarding/v1/tx';
|
||||
import { bankTypes } from './types/cosmos/bank/message';
|
||||
import { EthPayload } from './proto/cerc/onboarding/v1/onboarding';
|
||||
|
||||
const DEFAULT_WRITE_ERROR = 'Unable to write to laconic2d.';
|
||||
const DEFAULT_WRITE_ERROR = 'Unable to write to laconicd.';
|
||||
|
||||
export const laconicDefaultRegistryTypes: ReadonlyArray<[string, GeneratedType]> = [
|
||||
...defaultRegistryTypes,
|
||||
...bondTypes,
|
||||
...registryTypes,
|
||||
...auctionTypes,
|
||||
...bankTypes
|
||||
...bankTypes,
|
||||
...onboardingTypes
|
||||
];
|
||||
|
||||
function createDefaultRegistry (): Registry {
|
||||
@@ -383,6 +387,30 @@ export class LaconicClient extends SigningStargateClient {
|
||||
console.error(error);
|
||||
}
|
||||
|
||||
return errorMessage || DEFAULT_WRITE_ERROR;
|
||||
return `${errorMessage || DEFAULT_WRITE_ERROR}: ${error}`;
|
||||
}
|
||||
|
||||
public async onboardParticipant (
|
||||
signer: string,
|
||||
ethPayload: EthPayload,
|
||||
ethSignature: string,
|
||||
role: string,
|
||||
kycId: string,
|
||||
fee: StdFee | 'auto' | number,
|
||||
memo = ''
|
||||
) {
|
||||
const onboardParticipantMsg: MsgOnboardParticipantEncodeObject = {
|
||||
typeUrl: typeUrlMsgOnboardParticipant,
|
||||
value: {
|
||||
participant: signer,
|
||||
ethPayload,
|
||||
ethSignature,
|
||||
role,
|
||||
kycId
|
||||
}
|
||||
};
|
||||
|
||||
const response = await this.signAndBroadcast(signer, [onboardParticipantMsg], fee, memo);
|
||||
return this.parseResponse<MsgOnboardParticipantResponse>(response);
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ const WATCHER_YML_PATH = path.join(__dirname, './testing/data/watcher.yml');
|
||||
|
||||
jest.setTimeout(120 * 1000);
|
||||
|
||||
const { chainId, restEndpoint, gqlEndpoint, privateKey, fee } = getConfig();
|
||||
const { chainId, rpcEndpoint, gqlEndpoint, privateKey, fee } = getConfig();
|
||||
|
||||
const nameserviceExpiryTests = () => {
|
||||
let registry: Registry;
|
||||
@@ -21,7 +21,7 @@ const nameserviceExpiryTests = () => {
|
||||
let recordExpiryTime: Date;
|
||||
|
||||
beforeAll(async () => {
|
||||
registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||
registry = new Registry(gqlEndpoint, rpcEndpoint, chainId);
|
||||
|
||||
// Create bond.
|
||||
bondId = await registry.getNextBondId(privateKey);
|
||||
@@ -103,7 +103,7 @@ if (!process.env.TEST_NAMESERVICE_EXPIRY) {
|
||||
test('skipping nameservice expiry tests', () => {});
|
||||
} else {
|
||||
/**
|
||||
Running these tests requires timers to be set. In laconic2d repo run:
|
||||
Running these tests requires timers to be set. In laconicd repo run:
|
||||
|
||||
TEST_REGISTRY_EXPIRY=true ./init.sh
|
||||
|
||||
|
||||
+2
-2
@@ -10,7 +10,7 @@ const WATCHER_YML_PATH = path.join(__dirname, './testing/data/watcher.yml');
|
||||
|
||||
jest.setTimeout(5 * 60 * 1000);
|
||||
|
||||
const { chainId, restEndpoint, gqlEndpoint, privateKey, fee } = getConfig();
|
||||
const { chainId, rpcEndpoint, gqlEndpoint, privateKey, fee } = getConfig();
|
||||
|
||||
const namingTests = () => {
|
||||
let registry: Registry;
|
||||
@@ -20,7 +20,7 @@ const namingTests = () => {
|
||||
let watcherId: string;
|
||||
|
||||
beforeAll(async () => {
|
||||
registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||
registry = new Registry(gqlEndpoint, rpcEndpoint, chainId);
|
||||
|
||||
// Create bond.
|
||||
bondId = await registry.getNextBondId(privateKey);
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
import { Wallet } from 'ethers';
|
||||
|
||||
import { DirectSecp256k1Wallet } from '@cosmjs/proto-signing';
|
||||
|
||||
import { Registry, Account } from './index';
|
||||
import { getConfig } from './testing/helper';
|
||||
import { Participant } from './proto/cerc/onboarding/v1/onboarding';
|
||||
|
||||
const { chainId, rpcEndpoint, gqlEndpoint, privateKey, fee } = getConfig();
|
||||
|
||||
jest.setTimeout(90 * 1000);
|
||||
|
||||
const DUMMY_ROLE = 'validator';
|
||||
const DUMMY_KYC_ID = 'dummyKycId';
|
||||
|
||||
const onboardingEnabledTests = () => {
|
||||
let registry: Registry;
|
||||
let ethWallet: Wallet;
|
||||
|
||||
beforeAll(async () => {
|
||||
registry = new Registry(gqlEndpoint, rpcEndpoint, chainId);
|
||||
});
|
||||
|
||||
test('Onboard participant.', async () => {
|
||||
const mnemonic = Account.generateMnemonic();
|
||||
ethWallet = Wallet.fromMnemonic(mnemonic);
|
||||
|
||||
const ethPayload = {
|
||||
address: ethWallet.address,
|
||||
msg: 'Message signed by ethereum private key'
|
||||
};
|
||||
|
||||
const message = JSON.stringify(ethPayload);
|
||||
const ethSignature = await ethWallet.signMessage(message);
|
||||
|
||||
await registry.onboardParticipant({
|
||||
ethPayload,
|
||||
ethSignature,
|
||||
role: DUMMY_ROLE,
|
||||
kycId: DUMMY_KYC_ID
|
||||
}, privateKey, fee);
|
||||
});
|
||||
|
||||
test('Query participants.', async () => {
|
||||
const account = new Account(Buffer.from(privateKey, 'hex'));
|
||||
const cosmosAccount = await DirectSecp256k1Wallet.fromKey(account._privateKey, 'laconic');
|
||||
const [cosmosWallet] = await cosmosAccount.getAccounts();
|
||||
|
||||
const expectedParticipants: Participant[] = [
|
||||
{
|
||||
cosmosAddress: cosmosWallet.address,
|
||||
nitroAddress: ethWallet.address,
|
||||
role: DUMMY_ROLE,
|
||||
kycId: DUMMY_KYC_ID
|
||||
}
|
||||
];
|
||||
const participants = await registry.getParticipants();
|
||||
expect(participants).toEqual(expectedParticipants);
|
||||
});
|
||||
};
|
||||
|
||||
const onboardingDisabledTests = () => {
|
||||
let registry: Registry;
|
||||
let ethWallet: Wallet;
|
||||
|
||||
beforeAll(async () => {
|
||||
registry = new Registry(gqlEndpoint, rpcEndpoint, chainId);
|
||||
});
|
||||
|
||||
test('Error on onboarding attempt.', async () => {
|
||||
const errorMsg = 'Validator onboarding is disabled: invalid request';
|
||||
const mnemonic = Account.generateMnemonic();
|
||||
ethWallet = Wallet.fromMnemonic(mnemonic);
|
||||
|
||||
const ethPayload = {
|
||||
address: ethWallet.address,
|
||||
msg: 'Message signed by ethereum private key'
|
||||
};
|
||||
|
||||
const message = JSON.stringify(ethPayload);
|
||||
const ethSignature = await ethWallet.signMessage(message);
|
||||
|
||||
try {
|
||||
await registry.onboardParticipant({
|
||||
ethPayload,
|
||||
ethSignature,
|
||||
role: DUMMY_ROLE,
|
||||
kycId: DUMMY_KYC_ID
|
||||
}, privateKey, fee);
|
||||
} catch (error: any) {
|
||||
expect(error.toString()).toContain(errorMsg);
|
||||
}
|
||||
});
|
||||
|
||||
test('No participants onboarded.', async () => {
|
||||
const expectedParticipants: Participant[] = [];
|
||||
const participants = await registry.getParticipants();
|
||||
expect(participants).toMatchObject(expectedParticipants);
|
||||
});
|
||||
};
|
||||
|
||||
if (process.env.ONBOARDING_ENABLED !== '1') {
|
||||
describe('Onboarding disabled', onboardingDisabledTests);
|
||||
} else {
|
||||
/**
|
||||
Running this test requires participants onboarding enabled. In laconicd repo run:
|
||||
|
||||
ONBOARDING_ENABLED=true ./init.sh
|
||||
|
||||
Run test:
|
||||
|
||||
yarn test:onboarding
|
||||
*/
|
||||
describe('Onboarding enabled', onboardingEnabledTests);
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,102 @@
|
||||
/* eslint-disable */
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "cerc.onboarding.module.v1";
|
||||
|
||||
/**
|
||||
* Module is the app config object of the module.
|
||||
* Learn more: https://docs.cosmos.network/main/building-modules/depinject
|
||||
*/
|
||||
export interface Module {
|
||||
authority: string;
|
||||
}
|
||||
|
||||
function createBaseModule(): Module {
|
||||
return { authority: "" };
|
||||
}
|
||||
|
||||
export const Module = {
|
||||
encode(
|
||||
message: Module,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.authority !== "") {
|
||||
writer.uint32(10).string(message.authority);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): Module {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseModule();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.authority = reader.string();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): Module {
|
||||
return {
|
||||
authority: isSet(object.authority) ? String(object.authority) : "",
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: Module): unknown {
|
||||
const obj: any = {};
|
||||
message.authority !== undefined && (obj.authority = message.authority);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<Module>, I>>(object: I): Module {
|
||||
const message = createBaseModule();
|
||||
message.authority = object.authority ?? "";
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
type Builtin =
|
||||
| Date
|
||||
| Function
|
||||
| Uint8Array
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: T extends Long
|
||||
? string | number | Long
|
||||
: T extends Array<infer U>
|
||||
? Array<DeepPartial<U>>
|
||||
: T extends ReadonlyArray<infer U>
|
||||
? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {}
|
||||
? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||
export type Exact<P, I extends P> = P extends Builtin
|
||||
? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
||||
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
||||
};
|
||||
|
||||
if (_m0.util.Long !== Long) {
|
||||
_m0.util.Long = Long as any;
|
||||
_m0.configure();
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
/* eslint-disable */
|
||||
import { Params, Participant } from "./onboarding";
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "cerc.onboarding.v1";
|
||||
|
||||
/** GenesisState defines the onboarding module's genesis state. */
|
||||
export interface GenesisState {
|
||||
/** params defines all the parameters of the module. */
|
||||
params?: Params;
|
||||
/** participants defines all the participants */
|
||||
participants: Participant[];
|
||||
}
|
||||
|
||||
function createBaseGenesisState(): GenesisState {
|
||||
return { params: undefined, participants: [] };
|
||||
}
|
||||
|
||||
export const GenesisState = {
|
||||
encode(
|
||||
message: GenesisState,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.params !== undefined) {
|
||||
Params.encode(message.params, writer.uint32(10).fork()).ldelim();
|
||||
}
|
||||
for (const v of message.participants) {
|
||||
Participant.encode(v!, writer.uint32(18).fork()).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): GenesisState {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseGenesisState();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.params = Params.decode(reader, reader.uint32());
|
||||
break;
|
||||
case 2:
|
||||
message.participants.push(
|
||||
Participant.decode(reader, reader.uint32())
|
||||
);
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): GenesisState {
|
||||
return {
|
||||
params: isSet(object.params) ? Params.fromJSON(object.params) : undefined,
|
||||
participants: Array.isArray(object?.participants)
|
||||
? object.participants.map((e: any) => Participant.fromJSON(e))
|
||||
: [],
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: GenesisState): unknown {
|
||||
const obj: any = {};
|
||||
message.params !== undefined &&
|
||||
(obj.params = message.params ? Params.toJSON(message.params) : undefined);
|
||||
if (message.participants) {
|
||||
obj.participants = message.participants.map((e) =>
|
||||
e ? Participant.toJSON(e) : undefined
|
||||
);
|
||||
} else {
|
||||
obj.participants = [];
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<GenesisState>, I>>(
|
||||
object: I
|
||||
): GenesisState {
|
||||
const message = createBaseGenesisState();
|
||||
message.params =
|
||||
object.params !== undefined && object.params !== null
|
||||
? Params.fromPartial(object.params)
|
||||
: undefined;
|
||||
message.participants =
|
||||
object.participants?.map((e) => Participant.fromPartial(e)) || [];
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
type Builtin =
|
||||
| Date
|
||||
| Function
|
||||
| Uint8Array
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: T extends Long
|
||||
? string | number | Long
|
||||
: T extends Array<infer U>
|
||||
? Array<DeepPartial<U>>
|
||||
: T extends ReadonlyArray<infer U>
|
||||
? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {}
|
||||
? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||
export type Exact<P, I extends P> = P extends Builtin
|
||||
? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
||||
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
||||
};
|
||||
|
||||
if (_m0.util.Long !== Long) {
|
||||
_m0.util.Long = Long as any;
|
||||
_m0.configure();
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
||||
@@ -0,0 +1,273 @@
|
||||
/* eslint-disable */
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "cerc.onboarding.v1";
|
||||
|
||||
/** Params defines the parameters of the onboarding module. */
|
||||
export interface Params {
|
||||
onboardingEnabled: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* Participant defines the data that will be stored for each enrolled
|
||||
* participant
|
||||
*/
|
||||
export interface Participant {
|
||||
/** participant's cosmos (laconic) address */
|
||||
cosmosAddress: string;
|
||||
/** participant's Nitro address */
|
||||
nitroAddress: string;
|
||||
/** participant's role (participant | validator) */
|
||||
role: string;
|
||||
/** participant's KYC receipt ID */
|
||||
kycId: string;
|
||||
}
|
||||
|
||||
/** EthPayload defines the payload that is signed by the ethereum private key */
|
||||
export interface EthPayload {
|
||||
address: string;
|
||||
msg: string;
|
||||
}
|
||||
|
||||
function createBaseParams(): Params {
|
||||
return { onboardingEnabled: false };
|
||||
}
|
||||
|
||||
export const Params = {
|
||||
encode(
|
||||
message: Params,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.onboardingEnabled === true) {
|
||||
writer.uint32(8).bool(message.onboardingEnabled);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): Params {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseParams();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.onboardingEnabled = reader.bool();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): Params {
|
||||
return {
|
||||
onboardingEnabled: isSet(object.onboardingEnabled)
|
||||
? Boolean(object.onboardingEnabled)
|
||||
: false,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: Params): unknown {
|
||||
const obj: any = {};
|
||||
message.onboardingEnabled !== undefined &&
|
||||
(obj.onboardingEnabled = message.onboardingEnabled);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<Params>, I>>(object: I): Params {
|
||||
const message = createBaseParams();
|
||||
message.onboardingEnabled = object.onboardingEnabled ?? false;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseParticipant(): Participant {
|
||||
return { cosmosAddress: "", nitroAddress: "", role: "", kycId: "" };
|
||||
}
|
||||
|
||||
export const Participant = {
|
||||
encode(
|
||||
message: Participant,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.cosmosAddress !== "") {
|
||||
writer.uint32(10).string(message.cosmosAddress);
|
||||
}
|
||||
if (message.nitroAddress !== "") {
|
||||
writer.uint32(18).string(message.nitroAddress);
|
||||
}
|
||||
if (message.role !== "") {
|
||||
writer.uint32(26).string(message.role);
|
||||
}
|
||||
if (message.kycId !== "") {
|
||||
writer.uint32(34).string(message.kycId);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): Participant {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseParticipant();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.cosmosAddress = reader.string();
|
||||
break;
|
||||
case 2:
|
||||
message.nitroAddress = reader.string();
|
||||
break;
|
||||
case 3:
|
||||
message.role = reader.string();
|
||||
break;
|
||||
case 4:
|
||||
message.kycId = reader.string();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): Participant {
|
||||
return {
|
||||
cosmosAddress: isSet(object.cosmosAddress)
|
||||
? String(object.cosmosAddress)
|
||||
: "",
|
||||
nitroAddress: isSet(object.nitroAddress)
|
||||
? String(object.nitroAddress)
|
||||
: "",
|
||||
role: isSet(object.role) ? String(object.role) : "",
|
||||
kycId: isSet(object.kycId) ? String(object.kycId) : "",
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: Participant): unknown {
|
||||
const obj: any = {};
|
||||
message.cosmosAddress !== undefined &&
|
||||
(obj.cosmosAddress = message.cosmosAddress);
|
||||
message.nitroAddress !== undefined &&
|
||||
(obj.nitroAddress = message.nitroAddress);
|
||||
message.role !== undefined && (obj.role = message.role);
|
||||
message.kycId !== undefined && (obj.kycId = message.kycId);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<Participant>, I>>(
|
||||
object: I
|
||||
): Participant {
|
||||
const message = createBaseParticipant();
|
||||
message.cosmosAddress = object.cosmosAddress ?? "";
|
||||
message.nitroAddress = object.nitroAddress ?? "";
|
||||
message.role = object.role ?? "";
|
||||
message.kycId = object.kycId ?? "";
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseEthPayload(): EthPayload {
|
||||
return { address: "", msg: "" };
|
||||
}
|
||||
|
||||
export const EthPayload = {
|
||||
encode(
|
||||
message: EthPayload,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.address !== "") {
|
||||
writer.uint32(10).string(message.address);
|
||||
}
|
||||
if (message.msg !== "") {
|
||||
writer.uint32(18).string(message.msg);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): EthPayload {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseEthPayload();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.address = reader.string();
|
||||
break;
|
||||
case 2:
|
||||
message.msg = reader.string();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): EthPayload {
|
||||
return {
|
||||
address: isSet(object.address) ? String(object.address) : "",
|
||||
msg: isSet(object.msg) ? String(object.msg) : "",
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: EthPayload): unknown {
|
||||
const obj: any = {};
|
||||
message.address !== undefined && (obj.address = message.address);
|
||||
message.msg !== undefined && (obj.msg = message.msg);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<EthPayload>, I>>(
|
||||
object: I
|
||||
): EthPayload {
|
||||
const message = createBaseEthPayload();
|
||||
message.address = object.address ?? "";
|
||||
message.msg = object.msg ?? "";
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
type Builtin =
|
||||
| Date
|
||||
| Function
|
||||
| Uint8Array
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: T extends Long
|
||||
? string | number | Long
|
||||
: T extends Array<infer U>
|
||||
? Array<DeepPartial<U>>
|
||||
: T extends ReadonlyArray<infer U>
|
||||
? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {}
|
||||
? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||
export type Exact<P, I extends P> = P extends Builtin
|
||||
? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
||||
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
||||
};
|
||||
|
||||
if (_m0.util.Long !== Long) {
|
||||
_m0.util.Long = Long as any;
|
||||
_m0.configure();
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
||||
@@ -0,0 +1,250 @@
|
||||
/* eslint-disable */
|
||||
import {
|
||||
PageRequest,
|
||||
PageResponse,
|
||||
} from "../../../cosmos/base/query/v1beta1/pagination";
|
||||
import Long from "long";
|
||||
import { Participant } from "./onboarding";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "cerc.onboarding.v1";
|
||||
|
||||
/** QueryParticipantsRequest queries participants */
|
||||
export interface QueryParticipantsRequest {
|
||||
/** pagination defines an optional pagination for the request. */
|
||||
pagination?: PageRequest;
|
||||
}
|
||||
|
||||
/** QueryParticipantsResponse is response type for get the participants */
|
||||
export interface QueryParticipantsResponse {
|
||||
participants: Participant[];
|
||||
/** pagination defines the pagination in the response. */
|
||||
pagination?: PageResponse;
|
||||
}
|
||||
|
||||
function createBaseQueryParticipantsRequest(): QueryParticipantsRequest {
|
||||
return { pagination: undefined };
|
||||
}
|
||||
|
||||
export const QueryParticipantsRequest = {
|
||||
encode(
|
||||
message: QueryParticipantsRequest,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.pagination !== undefined) {
|
||||
PageRequest.encode(message.pagination, writer.uint32(10).fork()).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(
|
||||
input: _m0.Reader | Uint8Array,
|
||||
length?: number
|
||||
): QueryParticipantsRequest {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseQueryParticipantsRequest();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.pagination = PageRequest.decode(reader, reader.uint32());
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): QueryParticipantsRequest {
|
||||
return {
|
||||
pagination: isSet(object.pagination)
|
||||
? PageRequest.fromJSON(object.pagination)
|
||||
: undefined,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: QueryParticipantsRequest): unknown {
|
||||
const obj: any = {};
|
||||
message.pagination !== undefined &&
|
||||
(obj.pagination = message.pagination
|
||||
? PageRequest.toJSON(message.pagination)
|
||||
: undefined);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<QueryParticipantsRequest>, I>>(
|
||||
object: I
|
||||
): QueryParticipantsRequest {
|
||||
const message = createBaseQueryParticipantsRequest();
|
||||
message.pagination =
|
||||
object.pagination !== undefined && object.pagination !== null
|
||||
? PageRequest.fromPartial(object.pagination)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseQueryParticipantsResponse(): QueryParticipantsResponse {
|
||||
return { participants: [], pagination: undefined };
|
||||
}
|
||||
|
||||
export const QueryParticipantsResponse = {
|
||||
encode(
|
||||
message: QueryParticipantsResponse,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
for (const v of message.participants) {
|
||||
Participant.encode(v!, writer.uint32(10).fork()).ldelim();
|
||||
}
|
||||
if (message.pagination !== undefined) {
|
||||
PageResponse.encode(
|
||||
message.pagination,
|
||||
writer.uint32(18).fork()
|
||||
).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(
|
||||
input: _m0.Reader | Uint8Array,
|
||||
length?: number
|
||||
): QueryParticipantsResponse {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseQueryParticipantsResponse();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.participants.push(
|
||||
Participant.decode(reader, reader.uint32())
|
||||
);
|
||||
break;
|
||||
case 2:
|
||||
message.pagination = PageResponse.decode(reader, reader.uint32());
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): QueryParticipantsResponse {
|
||||
return {
|
||||
participants: Array.isArray(object?.participants)
|
||||
? object.participants.map((e: any) => Participant.fromJSON(e))
|
||||
: [],
|
||||
pagination: isSet(object.pagination)
|
||||
? PageResponse.fromJSON(object.pagination)
|
||||
: undefined,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: QueryParticipantsResponse): unknown {
|
||||
const obj: any = {};
|
||||
if (message.participants) {
|
||||
obj.participants = message.participants.map((e) =>
|
||||
e ? Participant.toJSON(e) : undefined
|
||||
);
|
||||
} else {
|
||||
obj.participants = [];
|
||||
}
|
||||
message.pagination !== undefined &&
|
||||
(obj.pagination = message.pagination
|
||||
? PageResponse.toJSON(message.pagination)
|
||||
: undefined);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<QueryParticipantsResponse>, I>>(
|
||||
object: I
|
||||
): QueryParticipantsResponse {
|
||||
const message = createBaseQueryParticipantsResponse();
|
||||
message.participants =
|
||||
object.participants?.map((e) => Participant.fromPartial(e)) || [];
|
||||
message.pagination =
|
||||
object.pagination !== undefined && object.pagination !== null
|
||||
? PageResponse.fromPartial(object.pagination)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
/** Query defines the gRPC querier service for onboarding module */
|
||||
export interface Query {
|
||||
/** Participants queries Participants list */
|
||||
Participants(
|
||||
request: QueryParticipantsRequest
|
||||
): Promise<QueryParticipantsResponse>;
|
||||
}
|
||||
|
||||
export class QueryClientImpl implements Query {
|
||||
private readonly rpc: Rpc;
|
||||
constructor(rpc: Rpc) {
|
||||
this.rpc = rpc;
|
||||
this.Participants = this.Participants.bind(this);
|
||||
}
|
||||
Participants(
|
||||
request: QueryParticipantsRequest
|
||||
): Promise<QueryParticipantsResponse> {
|
||||
const data = QueryParticipantsRequest.encode(request).finish();
|
||||
const promise = this.rpc.request(
|
||||
"cerc.onboarding.v1.Query",
|
||||
"Participants",
|
||||
data
|
||||
);
|
||||
return promise.then((data) =>
|
||||
QueryParticipantsResponse.decode(new _m0.Reader(data))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
interface Rpc {
|
||||
request(
|
||||
service: string,
|
||||
method: string,
|
||||
data: Uint8Array
|
||||
): Promise<Uint8Array>;
|
||||
}
|
||||
|
||||
type Builtin =
|
||||
| Date
|
||||
| Function
|
||||
| Uint8Array
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: T extends Long
|
||||
? string | number | Long
|
||||
: T extends Array<infer U>
|
||||
? Array<DeepPartial<U>>
|
||||
: T extends ReadonlyArray<infer U>
|
||||
? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {}
|
||||
? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||
export type Exact<P, I extends P> = P extends Builtin
|
||||
? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
||||
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
||||
};
|
||||
|
||||
if (_m0.util.Long !== Long) {
|
||||
_m0.util.Long = Long as any;
|
||||
_m0.configure();
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
||||
@@ -0,0 +1,254 @@
|
||||
/* eslint-disable */
|
||||
import { EthPayload } from "./onboarding";
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "cerc.onboarding.v1";
|
||||
|
||||
/** MsgOnboardParticipant defines a SDK message for enrolling a new validator. */
|
||||
export interface MsgOnboardParticipant {
|
||||
/** Participant is the msg sender */
|
||||
participant: string;
|
||||
ethPayload?: EthPayload;
|
||||
ethSignature: string;
|
||||
role: string;
|
||||
kycId: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* MsgOnboardParticipantResponse defines the Msg/OnboardParticipant response
|
||||
* type.
|
||||
*/
|
||||
export interface MsgOnboardParticipantResponse {}
|
||||
|
||||
function createBaseMsgOnboardParticipant(): MsgOnboardParticipant {
|
||||
return {
|
||||
participant: "",
|
||||
ethPayload: undefined,
|
||||
ethSignature: "",
|
||||
role: "",
|
||||
kycId: "",
|
||||
};
|
||||
}
|
||||
|
||||
export const MsgOnboardParticipant = {
|
||||
encode(
|
||||
message: MsgOnboardParticipant,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.participant !== "") {
|
||||
writer.uint32(10).string(message.participant);
|
||||
}
|
||||
if (message.ethPayload !== undefined) {
|
||||
EthPayload.encode(message.ethPayload, writer.uint32(18).fork()).ldelim();
|
||||
}
|
||||
if (message.ethSignature !== "") {
|
||||
writer.uint32(26).string(message.ethSignature);
|
||||
}
|
||||
if (message.role !== "") {
|
||||
writer.uint32(34).string(message.role);
|
||||
}
|
||||
if (message.kycId !== "") {
|
||||
writer.uint32(42).string(message.kycId);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(
|
||||
input: _m0.Reader | Uint8Array,
|
||||
length?: number
|
||||
): MsgOnboardParticipant {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseMsgOnboardParticipant();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.participant = reader.string();
|
||||
break;
|
||||
case 2:
|
||||
message.ethPayload = EthPayload.decode(reader, reader.uint32());
|
||||
break;
|
||||
case 3:
|
||||
message.ethSignature = reader.string();
|
||||
break;
|
||||
case 4:
|
||||
message.role = reader.string();
|
||||
break;
|
||||
case 5:
|
||||
message.kycId = reader.string();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): MsgOnboardParticipant {
|
||||
return {
|
||||
participant: isSet(object.participant) ? String(object.participant) : "",
|
||||
ethPayload: isSet(object.ethPayload)
|
||||
? EthPayload.fromJSON(object.ethPayload)
|
||||
: undefined,
|
||||
ethSignature: isSet(object.ethSignature)
|
||||
? String(object.ethSignature)
|
||||
: "",
|
||||
role: isSet(object.role) ? String(object.role) : "",
|
||||
kycId: isSet(object.kycId) ? String(object.kycId) : "",
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: MsgOnboardParticipant): unknown {
|
||||
const obj: any = {};
|
||||
message.participant !== undefined &&
|
||||
(obj.participant = message.participant);
|
||||
message.ethPayload !== undefined &&
|
||||
(obj.ethPayload = message.ethPayload
|
||||
? EthPayload.toJSON(message.ethPayload)
|
||||
: undefined);
|
||||
message.ethSignature !== undefined &&
|
||||
(obj.ethSignature = message.ethSignature);
|
||||
message.role !== undefined && (obj.role = message.role);
|
||||
message.kycId !== undefined && (obj.kycId = message.kycId);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<MsgOnboardParticipant>, I>>(
|
||||
object: I
|
||||
): MsgOnboardParticipant {
|
||||
const message = createBaseMsgOnboardParticipant();
|
||||
message.participant = object.participant ?? "";
|
||||
message.ethPayload =
|
||||
object.ethPayload !== undefined && object.ethPayload !== null
|
||||
? EthPayload.fromPartial(object.ethPayload)
|
||||
: undefined;
|
||||
message.ethSignature = object.ethSignature ?? "";
|
||||
message.role = object.role ?? "";
|
||||
message.kycId = object.kycId ?? "";
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseMsgOnboardParticipantResponse(): MsgOnboardParticipantResponse {
|
||||
return {};
|
||||
}
|
||||
|
||||
export const MsgOnboardParticipantResponse = {
|
||||
encode(
|
||||
_: MsgOnboardParticipantResponse,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(
|
||||
input: _m0.Reader | Uint8Array,
|
||||
length?: number
|
||||
): MsgOnboardParticipantResponse {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseMsgOnboardParticipantResponse();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(_: any): MsgOnboardParticipantResponse {
|
||||
return {};
|
||||
},
|
||||
|
||||
toJSON(_: MsgOnboardParticipantResponse): unknown {
|
||||
const obj: any = {};
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<MsgOnboardParticipantResponse>, I>>(
|
||||
_: I
|
||||
): MsgOnboardParticipantResponse {
|
||||
const message = createBaseMsgOnboardParticipantResponse();
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
/** Msg defines the onboarding Msg service. */
|
||||
export interface Msg {
|
||||
/** OnboardParticipant defines a method for enrolling a new validator. */
|
||||
OnboardParticipant(
|
||||
request: MsgOnboardParticipant
|
||||
): Promise<MsgOnboardParticipantResponse>;
|
||||
}
|
||||
|
||||
export class MsgClientImpl implements Msg {
|
||||
private readonly rpc: Rpc;
|
||||
constructor(rpc: Rpc) {
|
||||
this.rpc = rpc;
|
||||
this.OnboardParticipant = this.OnboardParticipant.bind(this);
|
||||
}
|
||||
OnboardParticipant(
|
||||
request: MsgOnboardParticipant
|
||||
): Promise<MsgOnboardParticipantResponse> {
|
||||
const data = MsgOnboardParticipant.encode(request).finish();
|
||||
const promise = this.rpc.request(
|
||||
"cerc.onboarding.v1.Msg",
|
||||
"OnboardParticipant",
|
||||
data
|
||||
);
|
||||
return promise.then((data) =>
|
||||
MsgOnboardParticipantResponse.decode(new _m0.Reader(data))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
interface Rpc {
|
||||
request(
|
||||
service: string,
|
||||
method: string,
|
||||
data: Uint8Array
|
||||
): Promise<Uint8Array>;
|
||||
}
|
||||
|
||||
type Builtin =
|
||||
| Date
|
||||
| Function
|
||||
| Uint8Array
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: T extends Long
|
||||
? string | number | Long
|
||||
: T extends Array<infer U>
|
||||
? Array<DeepPartial<U>>
|
||||
: T extends ReadonlyArray<infer U>
|
||||
? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {}
|
||||
? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||
export type Exact<P, I extends P> = P extends Builtin
|
||||
? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
||||
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
||||
};
|
||||
|
||||
if (_m0.util.Long !== Long) {
|
||||
_m0.util.Long = Long as any;
|
||||
_m0.configure();
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
@@ -5,6 +5,7 @@ import {
|
||||
NameAuthority,
|
||||
NameRecord,
|
||||
NameEntry,
|
||||
AuthorityEntry,
|
||||
} from "./registry";
|
||||
import {
|
||||
PageRequest,
|
||||
@@ -118,6 +119,18 @@ export interface QueryWhoisResponse {
|
||||
nameAuthority?: NameAuthority;
|
||||
}
|
||||
|
||||
/** QueryAuthoritiesRequest is request type to get all authorities */
|
||||
export interface QueryAuthoritiesRequest {
|
||||
owner: string;
|
||||
}
|
||||
|
||||
/** QueryAuthoritiesResponse is response type for authorities request */
|
||||
export interface QueryAuthoritiesResponse {
|
||||
authorities: AuthorityEntry[];
|
||||
/** pagination defines the pagination in the response. */
|
||||
pagination?: PageResponse;
|
||||
}
|
||||
|
||||
/** QueryLookupLrnRequest is request type for LookupLrn */
|
||||
export interface QueryLookupLrnRequest {
|
||||
lrn: string;
|
||||
@@ -1460,6 +1473,151 @@ export const QueryWhoisResponse = {
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseQueryAuthoritiesRequest(): QueryAuthoritiesRequest {
|
||||
return { owner: "" };
|
||||
}
|
||||
|
||||
export const QueryAuthoritiesRequest = {
|
||||
encode(
|
||||
message: QueryAuthoritiesRequest,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.owner !== "") {
|
||||
writer.uint32(10).string(message.owner);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(
|
||||
input: _m0.Reader | Uint8Array,
|
||||
length?: number
|
||||
): QueryAuthoritiesRequest {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseQueryAuthoritiesRequest();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.owner = reader.string();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): QueryAuthoritiesRequest {
|
||||
return {
|
||||
owner: isSet(object.owner) ? String(object.owner) : "",
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: QueryAuthoritiesRequest): unknown {
|
||||
const obj: any = {};
|
||||
message.owner !== undefined && (obj.owner = message.owner);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<QueryAuthoritiesRequest>, I>>(
|
||||
object: I
|
||||
): QueryAuthoritiesRequest {
|
||||
const message = createBaseQueryAuthoritiesRequest();
|
||||
message.owner = object.owner ?? "";
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseQueryAuthoritiesResponse(): QueryAuthoritiesResponse {
|
||||
return { authorities: [], pagination: undefined };
|
||||
}
|
||||
|
||||
export const QueryAuthoritiesResponse = {
|
||||
encode(
|
||||
message: QueryAuthoritiesResponse,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
for (const v of message.authorities) {
|
||||
AuthorityEntry.encode(v!, writer.uint32(10).fork()).ldelim();
|
||||
}
|
||||
if (message.pagination !== undefined) {
|
||||
PageResponse.encode(
|
||||
message.pagination,
|
||||
writer.uint32(18).fork()
|
||||
).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(
|
||||
input: _m0.Reader | Uint8Array,
|
||||
length?: number
|
||||
): QueryAuthoritiesResponse {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseQueryAuthoritiesResponse();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.authorities.push(
|
||||
AuthorityEntry.decode(reader, reader.uint32())
|
||||
);
|
||||
break;
|
||||
case 2:
|
||||
message.pagination = PageResponse.decode(reader, reader.uint32());
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): QueryAuthoritiesResponse {
|
||||
return {
|
||||
authorities: Array.isArray(object?.authorities)
|
||||
? object.authorities.map((e: any) => AuthorityEntry.fromJSON(e))
|
||||
: [],
|
||||
pagination: isSet(object.pagination)
|
||||
? PageResponse.fromJSON(object.pagination)
|
||||
: undefined,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: QueryAuthoritiesResponse): unknown {
|
||||
const obj: any = {};
|
||||
if (message.authorities) {
|
||||
obj.authorities = message.authorities.map((e) =>
|
||||
e ? AuthorityEntry.toJSON(e) : undefined
|
||||
);
|
||||
} else {
|
||||
obj.authorities = [];
|
||||
}
|
||||
message.pagination !== undefined &&
|
||||
(obj.pagination = message.pagination
|
||||
? PageResponse.toJSON(message.pagination)
|
||||
: undefined);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<QueryAuthoritiesResponse>, I>>(
|
||||
object: I
|
||||
): QueryAuthoritiesResponse {
|
||||
const message = createBaseQueryAuthoritiesResponse();
|
||||
message.authorities =
|
||||
object.authorities?.map((e) => AuthorityEntry.fromPartial(e)) || [];
|
||||
message.pagination =
|
||||
object.pagination !== undefined && object.pagination !== null
|
||||
? PageResponse.fromPartial(object.pagination)
|
||||
: undefined;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseQueryLookupLrnRequest(): QueryLookupLrnRequest {
|
||||
return { lrn: "" };
|
||||
}
|
||||
@@ -1907,6 +2065,10 @@ export interface Query {
|
||||
GetRegistryModuleBalance(
|
||||
request: QueryGetRegistryModuleBalanceRequest
|
||||
): Promise<QueryGetRegistryModuleBalanceResponse>;
|
||||
/** Authorities queries all authorities */
|
||||
Authorities(
|
||||
request: QueryAuthoritiesRequest
|
||||
): Promise<QueryAuthoritiesResponse>;
|
||||
}
|
||||
|
||||
export class QueryClientImpl implements Query {
|
||||
@@ -1922,6 +2084,7 @@ export class QueryClientImpl implements Query {
|
||||
this.LookupLrn = this.LookupLrn.bind(this);
|
||||
this.ResolveLrn = this.ResolveLrn.bind(this);
|
||||
this.GetRegistryModuleBalance = this.GetRegistryModuleBalance.bind(this);
|
||||
this.Authorities = this.Authorities.bind(this);
|
||||
}
|
||||
Params(request: QueryParamsRequest): Promise<QueryParamsResponse> {
|
||||
const data = QueryParamsRequest.encode(request).finish();
|
||||
@@ -2026,6 +2189,20 @@ export class QueryClientImpl implements Query {
|
||||
QueryGetRegistryModuleBalanceResponse.decode(new _m0.Reader(data))
|
||||
);
|
||||
}
|
||||
|
||||
Authorities(
|
||||
request: QueryAuthoritiesRequest
|
||||
): Promise<QueryAuthoritiesResponse> {
|
||||
const data = QueryAuthoritiesRequest.encode(request).finish();
|
||||
const promise = this.rpc.request(
|
||||
"cerc.registry.v1.Query",
|
||||
"Authorities",
|
||||
data
|
||||
);
|
||||
return promise.then((data) =>
|
||||
QueryAuthoritiesResponse.decode(new _m0.Reader(data))
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
interface Rpc {
|
||||
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,259 +1,322 @@
|
||||
// @ts-nocheck
|
||||
/* eslint-disable */
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "cosmos.base.query.v1beta1";
|
||||
|
||||
/**
|
||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||
* compiler version: 4.25.1
|
||||
* source: cosmos/base/query/v1beta1/pagination.proto
|
||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||
import * as pb_1 from "google-protobuf";
|
||||
export namespace cosmos.base.query.v1beta1 {
|
||||
export class PageRequest extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
key?: Uint8Array;
|
||||
offset?: number;
|
||||
limit?: number;
|
||||
count_total?: boolean;
|
||||
reverse?: boolean;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("key" in data && data.key != undefined) {
|
||||
this.key = data.key;
|
||||
}
|
||||
if ("offset" in data && data.offset != undefined) {
|
||||
this.offset = data.offset;
|
||||
}
|
||||
if ("limit" in data && data.limit != undefined) {
|
||||
this.limit = data.limit;
|
||||
}
|
||||
if ("count_total" in data && data.count_total != undefined) {
|
||||
this.count_total = data.count_total;
|
||||
}
|
||||
if ("reverse" in data && data.reverse != undefined) {
|
||||
this.reverse = data.reverse;
|
||||
}
|
||||
}
|
||||
}
|
||||
get key() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 1, new Uint8Array(0)) as Uint8Array;
|
||||
}
|
||||
set key(value: Uint8Array) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get offset() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 2, 0) as number;
|
||||
}
|
||||
set offset(value: number) {
|
||||
pb_1.Message.setField(this, 2, value);
|
||||
}
|
||||
get limit() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 3, 0) as number;
|
||||
}
|
||||
set limit(value: number) {
|
||||
pb_1.Message.setField(this, 3, value);
|
||||
}
|
||||
get count_total() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 4, false) as boolean;
|
||||
}
|
||||
set count_total(value: boolean) {
|
||||
pb_1.Message.setField(this, 4, value);
|
||||
}
|
||||
get reverse() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 5, false) as boolean;
|
||||
}
|
||||
set reverse(value: boolean) {
|
||||
pb_1.Message.setField(this, 5, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
key?: Uint8Array;
|
||||
offset?: number;
|
||||
limit?: number;
|
||||
count_total?: boolean;
|
||||
reverse?: boolean;
|
||||
}): PageRequest {
|
||||
const message = new PageRequest({});
|
||||
if (data.key != null) {
|
||||
message.key = data.key;
|
||||
}
|
||||
if (data.offset != null) {
|
||||
message.offset = data.offset;
|
||||
}
|
||||
if (data.limit != null) {
|
||||
message.limit = data.limit;
|
||||
}
|
||||
if (data.count_total != null) {
|
||||
message.count_total = data.count_total;
|
||||
}
|
||||
if (data.reverse != null) {
|
||||
message.reverse = data.reverse;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
key?: Uint8Array;
|
||||
offset?: number;
|
||||
limit?: number;
|
||||
count_total?: boolean;
|
||||
reverse?: boolean;
|
||||
} = {};
|
||||
if (this.key != null) {
|
||||
data.key = this.key;
|
||||
}
|
||||
if (this.offset != null) {
|
||||
data.offset = this.offset;
|
||||
}
|
||||
if (this.limit != null) {
|
||||
data.limit = this.limit;
|
||||
}
|
||||
if (this.count_total != null) {
|
||||
data.count_total = this.count_total;
|
||||
}
|
||||
if (this.reverse != null) {
|
||||
data.reverse = this.reverse;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.key.length)
|
||||
writer.writeBytes(1, this.key);
|
||||
if (this.offset != 0)
|
||||
writer.writeUint64(2, this.offset);
|
||||
if (this.limit != 0)
|
||||
writer.writeUint64(3, this.limit);
|
||||
if (this.count_total != false)
|
||||
writer.writeBool(4, this.count_total);
|
||||
if (this.reverse != false)
|
||||
writer.writeBool(5, this.reverse);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): PageRequest {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new PageRequest();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.key = reader.readBytes();
|
||||
break;
|
||||
case 2:
|
||||
message.offset = reader.readUint64();
|
||||
break;
|
||||
case 3:
|
||||
message.limit = reader.readUint64();
|
||||
break;
|
||||
case 4:
|
||||
message.count_total = reader.readBool();
|
||||
break;
|
||||
case 5:
|
||||
message.reverse = reader.readBool();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): PageRequest {
|
||||
return PageRequest.deserialize(bytes);
|
||||
}
|
||||
* PageRequest is to be embedded in gRPC request messages for efficient
|
||||
* pagination. Ex:
|
||||
*
|
||||
* message SomeRequest {
|
||||
* Foo some_parameter = 1;
|
||||
* PageRequest pagination = 2;
|
||||
* }
|
||||
*/
|
||||
export interface PageRequest {
|
||||
/**
|
||||
* key is a value returned in PageResponse.next_key to begin
|
||||
* querying the next page most efficiently. Only one of offset or key
|
||||
* should be set.
|
||||
*/
|
||||
key: Uint8Array;
|
||||
/**
|
||||
* offset is a numeric offset that can be used when key is unavailable.
|
||||
* It is less efficient than using key. Only one of offset or key should
|
||||
* be set.
|
||||
*/
|
||||
offset: Long;
|
||||
/**
|
||||
* limit is the total number of results to be returned in the result page.
|
||||
* If left empty it will default to a value to be set by each app.
|
||||
*/
|
||||
limit: Long;
|
||||
/**
|
||||
* count_total is set to true to indicate that the result set should include
|
||||
* a count of the total number of items available for pagination in UIs.
|
||||
* count_total is only respected when offset is used. It is ignored when key
|
||||
* is set.
|
||||
*/
|
||||
countTotal: boolean;
|
||||
/**
|
||||
* reverse is set to true if results are to be returned in the descending order.
|
||||
*
|
||||
* Since: cosmos-sdk 0.43
|
||||
*/
|
||||
reverse: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* PageResponse is to be embedded in gRPC response messages where the
|
||||
* corresponding request message has used PageRequest.
|
||||
*
|
||||
* message SomeResponse {
|
||||
* repeated Bar results = 1;
|
||||
* PageResponse page = 2;
|
||||
* }
|
||||
*/
|
||||
export interface PageResponse {
|
||||
/**
|
||||
* next_key is the key to be passed to PageRequest.key to
|
||||
* query the next page most efficiently. It will be empty if
|
||||
* there are no more results.
|
||||
*/
|
||||
nextKey: Uint8Array;
|
||||
/**
|
||||
* total is total number of results available if PageRequest.count_total
|
||||
* was set, its value is undefined otherwise
|
||||
*/
|
||||
total: Long;
|
||||
}
|
||||
|
||||
function createBasePageRequest(): PageRequest {
|
||||
return {
|
||||
key: new Uint8Array(),
|
||||
offset: Long.UZERO,
|
||||
limit: Long.UZERO,
|
||||
countTotal: false,
|
||||
reverse: false,
|
||||
};
|
||||
}
|
||||
|
||||
export const PageRequest = {
|
||||
encode(
|
||||
message: PageRequest,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.key.length !== 0) {
|
||||
writer.uint32(10).bytes(message.key);
|
||||
}
|
||||
export class PageResponse extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
next_key?: Uint8Array;
|
||||
total?: number;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("next_key" in data && data.next_key != undefined) {
|
||||
this.next_key = data.next_key;
|
||||
}
|
||||
if ("total" in data && data.total != undefined) {
|
||||
this.total = data.total;
|
||||
}
|
||||
}
|
||||
}
|
||||
get next_key() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 1, new Uint8Array(0)) as Uint8Array;
|
||||
}
|
||||
set next_key(value: Uint8Array) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get total() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 2, 0) as number;
|
||||
}
|
||||
set total(value: number) {
|
||||
pb_1.Message.setField(this, 2, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
next_key?: Uint8Array;
|
||||
total?: number;
|
||||
}): PageResponse {
|
||||
const message = new PageResponse({});
|
||||
if (data.next_key != null) {
|
||||
message.next_key = data.next_key;
|
||||
}
|
||||
if (data.total != null) {
|
||||
message.total = data.total;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
next_key?: Uint8Array;
|
||||
total?: number;
|
||||
} = {};
|
||||
if (this.next_key != null) {
|
||||
data.next_key = this.next_key;
|
||||
}
|
||||
if (this.total != null) {
|
||||
data.total = this.total;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.next_key.length)
|
||||
writer.writeBytes(1, this.next_key);
|
||||
if (this.total != 0)
|
||||
writer.writeUint64(2, this.total);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): PageResponse {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new PageResponse();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.next_key = reader.readBytes();
|
||||
break;
|
||||
case 2:
|
||||
message.total = reader.readUint64();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): PageResponse {
|
||||
return PageResponse.deserialize(bytes);
|
||||
}
|
||||
if (!message.offset.isZero()) {
|
||||
writer.uint32(16).uint64(message.offset);
|
||||
}
|
||||
if (!message.limit.isZero()) {
|
||||
writer.uint32(24).uint64(message.limit);
|
||||
}
|
||||
if (message.countTotal === true) {
|
||||
writer.uint32(32).bool(message.countTotal);
|
||||
}
|
||||
if (message.reverse === true) {
|
||||
writer.uint32(40).bool(message.reverse);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): PageRequest {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBasePageRequest();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.key = reader.bytes();
|
||||
break;
|
||||
case 2:
|
||||
message.offset = reader.uint64() as Long;
|
||||
break;
|
||||
case 3:
|
||||
message.limit = reader.uint64() as Long;
|
||||
break;
|
||||
case 4:
|
||||
message.countTotal = reader.bool();
|
||||
break;
|
||||
case 5:
|
||||
message.reverse = reader.bool();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): PageRequest {
|
||||
return {
|
||||
key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(),
|
||||
offset: isSet(object.offset) ? Long.fromValue(object.offset) : Long.UZERO,
|
||||
limit: isSet(object.limit) ? Long.fromValue(object.limit) : Long.UZERO,
|
||||
countTotal: isSet(object.countTotal) ? Boolean(object.countTotal) : false,
|
||||
reverse: isSet(object.reverse) ? Boolean(object.reverse) : false,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: PageRequest): unknown {
|
||||
const obj: any = {};
|
||||
message.key !== undefined &&
|
||||
(obj.key = base64FromBytes(
|
||||
message.key !== undefined ? message.key : new Uint8Array()
|
||||
));
|
||||
message.offset !== undefined &&
|
||||
(obj.offset = (message.offset || Long.UZERO).toString());
|
||||
message.limit !== undefined &&
|
||||
(obj.limit = (message.limit || Long.UZERO).toString());
|
||||
message.countTotal !== undefined && (obj.countTotal = message.countTotal);
|
||||
message.reverse !== undefined && (obj.reverse = message.reverse);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<PageRequest>, I>>(
|
||||
object: I
|
||||
): PageRequest {
|
||||
const message = createBasePageRequest();
|
||||
message.key = object.key ?? new Uint8Array();
|
||||
message.offset =
|
||||
object.offset !== undefined && object.offset !== null
|
||||
? Long.fromValue(object.offset)
|
||||
: Long.UZERO;
|
||||
message.limit =
|
||||
object.limit !== undefined && object.limit !== null
|
||||
? Long.fromValue(object.limit)
|
||||
: Long.UZERO;
|
||||
message.countTotal = object.countTotal ?? false;
|
||||
message.reverse = object.reverse ?? false;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBasePageResponse(): PageResponse {
|
||||
return { nextKey: new Uint8Array(), total: Long.UZERO };
|
||||
}
|
||||
|
||||
export const PageResponse = {
|
||||
encode(
|
||||
message: PageResponse,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.nextKey.length !== 0) {
|
||||
writer.uint32(10).bytes(message.nextKey);
|
||||
}
|
||||
if (!message.total.isZero()) {
|
||||
writer.uint32(16).uint64(message.total);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): PageResponse {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBasePageResponse();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.nextKey = reader.bytes();
|
||||
break;
|
||||
case 2:
|
||||
message.total = reader.uint64() as Long;
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): PageResponse {
|
||||
return {
|
||||
nextKey: isSet(object.nextKey)
|
||||
? bytesFromBase64(object.nextKey)
|
||||
: new Uint8Array(),
|
||||
total: isSet(object.total) ? Long.fromValue(object.total) : Long.UZERO,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: PageResponse): unknown {
|
||||
const obj: any = {};
|
||||
message.nextKey !== undefined &&
|
||||
(obj.nextKey = base64FromBytes(
|
||||
message.nextKey !== undefined ? message.nextKey : new Uint8Array()
|
||||
));
|
||||
message.total !== undefined &&
|
||||
(obj.total = (message.total || Long.UZERO).toString());
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<PageResponse>, I>>(
|
||||
object: I
|
||||
): PageResponse {
|
||||
const message = createBasePageResponse();
|
||||
message.nextKey = object.nextKey ?? new Uint8Array();
|
||||
message.total =
|
||||
object.total !== undefined && object.total !== null
|
||||
? Long.fromValue(object.total)
|
||||
: Long.UZERO;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
declare var self: any | undefined;
|
||||
declare var window: any | undefined;
|
||||
declare var global: any | undefined;
|
||||
var globalThis: any = (() => {
|
||||
if (typeof globalThis !== "undefined") return globalThis;
|
||||
if (typeof self !== "undefined") return self;
|
||||
if (typeof window !== "undefined") return window;
|
||||
if (typeof global !== "undefined") return global;
|
||||
throw "Unable to locate global object";
|
||||
})();
|
||||
|
||||
function bytesFromBase64(b64: string): Uint8Array {
|
||||
if (globalThis.Buffer) {
|
||||
return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
|
||||
} else {
|
||||
const bin = globalThis.atob(b64);
|
||||
const arr = new Uint8Array(bin.length);
|
||||
for (let i = 0; i < bin.length; ++i) {
|
||||
arr[i] = bin.charCodeAt(i);
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
}
|
||||
|
||||
function base64FromBytes(arr: Uint8Array): string {
|
||||
if (globalThis.Buffer) {
|
||||
return globalThis.Buffer.from(arr).toString("base64");
|
||||
} else {
|
||||
const bin: string[] = [];
|
||||
arr.forEach((byte) => {
|
||||
bin.push(String.fromCharCode(byte));
|
||||
});
|
||||
return globalThis.btoa(bin.join(""));
|
||||
}
|
||||
}
|
||||
|
||||
type Builtin =
|
||||
| Date
|
||||
| Function
|
||||
| Uint8Array
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: T extends Long
|
||||
? string | number | Long
|
||||
: T extends Array<infer U>
|
||||
? Array<DeepPartial<U>>
|
||||
: T extends ReadonlyArray<infer U>
|
||||
? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {}
|
||||
? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||
export type Exact<P, I extends P> = P extends Builtin
|
||||
? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
||||
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
||||
};
|
||||
|
||||
if (_m0.util.Long !== Long) {
|
||||
_m0.util.Long = Long as any;
|
||||
_m0.configure();
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
||||
@@ -1,325 +1,303 @@
|
||||
// @ts-nocheck
|
||||
/* eslint-disable */
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "cosmos.base.v1beta1";
|
||||
|
||||
/**
|
||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||
* compiler version: 4.25.1
|
||||
* source: cosmos/base/v1beta1/coin.proto
|
||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||
import * as dependency_1 from "./../../../gogoproto/gogo";
|
||||
import * as pb_1 from "google-protobuf";
|
||||
export namespace cosmos.base.v1beta1 {
|
||||
export class Coin extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
denom?: string;
|
||||
amount?: string;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("denom" in data && data.denom != undefined) {
|
||||
this.denom = data.denom;
|
||||
}
|
||||
if ("amount" in data && data.amount != undefined) {
|
||||
this.amount = data.amount;
|
||||
}
|
||||
}
|
||||
}
|
||||
get denom() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
|
||||
}
|
||||
set denom(value: string) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get amount() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
|
||||
}
|
||||
set amount(value: string) {
|
||||
pb_1.Message.setField(this, 2, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
denom?: string;
|
||||
amount?: string;
|
||||
}): Coin {
|
||||
const message = new Coin({});
|
||||
if (data.denom != null) {
|
||||
message.denom = data.denom;
|
||||
}
|
||||
if (data.amount != null) {
|
||||
message.amount = data.amount;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
denom?: string;
|
||||
amount?: string;
|
||||
} = {};
|
||||
if (this.denom != null) {
|
||||
data.denom = this.denom;
|
||||
}
|
||||
if (this.amount != null) {
|
||||
data.amount = this.amount;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.denom.length)
|
||||
writer.writeString(1, this.denom);
|
||||
if (this.amount.length)
|
||||
writer.writeString(2, this.amount);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Coin {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Coin();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.denom = reader.readString();
|
||||
break;
|
||||
case 2:
|
||||
message.amount = reader.readString();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): Coin {
|
||||
return Coin.deserialize(bytes);
|
||||
}
|
||||
* Coin defines a token with a denomination and an amount.
|
||||
*
|
||||
* NOTE: The amount field is an Int which implements the custom method
|
||||
* signatures required by gogoproto.
|
||||
*/
|
||||
export interface Coin {
|
||||
denom: string;
|
||||
amount: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* DecCoin defines a token with a denomination and a decimal amount.
|
||||
*
|
||||
* NOTE: The amount field is an Dec which implements the custom method
|
||||
* signatures required by gogoproto.
|
||||
*/
|
||||
export interface DecCoin {
|
||||
denom: string;
|
||||
amount: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* IntProto defines a Protobuf wrapper around an Int object.
|
||||
* Deprecated: Prefer to use math.Int directly. It supports binary Marshal and Unmarshal.
|
||||
*/
|
||||
export interface IntProto {
|
||||
int: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* DecProto defines a Protobuf wrapper around a Dec object.
|
||||
* Deprecated: Prefer to use math.LegacyDec directly. It supports binary Marshal and Unmarshal.
|
||||
*/
|
||||
export interface DecProto {
|
||||
dec: string;
|
||||
}
|
||||
|
||||
function createBaseCoin(): Coin {
|
||||
return { denom: "", amount: "" };
|
||||
}
|
||||
|
||||
export const Coin = {
|
||||
encode(message: Coin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
if (message.denom !== "") {
|
||||
writer.uint32(10).string(message.denom);
|
||||
}
|
||||
export class DecCoin extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
denom?: string;
|
||||
amount?: string;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("denom" in data && data.denom != undefined) {
|
||||
this.denom = data.denom;
|
||||
}
|
||||
if ("amount" in data && data.amount != undefined) {
|
||||
this.amount = data.amount;
|
||||
}
|
||||
}
|
||||
}
|
||||
get denom() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
|
||||
}
|
||||
set denom(value: string) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get amount() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
|
||||
}
|
||||
set amount(value: string) {
|
||||
pb_1.Message.setField(this, 2, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
denom?: string;
|
||||
amount?: string;
|
||||
}): DecCoin {
|
||||
const message = new DecCoin({});
|
||||
if (data.denom != null) {
|
||||
message.denom = data.denom;
|
||||
}
|
||||
if (data.amount != null) {
|
||||
message.amount = data.amount;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
denom?: string;
|
||||
amount?: string;
|
||||
} = {};
|
||||
if (this.denom != null) {
|
||||
data.denom = this.denom;
|
||||
}
|
||||
if (this.amount != null) {
|
||||
data.amount = this.amount;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.denom.length)
|
||||
writer.writeString(1, this.denom);
|
||||
if (this.amount.length)
|
||||
writer.writeString(2, this.amount);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): DecCoin {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new DecCoin();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.denom = reader.readString();
|
||||
break;
|
||||
case 2:
|
||||
message.amount = reader.readString();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): DecCoin {
|
||||
return DecCoin.deserialize(bytes);
|
||||
}
|
||||
if (message.amount !== "") {
|
||||
writer.uint32(18).string(message.amount);
|
||||
}
|
||||
export class IntProto extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
int?: string;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("int" in data && data.int != undefined) {
|
||||
this.int = data.int;
|
||||
}
|
||||
}
|
||||
}
|
||||
get int() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
|
||||
}
|
||||
set int(value: string) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
int?: string;
|
||||
}): IntProto {
|
||||
const message = new IntProto({});
|
||||
if (data.int != null) {
|
||||
message.int = data.int;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
int?: string;
|
||||
} = {};
|
||||
if (this.int != null) {
|
||||
data.int = this.int;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.int.length)
|
||||
writer.writeString(1, this.int);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): IntProto {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new IntProto();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.int = reader.readString();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): IntProto {
|
||||
return IntProto.deserialize(bytes);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): Coin {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseCoin();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.denom = reader.string();
|
||||
break;
|
||||
case 2:
|
||||
message.amount = reader.string();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
export class DecProto extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
dec?: string;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("dec" in data && data.dec != undefined) {
|
||||
this.dec = data.dec;
|
||||
}
|
||||
}
|
||||
}
|
||||
get dec() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
|
||||
}
|
||||
set dec(value: string) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
dec?: string;
|
||||
}): DecProto {
|
||||
const message = new DecProto({});
|
||||
if (data.dec != null) {
|
||||
message.dec = data.dec;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
dec?: string;
|
||||
} = {};
|
||||
if (this.dec != null) {
|
||||
data.dec = this.dec;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.dec.length)
|
||||
writer.writeString(1, this.dec);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): DecProto {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new DecProto();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.dec = reader.readString();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): DecProto {
|
||||
return DecProto.deserialize(bytes);
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): Coin {
|
||||
return {
|
||||
denom: isSet(object.denom) ? String(object.denom) : "",
|
||||
amount: isSet(object.amount) ? String(object.amount) : "",
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: Coin): unknown {
|
||||
const obj: any = {};
|
||||
message.denom !== undefined && (obj.denom = message.denom);
|
||||
message.amount !== undefined && (obj.amount = message.amount);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<Coin>, I>>(object: I): Coin {
|
||||
const message = createBaseCoin();
|
||||
message.denom = object.denom ?? "";
|
||||
message.amount = object.amount ?? "";
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseDecCoin(): DecCoin {
|
||||
return { denom: "", amount: "" };
|
||||
}
|
||||
|
||||
export const DecCoin = {
|
||||
encode(
|
||||
message: DecCoin,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.denom !== "") {
|
||||
writer.uint32(10).string(message.denom);
|
||||
}
|
||||
if (message.amount !== "") {
|
||||
writer.uint32(18).string(message.amount);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): DecCoin {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseDecCoin();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.denom = reader.string();
|
||||
break;
|
||||
case 2:
|
||||
message.amount = reader.string();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): DecCoin {
|
||||
return {
|
||||
denom: isSet(object.denom) ? String(object.denom) : "",
|
||||
amount: isSet(object.amount) ? String(object.amount) : "",
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: DecCoin): unknown {
|
||||
const obj: any = {};
|
||||
message.denom !== undefined && (obj.denom = message.denom);
|
||||
message.amount !== undefined && (obj.amount = message.amount);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<DecCoin>, I>>(object: I): DecCoin {
|
||||
const message = createBaseDecCoin();
|
||||
message.denom = object.denom ?? "";
|
||||
message.amount = object.amount ?? "";
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseIntProto(): IntProto {
|
||||
return { int: "" };
|
||||
}
|
||||
|
||||
export const IntProto = {
|
||||
encode(
|
||||
message: IntProto,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.int !== "") {
|
||||
writer.uint32(10).string(message.int);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): IntProto {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseIntProto();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.int = reader.string();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): IntProto {
|
||||
return {
|
||||
int: isSet(object.int) ? String(object.int) : "",
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: IntProto): unknown {
|
||||
const obj: any = {};
|
||||
message.int !== undefined && (obj.int = message.int);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<IntProto>, I>>(object: I): IntProto {
|
||||
const message = createBaseIntProto();
|
||||
message.int = object.int ?? "";
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseDecProto(): DecProto {
|
||||
return { dec: "" };
|
||||
}
|
||||
|
||||
export const DecProto = {
|
||||
encode(
|
||||
message: DecProto,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.dec !== "") {
|
||||
writer.uint32(10).string(message.dec);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): DecProto {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseDecProto();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.dec = reader.string();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): DecProto {
|
||||
return {
|
||||
dec: isSet(object.dec) ? String(object.dec) : "",
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: DecProto): unknown {
|
||||
const obj: any = {};
|
||||
message.dec !== undefined && (obj.dec = message.dec);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<DecProto>, I>>(object: I): DecProto {
|
||||
const message = createBaseDecProto();
|
||||
message.dec = object.dec ?? "";
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
type Builtin =
|
||||
| Date
|
||||
| Function
|
||||
| Uint8Array
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: T extends Long
|
||||
? string | number | Long
|
||||
: T extends Array<infer U>
|
||||
? Array<DeepPartial<U>>
|
||||
: T extends ReadonlyArray<infer U>
|
||||
? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {}
|
||||
? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||
export type Exact<P, I extends P> = P extends Builtin
|
||||
? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
||||
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
||||
};
|
||||
|
||||
if (_m0.util.Long !== Long) {
|
||||
_m0.util.Long = Long as any;
|
||||
_m0.configure();
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
||||
File renamed without changes.
File renamed without changes.
@@ -1,9 +1,2 @@
|
||||
// @ts-nocheck
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||
* compiler version: 4.25.1
|
||||
* source: gogoproto/gogo.proto
|
||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||
import * as dependency_1 from "./../google/protobuf/descriptor";
|
||||
export namespace gogoproto { }
|
||||
export const protobufPackage = "gogoproto";
|
||||
@@ -1,10 +1,2 @@
|
||||
// @ts-nocheck
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||
* compiler version: 4.25.1
|
||||
* source: google/api/annotations.proto
|
||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||
import * as dependency_1 from "./http";
|
||||
import * as dependency_2 from "./../protobuf/descriptor";
|
||||
export namespace google.api { }
|
||||
export const protobufPackage = "google.api";
|
||||
+641
-526
File diff suppressed because it is too large.
Load diff
+4391
-4258
File diff suppressed because it is too large.
Load diff
@@ -1,100 +1,187 @@
|
||||
// @ts-nocheck
|
||||
/* eslint-disable */
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "google.protobuf";
|
||||
|
||||
/**
|
||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||
* compiler version: 4.25.1
|
||||
* source: google/protobuf/duration.proto
|
||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||
import * as pb_1 from "google-protobuf";
|
||||
export namespace google.protobuf {
|
||||
export class Duration extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
seconds?: number;
|
||||
nanos?: number;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("seconds" in data && data.seconds != undefined) {
|
||||
this.seconds = data.seconds;
|
||||
}
|
||||
if ("nanos" in data && data.nanos != undefined) {
|
||||
this.nanos = data.nanos;
|
||||
}
|
||||
}
|
||||
}
|
||||
get seconds() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
|
||||
}
|
||||
set seconds(value: number) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get nanos() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 2, 0) as number;
|
||||
}
|
||||
set nanos(value: number) {
|
||||
pb_1.Message.setField(this, 2, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
seconds?: number;
|
||||
nanos?: number;
|
||||
}): Duration {
|
||||
const message = new Duration({});
|
||||
if (data.seconds != null) {
|
||||
message.seconds = data.seconds;
|
||||
}
|
||||
if (data.nanos != null) {
|
||||
message.nanos = data.nanos;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
seconds?: number;
|
||||
nanos?: number;
|
||||
} = {};
|
||||
if (this.seconds != null) {
|
||||
data.seconds = this.seconds;
|
||||
}
|
||||
if (this.nanos != null) {
|
||||
data.nanos = this.nanos;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.seconds != 0)
|
||||
writer.writeInt64(1, this.seconds);
|
||||
if (this.nanos != 0)
|
||||
writer.writeInt32(2, this.nanos);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Duration {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Duration();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.seconds = reader.readInt64();
|
||||
break;
|
||||
case 2:
|
||||
message.nanos = reader.readInt32();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): Duration {
|
||||
return Duration.deserialize(bytes);
|
||||
}
|
||||
* 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".
|
||||
*/
|
||||
export interface 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
|
||||
*/
|
||||
seconds: Long;
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
nanos: number;
|
||||
}
|
||||
|
||||
function createBaseDuration(): Duration {
|
||||
return { seconds: Long.ZERO, nanos: 0 };
|
||||
}
|
||||
|
||||
export const Duration = {
|
||||
encode(
|
||||
message: Duration,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (!message.seconds.isZero()) {
|
||||
writer.uint32(8).int64(message.seconds);
|
||||
}
|
||||
if (message.nanos !== 0) {
|
||||
writer.uint32(16).int32(message.nanos);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): Duration {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseDuration();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.seconds = reader.int64() as Long;
|
||||
break;
|
||||
case 2:
|
||||
message.nanos = reader.int32();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): Duration {
|
||||
return {
|
||||
seconds: isSet(object.seconds)
|
||||
? Long.fromValue(object.seconds)
|
||||
: Long.ZERO,
|
||||
nanos: isSet(object.nanos) ? Number(object.nanos) : 0,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: Duration): unknown {
|
||||
const obj: any = {};
|
||||
message.seconds !== undefined &&
|
||||
(obj.seconds = (message.seconds || Long.ZERO).toString());
|
||||
message.nanos !== undefined && (obj.nanos = Math.round(message.nanos));
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<Duration>, I>>(object: I): Duration {
|
||||
const message = createBaseDuration();
|
||||
message.seconds =
|
||||
object.seconds !== undefined && object.seconds !== null
|
||||
? Long.fromValue(object.seconds)
|
||||
: Long.ZERO;
|
||||
message.nanos = object.nanos ?? 0;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
type Builtin =
|
||||
| Date
|
||||
| Function
|
||||
| Uint8Array
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: T extends Long
|
||||
? string | number | Long
|
||||
: T extends Array<infer U>
|
||||
? Array<DeepPartial<U>>
|
||||
: T extends ReadonlyArray<infer U>
|
||||
? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {}
|
||||
? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||
export type Exact<P, I extends P> = P extends Builtin
|
||||
? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
||||
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
||||
};
|
||||
|
||||
if (_m0.util.Long !== Long) {
|
||||
_m0.util.Long = Long as any;
|
||||
_m0.configure();
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
||||
@@ -1,100 +1,220 @@
|
||||
// @ts-nocheck
|
||||
/* eslint-disable */
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "google.protobuf";
|
||||
|
||||
/**
|
||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||
* compiler version: 4.25.1
|
||||
* source: google/protobuf/timestamp.proto
|
||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||
import * as pb_1 from "google-protobuf";
|
||||
export namespace google.protobuf {
|
||||
export class Timestamp extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
seconds?: number;
|
||||
nanos?: number;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("seconds" in data && data.seconds != undefined) {
|
||||
this.seconds = data.seconds;
|
||||
}
|
||||
if ("nanos" in data && data.nanos != undefined) {
|
||||
this.nanos = data.nanos;
|
||||
}
|
||||
}
|
||||
}
|
||||
get seconds() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
|
||||
}
|
||||
set seconds(value: number) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get nanos() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 2, 0) as number;
|
||||
}
|
||||
set nanos(value: number) {
|
||||
pb_1.Message.setField(this, 2, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
seconds?: number;
|
||||
nanos?: number;
|
||||
}): Timestamp {
|
||||
const message = new Timestamp({});
|
||||
if (data.seconds != null) {
|
||||
message.seconds = data.seconds;
|
||||
}
|
||||
if (data.nanos != null) {
|
||||
message.nanos = data.nanos;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
seconds?: number;
|
||||
nanos?: number;
|
||||
} = {};
|
||||
if (this.seconds != null) {
|
||||
data.seconds = this.seconds;
|
||||
}
|
||||
if (this.nanos != null) {
|
||||
data.nanos = this.nanos;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.seconds != 0)
|
||||
writer.writeInt64(1, this.seconds);
|
||||
if (this.nanos != 0)
|
||||
writer.writeInt32(2, this.nanos);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Timestamp {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Timestamp();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.seconds = reader.readInt64();
|
||||
break;
|
||||
case 2:
|
||||
message.nanos = reader.readInt32();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): Timestamp {
|
||||
return Timestamp.deserialize(bytes);
|
||||
}
|
||||
* 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://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
|
||||
* ) to obtain a formatter capable of generating timestamps in this format.
|
||||
*/
|
||||
export interface 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.
|
||||
*/
|
||||
seconds: Long;
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
nanos: number;
|
||||
}
|
||||
|
||||
function createBaseTimestamp(): Timestamp {
|
||||
return { seconds: Long.ZERO, nanos: 0 };
|
||||
}
|
||||
|
||||
export const Timestamp = {
|
||||
encode(
|
||||
message: Timestamp,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (!message.seconds.isZero()) {
|
||||
writer.uint32(8).int64(message.seconds);
|
||||
}
|
||||
if (message.nanos !== 0) {
|
||||
writer.uint32(16).int32(message.nanos);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): Timestamp {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseTimestamp();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.seconds = reader.int64() as Long;
|
||||
break;
|
||||
case 2:
|
||||
message.nanos = reader.int32();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): Timestamp {
|
||||
return {
|
||||
seconds: isSet(object.seconds)
|
||||
? Long.fromValue(object.seconds)
|
||||
: Long.ZERO,
|
||||
nanos: isSet(object.nanos) ? Number(object.nanos) : 0,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: Timestamp): unknown {
|
||||
const obj: any = {};
|
||||
message.seconds !== undefined &&
|
||||
(obj.seconds = (message.seconds || Long.ZERO).toString());
|
||||
message.nanos !== undefined && (obj.nanos = Math.round(message.nanos));
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<Timestamp>, I>>(
|
||||
object: I
|
||||
): Timestamp {
|
||||
const message = createBaseTimestamp();
|
||||
message.seconds =
|
||||
object.seconds !== undefined && object.seconds !== null
|
||||
? Long.fromValue(object.seconds)
|
||||
: Long.ZERO;
|
||||
message.nanos = object.nanos ?? 0;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
type Builtin =
|
||||
| Date
|
||||
| Function
|
||||
| Uint8Array
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: T extends Long
|
||||
? string | number | Long
|
||||
: T extends Array<infer U>
|
||||
? Array<DeepPartial<U>>
|
||||
: T extends ReadonlyArray<infer U>
|
||||
? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {}
|
||||
? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||
export type Exact<P, I extends P> = P extends Builtin
|
||||
? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
||||
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
||||
};
|
||||
|
||||
if (_m0.util.Long !== Long) {
|
||||
_m0.util.Long = Long as any;
|
||||
_m0.configure();
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
||||
@@ -1,105 +0,0 @@
|
||||
// @ts-nocheck
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||
* compiler version: 4.25.1
|
||||
* source: vulcanize/auction/v1beta1/genesis.proto
|
||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||
import * as dependency_1 from "./../../../gogoproto/gogo";
|
||||
import * as dependency_2 from "./types";
|
||||
import * as pb_1 from "google-protobuf";
|
||||
export namespace vulcanize.auction.v1beta1 {
|
||||
export class GenesisState extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
params?: dependency_2.vulcanize.auction.v1beta1.Params;
|
||||
auctions?: dependency_2.vulcanize.auction.v1beta1.Auction[];
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("params" in data && data.params != undefined) {
|
||||
this.params = data.params;
|
||||
}
|
||||
if ("auctions" in data && data.auctions != undefined) {
|
||||
this.auctions = data.auctions;
|
||||
}
|
||||
}
|
||||
}
|
||||
get params() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_2.vulcanize.auction.v1beta1.Params, 1) as dependency_2.vulcanize.auction.v1beta1.Params;
|
||||
}
|
||||
set params(value: dependency_2.vulcanize.auction.v1beta1.Params) {
|
||||
pb_1.Message.setWrapperField(this, 1, value);
|
||||
}
|
||||
get has_params() {
|
||||
return pb_1.Message.getField(this, 1) != null;
|
||||
}
|
||||
get auctions() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, dependency_2.vulcanize.auction.v1beta1.Auction, 2) as dependency_2.vulcanize.auction.v1beta1.Auction[];
|
||||
}
|
||||
set auctions(value: dependency_2.vulcanize.auction.v1beta1.Auction[]) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 2, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
params?: ReturnType<typeof dependency_2.vulcanize.auction.v1beta1.Params.prototype.toObject>;
|
||||
auctions?: ReturnType<typeof dependency_2.vulcanize.auction.v1beta1.Auction.prototype.toObject>[];
|
||||
}): GenesisState {
|
||||
const message = new GenesisState({});
|
||||
if (data.params != null) {
|
||||
message.params = dependency_2.vulcanize.auction.v1beta1.Params.fromObject(data.params);
|
||||
}
|
||||
if (data.auctions != null) {
|
||||
message.auctions = data.auctions.map(item => dependency_2.vulcanize.auction.v1beta1.Auction.fromObject(item));
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
params?: ReturnType<typeof dependency_2.vulcanize.auction.v1beta1.Params.prototype.toObject>;
|
||||
auctions?: ReturnType<typeof dependency_2.vulcanize.auction.v1beta1.Auction.prototype.toObject>[];
|
||||
} = {};
|
||||
if (this.params != null) {
|
||||
data.params = this.params.toObject();
|
||||
}
|
||||
if (this.auctions != null) {
|
||||
data.auctions = this.auctions.map((item: dependency_2.vulcanize.auction.v1beta1.Auction) => item.toObject());
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.has_params)
|
||||
writer.writeMessage(1, this.params, () => this.params.serialize(writer));
|
||||
if (this.auctions.length)
|
||||
writer.writeRepeatedMessage(2, this.auctions, (item: dependency_2.vulcanize.auction.v1beta1.Auction) => item.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GenesisState {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GenesisState();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
reader.readMessage(message.params, () => message.params = dependency_2.vulcanize.auction.v1beta1.Params.deserialize(reader));
|
||||
break;
|
||||
case 2:
|
||||
reader.readMessage(message.auctions, () => pb_1.Message.addToRepeatedWrapperField(message, 2, dependency_2.vulcanize.auction.v1beta1.Auction.deserialize(reader), dependency_2.vulcanize.auction.v1beta1.Auction));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): GenesisState {
|
||||
return GenesisState.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,647 +0,0 @@
|
||||
// @ts-nocheck
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||
* compiler version: 4.25.1
|
||||
* source: vulcanize/auction/v1beta1/tx.proto
|
||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||
import * as dependency_1 from "./../../../gogoproto/gogo";
|
||||
import * as dependency_2 from "./../../../google/protobuf/duration";
|
||||
import * as dependency_3 from "./../../../cosmos/base/v1beta1/coin";
|
||||
import * as dependency_4 from "./types";
|
||||
import * as pb_1 from "google-protobuf";
|
||||
export namespace vulcanize.auction.v1beta1 {
|
||||
export class MsgCreateAuction extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
commits_duration?: dependency_2.google.protobuf.Duration;
|
||||
reveals_duration?: dependency_2.google.protobuf.Duration;
|
||||
commit_fee?: dependency_3.cosmos.base.v1beta1.Coin;
|
||||
reveal_fee?: dependency_3.cosmos.base.v1beta1.Coin;
|
||||
minimum_bid?: dependency_3.cosmos.base.v1beta1.Coin;
|
||||
signer?: string;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("commits_duration" in data && data.commits_duration != undefined) {
|
||||
this.commits_duration = data.commits_duration;
|
||||
}
|
||||
if ("reveals_duration" in data && data.reveals_duration != undefined) {
|
||||
this.reveals_duration = data.reveals_duration;
|
||||
}
|
||||
if ("commit_fee" in data && data.commit_fee != undefined) {
|
||||
this.commit_fee = data.commit_fee;
|
||||
}
|
||||
if ("reveal_fee" in data && data.reveal_fee != undefined) {
|
||||
this.reveal_fee = data.reveal_fee;
|
||||
}
|
||||
if ("minimum_bid" in data && data.minimum_bid != undefined) {
|
||||
this.minimum_bid = data.minimum_bid;
|
||||
}
|
||||
if ("signer" in data && data.signer != undefined) {
|
||||
this.signer = data.signer;
|
||||
}
|
||||
}
|
||||
}
|
||||
get commits_duration() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_2.google.protobuf.Duration, 1) as dependency_2.google.protobuf.Duration;
|
||||
}
|
||||
set commits_duration(value: dependency_2.google.protobuf.Duration) {
|
||||
pb_1.Message.setWrapperField(this, 1, value);
|
||||
}
|
||||
get has_commits_duration() {
|
||||
return pb_1.Message.getField(this, 1) != null;
|
||||
}
|
||||
get reveals_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) {
|
||||
pb_1.Message.setWrapperField(this, 2, value);
|
||||
}
|
||||
get has_reveals_duration() {
|
||||
return pb_1.Message.getField(this, 2) != null;
|
||||
}
|
||||
get commit_fee() {
|
||||
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) {
|
||||
pb_1.Message.setWrapperField(this, 3, value);
|
||||
}
|
||||
get has_commit_fee() {
|
||||
return pb_1.Message.getField(this, 3) != null;
|
||||
}
|
||||
get reveal_fee() {
|
||||
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) {
|
||||
pb_1.Message.setWrapperField(this, 4, value);
|
||||
}
|
||||
get has_reveal_fee() {
|
||||
return pb_1.Message.getField(this, 4) != null;
|
||||
}
|
||||
get minimum_bid() {
|
||||
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) {
|
||||
pb_1.Message.setWrapperField(this, 5, value);
|
||||
}
|
||||
get has_minimum_bid() {
|
||||
return pb_1.Message.getField(this, 5) != null;
|
||||
}
|
||||
get signer() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 6, "") as string;
|
||||
}
|
||||
set signer(value: string) {
|
||||
pb_1.Message.setField(this, 6, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
commits_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_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>;
|
||||
signer?: string;
|
||||
}): MsgCreateAuction {
|
||||
const message = new MsgCreateAuction({});
|
||||
if (data.commits_duration != null) {
|
||||
message.commits_duration = dependency_2.google.protobuf.Duration.fromObject(data.commits_duration);
|
||||
}
|
||||
if (data.reveals_duration != null) {
|
||||
message.reveals_duration = dependency_2.google.protobuf.Duration.fromObject(data.reveals_duration);
|
||||
}
|
||||
if (data.commit_fee != null) {
|
||||
message.commit_fee = dependency_3.cosmos.base.v1beta1.Coin.fromObject(data.commit_fee);
|
||||
}
|
||||
if (data.reveal_fee != null) {
|
||||
message.reveal_fee = dependency_3.cosmos.base.v1beta1.Coin.fromObject(data.reveal_fee);
|
||||
}
|
||||
if (data.minimum_bid != null) {
|
||||
message.minimum_bid = dependency_3.cosmos.base.v1beta1.Coin.fromObject(data.minimum_bid);
|
||||
}
|
||||
if (data.signer != null) {
|
||||
message.signer = data.signer;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
commits_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_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>;
|
||||
signer?: string;
|
||||
} = {};
|
||||
if (this.commits_duration != null) {
|
||||
data.commits_duration = this.commits_duration.toObject();
|
||||
}
|
||||
if (this.reveals_duration != null) {
|
||||
data.reveals_duration = this.reveals_duration.toObject();
|
||||
}
|
||||
if (this.commit_fee != null) {
|
||||
data.commit_fee = this.commit_fee.toObject();
|
||||
}
|
||||
if (this.reveal_fee != null) {
|
||||
data.reveal_fee = this.reveal_fee.toObject();
|
||||
}
|
||||
if (this.minimum_bid != null) {
|
||||
data.minimum_bid = this.minimum_bid.toObject();
|
||||
}
|
||||
if (this.signer != null) {
|
||||
data.signer = this.signer;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.has_commits_duration)
|
||||
writer.writeMessage(1, this.commits_duration, () => this.commits_duration.serialize(writer));
|
||||
if (this.has_reveals_duration)
|
||||
writer.writeMessage(2, this.reveals_duration, () => this.reveals_duration.serialize(writer));
|
||||
if (this.has_commit_fee)
|
||||
writer.writeMessage(3, this.commit_fee, () => this.commit_fee.serialize(writer));
|
||||
if (this.has_reveal_fee)
|
||||
writer.writeMessage(4, this.reveal_fee, () => this.reveal_fee.serialize(writer));
|
||||
if (this.has_minimum_bid)
|
||||
writer.writeMessage(5, this.minimum_bid, () => this.minimum_bid.serialize(writer));
|
||||
if (this.signer.length)
|
||||
writer.writeString(6, this.signer);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgCreateAuction {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgCreateAuction();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
reader.readMessage(message.commits_duration, () => message.commits_duration = dependency_2.google.protobuf.Duration.deserialize(reader));
|
||||
break;
|
||||
case 2:
|
||||
reader.readMessage(message.reveals_duration, () => message.reveals_duration = dependency_2.google.protobuf.Duration.deserialize(reader));
|
||||
break;
|
||||
case 3:
|
||||
reader.readMessage(message.commit_fee, () => message.commit_fee = dependency_3.cosmos.base.v1beta1.Coin.deserialize(reader));
|
||||
break;
|
||||
case 4:
|
||||
reader.readMessage(message.reveal_fee, () => message.reveal_fee = dependency_3.cosmos.base.v1beta1.Coin.deserialize(reader));
|
||||
break;
|
||||
case 5:
|
||||
reader.readMessage(message.minimum_bid, () => message.minimum_bid = dependency_3.cosmos.base.v1beta1.Coin.deserialize(reader));
|
||||
break;
|
||||
case 6:
|
||||
message.signer = reader.readString();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): MsgCreateAuction {
|
||||
return MsgCreateAuction.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
export class MsgCreateAuctionResponse extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
auction?: dependency_4.vulcanize.auction.v1beta1.Auction;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("auction" in data && data.auction != undefined) {
|
||||
this.auction = data.auction;
|
||||
}
|
||||
}
|
||||
}
|
||||
get auction() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_4.vulcanize.auction.v1beta1.Auction, 1) as dependency_4.vulcanize.auction.v1beta1.Auction;
|
||||
}
|
||||
set auction(value: dependency_4.vulcanize.auction.v1beta1.Auction) {
|
||||
pb_1.Message.setWrapperField(this, 1, value);
|
||||
}
|
||||
get has_auction() {
|
||||
return pb_1.Message.getField(this, 1) != null;
|
||||
}
|
||||
static fromObject(data: {
|
||||
auction?: ReturnType<typeof dependency_4.vulcanize.auction.v1beta1.Auction.prototype.toObject>;
|
||||
}): MsgCreateAuctionResponse {
|
||||
const message = new MsgCreateAuctionResponse({});
|
||||
if (data.auction != null) {
|
||||
message.auction = dependency_4.vulcanize.auction.v1beta1.Auction.fromObject(data.auction);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
auction?: ReturnType<typeof dependency_4.vulcanize.auction.v1beta1.Auction.prototype.toObject>;
|
||||
} = {};
|
||||
if (this.auction != null) {
|
||||
data.auction = this.auction.toObject();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.has_auction)
|
||||
writer.writeMessage(1, this.auction, () => this.auction.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgCreateAuctionResponse {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgCreateAuctionResponse();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
reader.readMessage(message.auction, () => message.auction = dependency_4.vulcanize.auction.v1beta1.Auction.deserialize(reader));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): MsgCreateAuctionResponse {
|
||||
return MsgCreateAuctionResponse.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
export class MsgCommitBid extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
auction_id?: string;
|
||||
commit_hash?: string;
|
||||
signer?: string;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("auction_id" in data && data.auction_id != undefined) {
|
||||
this.auction_id = data.auction_id;
|
||||
}
|
||||
if ("commit_hash" in data && data.commit_hash != undefined) {
|
||||
this.commit_hash = data.commit_hash;
|
||||
}
|
||||
if ("signer" in data && data.signer != undefined) {
|
||||
this.signer = data.signer;
|
||||
}
|
||||
}
|
||||
}
|
||||
get auction_id() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
|
||||
}
|
||||
set auction_id(value: string) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get commit_hash() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
|
||||
}
|
||||
set commit_hash(value: string) {
|
||||
pb_1.Message.setField(this, 2, value);
|
||||
}
|
||||
get signer() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 3, "") as string;
|
||||
}
|
||||
set signer(value: string) {
|
||||
pb_1.Message.setField(this, 3, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
auction_id?: string;
|
||||
commit_hash?: string;
|
||||
signer?: string;
|
||||
}): MsgCommitBid {
|
||||
const message = new MsgCommitBid({});
|
||||
if (data.auction_id != null) {
|
||||
message.auction_id = data.auction_id;
|
||||
}
|
||||
if (data.commit_hash != null) {
|
||||
message.commit_hash = data.commit_hash;
|
||||
}
|
||||
if (data.signer != null) {
|
||||
message.signer = data.signer;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
auction_id?: string;
|
||||
commit_hash?: string;
|
||||
signer?: string;
|
||||
} = {};
|
||||
if (this.auction_id != null) {
|
||||
data.auction_id = this.auction_id;
|
||||
}
|
||||
if (this.commit_hash != null) {
|
||||
data.commit_hash = this.commit_hash;
|
||||
}
|
||||
if (this.signer != null) {
|
||||
data.signer = this.signer;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.auction_id.length)
|
||||
writer.writeString(1, this.auction_id);
|
||||
if (this.commit_hash.length)
|
||||
writer.writeString(2, this.commit_hash);
|
||||
if (this.signer.length)
|
||||
writer.writeString(3, this.signer);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgCommitBid {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgCommitBid();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.auction_id = reader.readString();
|
||||
break;
|
||||
case 2:
|
||||
message.commit_hash = reader.readString();
|
||||
break;
|
||||
case 3:
|
||||
message.signer = reader.readString();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): MsgCommitBid {
|
||||
return MsgCommitBid.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
export class MsgRevealBid extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
auction_id?: string;
|
||||
reveal?: string;
|
||||
signer?: string;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("auction_id" in data && data.auction_id != undefined) {
|
||||
this.auction_id = data.auction_id;
|
||||
}
|
||||
if ("reveal" in data && data.reveal != undefined) {
|
||||
this.reveal = data.reveal;
|
||||
}
|
||||
if ("signer" in data && data.signer != undefined) {
|
||||
this.signer = data.signer;
|
||||
}
|
||||
}
|
||||
}
|
||||
get auction_id() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
|
||||
}
|
||||
set auction_id(value: string) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get reveal() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
|
||||
}
|
||||
set reveal(value: string) {
|
||||
pb_1.Message.setField(this, 2, value);
|
||||
}
|
||||
get signer() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 3, "") as string;
|
||||
}
|
||||
set signer(value: string) {
|
||||
pb_1.Message.setField(this, 3, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
auction_id?: string;
|
||||
reveal?: string;
|
||||
signer?: string;
|
||||
}): MsgRevealBid {
|
||||
const message = new MsgRevealBid({});
|
||||
if (data.auction_id != null) {
|
||||
message.auction_id = data.auction_id;
|
||||
}
|
||||
if (data.reveal != null) {
|
||||
message.reveal = data.reveal;
|
||||
}
|
||||
if (data.signer != null) {
|
||||
message.signer = data.signer;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
auction_id?: string;
|
||||
reveal?: string;
|
||||
signer?: string;
|
||||
} = {};
|
||||
if (this.auction_id != null) {
|
||||
data.auction_id = this.auction_id;
|
||||
}
|
||||
if (this.reveal != null) {
|
||||
data.reveal = this.reveal;
|
||||
}
|
||||
if (this.signer != null) {
|
||||
data.signer = this.signer;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.auction_id.length)
|
||||
writer.writeString(1, this.auction_id);
|
||||
if (this.reveal.length)
|
||||
writer.writeString(2, this.reveal);
|
||||
if (this.signer.length)
|
||||
writer.writeString(3, this.signer);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgRevealBid {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgRevealBid();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.auction_id = reader.readString();
|
||||
break;
|
||||
case 2:
|
||||
message.reveal = reader.readString();
|
||||
break;
|
||||
case 3:
|
||||
message.signer = reader.readString();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): MsgRevealBid {
|
||||
return MsgRevealBid.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
export class MsgCommitBidResponse extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
bid?: dependency_4.vulcanize.auction.v1beta1.Bid;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("bid" in data && data.bid != undefined) {
|
||||
this.bid = data.bid;
|
||||
}
|
||||
}
|
||||
}
|
||||
get bid() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_4.vulcanize.auction.v1beta1.Bid, 1) as dependency_4.vulcanize.auction.v1beta1.Bid;
|
||||
}
|
||||
set bid(value: dependency_4.vulcanize.auction.v1beta1.Bid) {
|
||||
pb_1.Message.setWrapperField(this, 1, value);
|
||||
}
|
||||
get has_bid() {
|
||||
return pb_1.Message.getField(this, 1) != null;
|
||||
}
|
||||
static fromObject(data: {
|
||||
bid?: ReturnType<typeof dependency_4.vulcanize.auction.v1beta1.Bid.prototype.toObject>;
|
||||
}): MsgCommitBidResponse {
|
||||
const message = new MsgCommitBidResponse({});
|
||||
if (data.bid != null) {
|
||||
message.bid = dependency_4.vulcanize.auction.v1beta1.Bid.fromObject(data.bid);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
bid?: ReturnType<typeof dependency_4.vulcanize.auction.v1beta1.Bid.prototype.toObject>;
|
||||
} = {};
|
||||
if (this.bid != null) {
|
||||
data.bid = this.bid.toObject();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.has_bid)
|
||||
writer.writeMessage(1, this.bid, () => this.bid.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgCommitBidResponse {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgCommitBidResponse();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
reader.readMessage(message.bid, () => message.bid = dependency_4.vulcanize.auction.v1beta1.Bid.deserialize(reader));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): MsgCommitBidResponse {
|
||||
return MsgCommitBidResponse.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
export class MsgRevealBidResponse extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
auction?: dependency_4.vulcanize.auction.v1beta1.Auction;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("auction" in data && data.auction != undefined) {
|
||||
this.auction = data.auction;
|
||||
}
|
||||
}
|
||||
}
|
||||
get auction() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_4.vulcanize.auction.v1beta1.Auction, 1) as dependency_4.vulcanize.auction.v1beta1.Auction;
|
||||
}
|
||||
set auction(value: dependency_4.vulcanize.auction.v1beta1.Auction) {
|
||||
pb_1.Message.setWrapperField(this, 1, value);
|
||||
}
|
||||
get has_auction() {
|
||||
return pb_1.Message.getField(this, 1) != null;
|
||||
}
|
||||
static fromObject(data: {
|
||||
auction?: ReturnType<typeof dependency_4.vulcanize.auction.v1beta1.Auction.prototype.toObject>;
|
||||
}): MsgRevealBidResponse {
|
||||
const message = new MsgRevealBidResponse({});
|
||||
if (data.auction != null) {
|
||||
message.auction = dependency_4.vulcanize.auction.v1beta1.Auction.fromObject(data.auction);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
auction?: ReturnType<typeof dependency_4.vulcanize.auction.v1beta1.Auction.prototype.toObject>;
|
||||
} = {};
|
||||
if (this.auction != null) {
|
||||
data.auction = this.auction.toObject();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.has_auction)
|
||||
writer.writeMessage(1, this.auction, () => this.auction.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgRevealBidResponse {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgRevealBidResponse();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
reader.readMessage(message.auction, () => message.auction = dependency_4.vulcanize.auction.v1beta1.Auction.deserialize(reader));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): MsgRevealBidResponse {
|
||||
return MsgRevealBidResponse.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,865 +0,0 @@
|
||||
// @ts-nocheck
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||
* compiler version: 4.25.1
|
||||
* source: vulcanize/auction/v1beta1/types.proto
|
||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||
import * as dependency_1 from "./../../../gogoproto/gogo";
|
||||
import * as dependency_2 from "./../../../google/protobuf/duration";
|
||||
import * as dependency_3 from "./../../../google/protobuf/timestamp";
|
||||
import * as dependency_4 from "./../../../cosmos/base/v1beta1/coin";
|
||||
import * as pb_1 from "google-protobuf";
|
||||
export namespace vulcanize.auction.v1beta1 {
|
||||
export class Params extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
commits_duration?: dependency_2.google.protobuf.Duration;
|
||||
reveals_duration?: dependency_2.google.protobuf.Duration;
|
||||
commit_fee?: dependency_4.cosmos.base.v1beta1.Coin;
|
||||
reveal_fee?: dependency_4.cosmos.base.v1beta1.Coin;
|
||||
minimum_bid?: dependency_4.cosmos.base.v1beta1.Coin;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("commits_duration" in data && data.commits_duration != undefined) {
|
||||
this.commits_duration = data.commits_duration;
|
||||
}
|
||||
if ("reveals_duration" in data && data.reveals_duration != undefined) {
|
||||
this.reveals_duration = data.reveals_duration;
|
||||
}
|
||||
if ("commit_fee" in data && data.commit_fee != undefined) {
|
||||
this.commit_fee = data.commit_fee;
|
||||
}
|
||||
if ("reveal_fee" in data && data.reveal_fee != undefined) {
|
||||
this.reveal_fee = data.reveal_fee;
|
||||
}
|
||||
if ("minimum_bid" in data && data.minimum_bid != undefined) {
|
||||
this.minimum_bid = data.minimum_bid;
|
||||
}
|
||||
}
|
||||
}
|
||||
get commits_duration() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_2.google.protobuf.Duration, 1) as dependency_2.google.protobuf.Duration;
|
||||
}
|
||||
set commits_duration(value: dependency_2.google.protobuf.Duration) {
|
||||
pb_1.Message.setWrapperField(this, 1, value);
|
||||
}
|
||||
get has_commits_duration() {
|
||||
return pb_1.Message.getField(this, 1) != null;
|
||||
}
|
||||
get reveals_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) {
|
||||
pb_1.Message.setWrapperField(this, 2, value);
|
||||
}
|
||||
get has_reveals_duration() {
|
||||
return pb_1.Message.getField(this, 2) != null;
|
||||
}
|
||||
get commit_fee() {
|
||||
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) {
|
||||
pb_1.Message.setWrapperField(this, 3, value);
|
||||
}
|
||||
get has_commit_fee() {
|
||||
return pb_1.Message.getField(this, 3) != null;
|
||||
}
|
||||
get reveal_fee() {
|
||||
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) {
|
||||
pb_1.Message.setWrapperField(this, 4, value);
|
||||
}
|
||||
get has_reveal_fee() {
|
||||
return pb_1.Message.getField(this, 4) != null;
|
||||
}
|
||||
get minimum_bid() {
|
||||
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) {
|
||||
pb_1.Message.setWrapperField(this, 5, value);
|
||||
}
|
||||
get has_minimum_bid() {
|
||||
return pb_1.Message.getField(this, 5) != null;
|
||||
}
|
||||
static fromObject(data: {
|
||||
commits_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>;
|
||||
reveal_fee?: 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({});
|
||||
if (data.commits_duration != null) {
|
||||
message.commits_duration = dependency_2.google.protobuf.Duration.fromObject(data.commits_duration);
|
||||
}
|
||||
if (data.reveals_duration != null) {
|
||||
message.reveals_duration = dependency_2.google.protobuf.Duration.fromObject(data.reveals_duration);
|
||||
}
|
||||
if (data.commit_fee != null) {
|
||||
message.commit_fee = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.commit_fee);
|
||||
}
|
||||
if (data.reveal_fee != null) {
|
||||
message.reveal_fee = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.reveal_fee);
|
||||
}
|
||||
if (data.minimum_bid != null) {
|
||||
message.minimum_bid = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.minimum_bid);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
commits_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>;
|
||||
reveal_fee?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>;
|
||||
minimum_bid?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>;
|
||||
} = {};
|
||||
if (this.commits_duration != null) {
|
||||
data.commits_duration = this.commits_duration.toObject();
|
||||
}
|
||||
if (this.reveals_duration != null) {
|
||||
data.reveals_duration = this.reveals_duration.toObject();
|
||||
}
|
||||
if (this.commit_fee != null) {
|
||||
data.commit_fee = this.commit_fee.toObject();
|
||||
}
|
||||
if (this.reveal_fee != null) {
|
||||
data.reveal_fee = this.reveal_fee.toObject();
|
||||
}
|
||||
if (this.minimum_bid != null) {
|
||||
data.minimum_bid = this.minimum_bid.toObject();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.has_commits_duration)
|
||||
writer.writeMessage(1, this.commits_duration, () => this.commits_duration.serialize(writer));
|
||||
if (this.has_reveals_duration)
|
||||
writer.writeMessage(2, this.reveals_duration, () => this.reveals_duration.serialize(writer));
|
||||
if (this.has_commit_fee)
|
||||
writer.writeMessage(3, this.commit_fee, () => this.commit_fee.serialize(writer));
|
||||
if (this.has_reveal_fee)
|
||||
writer.writeMessage(4, this.reveal_fee, () => this.reveal_fee.serialize(writer));
|
||||
if (this.has_minimum_bid)
|
||||
writer.writeMessage(5, this.minimum_bid, () => this.minimum_bid.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Params {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Params();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
reader.readMessage(message.commits_duration, () => message.commits_duration = dependency_2.google.protobuf.Duration.deserialize(reader));
|
||||
break;
|
||||
case 2:
|
||||
reader.readMessage(message.reveals_duration, () => message.reveals_duration = dependency_2.google.protobuf.Duration.deserialize(reader));
|
||||
break;
|
||||
case 3:
|
||||
reader.readMessage(message.commit_fee, () => message.commit_fee = dependency_4.cosmos.base.v1beta1.Coin.deserialize(reader));
|
||||
break;
|
||||
case 4:
|
||||
reader.readMessage(message.reveal_fee, () => message.reveal_fee = dependency_4.cosmos.base.v1beta1.Coin.deserialize(reader));
|
||||
break;
|
||||
case 5:
|
||||
reader.readMessage(message.minimum_bid, () => message.minimum_bid = dependency_4.cosmos.base.v1beta1.Coin.deserialize(reader));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): Params {
|
||||
return Params.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
export class Auction extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
id?: string;
|
||||
status?: string;
|
||||
owner_address?: string;
|
||||
create_time?: dependency_3.google.protobuf.Timestamp;
|
||||
commits_end_time?: dependency_3.google.protobuf.Timestamp;
|
||||
reveals_end_time?: dependency_3.google.protobuf.Timestamp;
|
||||
commit_fee?: dependency_4.cosmos.base.v1beta1.Coin;
|
||||
reveal_fee?: dependency_4.cosmos.base.v1beta1.Coin;
|
||||
minimum_bid?: dependency_4.cosmos.base.v1beta1.Coin;
|
||||
winner_address?: string;
|
||||
winning_bid?: dependency_4.cosmos.base.v1beta1.Coin;
|
||||
winning_price?: dependency_4.cosmos.base.v1beta1.Coin;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("id" in data && data.id != undefined) {
|
||||
this.id = data.id;
|
||||
}
|
||||
if ("status" in data && data.status != undefined) {
|
||||
this.status = data.status;
|
||||
}
|
||||
if ("owner_address" in data && data.owner_address != undefined) {
|
||||
this.owner_address = data.owner_address;
|
||||
}
|
||||
if ("create_time" in data && data.create_time != undefined) {
|
||||
this.create_time = data.create_time;
|
||||
}
|
||||
if ("commits_end_time" in data && data.commits_end_time != undefined) {
|
||||
this.commits_end_time = data.commits_end_time;
|
||||
}
|
||||
if ("reveals_end_time" in data && data.reveals_end_time != undefined) {
|
||||
this.reveals_end_time = data.reveals_end_time;
|
||||
}
|
||||
if ("commit_fee" in data && data.commit_fee != undefined) {
|
||||
this.commit_fee = data.commit_fee;
|
||||
}
|
||||
if ("reveal_fee" in data && data.reveal_fee != undefined) {
|
||||
this.reveal_fee = data.reveal_fee;
|
||||
}
|
||||
if ("minimum_bid" in data && data.minimum_bid != undefined) {
|
||||
this.minimum_bid = data.minimum_bid;
|
||||
}
|
||||
if ("winner_address" in data && data.winner_address != undefined) {
|
||||
this.winner_address = data.winner_address;
|
||||
}
|
||||
if ("winning_bid" in data && data.winning_bid != undefined) {
|
||||
this.winning_bid = data.winning_bid;
|
||||
}
|
||||
if ("winning_price" in data && data.winning_price != undefined) {
|
||||
this.winning_price = data.winning_price;
|
||||
}
|
||||
}
|
||||
}
|
||||
get id() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
|
||||
}
|
||||
set id(value: string) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get status() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
|
||||
}
|
||||
set status(value: string) {
|
||||
pb_1.Message.setField(this, 2, value);
|
||||
}
|
||||
get owner_address() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 3, "") as string;
|
||||
}
|
||||
set owner_address(value: string) {
|
||||
pb_1.Message.setField(this, 3, value);
|
||||
}
|
||||
get create_time() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_3.google.protobuf.Timestamp, 4) as dependency_3.google.protobuf.Timestamp;
|
||||
}
|
||||
set create_time(value: dependency_3.google.protobuf.Timestamp) {
|
||||
pb_1.Message.setWrapperField(this, 4, value);
|
||||
}
|
||||
get has_create_time() {
|
||||
return pb_1.Message.getField(this, 4) != null;
|
||||
}
|
||||
get commits_end_time() {
|
||||
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) {
|
||||
pb_1.Message.setWrapperField(this, 5, value);
|
||||
}
|
||||
get has_commits_end_time() {
|
||||
return pb_1.Message.getField(this, 5) != null;
|
||||
}
|
||||
get reveals_end_time() {
|
||||
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) {
|
||||
pb_1.Message.setWrapperField(this, 6, value);
|
||||
}
|
||||
get has_reveals_end_time() {
|
||||
return pb_1.Message.getField(this, 6) != null;
|
||||
}
|
||||
get commit_fee() {
|
||||
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) {
|
||||
pb_1.Message.setWrapperField(this, 7, value);
|
||||
}
|
||||
get has_commit_fee() {
|
||||
return pb_1.Message.getField(this, 7) != null;
|
||||
}
|
||||
get reveal_fee() {
|
||||
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) {
|
||||
pb_1.Message.setWrapperField(this, 8, value);
|
||||
}
|
||||
get has_reveal_fee() {
|
||||
return pb_1.Message.getField(this, 8) != null;
|
||||
}
|
||||
get minimum_bid() {
|
||||
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) {
|
||||
pb_1.Message.setWrapperField(this, 9, value);
|
||||
}
|
||||
get has_minimum_bid() {
|
||||
return pb_1.Message.getField(this, 9) != null;
|
||||
}
|
||||
get winner_address() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 10, "") as string;
|
||||
}
|
||||
set winner_address(value: string) {
|
||||
pb_1.Message.setField(this, 10, value);
|
||||
}
|
||||
get winning_bid() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 11) as dependency_4.cosmos.base.v1beta1.Coin;
|
||||
}
|
||||
set winning_bid(value: dependency_4.cosmos.base.v1beta1.Coin) {
|
||||
pb_1.Message.setWrapperField(this, 11, value);
|
||||
}
|
||||
get has_winning_bid() {
|
||||
return pb_1.Message.getField(this, 11) != null;
|
||||
}
|
||||
get winning_price() {
|
||||
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) {
|
||||
pb_1.Message.setWrapperField(this, 12, value);
|
||||
}
|
||||
get has_winning_price() {
|
||||
return pb_1.Message.getField(this, 12) != null;
|
||||
}
|
||||
static fromObject(data: {
|
||||
id?: string;
|
||||
status?: string;
|
||||
owner_address?: string;
|
||||
create_time?: ReturnType<typeof dependency_3.google.protobuf.Timestamp.prototype.toObject>;
|
||||
commits_end_time?: ReturnType<typeof dependency_3.google.protobuf.Timestamp.prototype.toObject>;
|
||||
reveals_end_time?: ReturnType<typeof dependency_3.google.protobuf.Timestamp.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>;
|
||||
minimum_bid?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>;
|
||||
winner_address?: string;
|
||||
winning_bid?: 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({});
|
||||
if (data.id != null) {
|
||||
message.id = data.id;
|
||||
}
|
||||
if (data.status != null) {
|
||||
message.status = data.status;
|
||||
}
|
||||
if (data.owner_address != null) {
|
||||
message.owner_address = data.owner_address;
|
||||
}
|
||||
if (data.create_time != null) {
|
||||
message.create_time = dependency_3.google.protobuf.Timestamp.fromObject(data.create_time);
|
||||
}
|
||||
if (data.commits_end_time != null) {
|
||||
message.commits_end_time = dependency_3.google.protobuf.Timestamp.fromObject(data.commits_end_time);
|
||||
}
|
||||
if (data.reveals_end_time != null) {
|
||||
message.reveals_end_time = dependency_3.google.protobuf.Timestamp.fromObject(data.reveals_end_time);
|
||||
}
|
||||
if (data.commit_fee != null) {
|
||||
message.commit_fee = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.commit_fee);
|
||||
}
|
||||
if (data.reveal_fee != null) {
|
||||
message.reveal_fee = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.reveal_fee);
|
||||
}
|
||||
if (data.minimum_bid != null) {
|
||||
message.minimum_bid = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.minimum_bid);
|
||||
}
|
||||
if (data.winner_address != null) {
|
||||
message.winner_address = data.winner_address;
|
||||
}
|
||||
if (data.winning_bid != null) {
|
||||
message.winning_bid = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.winning_bid);
|
||||
}
|
||||
if (data.winning_price != null) {
|
||||
message.winning_price = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.winning_price);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
id?: string;
|
||||
status?: string;
|
||||
owner_address?: string;
|
||||
create_time?: ReturnType<typeof dependency_3.google.protobuf.Timestamp.prototype.toObject>;
|
||||
commits_end_time?: ReturnType<typeof dependency_3.google.protobuf.Timestamp.prototype.toObject>;
|
||||
reveals_end_time?: ReturnType<typeof dependency_3.google.protobuf.Timestamp.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>;
|
||||
minimum_bid?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>;
|
||||
winner_address?: string;
|
||||
winning_bid?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>;
|
||||
winning_price?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>;
|
||||
} = {};
|
||||
if (this.id != null) {
|
||||
data.id = this.id;
|
||||
}
|
||||
if (this.status != null) {
|
||||
data.status = this.status;
|
||||
}
|
||||
if (this.owner_address != null) {
|
||||
data.owner_address = this.owner_address;
|
||||
}
|
||||
if (this.create_time != null) {
|
||||
data.create_time = this.create_time.toObject();
|
||||
}
|
||||
if (this.commits_end_time != null) {
|
||||
data.commits_end_time = this.commits_end_time.toObject();
|
||||
}
|
||||
if (this.reveals_end_time != null) {
|
||||
data.reveals_end_time = this.reveals_end_time.toObject();
|
||||
}
|
||||
if (this.commit_fee != null) {
|
||||
data.commit_fee = this.commit_fee.toObject();
|
||||
}
|
||||
if (this.reveal_fee != null) {
|
||||
data.reveal_fee = this.reveal_fee.toObject();
|
||||
}
|
||||
if (this.minimum_bid != null) {
|
||||
data.minimum_bid = this.minimum_bid.toObject();
|
||||
}
|
||||
if (this.winner_address != null) {
|
||||
data.winner_address = this.winner_address;
|
||||
}
|
||||
if (this.winning_bid != null) {
|
||||
data.winning_bid = this.winning_bid.toObject();
|
||||
}
|
||||
if (this.winning_price != null) {
|
||||
data.winning_price = this.winning_price.toObject();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.id.length)
|
||||
writer.writeString(1, this.id);
|
||||
if (this.status.length)
|
||||
writer.writeString(2, this.status);
|
||||
if (this.owner_address.length)
|
||||
writer.writeString(3, this.owner_address);
|
||||
if (this.has_create_time)
|
||||
writer.writeMessage(4, this.create_time, () => this.create_time.serialize(writer));
|
||||
if (this.has_commits_end_time)
|
||||
writer.writeMessage(5, this.commits_end_time, () => this.commits_end_time.serialize(writer));
|
||||
if (this.has_reveals_end_time)
|
||||
writer.writeMessage(6, this.reveals_end_time, () => this.reveals_end_time.serialize(writer));
|
||||
if (this.has_commit_fee)
|
||||
writer.writeMessage(7, this.commit_fee, () => this.commit_fee.serialize(writer));
|
||||
if (this.has_reveal_fee)
|
||||
writer.writeMessage(8, this.reveal_fee, () => this.reveal_fee.serialize(writer));
|
||||
if (this.has_minimum_bid)
|
||||
writer.writeMessage(9, this.minimum_bid, () => this.minimum_bid.serialize(writer));
|
||||
if (this.winner_address.length)
|
||||
writer.writeString(10, this.winner_address);
|
||||
if (this.has_winning_bid)
|
||||
writer.writeMessage(11, this.winning_bid, () => this.winning_bid.serialize(writer));
|
||||
if (this.has_winning_price)
|
||||
writer.writeMessage(12, this.winning_price, () => this.winning_price.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Auction {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Auction();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.id = reader.readString();
|
||||
break;
|
||||
case 2:
|
||||
message.status = reader.readString();
|
||||
break;
|
||||
case 3:
|
||||
message.owner_address = reader.readString();
|
||||
break;
|
||||
case 4:
|
||||
reader.readMessage(message.create_time, () => message.create_time = dependency_3.google.protobuf.Timestamp.deserialize(reader));
|
||||
break;
|
||||
case 5:
|
||||
reader.readMessage(message.commits_end_time, () => message.commits_end_time = dependency_3.google.protobuf.Timestamp.deserialize(reader));
|
||||
break;
|
||||
case 6:
|
||||
reader.readMessage(message.reveals_end_time, () => message.reveals_end_time = dependency_3.google.protobuf.Timestamp.deserialize(reader));
|
||||
break;
|
||||
case 7:
|
||||
reader.readMessage(message.commit_fee, () => message.commit_fee = dependency_4.cosmos.base.v1beta1.Coin.deserialize(reader));
|
||||
break;
|
||||
case 8:
|
||||
reader.readMessage(message.reveal_fee, () => message.reveal_fee = dependency_4.cosmos.base.v1beta1.Coin.deserialize(reader));
|
||||
break;
|
||||
case 9:
|
||||
reader.readMessage(message.minimum_bid, () => message.minimum_bid = dependency_4.cosmos.base.v1beta1.Coin.deserialize(reader));
|
||||
break;
|
||||
case 10:
|
||||
message.winner_address = reader.readString();
|
||||
break;
|
||||
case 11:
|
||||
reader.readMessage(message.winning_bid, () => message.winning_bid = dependency_4.cosmos.base.v1beta1.Coin.deserialize(reader));
|
||||
break;
|
||||
case 12:
|
||||
reader.readMessage(message.winning_price, () => message.winning_price = dependency_4.cosmos.base.v1beta1.Coin.deserialize(reader));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): Auction {
|
||||
return Auction.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
export class Auctions extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
auctions?: Auction[];
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("auctions" in data && data.auctions != undefined) {
|
||||
this.auctions = data.auctions;
|
||||
}
|
||||
}
|
||||
}
|
||||
get auctions() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, Auction, 1) as Auction[];
|
||||
}
|
||||
set auctions(value: Auction[]) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 1, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
auctions?: ReturnType<typeof Auction.prototype.toObject>[];
|
||||
}): Auctions {
|
||||
const message = new Auctions({});
|
||||
if (data.auctions != null) {
|
||||
message.auctions = data.auctions.map(item => Auction.fromObject(item));
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
auctions?: ReturnType<typeof Auction.prototype.toObject>[];
|
||||
} = {};
|
||||
if (this.auctions != null) {
|
||||
data.auctions = this.auctions.map((item: Auction) => item.toObject());
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.auctions.length)
|
||||
writer.writeRepeatedMessage(1, this.auctions, (item: Auction) => item.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Auctions {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Auctions();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
reader.readMessage(message.auctions, () => pb_1.Message.addToRepeatedWrapperField(message, 1, Auction.deserialize(reader), Auction));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): Auctions {
|
||||
return Auctions.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
export class Bid extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
auction_id?: string;
|
||||
bidder_address?: string;
|
||||
status?: string;
|
||||
commit_hash?: string;
|
||||
commit_time?: dependency_3.google.protobuf.Timestamp;
|
||||
commit_fee?: dependency_4.cosmos.base.v1beta1.Coin;
|
||||
reveal_time?: dependency_3.google.protobuf.Timestamp;
|
||||
reveal_fee?: dependency_4.cosmos.base.v1beta1.Coin;
|
||||
bid_amount?: dependency_4.cosmos.base.v1beta1.Coin;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("auction_id" in data && data.auction_id != undefined) {
|
||||
this.auction_id = data.auction_id;
|
||||
}
|
||||
if ("bidder_address" in data && data.bidder_address != undefined) {
|
||||
this.bidder_address = data.bidder_address;
|
||||
}
|
||||
if ("status" in data && data.status != undefined) {
|
||||
this.status = data.status;
|
||||
}
|
||||
if ("commit_hash" in data && data.commit_hash != undefined) {
|
||||
this.commit_hash = data.commit_hash;
|
||||
}
|
||||
if ("commit_time" in data && data.commit_time != undefined) {
|
||||
this.commit_time = data.commit_time;
|
||||
}
|
||||
if ("commit_fee" in data && data.commit_fee != undefined) {
|
||||
this.commit_fee = data.commit_fee;
|
||||
}
|
||||
if ("reveal_time" in data && data.reveal_time != undefined) {
|
||||
this.reveal_time = data.reveal_time;
|
||||
}
|
||||
if ("reveal_fee" in data && data.reveal_fee != undefined) {
|
||||
this.reveal_fee = data.reveal_fee;
|
||||
}
|
||||
if ("bid_amount" in data && data.bid_amount != undefined) {
|
||||
this.bid_amount = data.bid_amount;
|
||||
}
|
||||
}
|
||||
}
|
||||
get auction_id() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
|
||||
}
|
||||
set auction_id(value: string) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get bidder_address() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
|
||||
}
|
||||
set bidder_address(value: string) {
|
||||
pb_1.Message.setField(this, 2, value);
|
||||
}
|
||||
get status() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 3, "") as string;
|
||||
}
|
||||
set status(value: string) {
|
||||
pb_1.Message.setField(this, 3, value);
|
||||
}
|
||||
get commit_hash() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 4, "") as string;
|
||||
}
|
||||
set commit_hash(value: string) {
|
||||
pb_1.Message.setField(this, 4, value);
|
||||
}
|
||||
get commit_time() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_3.google.protobuf.Timestamp, 5) as dependency_3.google.protobuf.Timestamp;
|
||||
}
|
||||
set commit_time(value: dependency_3.google.protobuf.Timestamp) {
|
||||
pb_1.Message.setWrapperField(this, 5, value);
|
||||
}
|
||||
get has_commit_time() {
|
||||
return pb_1.Message.getField(this, 5) != null;
|
||||
}
|
||||
get commit_fee() {
|
||||
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) {
|
||||
pb_1.Message.setWrapperField(this, 6, value);
|
||||
}
|
||||
get has_commit_fee() {
|
||||
return pb_1.Message.getField(this, 6) != null;
|
||||
}
|
||||
get reveal_time() {
|
||||
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) {
|
||||
pb_1.Message.setWrapperField(this, 7, value);
|
||||
}
|
||||
get has_reveal_time() {
|
||||
return pb_1.Message.getField(this, 7) != null;
|
||||
}
|
||||
get reveal_fee() {
|
||||
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) {
|
||||
pb_1.Message.setWrapperField(this, 8, value);
|
||||
}
|
||||
get has_reveal_fee() {
|
||||
return pb_1.Message.getField(this, 8) != null;
|
||||
}
|
||||
get bid_amount() {
|
||||
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) {
|
||||
pb_1.Message.setWrapperField(this, 9, value);
|
||||
}
|
||||
get has_bid_amount() {
|
||||
return pb_1.Message.getField(this, 9) != null;
|
||||
}
|
||||
static fromObject(data: {
|
||||
auction_id?: string;
|
||||
bidder_address?: string;
|
||||
status?: string;
|
||||
commit_hash?: string;
|
||||
commit_time?: ReturnType<typeof dependency_3.google.protobuf.Timestamp.prototype.toObject>;
|
||||
commit_fee?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.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>;
|
||||
bid_amount?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>;
|
||||
}): Bid {
|
||||
const message = new Bid({});
|
||||
if (data.auction_id != null) {
|
||||
message.auction_id = data.auction_id;
|
||||
}
|
||||
if (data.bidder_address != null) {
|
||||
message.bidder_address = data.bidder_address;
|
||||
}
|
||||
if (data.status != null) {
|
||||
message.status = data.status;
|
||||
}
|
||||
if (data.commit_hash != null) {
|
||||
message.commit_hash = data.commit_hash;
|
||||
}
|
||||
if (data.commit_time != null) {
|
||||
message.commit_time = dependency_3.google.protobuf.Timestamp.fromObject(data.commit_time);
|
||||
}
|
||||
if (data.commit_fee != null) {
|
||||
message.commit_fee = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.commit_fee);
|
||||
}
|
||||
if (data.reveal_time != null) {
|
||||
message.reveal_time = dependency_3.google.protobuf.Timestamp.fromObject(data.reveal_time);
|
||||
}
|
||||
if (data.reveal_fee != null) {
|
||||
message.reveal_fee = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.reveal_fee);
|
||||
}
|
||||
if (data.bid_amount != null) {
|
||||
message.bid_amount = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.bid_amount);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
auction_id?: string;
|
||||
bidder_address?: string;
|
||||
status?: string;
|
||||
commit_hash?: string;
|
||||
commit_time?: ReturnType<typeof dependency_3.google.protobuf.Timestamp.prototype.toObject>;
|
||||
commit_fee?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.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>;
|
||||
bid_amount?: ReturnType<typeof dependency_4.cosmos.base.v1beta1.Coin.prototype.toObject>;
|
||||
} = {};
|
||||
if (this.auction_id != null) {
|
||||
data.auction_id = this.auction_id;
|
||||
}
|
||||
if (this.bidder_address != null) {
|
||||
data.bidder_address = this.bidder_address;
|
||||
}
|
||||
if (this.status != null) {
|
||||
data.status = this.status;
|
||||
}
|
||||
if (this.commit_hash != null) {
|
||||
data.commit_hash = this.commit_hash;
|
||||
}
|
||||
if (this.commit_time != null) {
|
||||
data.commit_time = this.commit_time.toObject();
|
||||
}
|
||||
if (this.commit_fee != null) {
|
||||
data.commit_fee = this.commit_fee.toObject();
|
||||
}
|
||||
if (this.reveal_time != null) {
|
||||
data.reveal_time = this.reveal_time.toObject();
|
||||
}
|
||||
if (this.reveal_fee != null) {
|
||||
data.reveal_fee = this.reveal_fee.toObject();
|
||||
}
|
||||
if (this.bid_amount != null) {
|
||||
data.bid_amount = this.bid_amount.toObject();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.auction_id.length)
|
||||
writer.writeString(1, this.auction_id);
|
||||
if (this.bidder_address.length)
|
||||
writer.writeString(2, this.bidder_address);
|
||||
if (this.status.length)
|
||||
writer.writeString(3, this.status);
|
||||
if (this.commit_hash.length)
|
||||
writer.writeString(4, this.commit_hash);
|
||||
if (this.has_commit_time)
|
||||
writer.writeMessage(5, this.commit_time, () => this.commit_time.serialize(writer));
|
||||
if (this.has_commit_fee)
|
||||
writer.writeMessage(6, this.commit_fee, () => this.commit_fee.serialize(writer));
|
||||
if (this.has_reveal_time)
|
||||
writer.writeMessage(7, this.reveal_time, () => this.reveal_time.serialize(writer));
|
||||
if (this.has_reveal_fee)
|
||||
writer.writeMessage(8, this.reveal_fee, () => this.reveal_fee.serialize(writer));
|
||||
if (this.has_bid_amount)
|
||||
writer.writeMessage(9, this.bid_amount, () => this.bid_amount.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Bid {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Bid();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.auction_id = reader.readString();
|
||||
break;
|
||||
case 2:
|
||||
message.bidder_address = reader.readString();
|
||||
break;
|
||||
case 3:
|
||||
message.status = reader.readString();
|
||||
break;
|
||||
case 4:
|
||||
message.commit_hash = reader.readString();
|
||||
break;
|
||||
case 5:
|
||||
reader.readMessage(message.commit_time, () => message.commit_time = dependency_3.google.protobuf.Timestamp.deserialize(reader));
|
||||
break;
|
||||
case 6:
|
||||
reader.readMessage(message.commit_fee, () => message.commit_fee = dependency_4.cosmos.base.v1beta1.Coin.deserialize(reader));
|
||||
break;
|
||||
case 7:
|
||||
reader.readMessage(message.reveal_time, () => message.reveal_time = dependency_3.google.protobuf.Timestamp.deserialize(reader));
|
||||
break;
|
||||
case 8:
|
||||
reader.readMessage(message.reveal_fee, () => message.reveal_fee = dependency_4.cosmos.base.v1beta1.Coin.deserialize(reader));
|
||||
break;
|
||||
case 9:
|
||||
reader.readMessage(message.bid_amount, () => message.bid_amount = dependency_4.cosmos.base.v1beta1.Coin.deserialize(reader));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): Bid {
|
||||
return Bid.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,195 +0,0 @@
|
||||
// @ts-nocheck
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||
* compiler version: 4.25.1
|
||||
* source: vulcanize/bond/v1beta1/bond.proto
|
||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||
import * as dependency_1 from "./../../../gogoproto/gogo";
|
||||
import * as dependency_2 from "./../../../cosmos/base/v1beta1/coin";
|
||||
import * as pb_1 from "google-protobuf";
|
||||
export namespace vulcanize.bond.v1beta1 {
|
||||
export class Params extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
max_bond_amount?: dependency_2.cosmos.base.v1beta1.Coin;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("max_bond_amount" in data && data.max_bond_amount != undefined) {
|
||||
this.max_bond_amount = data.max_bond_amount;
|
||||
}
|
||||
}
|
||||
}
|
||||
get max_bond_amount() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_2.cosmos.base.v1beta1.Coin, 1) as dependency_2.cosmos.base.v1beta1.Coin;
|
||||
}
|
||||
set max_bond_amount(value: dependency_2.cosmos.base.v1beta1.Coin) {
|
||||
pb_1.Message.setWrapperField(this, 1, value);
|
||||
}
|
||||
get has_max_bond_amount() {
|
||||
return pb_1.Message.getField(this, 1) != null;
|
||||
}
|
||||
static fromObject(data: {
|
||||
max_bond_amount?: ReturnType<typeof dependency_2.cosmos.base.v1beta1.Coin.prototype.toObject>;
|
||||
}): Params {
|
||||
const message = new Params({});
|
||||
if (data.max_bond_amount != null) {
|
||||
message.max_bond_amount = dependency_2.cosmos.base.v1beta1.Coin.fromObject(data.max_bond_amount);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
max_bond_amount?: ReturnType<typeof dependency_2.cosmos.base.v1beta1.Coin.prototype.toObject>;
|
||||
} = {};
|
||||
if (this.max_bond_amount != null) {
|
||||
data.max_bond_amount = this.max_bond_amount.toObject();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.has_max_bond_amount)
|
||||
writer.writeMessage(1, this.max_bond_amount, () => this.max_bond_amount.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Params {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Params();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
reader.readMessage(message.max_bond_amount, () => message.max_bond_amount = dependency_2.cosmos.base.v1beta1.Coin.deserialize(reader));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): Params {
|
||||
return Params.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
export class Bond extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
id?: string;
|
||||
owner?: string;
|
||||
balance?: dependency_2.cosmos.base.v1beta1.Coin[];
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("id" in data && data.id != undefined) {
|
||||
this.id = data.id;
|
||||
}
|
||||
if ("owner" in data && data.owner != undefined) {
|
||||
this.owner = data.owner;
|
||||
}
|
||||
if ("balance" in data && data.balance != undefined) {
|
||||
this.balance = data.balance;
|
||||
}
|
||||
}
|
||||
}
|
||||
get id() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
|
||||
}
|
||||
set id(value: string) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get owner() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
|
||||
}
|
||||
set owner(value: string) {
|
||||
pb_1.Message.setField(this, 2, value);
|
||||
}
|
||||
get balance() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, dependency_2.cosmos.base.v1beta1.Coin, 3) as dependency_2.cosmos.base.v1beta1.Coin[];
|
||||
}
|
||||
set balance(value: dependency_2.cosmos.base.v1beta1.Coin[]) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 3, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
id?: string;
|
||||
owner?: string;
|
||||
balance?: ReturnType<typeof dependency_2.cosmos.base.v1beta1.Coin.prototype.toObject>[];
|
||||
}): Bond {
|
||||
const message = new Bond({});
|
||||
if (data.id != null) {
|
||||
message.id = data.id;
|
||||
}
|
||||
if (data.owner != null) {
|
||||
message.owner = data.owner;
|
||||
}
|
||||
if (data.balance != null) {
|
||||
message.balance = data.balance.map(item => dependency_2.cosmos.base.v1beta1.Coin.fromObject(item));
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
id?: string;
|
||||
owner?: string;
|
||||
balance?: ReturnType<typeof dependency_2.cosmos.base.v1beta1.Coin.prototype.toObject>[];
|
||||
} = {};
|
||||
if (this.id != null) {
|
||||
data.id = this.id;
|
||||
}
|
||||
if (this.owner != null) {
|
||||
data.owner = this.owner;
|
||||
}
|
||||
if (this.balance != null) {
|
||||
data.balance = this.balance.map((item: dependency_2.cosmos.base.v1beta1.Coin) => item.toObject());
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.id.length)
|
||||
writer.writeString(1, this.id);
|
||||
if (this.owner.length)
|
||||
writer.writeString(2, this.owner);
|
||||
if (this.balance.length)
|
||||
writer.writeRepeatedMessage(3, this.balance, (item: dependency_2.cosmos.base.v1beta1.Coin) => item.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Bond {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Bond();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.id = reader.readString();
|
||||
break;
|
||||
case 2:
|
||||
message.owner = reader.readString();
|
||||
break;
|
||||
case 3:
|
||||
reader.readMessage(message.balance, () => pb_1.Message.addToRepeatedWrapperField(message, 3, dependency_2.cosmos.base.v1beta1.Coin.deserialize(reader), dependency_2.cosmos.base.v1beta1.Coin));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): Bond {
|
||||
return Bond.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,105 +0,0 @@
|
||||
// @ts-nocheck
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||
* compiler version: 4.25.1
|
||||
* source: vulcanize/bond/v1beta1/genesis.proto
|
||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||
import * as dependency_1 from "./../../../gogoproto/gogo";
|
||||
import * as dependency_2 from "./bond";
|
||||
import * as pb_1 from "google-protobuf";
|
||||
export namespace vulcanize.bond.v1beta1 {
|
||||
export class GenesisState extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
params?: dependency_2.vulcanize.bond.v1beta1.Params;
|
||||
bonds?: dependency_2.vulcanize.bond.v1beta1.Bond[];
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("params" in data && data.params != undefined) {
|
||||
this.params = data.params;
|
||||
}
|
||||
if ("bonds" in data && data.bonds != undefined) {
|
||||
this.bonds = data.bonds;
|
||||
}
|
||||
}
|
||||
}
|
||||
get params() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_2.vulcanize.bond.v1beta1.Params, 1) as dependency_2.vulcanize.bond.v1beta1.Params;
|
||||
}
|
||||
set params(value: dependency_2.vulcanize.bond.v1beta1.Params) {
|
||||
pb_1.Message.setWrapperField(this, 1, value);
|
||||
}
|
||||
get has_params() {
|
||||
return pb_1.Message.getField(this, 1) != null;
|
||||
}
|
||||
get bonds() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, dependency_2.vulcanize.bond.v1beta1.Bond, 2) as dependency_2.vulcanize.bond.v1beta1.Bond[];
|
||||
}
|
||||
set bonds(value: dependency_2.vulcanize.bond.v1beta1.Bond[]) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 2, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
params?: ReturnType<typeof dependency_2.vulcanize.bond.v1beta1.Params.prototype.toObject>;
|
||||
bonds?: ReturnType<typeof dependency_2.vulcanize.bond.v1beta1.Bond.prototype.toObject>[];
|
||||
}): GenesisState {
|
||||
const message = new GenesisState({});
|
||||
if (data.params != null) {
|
||||
message.params = dependency_2.vulcanize.bond.v1beta1.Params.fromObject(data.params);
|
||||
}
|
||||
if (data.bonds != null) {
|
||||
message.bonds = data.bonds.map(item => dependency_2.vulcanize.bond.v1beta1.Bond.fromObject(item));
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
params?: ReturnType<typeof dependency_2.vulcanize.bond.v1beta1.Params.prototype.toObject>;
|
||||
bonds?: ReturnType<typeof dependency_2.vulcanize.bond.v1beta1.Bond.prototype.toObject>[];
|
||||
} = {};
|
||||
if (this.params != null) {
|
||||
data.params = this.params.toObject();
|
||||
}
|
||||
if (this.bonds != null) {
|
||||
data.bonds = this.bonds.map((item: dependency_2.vulcanize.bond.v1beta1.Bond) => item.toObject());
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.has_params)
|
||||
writer.writeMessage(1, this.params, () => this.params.serialize(writer));
|
||||
if (this.bonds.length)
|
||||
writer.writeRepeatedMessage(2, this.bonds, (item: dependency_2.vulcanize.bond.v1beta1.Bond) => item.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GenesisState {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GenesisState();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
reader.readMessage(message.params, () => message.params = dependency_2.vulcanize.bond.v1beta1.Params.deserialize(reader));
|
||||
break;
|
||||
case 2:
|
||||
reader.readMessage(message.bonds, () => pb_1.Message.addToRepeatedWrapperField(message, 2, dependency_2.vulcanize.bond.v1beta1.Bond.deserialize(reader), dependency_2.vulcanize.bond.v1beta1.Bond));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): GenesisState {
|
||||
return GenesisState.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,718 +0,0 @@
|
||||
// @ts-nocheck
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||
* compiler version: 4.25.1
|
||||
* source: vulcanize/bond/v1beta1/query.proto
|
||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||
import * as dependency_1 from "./../../../gogoproto/gogo";
|
||||
import * as dependency_2 from "./bond";
|
||||
import * as dependency_3 from "./../../../google/api/annotations";
|
||||
import * as dependency_4 from "./../../../cosmos/base/query/v1beta1/pagination";
|
||||
import * as dependency_5 from "./../../../cosmos/base/v1beta1/coin";
|
||||
import * as pb_1 from "google-protobuf";
|
||||
export namespace vulcanize.bond.v1beta1 {
|
||||
export class QueryParamsRequest extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") { }
|
||||
}
|
||||
static fromObject(data: {}): QueryParamsRequest {
|
||||
const message = new QueryParamsRequest({});
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {} = {};
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryParamsRequest {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryParamsRequest();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): QueryParamsRequest {
|
||||
return QueryParamsRequest.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
export class QueryParamsResponse extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
params?: dependency_2.vulcanize.bond.v1beta1.Params;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("params" in data && data.params != undefined) {
|
||||
this.params = data.params;
|
||||
}
|
||||
}
|
||||
}
|
||||
get params() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_2.vulcanize.bond.v1beta1.Params, 1) as dependency_2.vulcanize.bond.v1beta1.Params;
|
||||
}
|
||||
set params(value: dependency_2.vulcanize.bond.v1beta1.Params) {
|
||||
pb_1.Message.setWrapperField(this, 1, value);
|
||||
}
|
||||
get has_params() {
|
||||
return pb_1.Message.getField(this, 1) != null;
|
||||
}
|
||||
static fromObject(data: {
|
||||
params?: ReturnType<typeof dependency_2.vulcanize.bond.v1beta1.Params.prototype.toObject>;
|
||||
}): QueryParamsResponse {
|
||||
const message = new QueryParamsResponse({});
|
||||
if (data.params != null) {
|
||||
message.params = dependency_2.vulcanize.bond.v1beta1.Params.fromObject(data.params);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
params?: ReturnType<typeof dependency_2.vulcanize.bond.v1beta1.Params.prototype.toObject>;
|
||||
} = {};
|
||||
if (this.params != null) {
|
||||
data.params = this.params.toObject();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.has_params)
|
||||
writer.writeMessage(1, this.params, () => this.params.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryParamsResponse {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryParamsResponse();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
reader.readMessage(message.params, () => message.params = dependency_2.vulcanize.bond.v1beta1.Params.deserialize(reader));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): QueryParamsResponse {
|
||||
return QueryParamsResponse.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
export class QueryGetBondsRequest extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
pagination?: dependency_4.cosmos.base.query.v1beta1.PageRequest;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("pagination" in data && data.pagination != undefined) {
|
||||
this.pagination = data.pagination;
|
||||
}
|
||||
}
|
||||
}
|
||||
get pagination() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.query.v1beta1.PageRequest, 1) as dependency_4.cosmos.base.query.v1beta1.PageRequest;
|
||||
}
|
||||
set pagination(value: dependency_4.cosmos.base.query.v1beta1.PageRequest) {
|
||||
pb_1.Message.setWrapperField(this, 1, value);
|
||||
}
|
||||
get has_pagination() {
|
||||
return pb_1.Message.getField(this, 1) != null;
|
||||
}
|
||||
static fromObject(data: {
|
||||
pagination?: ReturnType<typeof dependency_4.cosmos.base.query.v1beta1.PageRequest.prototype.toObject>;
|
||||
}): QueryGetBondsRequest {
|
||||
const message = new QueryGetBondsRequest({});
|
||||
if (data.pagination != null) {
|
||||
message.pagination = dependency_4.cosmos.base.query.v1beta1.PageRequest.fromObject(data.pagination);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
pagination?: ReturnType<typeof dependency_4.cosmos.base.query.v1beta1.PageRequest.prototype.toObject>;
|
||||
} = {};
|
||||
if (this.pagination != null) {
|
||||
data.pagination = this.pagination.toObject();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.has_pagination)
|
||||
writer.writeMessage(1, this.pagination, () => this.pagination.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryGetBondsRequest {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryGetBondsRequest();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
reader.readMessage(message.pagination, () => message.pagination = dependency_4.cosmos.base.query.v1beta1.PageRequest.deserialize(reader));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): QueryGetBondsRequest {
|
||||
return QueryGetBondsRequest.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
export class QueryGetBondsResponse extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
bonds?: dependency_2.vulcanize.bond.v1beta1.Bond[];
|
||||
pagination?: dependency_4.cosmos.base.query.v1beta1.PageResponse;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("bonds" in data && data.bonds != undefined) {
|
||||
this.bonds = data.bonds;
|
||||
}
|
||||
if ("pagination" in data && data.pagination != undefined) {
|
||||
this.pagination = data.pagination;
|
||||
}
|
||||
}
|
||||
}
|
||||
get bonds() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, dependency_2.vulcanize.bond.v1beta1.Bond, 1) as dependency_2.vulcanize.bond.v1beta1.Bond[];
|
||||
}
|
||||
set bonds(value: dependency_2.vulcanize.bond.v1beta1.Bond[]) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 1, value);
|
||||
}
|
||||
get pagination() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.query.v1beta1.PageResponse, 2) as dependency_4.cosmos.base.query.v1beta1.PageResponse;
|
||||
}
|
||||
set pagination(value: dependency_4.cosmos.base.query.v1beta1.PageResponse) {
|
||||
pb_1.Message.setWrapperField(this, 2, value);
|
||||
}
|
||||
get has_pagination() {
|
||||
return pb_1.Message.getField(this, 2) != null;
|
||||
}
|
||||
static fromObject(data: {
|
||||
bonds?: ReturnType<typeof dependency_2.vulcanize.bond.v1beta1.Bond.prototype.toObject>[];
|
||||
pagination?: ReturnType<typeof dependency_4.cosmos.base.query.v1beta1.PageResponse.prototype.toObject>;
|
||||
}): QueryGetBondsResponse {
|
||||
const message = new QueryGetBondsResponse({});
|
||||
if (data.bonds != null) {
|
||||
message.bonds = data.bonds.map(item => dependency_2.vulcanize.bond.v1beta1.Bond.fromObject(item));
|
||||
}
|
||||
if (data.pagination != null) {
|
||||
message.pagination = dependency_4.cosmos.base.query.v1beta1.PageResponse.fromObject(data.pagination);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
bonds?: ReturnType<typeof dependency_2.vulcanize.bond.v1beta1.Bond.prototype.toObject>[];
|
||||
pagination?: ReturnType<typeof dependency_4.cosmos.base.query.v1beta1.PageResponse.prototype.toObject>;
|
||||
} = {};
|
||||
if (this.bonds != null) {
|
||||
data.bonds = this.bonds.map((item: dependency_2.vulcanize.bond.v1beta1.Bond) => item.toObject());
|
||||
}
|
||||
if (this.pagination != null) {
|
||||
data.pagination = this.pagination.toObject();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.bonds.length)
|
||||
writer.writeRepeatedMessage(1, this.bonds, (item: dependency_2.vulcanize.bond.v1beta1.Bond) => item.serialize(writer));
|
||||
if (this.has_pagination)
|
||||
writer.writeMessage(2, this.pagination, () => this.pagination.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryGetBondsResponse {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryGetBondsResponse();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
reader.readMessage(message.bonds, () => pb_1.Message.addToRepeatedWrapperField(message, 1, dependency_2.vulcanize.bond.v1beta1.Bond.deserialize(reader), dependency_2.vulcanize.bond.v1beta1.Bond));
|
||||
break;
|
||||
case 2:
|
||||
reader.readMessage(message.pagination, () => message.pagination = dependency_4.cosmos.base.query.v1beta1.PageResponse.deserialize(reader));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): QueryGetBondsResponse {
|
||||
return QueryGetBondsResponse.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
export class QueryGetBondByIdRequest extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
id?: string;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("id" in data && data.id != undefined) {
|
||||
this.id = data.id;
|
||||
}
|
||||
}
|
||||
}
|
||||
get id() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
|
||||
}
|
||||
set id(value: string) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
id?: string;
|
||||
}): QueryGetBondByIdRequest {
|
||||
const message = new QueryGetBondByIdRequest({});
|
||||
if (data.id != null) {
|
||||
message.id = data.id;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
id?: string;
|
||||
} = {};
|
||||
if (this.id != null) {
|
||||
data.id = this.id;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.id.length)
|
||||
writer.writeString(1, this.id);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryGetBondByIdRequest {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryGetBondByIdRequest();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.id = reader.readString();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): QueryGetBondByIdRequest {
|
||||
return QueryGetBondByIdRequest.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
export class QueryGetBondByIdResponse extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
bond?: dependency_2.vulcanize.bond.v1beta1.Bond;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("bond" in data && data.bond != undefined) {
|
||||
this.bond = data.bond;
|
||||
}
|
||||
}
|
||||
}
|
||||
get bond() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_2.vulcanize.bond.v1beta1.Bond, 1) as dependency_2.vulcanize.bond.v1beta1.Bond;
|
||||
}
|
||||
set bond(value: dependency_2.vulcanize.bond.v1beta1.Bond) {
|
||||
pb_1.Message.setWrapperField(this, 1, value);
|
||||
}
|
||||
get has_bond() {
|
||||
return pb_1.Message.getField(this, 1) != null;
|
||||
}
|
||||
static fromObject(data: {
|
||||
bond?: ReturnType<typeof dependency_2.vulcanize.bond.v1beta1.Bond.prototype.toObject>;
|
||||
}): QueryGetBondByIdResponse {
|
||||
const message = new QueryGetBondByIdResponse({});
|
||||
if (data.bond != null) {
|
||||
message.bond = dependency_2.vulcanize.bond.v1beta1.Bond.fromObject(data.bond);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
bond?: ReturnType<typeof dependency_2.vulcanize.bond.v1beta1.Bond.prototype.toObject>;
|
||||
} = {};
|
||||
if (this.bond != null) {
|
||||
data.bond = this.bond.toObject();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.has_bond)
|
||||
writer.writeMessage(1, this.bond, () => this.bond.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryGetBondByIdResponse {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryGetBondByIdResponse();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
reader.readMessage(message.bond, () => message.bond = dependency_2.vulcanize.bond.v1beta1.Bond.deserialize(reader));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): QueryGetBondByIdResponse {
|
||||
return QueryGetBondByIdResponse.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
export class QueryGetBondsByOwnerRequest extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
owner?: string;
|
||||
pagination?: dependency_4.cosmos.base.query.v1beta1.PageResponse;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("owner" in data && data.owner != undefined) {
|
||||
this.owner = data.owner;
|
||||
}
|
||||
if ("pagination" in data && data.pagination != undefined) {
|
||||
this.pagination = data.pagination;
|
||||
}
|
||||
}
|
||||
}
|
||||
get owner() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
|
||||
}
|
||||
set owner(value: string) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get pagination() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.query.v1beta1.PageResponse, 2) as dependency_4.cosmos.base.query.v1beta1.PageResponse;
|
||||
}
|
||||
set pagination(value: dependency_4.cosmos.base.query.v1beta1.PageResponse) {
|
||||
pb_1.Message.setWrapperField(this, 2, value);
|
||||
}
|
||||
get has_pagination() {
|
||||
return pb_1.Message.getField(this, 2) != null;
|
||||
}
|
||||
static fromObject(data: {
|
||||
owner?: string;
|
||||
pagination?: ReturnType<typeof dependency_4.cosmos.base.query.v1beta1.PageResponse.prototype.toObject>;
|
||||
}): QueryGetBondsByOwnerRequest {
|
||||
const message = new QueryGetBondsByOwnerRequest({});
|
||||
if (data.owner != null) {
|
||||
message.owner = data.owner;
|
||||
}
|
||||
if (data.pagination != null) {
|
||||
message.pagination = dependency_4.cosmos.base.query.v1beta1.PageResponse.fromObject(data.pagination);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
owner?: string;
|
||||
pagination?: ReturnType<typeof dependency_4.cosmos.base.query.v1beta1.PageResponse.prototype.toObject>;
|
||||
} = {};
|
||||
if (this.owner != null) {
|
||||
data.owner = this.owner;
|
||||
}
|
||||
if (this.pagination != null) {
|
||||
data.pagination = this.pagination.toObject();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.owner.length)
|
||||
writer.writeString(1, this.owner);
|
||||
if (this.has_pagination)
|
||||
writer.writeMessage(2, this.pagination, () => this.pagination.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryGetBondsByOwnerRequest {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryGetBondsByOwnerRequest();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.owner = reader.readString();
|
||||
break;
|
||||
case 2:
|
||||
reader.readMessage(message.pagination, () => message.pagination = dependency_4.cosmos.base.query.v1beta1.PageResponse.deserialize(reader));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): QueryGetBondsByOwnerRequest {
|
||||
return QueryGetBondsByOwnerRequest.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
export class QueryGetBondsByOwnerResponse extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
bonds?: dependency_2.vulcanize.bond.v1beta1.Bond[];
|
||||
pagination?: dependency_4.cosmos.base.query.v1beta1.PageResponse;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("bonds" in data && data.bonds != undefined) {
|
||||
this.bonds = data.bonds;
|
||||
}
|
||||
if ("pagination" in data && data.pagination != undefined) {
|
||||
this.pagination = data.pagination;
|
||||
}
|
||||
}
|
||||
}
|
||||
get bonds() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, dependency_2.vulcanize.bond.v1beta1.Bond, 1) as dependency_2.vulcanize.bond.v1beta1.Bond[];
|
||||
}
|
||||
set bonds(value: dependency_2.vulcanize.bond.v1beta1.Bond[]) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 1, value);
|
||||
}
|
||||
get pagination() {
|
||||
return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.query.v1beta1.PageResponse, 2) as dependency_4.cosmos.base.query.v1beta1.PageResponse;
|
||||
}
|
||||
set pagination(value: dependency_4.cosmos.base.query.v1beta1.PageResponse) {
|
||||
pb_1.Message.setWrapperField(this, 2, value);
|
||||
}
|
||||
get has_pagination() {
|
||||
return pb_1.Message.getField(this, 2) != null;
|
||||
}
|
||||
static fromObject(data: {
|
||||
bonds?: ReturnType<typeof dependency_2.vulcanize.bond.v1beta1.Bond.prototype.toObject>[];
|
||||
pagination?: ReturnType<typeof dependency_4.cosmos.base.query.v1beta1.PageResponse.prototype.toObject>;
|
||||
}): QueryGetBondsByOwnerResponse {
|
||||
const message = new QueryGetBondsByOwnerResponse({});
|
||||
if (data.bonds != null) {
|
||||
message.bonds = data.bonds.map(item => dependency_2.vulcanize.bond.v1beta1.Bond.fromObject(item));
|
||||
}
|
||||
if (data.pagination != null) {
|
||||
message.pagination = dependency_4.cosmos.base.query.v1beta1.PageResponse.fromObject(data.pagination);
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
bonds?: ReturnType<typeof dependency_2.vulcanize.bond.v1beta1.Bond.prototype.toObject>[];
|
||||
pagination?: ReturnType<typeof dependency_4.cosmos.base.query.v1beta1.PageResponse.prototype.toObject>;
|
||||
} = {};
|
||||
if (this.bonds != null) {
|
||||
data.bonds = this.bonds.map((item: dependency_2.vulcanize.bond.v1beta1.Bond) => item.toObject());
|
||||
}
|
||||
if (this.pagination != null) {
|
||||
data.pagination = this.pagination.toObject();
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.bonds.length)
|
||||
writer.writeRepeatedMessage(1, this.bonds, (item: dependency_2.vulcanize.bond.v1beta1.Bond) => item.serialize(writer));
|
||||
if (this.has_pagination)
|
||||
writer.writeMessage(2, this.pagination, () => this.pagination.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryGetBondsByOwnerResponse {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryGetBondsByOwnerResponse();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
reader.readMessage(message.bonds, () => pb_1.Message.addToRepeatedWrapperField(message, 1, dependency_2.vulcanize.bond.v1beta1.Bond.deserialize(reader), dependency_2.vulcanize.bond.v1beta1.Bond));
|
||||
break;
|
||||
case 2:
|
||||
reader.readMessage(message.pagination, () => message.pagination = dependency_4.cosmos.base.query.v1beta1.PageResponse.deserialize(reader));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): QueryGetBondsByOwnerResponse {
|
||||
return QueryGetBondsByOwnerResponse.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
export class QueryGetBondModuleBalanceRequest extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") { }
|
||||
}
|
||||
static fromObject(data: {}): QueryGetBondModuleBalanceRequest {
|
||||
const message = new QueryGetBondModuleBalanceRequest({});
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {} = {};
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryGetBondModuleBalanceRequest {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryGetBondModuleBalanceRequest();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): QueryGetBondModuleBalanceRequest {
|
||||
return QueryGetBondModuleBalanceRequest.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
export class QueryGetBondModuleBalanceResponse extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
balance?: dependency_5.cosmos.base.v1beta1.Coin[];
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("balance" in data && data.balance != undefined) {
|
||||
this.balance = data.balance;
|
||||
}
|
||||
}
|
||||
}
|
||||
get balance() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, dependency_5.cosmos.base.v1beta1.Coin, 2) as dependency_5.cosmos.base.v1beta1.Coin[];
|
||||
}
|
||||
set balance(value: dependency_5.cosmos.base.v1beta1.Coin[]) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 2, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
balance?: ReturnType<typeof dependency_5.cosmos.base.v1beta1.Coin.prototype.toObject>[];
|
||||
}): QueryGetBondModuleBalanceResponse {
|
||||
const message = new QueryGetBondModuleBalanceResponse({});
|
||||
if (data.balance != null) {
|
||||
message.balance = data.balance.map(item => dependency_5.cosmos.base.v1beta1.Coin.fromObject(item));
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
balance?: ReturnType<typeof dependency_5.cosmos.base.v1beta1.Coin.prototype.toObject>[];
|
||||
} = {};
|
||||
if (this.balance != null) {
|
||||
data.balance = this.balance.map((item: dependency_5.cosmos.base.v1beta1.Coin) => item.toObject());
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.balance.length)
|
||||
writer.writeRepeatedMessage(2, this.balance, (item: dependency_5.cosmos.base.v1beta1.Coin) => item.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryGetBondModuleBalanceResponse {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryGetBondModuleBalanceResponse();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 2:
|
||||
reader.readMessage(message.balance, () => pb_1.Message.addToRepeatedWrapperField(message, 2, dependency_5.cosmos.base.v1beta1.Coin.deserialize(reader), dependency_5.cosmos.base.v1beta1.Coin));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): QueryGetBondModuleBalanceResponse {
|
||||
return QueryGetBondModuleBalanceResponse.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,605 +0,0 @@
|
||||
// @ts-nocheck
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||
* compiler version: 4.25.1
|
||||
* source: vulcanize/bond/v1beta1/tx.proto
|
||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||
import * as dependency_1 from "./../../../gogoproto/gogo";
|
||||
import * as dependency_2 from "./../../../cosmos/base/v1beta1/coin";
|
||||
import * as pb_1 from "google-protobuf";
|
||||
export namespace vulcanize.bond.v1beta1 {
|
||||
export class MsgCreateBond extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
signer?: string;
|
||||
coins?: dependency_2.cosmos.base.v1beta1.Coin[];
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("signer" in data && data.signer != undefined) {
|
||||
this.signer = data.signer;
|
||||
}
|
||||
if ("coins" in data && data.coins != undefined) {
|
||||
this.coins = data.coins;
|
||||
}
|
||||
}
|
||||
}
|
||||
get signer() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
|
||||
}
|
||||
set signer(value: string) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get coins() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, dependency_2.cosmos.base.v1beta1.Coin, 2) as dependency_2.cosmos.base.v1beta1.Coin[];
|
||||
}
|
||||
set coins(value: dependency_2.cosmos.base.v1beta1.Coin[]) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 2, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
signer?: string;
|
||||
coins?: ReturnType<typeof dependency_2.cosmos.base.v1beta1.Coin.prototype.toObject>[];
|
||||
}): MsgCreateBond {
|
||||
const message = new MsgCreateBond({});
|
||||
if (data.signer != null) {
|
||||
message.signer = data.signer;
|
||||
}
|
||||
if (data.coins != null) {
|
||||
message.coins = data.coins.map(item => dependency_2.cosmos.base.v1beta1.Coin.fromObject(item));
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
signer?: string;
|
||||
coins?: ReturnType<typeof dependency_2.cosmos.base.v1beta1.Coin.prototype.toObject>[];
|
||||
} = {};
|
||||
if (this.signer != null) {
|
||||
data.signer = this.signer;
|
||||
}
|
||||
if (this.coins != null) {
|
||||
data.coins = this.coins.map((item: dependency_2.cosmos.base.v1beta1.Coin) => item.toObject());
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.signer.length)
|
||||
writer.writeString(1, this.signer);
|
||||
if (this.coins.length)
|
||||
writer.writeRepeatedMessage(2, this.coins, (item: dependency_2.cosmos.base.v1beta1.Coin) => item.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgCreateBond {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgCreateBond();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.signer = reader.readString();
|
||||
break;
|
||||
case 2:
|
||||
reader.readMessage(message.coins, () => pb_1.Message.addToRepeatedWrapperField(message, 2, dependency_2.cosmos.base.v1beta1.Coin.deserialize(reader), dependency_2.cosmos.base.v1beta1.Coin));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): MsgCreateBond {
|
||||
return MsgCreateBond.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
export class MsgCreateBondResponse extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
id?: string;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("id" in data && data.id != undefined) {
|
||||
this.id = data.id;
|
||||
}
|
||||
}
|
||||
}
|
||||
get id() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
|
||||
}
|
||||
set id(value: string) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
id?: string;
|
||||
}): MsgCreateBondResponse {
|
||||
const message = new MsgCreateBondResponse({});
|
||||
if (data.id != null) {
|
||||
message.id = data.id;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
id?: string;
|
||||
} = {};
|
||||
if (this.id != null) {
|
||||
data.id = this.id;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.id.length)
|
||||
writer.writeString(1, this.id);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgCreateBondResponse {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgCreateBondResponse();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.id = reader.readString();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): MsgCreateBondResponse {
|
||||
return MsgCreateBondResponse.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
export class MsgRefillBond extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
id?: string;
|
||||
signer?: string;
|
||||
coins?: dependency_2.cosmos.base.v1beta1.Coin[];
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("id" in data && data.id != undefined) {
|
||||
this.id = data.id;
|
||||
}
|
||||
if ("signer" in data && data.signer != undefined) {
|
||||
this.signer = data.signer;
|
||||
}
|
||||
if ("coins" in data && data.coins != undefined) {
|
||||
this.coins = data.coins;
|
||||
}
|
||||
}
|
||||
}
|
||||
get id() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
|
||||
}
|
||||
set id(value: string) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get signer() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
|
||||
}
|
||||
set signer(value: string) {
|
||||
pb_1.Message.setField(this, 2, value);
|
||||
}
|
||||
get coins() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, dependency_2.cosmos.base.v1beta1.Coin, 3) as dependency_2.cosmos.base.v1beta1.Coin[];
|
||||
}
|
||||
set coins(value: dependency_2.cosmos.base.v1beta1.Coin[]) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 3, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
id?: string;
|
||||
signer?: string;
|
||||
coins?: ReturnType<typeof dependency_2.cosmos.base.v1beta1.Coin.prototype.toObject>[];
|
||||
}): MsgRefillBond {
|
||||
const message = new MsgRefillBond({});
|
||||
if (data.id != null) {
|
||||
message.id = data.id;
|
||||
}
|
||||
if (data.signer != null) {
|
||||
message.signer = data.signer;
|
||||
}
|
||||
if (data.coins != null) {
|
||||
message.coins = data.coins.map(item => dependency_2.cosmos.base.v1beta1.Coin.fromObject(item));
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
id?: string;
|
||||
signer?: string;
|
||||
coins?: ReturnType<typeof dependency_2.cosmos.base.v1beta1.Coin.prototype.toObject>[];
|
||||
} = {};
|
||||
if (this.id != null) {
|
||||
data.id = this.id;
|
||||
}
|
||||
if (this.signer != null) {
|
||||
data.signer = this.signer;
|
||||
}
|
||||
if (this.coins != null) {
|
||||
data.coins = this.coins.map((item: dependency_2.cosmos.base.v1beta1.Coin) => item.toObject());
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.id.length)
|
||||
writer.writeString(1, this.id);
|
||||
if (this.signer.length)
|
||||
writer.writeString(2, this.signer);
|
||||
if (this.coins.length)
|
||||
writer.writeRepeatedMessage(3, this.coins, (item: dependency_2.cosmos.base.v1beta1.Coin) => item.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgRefillBond {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgRefillBond();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.id = reader.readString();
|
||||
break;
|
||||
case 2:
|
||||
message.signer = reader.readString();
|
||||
break;
|
||||
case 3:
|
||||
reader.readMessage(message.coins, () => pb_1.Message.addToRepeatedWrapperField(message, 3, dependency_2.cosmos.base.v1beta1.Coin.deserialize(reader), dependency_2.cosmos.base.v1beta1.Coin));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): MsgRefillBond {
|
||||
return MsgRefillBond.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
export class MsgRefillBondResponse extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") { }
|
||||
}
|
||||
static fromObject(data: {}): MsgRefillBondResponse {
|
||||
const message = new MsgRefillBondResponse({});
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {} = {};
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgRefillBondResponse {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgRefillBondResponse();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): MsgRefillBondResponse {
|
||||
return MsgRefillBondResponse.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
export class MsgWithdrawBond extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
id?: string;
|
||||
signer?: string;
|
||||
coins?: dependency_2.cosmos.base.v1beta1.Coin[];
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("id" in data && data.id != undefined) {
|
||||
this.id = data.id;
|
||||
}
|
||||
if ("signer" in data && data.signer != undefined) {
|
||||
this.signer = data.signer;
|
||||
}
|
||||
if ("coins" in data && data.coins != undefined) {
|
||||
this.coins = data.coins;
|
||||
}
|
||||
}
|
||||
}
|
||||
get id() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
|
||||
}
|
||||
set id(value: string) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get signer() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
|
||||
}
|
||||
set signer(value: string) {
|
||||
pb_1.Message.setField(this, 2, value);
|
||||
}
|
||||
get coins() {
|
||||
return pb_1.Message.getRepeatedWrapperField(this, dependency_2.cosmos.base.v1beta1.Coin, 3) as dependency_2.cosmos.base.v1beta1.Coin[];
|
||||
}
|
||||
set coins(value: dependency_2.cosmos.base.v1beta1.Coin[]) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 3, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
id?: string;
|
||||
signer?: string;
|
||||
coins?: ReturnType<typeof dependency_2.cosmos.base.v1beta1.Coin.prototype.toObject>[];
|
||||
}): MsgWithdrawBond {
|
||||
const message = new MsgWithdrawBond({});
|
||||
if (data.id != null) {
|
||||
message.id = data.id;
|
||||
}
|
||||
if (data.signer != null) {
|
||||
message.signer = data.signer;
|
||||
}
|
||||
if (data.coins != null) {
|
||||
message.coins = data.coins.map(item => dependency_2.cosmos.base.v1beta1.Coin.fromObject(item));
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
id?: string;
|
||||
signer?: string;
|
||||
coins?: ReturnType<typeof dependency_2.cosmos.base.v1beta1.Coin.prototype.toObject>[];
|
||||
} = {};
|
||||
if (this.id != null) {
|
||||
data.id = this.id;
|
||||
}
|
||||
if (this.signer != null) {
|
||||
data.signer = this.signer;
|
||||
}
|
||||
if (this.coins != null) {
|
||||
data.coins = this.coins.map((item: dependency_2.cosmos.base.v1beta1.Coin) => item.toObject());
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.id.length)
|
||||
writer.writeString(1, this.id);
|
||||
if (this.signer.length)
|
||||
writer.writeString(2, this.signer);
|
||||
if (this.coins.length)
|
||||
writer.writeRepeatedMessage(3, this.coins, (item: dependency_2.cosmos.base.v1beta1.Coin) => item.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgWithdrawBond {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgWithdrawBond();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.id = reader.readString();
|
||||
break;
|
||||
case 2:
|
||||
message.signer = reader.readString();
|
||||
break;
|
||||
case 3:
|
||||
reader.readMessage(message.coins, () => pb_1.Message.addToRepeatedWrapperField(message, 3, dependency_2.cosmos.base.v1beta1.Coin.deserialize(reader), dependency_2.cosmos.base.v1beta1.Coin));
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): MsgWithdrawBond {
|
||||
return MsgWithdrawBond.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
export class MsgWithdrawBondResponse extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") { }
|
||||
}
|
||||
static fromObject(data: {}): MsgWithdrawBondResponse {
|
||||
const message = new MsgWithdrawBondResponse({});
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {} = {};
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgWithdrawBondResponse {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgWithdrawBondResponse();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): MsgWithdrawBondResponse {
|
||||
return MsgWithdrawBondResponse.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
export class MsgCancelBond extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
id?: string;
|
||||
signer?: string;
|
||||
}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") {
|
||||
if ("id" in data && data.id != undefined) {
|
||||
this.id = data.id;
|
||||
}
|
||||
if ("signer" in data && data.signer != undefined) {
|
||||
this.signer = data.signer;
|
||||
}
|
||||
}
|
||||
}
|
||||
get id() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 1, "") as string;
|
||||
}
|
||||
set id(value: string) {
|
||||
pb_1.Message.setField(this, 1, value);
|
||||
}
|
||||
get signer() {
|
||||
return pb_1.Message.getFieldWithDefault(this, 2, "") as string;
|
||||
}
|
||||
set signer(value: string) {
|
||||
pb_1.Message.setField(this, 2, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
id?: string;
|
||||
signer?: string;
|
||||
}): MsgCancelBond {
|
||||
const message = new MsgCancelBond({});
|
||||
if (data.id != null) {
|
||||
message.id = data.id;
|
||||
}
|
||||
if (data.signer != null) {
|
||||
message.signer = data.signer;
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
id?: string;
|
||||
signer?: string;
|
||||
} = {};
|
||||
if (this.id != null) {
|
||||
data.id = this.id;
|
||||
}
|
||||
if (this.signer != null) {
|
||||
data.signer = this.signer;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.id.length)
|
||||
writer.writeString(1, this.id);
|
||||
if (this.signer.length)
|
||||
writer.writeString(2, this.signer);
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgCancelBond {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgCancelBond();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
message.id = reader.readString();
|
||||
break;
|
||||
case 2:
|
||||
message.signer = reader.readString();
|
||||
break;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): MsgCancelBond {
|
||||
return MsgCancelBond.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
export class MsgCancelBondResponse extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {}) {
|
||||
super();
|
||||
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls);
|
||||
if (!Array.isArray(data) && typeof data == "object") { }
|
||||
}
|
||||
static fromObject(data: {}): MsgCancelBondResponse {
|
||||
const message = new MsgCancelBondResponse({});
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {} = {};
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgCancelBondResponse {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgCancelBondResponse();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): MsgCancelBondResponse {
|
||||
return MsgCancelBondResponse.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,151 +0,0 @@
|
||||
// @ts-nocheck
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* Generated by the protoc-gen-ts. DO NOT EDIT!
|
||||
* compiler version: 4.25.1
|
||||
* source: vulcanize/registry/v1beta1/genesis.proto
|
||||
* git: https://github.com/thesayyn/protoc-gen-ts */
|
||||
import * as dependency_1 from "./../../../gogoproto/gogo";
|
||||
import * as dependency_2 from "./registry";
|
||||
import * as pb_1 from "google-protobuf";
|
||||
export namespace vulcanize.registry.v1beta1 {
|
||||
export class GenesisState extends pb_1.Message {
|
||||
#one_of_decls: number[][] = [];
|
||||
constructor(data?: any[] | {
|
||||
params?: dependency_2.vulcanize.registry.v1beta1.Params;
|
||||
records?: dependency_2.vulcanize.registry.v1beta1.Record[];
|
||||
authorities?: dependency_2.vulcanize.registry.v1beta1.AuthorityEntry[];
|
||||
names?: dependency_2.vulcanize.registry.v1beta1.NameEntry[];
|
||||
}) {
|
||||
super();
|
||||
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 ("params" in data && data.params != undefined) {
|
||||
this.params = data.params;
|
||||
}
|
||||
if ("records" in data && data.records != undefined) {
|
||||
this.records = data.records;
|
||||
}
|
||||
if ("authorities" in data && data.authorities != undefined) {
|
||||
this.authorities = data.authorities;
|
||||
}
|
||||
if ("names" in data && data.names != undefined) {
|
||||
this.names = data.names;
|
||||
}
|
||||
}
|
||||
}
|
||||
get 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.registry.v1beta1.Params) {
|
||||
pb_1.Message.setWrapperField(this, 1, value);
|
||||
}
|
||||
get has_params() {
|
||||
return pb_1.Message.getField(this, 1) != null;
|
||||
}
|
||||
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);
|
||||
}
|
||||
get authorities() {
|
||||
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.registry.v1beta1.AuthorityEntry[]) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 3, value);
|
||||
}
|
||||
get names() {
|
||||
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.registry.v1beta1.NameEntry[]) {
|
||||
pb_1.Message.setRepeatedWrapperField(this, 4, value);
|
||||
}
|
||||
static fromObject(data: {
|
||||
params?: ReturnType<typeof dependency_2.vulcanize.registry.v1beta1.Params.prototype.toObject>;
|
||||
records?: ReturnType<typeof dependency_2.vulcanize.registry.v1beta1.Record.prototype.toObject>[];
|
||||
authorities?: ReturnType<typeof dependency_2.vulcanize.registry.v1beta1.AuthorityEntry.prototype.toObject>[];
|
||||
names?: ReturnType<typeof dependency_2.vulcanize.registry.v1beta1.NameEntry.prototype.toObject>[];
|
||||
}): GenesisState {
|
||||
const message = new GenesisState({});
|
||||
if (data.params != null) {
|
||||
message.params = dependency_2.vulcanize.registry.v1beta1.Params.fromObject(data.params);
|
||||
}
|
||||
if (data.records != null) {
|
||||
message.records = data.records.map(item => dependency_2.vulcanize.registry.v1beta1.Record.fromObject(item));
|
||||
}
|
||||
if (data.authorities != null) {
|
||||
message.authorities = data.authorities.map(item => dependency_2.vulcanize.registry.v1beta1.AuthorityEntry.fromObject(item));
|
||||
}
|
||||
if (data.names != null) {
|
||||
message.names = data.names.map(item => dependency_2.vulcanize.registry.v1beta1.NameEntry.fromObject(item));
|
||||
}
|
||||
return message;
|
||||
}
|
||||
toObject() {
|
||||
const data: {
|
||||
params?: ReturnType<typeof dependency_2.vulcanize.registry.v1beta1.Params.prototype.toObject>;
|
||||
records?: ReturnType<typeof dependency_2.vulcanize.registry.v1beta1.Record.prototype.toObject>[];
|
||||
authorities?: ReturnType<typeof dependency_2.vulcanize.registry.v1beta1.AuthorityEntry.prototype.toObject>[];
|
||||
names?: ReturnType<typeof dependency_2.vulcanize.registry.v1beta1.NameEntry.prototype.toObject>[];
|
||||
} = {};
|
||||
if (this.params != null) {
|
||||
data.params = this.params.toObject();
|
||||
}
|
||||
if (this.records != null) {
|
||||
data.records = this.records.map((item: dependency_2.vulcanize.registry.v1beta1.Record) => item.toObject());
|
||||
}
|
||||
if (this.authorities != null) {
|
||||
data.authorities = this.authorities.map((item: dependency_2.vulcanize.registry.v1beta1.AuthorityEntry) => item.toObject());
|
||||
}
|
||||
if (this.names != null) {
|
||||
data.names = this.names.map((item: dependency_2.vulcanize.registry.v1beta1.NameEntry) => item.toObject());
|
||||
}
|
||||
return data;
|
||||
}
|
||||
serialize(): Uint8Array;
|
||||
serialize(w: pb_1.BinaryWriter): void;
|
||||
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
|
||||
const writer = w || new pb_1.BinaryWriter();
|
||||
if (this.has_params)
|
||||
writer.writeMessage(1, this.params, () => this.params.serialize(writer));
|
||||
if (this.records.length)
|
||||
writer.writeRepeatedMessage(2, this.records, (item: dependency_2.vulcanize.registry.v1beta1.Record) => item.serialize(writer));
|
||||
if (this.authorities.length)
|
||||
writer.writeRepeatedMessage(3, this.authorities, (item: dependency_2.vulcanize.registry.v1beta1.AuthorityEntry) => item.serialize(writer));
|
||||
if (this.names.length)
|
||||
writer.writeRepeatedMessage(4, this.names, (item: dependency_2.vulcanize.registry.v1beta1.NameEntry) => item.serialize(writer));
|
||||
if (!w)
|
||||
return writer.getResultBuffer();
|
||||
}
|
||||
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GenesisState {
|
||||
const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GenesisState();
|
||||
while (reader.nextField()) {
|
||||
if (reader.isEndGroup())
|
||||
break;
|
||||
switch (reader.getFieldNumber()) {
|
||||
case 1:
|
||||
reader.readMessage(message.params, () => message.params = dependency_2.vulcanize.registry.v1beta1.Params.deserialize(reader));
|
||||
break;
|
||||
case 2:
|
||||
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;
|
||||
case 3:
|
||||
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;
|
||||
case 4:
|
||||
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;
|
||||
default: reader.skipField();
|
||||
}
|
||||
}
|
||||
return message;
|
||||
}
|
||||
serializeBinary(): Uint8Array {
|
||||
return this.serialize();
|
||||
}
|
||||
static deserializeBinary(bytes: Uint8Array): GenesisState {
|
||||
return GenesisState.deserialize(bytes);
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -1,322 +0,0 @@
|
||||
/* eslint-disable */
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "cosmos.base.query.v1beta1";
|
||||
|
||||
/**
|
||||
* PageRequest is to be embedded in gRPC request messages for efficient
|
||||
* pagination. Ex:
|
||||
*
|
||||
* message SomeRequest {
|
||||
* Foo some_parameter = 1;
|
||||
* PageRequest pagination = 2;
|
||||
* }
|
||||
*/
|
||||
export interface PageRequest {
|
||||
/**
|
||||
* key is a value returned in PageResponse.next_key to begin
|
||||
* querying the next page most efficiently. Only one of offset or key
|
||||
* should be set.
|
||||
*/
|
||||
key: Uint8Array;
|
||||
/**
|
||||
* offset is a numeric offset that can be used when key is unavailable.
|
||||
* It is less efficient than using key. Only one of offset or key should
|
||||
* be set.
|
||||
*/
|
||||
offset: Long;
|
||||
/**
|
||||
* limit is the total number of results to be returned in the result page.
|
||||
* If left empty it will default to a value to be set by each app.
|
||||
*/
|
||||
limit: Long;
|
||||
/**
|
||||
* count_total is set to true to indicate that the result set should include
|
||||
* a count of the total number of items available for pagination in UIs.
|
||||
* count_total is only respected when offset is used. It is ignored when key
|
||||
* is set.
|
||||
*/
|
||||
countTotal: boolean;
|
||||
/**
|
||||
* reverse is set to true if results are to be returned in the descending order.
|
||||
*
|
||||
* Since: cosmos-sdk 0.43
|
||||
*/
|
||||
reverse: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* PageResponse is to be embedded in gRPC response messages where the
|
||||
* corresponding request message has used PageRequest.
|
||||
*
|
||||
* message SomeResponse {
|
||||
* repeated Bar results = 1;
|
||||
* PageResponse page = 2;
|
||||
* }
|
||||
*/
|
||||
export interface PageResponse {
|
||||
/**
|
||||
* next_key is the key to be passed to PageRequest.key to
|
||||
* query the next page most efficiently. It will be empty if
|
||||
* there are no more results.
|
||||
*/
|
||||
nextKey: Uint8Array;
|
||||
/**
|
||||
* total is total number of results available if PageRequest.count_total
|
||||
* was set, its value is undefined otherwise
|
||||
*/
|
||||
total: Long;
|
||||
}
|
||||
|
||||
function createBasePageRequest(): PageRequest {
|
||||
return {
|
||||
key: new Uint8Array(),
|
||||
offset: Long.UZERO,
|
||||
limit: Long.UZERO,
|
||||
countTotal: false,
|
||||
reverse: false,
|
||||
};
|
||||
}
|
||||
|
||||
export const PageRequest = {
|
||||
encode(
|
||||
message: PageRequest,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.key.length !== 0) {
|
||||
writer.uint32(10).bytes(message.key);
|
||||
}
|
||||
if (!message.offset.isZero()) {
|
||||
writer.uint32(16).uint64(message.offset);
|
||||
}
|
||||
if (!message.limit.isZero()) {
|
||||
writer.uint32(24).uint64(message.limit);
|
||||
}
|
||||
if (message.countTotal === true) {
|
||||
writer.uint32(32).bool(message.countTotal);
|
||||
}
|
||||
if (message.reverse === true) {
|
||||
writer.uint32(40).bool(message.reverse);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): PageRequest {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBasePageRequest();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.key = reader.bytes();
|
||||
break;
|
||||
case 2:
|
||||
message.offset = reader.uint64() as Long;
|
||||
break;
|
||||
case 3:
|
||||
message.limit = reader.uint64() as Long;
|
||||
break;
|
||||
case 4:
|
||||
message.countTotal = reader.bool();
|
||||
break;
|
||||
case 5:
|
||||
message.reverse = reader.bool();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): PageRequest {
|
||||
return {
|
||||
key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(),
|
||||
offset: isSet(object.offset) ? Long.fromValue(object.offset) : Long.UZERO,
|
||||
limit: isSet(object.limit) ? Long.fromValue(object.limit) : Long.UZERO,
|
||||
countTotal: isSet(object.countTotal) ? Boolean(object.countTotal) : false,
|
||||
reverse: isSet(object.reverse) ? Boolean(object.reverse) : false,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: PageRequest): unknown {
|
||||
const obj: any = {};
|
||||
message.key !== undefined &&
|
||||
(obj.key = base64FromBytes(
|
||||
message.key !== undefined ? message.key : new Uint8Array()
|
||||
));
|
||||
message.offset !== undefined &&
|
||||
(obj.offset = (message.offset || Long.UZERO).toString());
|
||||
message.limit !== undefined &&
|
||||
(obj.limit = (message.limit || Long.UZERO).toString());
|
||||
message.countTotal !== undefined && (obj.countTotal = message.countTotal);
|
||||
message.reverse !== undefined && (obj.reverse = message.reverse);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<PageRequest>, I>>(
|
||||
object: I
|
||||
): PageRequest {
|
||||
const message = createBasePageRequest();
|
||||
message.key = object.key ?? new Uint8Array();
|
||||
message.offset =
|
||||
object.offset !== undefined && object.offset !== null
|
||||
? Long.fromValue(object.offset)
|
||||
: Long.UZERO;
|
||||
message.limit =
|
||||
object.limit !== undefined && object.limit !== null
|
||||
? Long.fromValue(object.limit)
|
||||
: Long.UZERO;
|
||||
message.countTotal = object.countTotal ?? false;
|
||||
message.reverse = object.reverse ?? false;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBasePageResponse(): PageResponse {
|
||||
return { nextKey: new Uint8Array(), total: Long.UZERO };
|
||||
}
|
||||
|
||||
export const PageResponse = {
|
||||
encode(
|
||||
message: PageResponse,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.nextKey.length !== 0) {
|
||||
writer.uint32(10).bytes(message.nextKey);
|
||||
}
|
||||
if (!message.total.isZero()) {
|
||||
writer.uint32(16).uint64(message.total);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): PageResponse {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBasePageResponse();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.nextKey = reader.bytes();
|
||||
break;
|
||||
case 2:
|
||||
message.total = reader.uint64() as Long;
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): PageResponse {
|
||||
return {
|
||||
nextKey: isSet(object.nextKey)
|
||||
? bytesFromBase64(object.nextKey)
|
||||
: new Uint8Array(),
|
||||
total: isSet(object.total) ? Long.fromValue(object.total) : Long.UZERO,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: PageResponse): unknown {
|
||||
const obj: any = {};
|
||||
message.nextKey !== undefined &&
|
||||
(obj.nextKey = base64FromBytes(
|
||||
message.nextKey !== undefined ? message.nextKey : new Uint8Array()
|
||||
));
|
||||
message.total !== undefined &&
|
||||
(obj.total = (message.total || Long.UZERO).toString());
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<PageResponse>, I>>(
|
||||
object: I
|
||||
): PageResponse {
|
||||
const message = createBasePageResponse();
|
||||
message.nextKey = object.nextKey ?? new Uint8Array();
|
||||
message.total =
|
||||
object.total !== undefined && object.total !== null
|
||||
? Long.fromValue(object.total)
|
||||
: Long.UZERO;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
declare var self: any | undefined;
|
||||
declare var window: any | undefined;
|
||||
declare var global: any | undefined;
|
||||
var globalThis: any = (() => {
|
||||
if (typeof globalThis !== "undefined") return globalThis;
|
||||
if (typeof self !== "undefined") return self;
|
||||
if (typeof window !== "undefined") return window;
|
||||
if (typeof global !== "undefined") return global;
|
||||
throw "Unable to locate global object";
|
||||
})();
|
||||
|
||||
function bytesFromBase64(b64: string): Uint8Array {
|
||||
if (globalThis.Buffer) {
|
||||
return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
|
||||
} else {
|
||||
const bin = globalThis.atob(b64);
|
||||
const arr = new Uint8Array(bin.length);
|
||||
for (let i = 0; i < bin.length; ++i) {
|
||||
arr[i] = bin.charCodeAt(i);
|
||||
}
|
||||
return arr;
|
||||
}
|
||||
}
|
||||
|
||||
function base64FromBytes(arr: Uint8Array): string {
|
||||
if (globalThis.Buffer) {
|
||||
return globalThis.Buffer.from(arr).toString("base64");
|
||||
} else {
|
||||
const bin: string[] = [];
|
||||
arr.forEach((byte) => {
|
||||
bin.push(String.fromCharCode(byte));
|
||||
});
|
||||
return globalThis.btoa(bin.join(""));
|
||||
}
|
||||
}
|
||||
|
||||
type Builtin =
|
||||
| Date
|
||||
| Function
|
||||
| Uint8Array
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: T extends Long
|
||||
? string | number | Long
|
||||
: T extends Array<infer U>
|
||||
? Array<DeepPartial<U>>
|
||||
: T extends ReadonlyArray<infer U>
|
||||
? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {}
|
||||
? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||
export type Exact<P, I extends P> = P extends Builtin
|
||||
? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
||||
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
||||
};
|
||||
|
||||
if (_m0.util.Long !== Long) {
|
||||
_m0.util.Long = Long as any;
|
||||
_m0.configure();
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
||||
@@ -1,303 +0,0 @@
|
||||
/* eslint-disable */
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "cosmos.base.v1beta1";
|
||||
|
||||
/**
|
||||
* Coin defines a token with a denomination and an amount.
|
||||
*
|
||||
* NOTE: The amount field is an Int which implements the custom method
|
||||
* signatures required by gogoproto.
|
||||
*/
|
||||
export interface Coin {
|
||||
denom: string;
|
||||
amount: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* DecCoin defines a token with a denomination and a decimal amount.
|
||||
*
|
||||
* NOTE: The amount field is an Dec which implements the custom method
|
||||
* signatures required by gogoproto.
|
||||
*/
|
||||
export interface DecCoin {
|
||||
denom: string;
|
||||
amount: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* IntProto defines a Protobuf wrapper around an Int object.
|
||||
* Deprecated: Prefer to use math.Int directly. It supports binary Marshal and Unmarshal.
|
||||
*/
|
||||
export interface IntProto {
|
||||
int: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* DecProto defines a Protobuf wrapper around a Dec object.
|
||||
* Deprecated: Prefer to use math.LegacyDec directly. It supports binary Marshal and Unmarshal.
|
||||
*/
|
||||
export interface DecProto {
|
||||
dec: string;
|
||||
}
|
||||
|
||||
function createBaseCoin(): Coin {
|
||||
return { denom: "", amount: "" };
|
||||
}
|
||||
|
||||
export const Coin = {
|
||||
encode(message: Coin, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
if (message.denom !== "") {
|
||||
writer.uint32(10).string(message.denom);
|
||||
}
|
||||
if (message.amount !== "") {
|
||||
writer.uint32(18).string(message.amount);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): Coin {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseCoin();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.denom = reader.string();
|
||||
break;
|
||||
case 2:
|
||||
message.amount = reader.string();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): Coin {
|
||||
return {
|
||||
denom: isSet(object.denom) ? String(object.denom) : "",
|
||||
amount: isSet(object.amount) ? String(object.amount) : "",
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: Coin): unknown {
|
||||
const obj: any = {};
|
||||
message.denom !== undefined && (obj.denom = message.denom);
|
||||
message.amount !== undefined && (obj.amount = message.amount);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<Coin>, I>>(object: I): Coin {
|
||||
const message = createBaseCoin();
|
||||
message.denom = object.denom ?? "";
|
||||
message.amount = object.amount ?? "";
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseDecCoin(): DecCoin {
|
||||
return { denom: "", amount: "" };
|
||||
}
|
||||
|
||||
export const DecCoin = {
|
||||
encode(
|
||||
message: DecCoin,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.denom !== "") {
|
||||
writer.uint32(10).string(message.denom);
|
||||
}
|
||||
if (message.amount !== "") {
|
||||
writer.uint32(18).string(message.amount);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): DecCoin {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseDecCoin();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.denom = reader.string();
|
||||
break;
|
||||
case 2:
|
||||
message.amount = reader.string();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): DecCoin {
|
||||
return {
|
||||
denom: isSet(object.denom) ? String(object.denom) : "",
|
||||
amount: isSet(object.amount) ? String(object.amount) : "",
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: DecCoin): unknown {
|
||||
const obj: any = {};
|
||||
message.denom !== undefined && (obj.denom = message.denom);
|
||||
message.amount !== undefined && (obj.amount = message.amount);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<DecCoin>, I>>(object: I): DecCoin {
|
||||
const message = createBaseDecCoin();
|
||||
message.denom = object.denom ?? "";
|
||||
message.amount = object.amount ?? "";
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseIntProto(): IntProto {
|
||||
return { int: "" };
|
||||
}
|
||||
|
||||
export const IntProto = {
|
||||
encode(
|
||||
message: IntProto,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.int !== "") {
|
||||
writer.uint32(10).string(message.int);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): IntProto {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseIntProto();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.int = reader.string();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): IntProto {
|
||||
return {
|
||||
int: isSet(object.int) ? String(object.int) : "",
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: IntProto): unknown {
|
||||
const obj: any = {};
|
||||
message.int !== undefined && (obj.int = message.int);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<IntProto>, I>>(object: I): IntProto {
|
||||
const message = createBaseIntProto();
|
||||
message.int = object.int ?? "";
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseDecProto(): DecProto {
|
||||
return { dec: "" };
|
||||
}
|
||||
|
||||
export const DecProto = {
|
||||
encode(
|
||||
message: DecProto,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.dec !== "") {
|
||||
writer.uint32(10).string(message.dec);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): DecProto {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseDecProto();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.dec = reader.string();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): DecProto {
|
||||
return {
|
||||
dec: isSet(object.dec) ? String(object.dec) : "",
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: DecProto): unknown {
|
||||
const obj: any = {};
|
||||
message.dec !== undefined && (obj.dec = message.dec);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<DecProto>, I>>(object: I): DecProto {
|
||||
const message = createBaseDecProto();
|
||||
message.dec = object.dec ?? "";
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
type Builtin =
|
||||
| Date
|
||||
| Function
|
||||
| Uint8Array
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: T extends Long
|
||||
? string | number | Long
|
||||
: T extends Array<infer U>
|
||||
? Array<DeepPartial<U>>
|
||||
: T extends ReadonlyArray<infer U>
|
||||
? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {}
|
||||
? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||
export type Exact<P, I extends P> = P extends Builtin
|
||||
? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
||||
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
||||
};
|
||||
|
||||
if (_m0.util.Long !== Long) {
|
||||
_m0.util.Long = Long as any;
|
||||
_m0.configure();
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
/* eslint-disable */
|
||||
export const protobufPackage = "gogoproto";
|
||||
@@ -1,2 +0,0 @@
|
||||
/* eslint-disable */
|
||||
export const protobufPackage = "google.api";
|
||||
@@ -1,647 +0,0 @@
|
||||
/* eslint-disable */
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "google.api";
|
||||
|
||||
/**
|
||||
* Defines the HTTP configuration for an API service. It contains a list of
|
||||
* [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method
|
||||
* to one or more HTTP REST API methods.
|
||||
*/
|
||||
export interface Http {
|
||||
/**
|
||||
* A list of HTTP configuration rules that apply to individual API methods.
|
||||
*
|
||||
* **NOTE:** All service configuration rules follow "last one wins" order.
|
||||
*/
|
||||
rules: HttpRule[];
|
||||
/**
|
||||
* When set to true, URL path parmeters will be fully URI-decoded except in
|
||||
* cases of single segment matches in reserved expansion, where "%2F" will be
|
||||
* left encoded.
|
||||
*
|
||||
* The default behavior is to not decode RFC 6570 reserved characters in multi
|
||||
* segment matches.
|
||||
*/
|
||||
fullyDecodeReservedExpansion: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* `HttpRule` defines the mapping of an RPC method to one or more HTTP
|
||||
* REST API methods. The mapping specifies how different portions of the RPC
|
||||
* request message are mapped to URL path, URL query parameters, and
|
||||
* HTTP request body. The mapping is typically specified as an
|
||||
* `google.api.http` annotation on the RPC method,
|
||||
* see "google/api/annotations.proto" for details.
|
||||
*
|
||||
* The mapping consists of a field specifying the path template and
|
||||
* method kind. The path template can refer to fields in the request
|
||||
* message, as in the example below which describes a REST GET
|
||||
* operation on a resource collection of messages:
|
||||
*
|
||||
*
|
||||
* service Messaging {
|
||||
* rpc GetMessage(GetMessageRequest) returns (Message) {
|
||||
* option (google.api.http).get =
|
||||
* "/v1/messages/{message_id}/{sub.subfield}";
|
||||
* }
|
||||
* }
|
||||
* message GetMessageRequest {
|
||||
* message SubMessage {
|
||||
* string subfield = 1;
|
||||
* }
|
||||
* string message_id = 1; // mapped to the URL
|
||||
* SubMessage sub = 2; // `sub.subfield` is url-mapped
|
||||
* }
|
||||
* message Message {
|
||||
* string text = 1; // content of the resource
|
||||
* }
|
||||
*
|
||||
* The same http annotation can alternatively be expressed inside the
|
||||
* `GRPC API Configuration` YAML file.
|
||||
*
|
||||
* http:
|
||||
* rules:
|
||||
* - selector: <proto_package_name>.Messaging.GetMessage
|
||||
* get: /v1/messages/{message_id}/{sub.subfield}
|
||||
*
|
||||
* This definition enables an automatic, bidrectional mapping of HTTP
|
||||
* JSON to RPC. Example:
|
||||
*
|
||||
* HTTP | RPC
|
||||
* -----|-----
|
||||
* `GET /v1/messages/123456/foo` | `GetMessage(message_id: "123456" sub:
|
||||
* SubMessage(subfield: "foo"))`
|
||||
*
|
||||
* In general, not only fields but also field paths can be referenced
|
||||
* from a path pattern. Fields mapped to the path pattern cannot be
|
||||
* repeated and must have a primitive (non-message) type.
|
||||
*
|
||||
* Any fields in the request message which are not bound by the path
|
||||
* pattern automatically become (optional) HTTP query
|
||||
* parameters. Assume the following definition of the request message:
|
||||
*
|
||||
*
|
||||
* service Messaging {
|
||||
* rpc GetMessage(GetMessageRequest) returns (Message) {
|
||||
* option (google.api.http).get = "/v1/messages/{message_id}";
|
||||
* }
|
||||
* }
|
||||
* message GetMessageRequest {
|
||||
* message SubMessage {
|
||||
* string subfield = 1;
|
||||
* }
|
||||
* string message_id = 1; // mapped to the URL
|
||||
* int64 revision = 2; // becomes a parameter
|
||||
* SubMessage sub = 3; // `sub.subfield` becomes a parameter
|
||||
* }
|
||||
*
|
||||
*
|
||||
* This enables a HTTP JSON to RPC mapping as below:
|
||||
*
|
||||
* HTTP | RPC
|
||||
* -----|-----
|
||||
* `GET /v1/messages/123456?revision=2&sub.subfield=foo` |
|
||||
* `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield:
|
||||
* "foo"))`
|
||||
*
|
||||
* Note that fields which are mapped to HTTP parameters must have a
|
||||
* primitive type or a repeated primitive type. Message types are not
|
||||
* allowed. In the case of a repeated type, the parameter can be
|
||||
* repeated in the URL, as in `...?param=A¶m=B`.
|
||||
*
|
||||
* For HTTP method kinds which allow a request body, the `body` field
|
||||
* specifies the mapping. Consider a REST update method on the
|
||||
* message resource collection:
|
||||
*
|
||||
*
|
||||
* service Messaging {
|
||||
* rpc UpdateMessage(UpdateMessageRequest) returns (Message) {
|
||||
* option (google.api.http) = {
|
||||
* put: "/v1/messages/{message_id}"
|
||||
* body: "message"
|
||||
* };
|
||||
* }
|
||||
* }
|
||||
* message UpdateMessageRequest {
|
||||
* string message_id = 1; // mapped to the URL
|
||||
* Message message = 2; // mapped to the body
|
||||
* }
|
||||
*
|
||||
*
|
||||
* The following HTTP JSON to RPC mapping is enabled, where the
|
||||
* representation of the JSON in the request body is determined by
|
||||
* protos JSON encoding:
|
||||
*
|
||||
* HTTP | RPC
|
||||
* -----|-----
|
||||
* `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
|
||||
* "123456" message { text: "Hi!" })`
|
||||
*
|
||||
* The special name `*` can be used in the body mapping to define that
|
||||
* every field not bound by the path template should be mapped to the
|
||||
* request body. This enables the following alternative definition of
|
||||
* the update method:
|
||||
*
|
||||
* service Messaging {
|
||||
* rpc UpdateMessage(Message) returns (Message) {
|
||||
* option (google.api.http) = {
|
||||
* put: "/v1/messages/{message_id}"
|
||||
* body: "*"
|
||||
* };
|
||||
* }
|
||||
* }
|
||||
* message Message {
|
||||
* string message_id = 1;
|
||||
* string text = 2;
|
||||
* }
|
||||
*
|
||||
*
|
||||
* The following HTTP JSON to RPC mapping is enabled:
|
||||
*
|
||||
* HTTP | RPC
|
||||
* -----|-----
|
||||
* `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id:
|
||||
* "123456" text: "Hi!")`
|
||||
*
|
||||
* Note that when using `*` in the body mapping, it is not possible to
|
||||
* have HTTP parameters, as all fields not bound by the path end in
|
||||
* the body. This makes this option more rarely used in practice of
|
||||
* defining REST APIs. The common usage of `*` is in custom methods
|
||||
* which don't use the URL at all for transferring data.
|
||||
*
|
||||
* It is possible to define multiple HTTP methods for one RPC by using
|
||||
* the `additional_bindings` option. Example:
|
||||
*
|
||||
* service Messaging {
|
||||
* rpc GetMessage(GetMessageRequest) returns (Message) {
|
||||
* option (google.api.http) = {
|
||||
* get: "/v1/messages/{message_id}"
|
||||
* additional_bindings {
|
||||
* get: "/v1/users/{user_id}/messages/{message_id}"
|
||||
* }
|
||||
* };
|
||||
* }
|
||||
* }
|
||||
* message GetMessageRequest {
|
||||
* string message_id = 1;
|
||||
* string user_id = 2;
|
||||
* }
|
||||
*
|
||||
*
|
||||
* This enables the following two alternative HTTP JSON to RPC
|
||||
* mappings:
|
||||
*
|
||||
* HTTP | RPC
|
||||
* -----|-----
|
||||
* `GET /v1/messages/123456` | `GetMessage(message_id: "123456")`
|
||||
* `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id:
|
||||
* "123456")`
|
||||
*
|
||||
* # Rules for HTTP mapping
|
||||
*
|
||||
* The rules for mapping HTTP path, query parameters, and body fields
|
||||
* to the request message are as follows:
|
||||
*
|
||||
* 1. The `body` field specifies either `*` or a field path, or is
|
||||
* omitted. If omitted, it indicates there is no HTTP request body.
|
||||
* 2. Leaf fields (recursive expansion of nested messages in the
|
||||
* request) can be classified into three types:
|
||||
* (a) Matched in the URL template.
|
||||
* (b) Covered by body (if body is `*`, everything except (a) fields;
|
||||
* else everything under the body field)
|
||||
* (c) All other fields.
|
||||
* 3. URL query parameters found in the HTTP request are mapped to (c) fields.
|
||||
* 4. Any body sent with an HTTP request can contain only (b) fields.
|
||||
*
|
||||
* The syntax of the path template is as follows:
|
||||
*
|
||||
* Template = "/" Segments [ Verb ] ;
|
||||
* Segments = Segment { "/" Segment } ;
|
||||
* Segment = "*" | "**" | LITERAL | Variable ;
|
||||
* Variable = "{" FieldPath [ "=" Segments ] "}" ;
|
||||
* FieldPath = IDENT { "." IDENT } ;
|
||||
* Verb = ":" LITERAL ;
|
||||
*
|
||||
* The syntax `*` matches a single path segment. The syntax `**` matches zero
|
||||
* or more path segments, which must be the last part of the path except the
|
||||
* `Verb`. The syntax `LITERAL` matches literal text in the path.
|
||||
*
|
||||
* The syntax `Variable` matches part of the URL path as specified by its
|
||||
* template. A variable template must not contain other variables. If a variable
|
||||
* matches a single path segment, its template may be omitted, e.g. `{var}`
|
||||
* is equivalent to `{var=*}`.
|
||||
*
|
||||
* If a variable contains exactly one path segment, such as `"{var}"` or
|
||||
* `"{var=*}"`, when such a variable is expanded into a URL path, all characters
|
||||
* except `[-_.~0-9a-zA-Z]` are percent-encoded. Such variables show up in the
|
||||
* Discovery Document as `{var}`.
|
||||
*
|
||||
* If a variable contains one or more path segments, such as `"{var=foo/*}"`
|
||||
* or `"{var=**}"`, when such a variable is expanded into a URL path, all
|
||||
* characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. Such variables
|
||||
* show up in the Discovery Document as `{+var}`.
|
||||
*
|
||||
* NOTE: While the single segment variable matches the semantics of
|
||||
* [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2
|
||||
* Simple String Expansion, the multi segment variable **does not** match
|
||||
* RFC 6570 Reserved Expansion. The reason is that the Reserved Expansion
|
||||
* does not expand special characters like `?` and `#`, which would lead
|
||||
* to invalid URLs.
|
||||
*
|
||||
* NOTE: the field paths in variables and in the `body` must not refer to
|
||||
* repeated fields or map fields.
|
||||
*/
|
||||
export interface HttpRule {
|
||||
/**
|
||||
* Selects methods to which this rule applies.
|
||||
*
|
||||
* Refer to [selector][google.api.DocumentationRule.selector] for syntax
|
||||
* details.
|
||||
*/
|
||||
selector: string;
|
||||
/** Used for listing and getting information about resources. */
|
||||
get: string | undefined;
|
||||
/** Used for updating a resource. */
|
||||
put: string | undefined;
|
||||
/** Used for creating a resource. */
|
||||
post: string | undefined;
|
||||
/** Used for deleting a resource. */
|
||||
delete: string | undefined;
|
||||
/** Used for updating a resource. */
|
||||
patch: string | undefined;
|
||||
/**
|
||||
* The custom pattern is used for specifying an HTTP method that is not
|
||||
* included in the `pattern` field, such as HEAD, or "*" to leave the
|
||||
* HTTP method unspecified for this rule. The wild-card rule is useful
|
||||
* for services that provide content to Web (HTML) clients.
|
||||
*/
|
||||
custom?: CustomHttpPattern | undefined;
|
||||
/**
|
||||
* The name of the request field whose value is mapped to the HTTP body, or
|
||||
* `*` for mapping all fields not captured by the path pattern to the HTTP
|
||||
* body. NOTE: the referred field must not be a repeated field and must be
|
||||
* present at the top-level of request message type.
|
||||
*/
|
||||
body: string;
|
||||
/**
|
||||
* Optional. The name of the response field whose value is mapped to the HTTP
|
||||
* body of response. Other response fields are ignored. When
|
||||
* not set, the response message will be used as HTTP body of response.
|
||||
*/
|
||||
responseBody: string;
|
||||
/**
|
||||
* Additional HTTP bindings for the selector. Nested bindings must
|
||||
* not contain an `additional_bindings` field themselves (that is,
|
||||
* the nesting may only be one level deep).
|
||||
*/
|
||||
additionalBindings: HttpRule[];
|
||||
}
|
||||
|
||||
/** A custom pattern is used for defining custom HTTP verb. */
|
||||
export interface CustomHttpPattern {
|
||||
/** The name of this custom HTTP verb. */
|
||||
kind: string;
|
||||
/** The path matched by this custom verb. */
|
||||
path: string;
|
||||
}
|
||||
|
||||
function createBaseHttp(): Http {
|
||||
return { rules: [], fullyDecodeReservedExpansion: false };
|
||||
}
|
||||
|
||||
export const Http = {
|
||||
encode(message: Http, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
||||
for (const v of message.rules) {
|
||||
HttpRule.encode(v!, writer.uint32(10).fork()).ldelim();
|
||||
}
|
||||
if (message.fullyDecodeReservedExpansion === true) {
|
||||
writer.uint32(16).bool(message.fullyDecodeReservedExpansion);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): Http {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseHttp();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.rules.push(HttpRule.decode(reader, reader.uint32()));
|
||||
break;
|
||||
case 2:
|
||||
message.fullyDecodeReservedExpansion = reader.bool();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): Http {
|
||||
return {
|
||||
rules: Array.isArray(object?.rules)
|
||||
? object.rules.map((e: any) => HttpRule.fromJSON(e))
|
||||
: [],
|
||||
fullyDecodeReservedExpansion: isSet(object.fullyDecodeReservedExpansion)
|
||||
? Boolean(object.fullyDecodeReservedExpansion)
|
||||
: false,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: Http): unknown {
|
||||
const obj: any = {};
|
||||
if (message.rules) {
|
||||
obj.rules = message.rules.map((e) =>
|
||||
e ? HttpRule.toJSON(e) : undefined
|
||||
);
|
||||
} else {
|
||||
obj.rules = [];
|
||||
}
|
||||
message.fullyDecodeReservedExpansion !== undefined &&
|
||||
(obj.fullyDecodeReservedExpansion = message.fullyDecodeReservedExpansion);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<Http>, I>>(object: I): Http {
|
||||
const message = createBaseHttp();
|
||||
message.rules = object.rules?.map((e) => HttpRule.fromPartial(e)) || [];
|
||||
message.fullyDecodeReservedExpansion =
|
||||
object.fullyDecodeReservedExpansion ?? false;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseHttpRule(): HttpRule {
|
||||
return {
|
||||
selector: "",
|
||||
get: undefined,
|
||||
put: undefined,
|
||||
post: undefined,
|
||||
delete: undefined,
|
||||
patch: undefined,
|
||||
custom: undefined,
|
||||
body: "",
|
||||
responseBody: "",
|
||||
additionalBindings: [],
|
||||
};
|
||||
}
|
||||
|
||||
export const HttpRule = {
|
||||
encode(
|
||||
message: HttpRule,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.selector !== "") {
|
||||
writer.uint32(10).string(message.selector);
|
||||
}
|
||||
if (message.get !== undefined) {
|
||||
writer.uint32(18).string(message.get);
|
||||
}
|
||||
if (message.put !== undefined) {
|
||||
writer.uint32(26).string(message.put);
|
||||
}
|
||||
if (message.post !== undefined) {
|
||||
writer.uint32(34).string(message.post);
|
||||
}
|
||||
if (message.delete !== undefined) {
|
||||
writer.uint32(42).string(message.delete);
|
||||
}
|
||||
if (message.patch !== undefined) {
|
||||
writer.uint32(50).string(message.patch);
|
||||
}
|
||||
if (message.custom !== undefined) {
|
||||
CustomHttpPattern.encode(
|
||||
message.custom,
|
||||
writer.uint32(66).fork()
|
||||
).ldelim();
|
||||
}
|
||||
if (message.body !== "") {
|
||||
writer.uint32(58).string(message.body);
|
||||
}
|
||||
if (message.responseBody !== "") {
|
||||
writer.uint32(98).string(message.responseBody);
|
||||
}
|
||||
for (const v of message.additionalBindings) {
|
||||
HttpRule.encode(v!, writer.uint32(90).fork()).ldelim();
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): HttpRule {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseHttpRule();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.selector = reader.string();
|
||||
break;
|
||||
case 2:
|
||||
message.get = reader.string();
|
||||
break;
|
||||
case 3:
|
||||
message.put = reader.string();
|
||||
break;
|
||||
case 4:
|
||||
message.post = reader.string();
|
||||
break;
|
||||
case 5:
|
||||
message.delete = reader.string();
|
||||
break;
|
||||
case 6:
|
||||
message.patch = reader.string();
|
||||
break;
|
||||
case 8:
|
||||
message.custom = CustomHttpPattern.decode(reader, reader.uint32());
|
||||
break;
|
||||
case 7:
|
||||
message.body = reader.string();
|
||||
break;
|
||||
case 12:
|
||||
message.responseBody = reader.string();
|
||||
break;
|
||||
case 11:
|
||||
message.additionalBindings.push(
|
||||
HttpRule.decode(reader, reader.uint32())
|
||||
);
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): HttpRule {
|
||||
return {
|
||||
selector: isSet(object.selector) ? String(object.selector) : "",
|
||||
get: isSet(object.get) ? String(object.get) : undefined,
|
||||
put: isSet(object.put) ? String(object.put) : undefined,
|
||||
post: isSet(object.post) ? String(object.post) : undefined,
|
||||
delete: isSet(object.delete) ? String(object.delete) : undefined,
|
||||
patch: isSet(object.patch) ? String(object.patch) : undefined,
|
||||
custom: isSet(object.custom)
|
||||
? CustomHttpPattern.fromJSON(object.custom)
|
||||
: undefined,
|
||||
body: isSet(object.body) ? String(object.body) : "",
|
||||
responseBody: isSet(object.responseBody)
|
||||
? String(object.responseBody)
|
||||
: "",
|
||||
additionalBindings: Array.isArray(object?.additionalBindings)
|
||||
? object.additionalBindings.map((e: any) => HttpRule.fromJSON(e))
|
||||
: [],
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: HttpRule): unknown {
|
||||
const obj: any = {};
|
||||
message.selector !== undefined && (obj.selector = message.selector);
|
||||
message.get !== undefined && (obj.get = message.get);
|
||||
message.put !== undefined && (obj.put = message.put);
|
||||
message.post !== undefined && (obj.post = message.post);
|
||||
message.delete !== undefined && (obj.delete = message.delete);
|
||||
message.patch !== undefined && (obj.patch = message.patch);
|
||||
message.custom !== undefined &&
|
||||
(obj.custom = message.custom
|
||||
? CustomHttpPattern.toJSON(message.custom)
|
||||
: undefined);
|
||||
message.body !== undefined && (obj.body = message.body);
|
||||
message.responseBody !== undefined &&
|
||||
(obj.responseBody = message.responseBody);
|
||||
if (message.additionalBindings) {
|
||||
obj.additionalBindings = message.additionalBindings.map((e) =>
|
||||
e ? HttpRule.toJSON(e) : undefined
|
||||
);
|
||||
} else {
|
||||
obj.additionalBindings = [];
|
||||
}
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<HttpRule>, I>>(object: I): HttpRule {
|
||||
const message = createBaseHttpRule();
|
||||
message.selector = object.selector ?? "";
|
||||
message.get = object.get ?? undefined;
|
||||
message.put = object.put ?? undefined;
|
||||
message.post = object.post ?? undefined;
|
||||
message.delete = object.delete ?? undefined;
|
||||
message.patch = object.patch ?? undefined;
|
||||
message.custom =
|
||||
object.custom !== undefined && object.custom !== null
|
||||
? CustomHttpPattern.fromPartial(object.custom)
|
||||
: undefined;
|
||||
message.body = object.body ?? "";
|
||||
message.responseBody = object.responseBody ?? "";
|
||||
message.additionalBindings =
|
||||
object.additionalBindings?.map((e) => HttpRule.fromPartial(e)) || [];
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
function createBaseCustomHttpPattern(): CustomHttpPattern {
|
||||
return { kind: "", path: "" };
|
||||
}
|
||||
|
||||
export const CustomHttpPattern = {
|
||||
encode(
|
||||
message: CustomHttpPattern,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (message.kind !== "") {
|
||||
writer.uint32(10).string(message.kind);
|
||||
}
|
||||
if (message.path !== "") {
|
||||
writer.uint32(18).string(message.path);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): CustomHttpPattern {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseCustomHttpPattern();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.kind = reader.string();
|
||||
break;
|
||||
case 2:
|
||||
message.path = reader.string();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): CustomHttpPattern {
|
||||
return {
|
||||
kind: isSet(object.kind) ? String(object.kind) : "",
|
||||
path: isSet(object.path) ? String(object.path) : "",
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: CustomHttpPattern): unknown {
|
||||
const obj: any = {};
|
||||
message.kind !== undefined && (obj.kind = message.kind);
|
||||
message.path !== undefined && (obj.path = message.path);
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<CustomHttpPattern>, I>>(
|
||||
object: I
|
||||
): CustomHttpPattern {
|
||||
const message = createBaseCustomHttpPattern();
|
||||
message.kind = object.kind ?? "";
|
||||
message.path = object.path ?? "";
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
type Builtin =
|
||||
| Date
|
||||
| Function
|
||||
| Uint8Array
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: T extends Long
|
||||
? string | number | Long
|
||||
: T extends Array<infer U>
|
||||
? Array<DeepPartial<U>>
|
||||
: T extends ReadonlyArray<infer U>
|
||||
? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {}
|
||||
? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||
export type Exact<P, I extends P> = P extends Builtin
|
||||
? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
||||
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
||||
};
|
||||
|
||||
if (_m0.util.Long !== Long) {
|
||||
_m0.util.Long = Long as any;
|
||||
_m0.configure();
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -1,187 +0,0 @@
|
||||
/* eslint-disable */
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "google.protobuf";
|
||||
|
||||
/**
|
||||
* 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".
|
||||
*/
|
||||
export interface 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
|
||||
*/
|
||||
seconds: Long;
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
nanos: number;
|
||||
}
|
||||
|
||||
function createBaseDuration(): Duration {
|
||||
return { seconds: Long.ZERO, nanos: 0 };
|
||||
}
|
||||
|
||||
export const Duration = {
|
||||
encode(
|
||||
message: Duration,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (!message.seconds.isZero()) {
|
||||
writer.uint32(8).int64(message.seconds);
|
||||
}
|
||||
if (message.nanos !== 0) {
|
||||
writer.uint32(16).int32(message.nanos);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): Duration {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseDuration();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.seconds = reader.int64() as Long;
|
||||
break;
|
||||
case 2:
|
||||
message.nanos = reader.int32();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): Duration {
|
||||
return {
|
||||
seconds: isSet(object.seconds)
|
||||
? Long.fromValue(object.seconds)
|
||||
: Long.ZERO,
|
||||
nanos: isSet(object.nanos) ? Number(object.nanos) : 0,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: Duration): unknown {
|
||||
const obj: any = {};
|
||||
message.seconds !== undefined &&
|
||||
(obj.seconds = (message.seconds || Long.ZERO).toString());
|
||||
message.nanos !== undefined && (obj.nanos = Math.round(message.nanos));
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<Duration>, I>>(object: I): Duration {
|
||||
const message = createBaseDuration();
|
||||
message.seconds =
|
||||
object.seconds !== undefined && object.seconds !== null
|
||||
? Long.fromValue(object.seconds)
|
||||
: Long.ZERO;
|
||||
message.nanos = object.nanos ?? 0;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
type Builtin =
|
||||
| Date
|
||||
| Function
|
||||
| Uint8Array
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: T extends Long
|
||||
? string | number | Long
|
||||
: T extends Array<infer U>
|
||||
? Array<DeepPartial<U>>
|
||||
: T extends ReadonlyArray<infer U>
|
||||
? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {}
|
||||
? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||
export type Exact<P, I extends P> = P extends Builtin
|
||||
? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
||||
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
||||
};
|
||||
|
||||
if (_m0.util.Long !== Long) {
|
||||
_m0.util.Long = Long as any;
|
||||
_m0.configure();
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
||||
@@ -1,220 +0,0 @@
|
||||
/* eslint-disable */
|
||||
import Long from "long";
|
||||
import _m0 from "protobufjs/minimal";
|
||||
|
||||
export const protobufPackage = "google.protobuf";
|
||||
|
||||
/**
|
||||
* 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://www.joda.org/joda-time/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime%2D%2D
|
||||
* ) to obtain a formatter capable of generating timestamps in this format.
|
||||
*/
|
||||
export interface 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.
|
||||
*/
|
||||
seconds: Long;
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
nanos: number;
|
||||
}
|
||||
|
||||
function createBaseTimestamp(): Timestamp {
|
||||
return { seconds: Long.ZERO, nanos: 0 };
|
||||
}
|
||||
|
||||
export const Timestamp = {
|
||||
encode(
|
||||
message: Timestamp,
|
||||
writer: _m0.Writer = _m0.Writer.create()
|
||||
): _m0.Writer {
|
||||
if (!message.seconds.isZero()) {
|
||||
writer.uint32(8).int64(message.seconds);
|
||||
}
|
||||
if (message.nanos !== 0) {
|
||||
writer.uint32(16).int32(message.nanos);
|
||||
}
|
||||
return writer;
|
||||
},
|
||||
|
||||
decode(input: _m0.Reader | Uint8Array, length?: number): Timestamp {
|
||||
const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
|
||||
let end = length === undefined ? reader.len : reader.pos + length;
|
||||
const message = createBaseTimestamp();
|
||||
while (reader.pos < end) {
|
||||
const tag = reader.uint32();
|
||||
switch (tag >>> 3) {
|
||||
case 1:
|
||||
message.seconds = reader.int64() as Long;
|
||||
break;
|
||||
case 2:
|
||||
message.nanos = reader.int32();
|
||||
break;
|
||||
default:
|
||||
reader.skipType(tag & 7);
|
||||
break;
|
||||
}
|
||||
}
|
||||
return message;
|
||||
},
|
||||
|
||||
fromJSON(object: any): Timestamp {
|
||||
return {
|
||||
seconds: isSet(object.seconds)
|
||||
? Long.fromValue(object.seconds)
|
||||
: Long.ZERO,
|
||||
nanos: isSet(object.nanos) ? Number(object.nanos) : 0,
|
||||
};
|
||||
},
|
||||
|
||||
toJSON(message: Timestamp): unknown {
|
||||
const obj: any = {};
|
||||
message.seconds !== undefined &&
|
||||
(obj.seconds = (message.seconds || Long.ZERO).toString());
|
||||
message.nanos !== undefined && (obj.nanos = Math.round(message.nanos));
|
||||
return obj;
|
||||
},
|
||||
|
||||
fromPartial<I extends Exact<DeepPartial<Timestamp>, I>>(
|
||||
object: I
|
||||
): Timestamp {
|
||||
const message = createBaseTimestamp();
|
||||
message.seconds =
|
||||
object.seconds !== undefined && object.seconds !== null
|
||||
? Long.fromValue(object.seconds)
|
||||
: Long.ZERO;
|
||||
message.nanos = object.nanos ?? 0;
|
||||
return message;
|
||||
},
|
||||
};
|
||||
|
||||
type Builtin =
|
||||
| Date
|
||||
| Function
|
||||
| Uint8Array
|
||||
| string
|
||||
| number
|
||||
| boolean
|
||||
| undefined;
|
||||
|
||||
export type DeepPartial<T> = T extends Builtin
|
||||
? T
|
||||
: T extends Long
|
||||
? string | number | Long
|
||||
: T extends Array<infer U>
|
||||
? Array<DeepPartial<U>>
|
||||
: T extends ReadonlyArray<infer U>
|
||||
? ReadonlyArray<DeepPartial<U>>
|
||||
: T extends {}
|
||||
? { [K in keyof T]?: DeepPartial<T[K]> }
|
||||
: Partial<T>;
|
||||
|
||||
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
||||
export type Exact<P, I extends P> = P extends Builtin
|
||||
? P
|
||||
: P & { [K in keyof P]: Exact<P[K], I[K]> } & {
|
||||
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
||||
};
|
||||
|
||||
if (_m0.util.Long !== Long) {
|
||||
_m0.util.Long = Long as any;
|
||||
_m0.configure();
|
||||
}
|
||||
|
||||
function isSet(value: any): boolean {
|
||||
return value !== null && value !== undefined;
|
||||
}
|
||||
+34
-16
@@ -95,7 +95,7 @@ const auctionFields = `
|
||||
* Registry
|
||||
*/
|
||||
export class RegistryClient {
|
||||
_restEndpoint: string;
|
||||
_rpcEndpoint: string;
|
||||
_graph: any;
|
||||
|
||||
/**
|
||||
@@ -128,14 +128,14 @@ export class RegistryClient {
|
||||
/**
|
||||
* New Client.
|
||||
*/
|
||||
constructor (gqlEndpoint: string, restEndpoint: string) {
|
||||
constructor (gqlEndpoint: string, rpcEndpoint: string) {
|
||||
assert(gqlEndpoint);
|
||||
this._graph = graphqlClient(gqlEndpoint, {
|
||||
method: 'POST',
|
||||
asJSON: true
|
||||
});
|
||||
|
||||
this._restEndpoint = restEndpoint;
|
||||
this._rpcEndpoint = rpcEndpoint;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -151,31 +151,31 @@ export class RegistryClient {
|
||||
moniker
|
||||
}
|
||||
sync {
|
||||
latest_block_hash
|
||||
latest_block_height
|
||||
latest_block_time
|
||||
catching_up
|
||||
latestBlockHash
|
||||
latestBlockHeight
|
||||
latestBlockTime
|
||||
catchingUp
|
||||
}
|
||||
validator {
|
||||
address
|
||||
voting_power
|
||||
votingPower
|
||||
}
|
||||
validators {
|
||||
address
|
||||
voting_power
|
||||
proposer_priority
|
||||
votingPower
|
||||
proposerPriority
|
||||
}
|
||||
num_peers
|
||||
numPeers
|
||||
peers {
|
||||
node {
|
||||
id
|
||||
network
|
||||
moniker
|
||||
}
|
||||
is_outbound
|
||||
remote_ip
|
||||
isOutbound
|
||||
remoteIp
|
||||
}
|
||||
disk_usage
|
||||
diskUsage
|
||||
}
|
||||
}`;
|
||||
|
||||
@@ -241,7 +241,7 @@ export class RegistryClient {
|
||||
/**
|
||||
* Get records by attributes.
|
||||
*/
|
||||
async queryRecords (attributes: {[key: string]: any}, all = false, refs = false) {
|
||||
async queryRecords (attributes: { [key: string]: any }, all = false, refs = false) {
|
||||
if (!attributes) {
|
||||
attributes = {};
|
||||
}
|
||||
@@ -397,7 +397,7 @@ export class RegistryClient {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get records by attributes.
|
||||
* Get bonds by attributes.
|
||||
*/
|
||||
async queryBonds (attributes = {}) {
|
||||
const query = `query ($attributes: [KeyValueInput!]) {
|
||||
@@ -417,4 +417,22 @@ export class RegistryClient {
|
||||
|
||||
return RegistryClient.getResult(this._graph(query)(variables), 'queryBonds');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get participants.
|
||||
*/
|
||||
async getParticipants () {
|
||||
const query = `query {
|
||||
getParticipants {
|
||||
cosmosAddress
|
||||
nitroAddress
|
||||
role
|
||||
kycId
|
||||
}
|
||||
}`;
|
||||
|
||||
const variables = {};
|
||||
|
||||
return RegistryClient.getResult(this._graph(query)(variables), 'getParticipants');
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -8,7 +8,7 @@ const WATCHER_YML_PATH = path.join(__dirname, './testing/data/watcher.yml');
|
||||
|
||||
jest.setTimeout(40 * 1000);
|
||||
|
||||
const { chainId, restEndpoint, gqlEndpoint, privateKey, fee } = getConfig();
|
||||
const { chainId, rpcEndpoint, gqlEndpoint, privateKey, fee } = getConfig();
|
||||
|
||||
describe('Querying', () => {
|
||||
let watcher: any;
|
||||
@@ -16,7 +16,7 @@ describe('Querying', () => {
|
||||
let bondId: string;
|
||||
|
||||
beforeAll(async () => {
|
||||
registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||
registry = new Registry(gqlEndpoint, rpcEndpoint, chainId);
|
||||
|
||||
bondId = await registry.getNextBondId(privateKey);
|
||||
await registry.createBond({ denom: DENOM, amount: '1000000000' }, privateKey, fee);
|
||||
@@ -31,7 +31,7 @@ describe('Querying', () => {
|
||||
});
|
||||
|
||||
test('Endpoint and chain ID.', async () => {
|
||||
expect(registry.endpoints.rest).toBe(restEndpoint);
|
||||
expect(registry.endpoints.rpc).toBe(rpcEndpoint);
|
||||
expect(registry.endpoints.gql).toBe(gqlEndpoint);
|
||||
expect(registry.chainID).toBe(chainId);
|
||||
});
|
||||
|
||||
@@ -7,4 +7,4 @@ record:
|
||||
/: QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9
|
||||
tls_cert_cid:
|
||||
/: QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR
|
||||
version: 1.0.23
|
||||
version: 1.0.30
|
||||
@@ -25,7 +25,7 @@ export const getConfig = () => {
|
||||
return {
|
||||
chainId: process.env.COSMOS_CHAIN_ID || DEFAULT_CHAIN_ID,
|
||||
privateKey: process.env.PRIVATE_KEY,
|
||||
restEndpoint: process.env.LACONICD_REST_ENDPOINT || 'http://localhost:26657',
|
||||
rpcEndpoint: process.env.LACONICD_RPC_ENDPOINT || 'http://localhost:26657',
|
||||
gqlEndpoint: process.env.LACONICD_GQL_ENDPOINT || 'http://localhost:9473/api',
|
||||
fee: {
|
||||
amount: [{ denom: 'photon', amount: '40' }],
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { EncodeObject, GeneratedType } from '@cosmjs/proto-signing';
|
||||
|
||||
import { MsgCommitBidResponse, MsgCommitBid, MsgRevealBid, MsgRevealBidResponse } from '../../../proto2/cerc/auction/v1/tx';
|
||||
import { MsgCommitBidResponse, MsgCommitBid, MsgRevealBid, MsgRevealBidResponse } from '../../../proto/cerc/auction/v1/tx';
|
||||
|
||||
export const typeUrlMsgCommitBid = '/cerc.auction.v1.MsgCommitBid';
|
||||
export const typeUrlMsgCommitBidResponse = '/cerc.auction.v1.MsgCommitBidResponse';
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
MsgRefillBondResponse,
|
||||
MsgWithdrawBondResponse,
|
||||
MsgCancelBondResponse
|
||||
} from '../../../proto2/cerc/bond/v1/tx';
|
||||
} from '../../../proto/cerc/bond/v1/tx';
|
||||
|
||||
export const typeUrlMsgCreateBond = '/cerc.bond.v1.MsgCreateBond';
|
||||
export const typeUrlMsgRefillBond = '/cerc.bond.v1.MsgRefillBond';
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
import { EncodeObject, GeneratedType } from '@cosmjs/proto-signing';
|
||||
|
||||
import { MsgOnboardParticipantResponse, MsgOnboardParticipant } from '../../../proto/cerc/onboarding/v1/tx';
|
||||
|
||||
export const typeUrlMsgOnboardParticipant = '/cerc.onboarding.v1.MsgOnboardParticipant';
|
||||
export const typeUrlMsgOnboardParticipantResponse = '/cerc.onboarding.v1.MsgOnboardParticipantResponse';
|
||||
|
||||
export const onboardingTypes: ReadonlyArray<[string, GeneratedType]> = [
|
||||
[typeUrlMsgOnboardParticipant, MsgOnboardParticipant],
|
||||
[typeUrlMsgOnboardParticipantResponse, MsgOnboardParticipantResponse]
|
||||
];
|
||||
|
||||
export interface MsgOnboardParticipantEncodeObject extends EncodeObject {
|
||||
readonly typeUrl: '/cerc.onboarding.v1.MsgOnboardParticipant';
|
||||
readonly value: MsgOnboardParticipant;
|
||||
}
|
||||
|
||||
interface ethPayload {
|
||||
address: string
|
||||
msg: string
|
||||
}
|
||||
|
||||
export interface MessageMsgOnboardParticipant {
|
||||
ethPayload: ethPayload
|
||||
ethSignature: string
|
||||
role: string
|
||||
kycId: string
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import { EncodeObject, GeneratedType } from '@cosmjs/proto-signing';
|
||||
|
||||
import { MsgReserveAuthority, MsgReserveAuthorityResponse, MsgSetAuthorityBond, MsgSetAuthorityBondResponse, MsgSetRecord, MsgSetRecordResponse, MsgSetName, MsgSetNameResponse, MsgDeleteName, MsgDeleteNameResponse, MsgAssociateBond, MsgAssociateBondResponse, MsgDissociateBond, MsgDissociateBondResponse, MsgDissociateRecords, MsgReassociateRecords, MsgDissociateRecordsResponse, MsgReassociateRecordsResponse } from '../../../proto2/cerc/registry/v1/tx';
|
||||
import { MsgReserveAuthority, MsgReserveAuthorityResponse, MsgSetAuthorityBond, MsgSetAuthorityBondResponse, MsgSetRecord, MsgSetRecordResponse, MsgSetName, MsgSetNameResponse, MsgDeleteName, MsgDeleteNameResponse, MsgAssociateBond, MsgAssociateBondResponse, MsgDissociateBond, MsgDissociateBondResponse, MsgDissociateRecords, MsgReassociateRecords, MsgDissociateRecordsResponse, MsgReassociateRecordsResponse } from '../../../proto/cerc/registry/v1/tx';
|
||||
|
||||
export const typeUrlMsgReserveAuthority = '/cerc.registry.v1.MsgReserveAuthority';
|
||||
export const typeUrlMsgSetRecord = '/cerc.registry.v1.MsgSetRecord';
|
||||
|
||||
@@ -2,7 +2,7 @@ import { GeneratedType } from '@cosmjs/proto-signing';
|
||||
|
||||
import {
|
||||
MsgSendResponse
|
||||
} from '../../../proto2/cosmos/bank/v1beta1/tx';
|
||||
} from '../../../proto/cosmos/bank/v1beta1/tx';
|
||||
|
||||
export const typeUrlMsgSendResponse = '/cosmos.bank.v1beta1.MsgSendResponse';
|
||||
|
||||
|
||||
Loaded 100 of 101 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user