diff --git a/.env.example b/.env.example index f14a8fc..a56bf4f 100644 --- a/.env.example +++ b/.env.example @@ -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 diff --git a/.gitea/workflows/test.yml b/.gitea/workflows/test.yml index f10d52b..e39c7ca 100644 --- a/.gitea/workflows/test.yml +++ b/.gitea/workflows/test.yml @@ -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/laconic2d # TODO: Update to laconicd on repo renaming fetch-depth: 0 ref: main - name: Environment @@ -31,33 +31,33 @@ 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 diff --git a/README.md b/README.md index 08b9680..892129b 100644 --- a/README.md +++ b/README.md @@ -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/laconic2d) 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. ``` diff --git a/package.json b/package.json index 5d9a345..131a33a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@cerc-io/registry-sdk", - "version": "0.2.0", + "version": "0.2.1", "main": "dist/index.js", "types": "dist/index.d.ts", "repository": "git@github.com:cerc-io/registry-sdk.git", diff --git a/proto/cerc/auction/module/v1/module.proto b/proto/cerc/auction/module/v1/module.proto index 3a7b2f6..287edff 100644 --- a/proto/cerc/auction/module/v1/module.proto +++ b/proto/cerc/auction/module/v1/module.proto @@ -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" }; } diff --git a/proto/cerc/auction/v1/auction.proto b/proto/cerc/auction/v1/auction.proto index 8e8cc55..f80c9d6 100644 --- a/proto/cerc/auction/v1/auction.proto +++ b/proto/cerc/auction/v1/auction.proto @@ -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 { diff --git a/proto/cerc/auction/v1/genesis.proto b/proto/cerc/auction/v1/genesis.proto index 667a49a..2e2af1a 100644 --- a/proto/cerc/auction/v1/genesis.proto +++ b/proto/cerc/auction/v1/genesis.proto @@ -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 { diff --git a/proto/cerc/auction/v1/query.proto b/proto/cerc/auction/v1/query.proto index d513f49..46e424a 100644 --- a/proto/cerc/auction/v1/query.proto +++ b/proto/cerc/auction/v1/query.proto @@ -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 { diff --git a/proto/cerc/auction/v1/tx.proto b/proto/cerc/auction/v1/tx.proto index f200026..b4b1795 100644 --- a/proto/cerc/auction/v1/tx.proto +++ b/proto/cerc/auction/v1/tx.proto @@ -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 { diff --git a/proto/cerc/bond/module/v1/module.proto b/proto/cerc/bond/module/v1/module.proto index fb868aa..ea52203 100644 --- a/proto/cerc/bond/module/v1/module.proto +++ b/proto/cerc/bond/module/v1/module.proto @@ -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" }; } diff --git a/proto/cerc/bond/v1/bond.proto b/proto/cerc/bond/v1/bond.proto index c8351ae..c6f5dfe 100644 --- a/proto/cerc/bond/v1/bond.proto +++ b/proto/cerc/bond/v1/bond.proto @@ -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 { diff --git a/proto/cerc/bond/v1/genesis.proto b/proto/cerc/bond/v1/genesis.proto index a40e52b..f599beb 100644 --- a/proto/cerc/bond/v1/genesis.proto +++ b/proto/cerc/bond/v1/genesis.proto @@ -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 { diff --git a/proto/cerc/bond/v1/query.proto b/proto/cerc/bond/v1/query.proto index 9814f8c..5923b77 100644 --- a/proto/cerc/bond/v1/query.proto +++ b/proto/cerc/bond/v1/query.proto @@ -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 { diff --git a/proto/cerc/bond/v1/tx.proto b/proto/cerc/bond/v1/tx.proto index 43e0071..1812b10 100644 --- a/proto/cerc/bond/v1/tx.proto +++ b/proto/cerc/bond/v1/tx.proto @@ -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 { diff --git a/proto/cerc/registry/module/v1/module.proto b/proto/cerc/registry/module/v1/module.proto index b09e2fc..2140d6a 100644 --- a/proto/cerc/registry/module/v1/module.proto +++ b/proto/cerc/registry/module/v1/module.proto @@ -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" }; } diff --git a/proto/cerc/registry/v1/genesis.proto b/proto/cerc/registry/v1/genesis.proto index 90b5dd2..90a4d68 100644 --- a/proto/cerc/registry/v1/genesis.proto +++ b/proto/cerc/registry/v1/genesis.proto @@ -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 { diff --git a/proto/cerc/registry/v1/query.proto b/proto/cerc/registry/v1/query.proto index 4572f48..3bc1909 100644 --- a/proto/cerc/registry/v1/query.proto +++ b/proto/cerc/registry/v1/query.proto @@ -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 { diff --git a/proto/cerc/registry/v1/registry.proto b/proto/cerc/registry/v1/registry.proto index c32e476..35cf899 100644 --- a/proto/cerc/registry/v1/registry.proto +++ b/proto/cerc/registry/v1/registry.proto @@ -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 { diff --git a/proto/cerc/registry/v1/tx.proto b/proto/cerc/registry/v1/tx.proto index 36ecc70..b38c50f 100644 --- a/proto/cerc/registry/v1/tx.proto +++ b/proto/cerc/registry/v1/tx.proto @@ -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 { diff --git a/scripts/proto-gen.sh b/scripts/proto-gen.sh index 4c5d11c..38ba89d 100755 --- a/scripts/proto-gen.sh +++ b/scripts/proto-gen.sh @@ -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" diff --git a/src/auction.test.ts b/src/auction.test.ts index a96af82..9e7c90a 100644 --- a/src/auction.test.ts +++ b/src/auction.test.ts @@ -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 () => { diff --git a/src/bond.test.ts b/src/bond.test.ts index 92124dc..ce4524c 100644 --- a/src/bond.test.ts +++ b/src/bond.test.ts @@ -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 () => { diff --git a/src/index.test.ts b/src/index.test.ts index b68101e..0d846fc 100644 --- a/src/index.test.ts +++ b/src/index.test.ts @@ -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 () => { diff --git a/src/index.ts b/src/index.ts index 3cc0e37..1bb4239 100644 --- a/src/index.ts +++ b/src/index.ts @@ -25,9 +25,9 @@ import { 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 { MsgCancelBondResponse, MsgCreateBondResponse, MsgRefillBondResponse, MsgWithdrawBondResponse } from './proto/cerc/bond/v1/tx'; +import { Coin } from './proto/cosmos/base/v1beta1/coin'; +import { MsgSendResponse } from './proto/cosmos/bank/v1beta1/tx'; import { MessageMsgSendCoins } from './types/cosmos/bank/message'; export const DEFAULT_CHAIN_ID = 'laconic_9000-1'; @@ -63,13 +63,13 @@ export class Registry { _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; } @@ -432,7 +432,7 @@ export class Registry { } async getLaconicClient (account: Account) { - return LaconicClient.connectWithSigner(this._endpoints.rest, account.wallet); + return LaconicClient.connectWithSigner(this._endpoints.rpc, account.wallet); } } diff --git a/src/laconic-client.ts b/src/laconic-client.ts index fafcca8..f8b65a3 100644 --- a/src/laconic-client.ts +++ b/src/laconic-client.ts @@ -10,15 +10,15 @@ 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 { 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 { bankTypes } from './types/cosmos/bank/message'; const DEFAULT_WRITE_ERROR = 'Unable to write to laconic2d.'; diff --git a/src/nameservice-expiry.test.ts b/src/nameservice-expiry.test.ts index 7506eaa..c7ae38a 100644 --- a/src/nameservice-expiry.test.ts +++ b/src/nameservice-expiry.test.ts @@ -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); diff --git a/src/naming.test.ts b/src/naming.test.ts index 098d2a7..973ad13 100644 --- a/src/naming.test.ts +++ b/src/naming.test.ts @@ -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); diff --git a/src/proto2/amino/amino.ts b/src/proto/amino/amino.ts similarity index 100% rename from src/proto2/amino/amino.ts rename to src/proto/amino/amino.ts diff --git a/src/proto2/cerc/auction/module/v1/module.ts b/src/proto/cerc/auction/module/v1/module.ts similarity index 100% rename from src/proto2/cerc/auction/module/v1/module.ts rename to src/proto/cerc/auction/module/v1/module.ts diff --git a/src/proto2/cerc/auction/v1/auction.ts b/src/proto/cerc/auction/v1/auction.ts similarity index 100% rename from src/proto2/cerc/auction/v1/auction.ts rename to src/proto/cerc/auction/v1/auction.ts diff --git a/src/proto2/cerc/auction/v1/genesis.ts b/src/proto/cerc/auction/v1/genesis.ts similarity index 100% rename from src/proto2/cerc/auction/v1/genesis.ts rename to src/proto/cerc/auction/v1/genesis.ts diff --git a/src/proto2/cerc/auction/v1/query.ts b/src/proto/cerc/auction/v1/query.ts similarity index 100% rename from src/proto2/cerc/auction/v1/query.ts rename to src/proto/cerc/auction/v1/query.ts diff --git a/src/proto2/cerc/auction/v1/tx.ts b/src/proto/cerc/auction/v1/tx.ts similarity index 100% rename from src/proto2/cerc/auction/v1/tx.ts rename to src/proto/cerc/auction/v1/tx.ts diff --git a/src/proto2/cerc/bond/module/v1/module.ts b/src/proto/cerc/bond/module/v1/module.ts similarity index 100% rename from src/proto2/cerc/bond/module/v1/module.ts rename to src/proto/cerc/bond/module/v1/module.ts diff --git a/src/proto2/cerc/bond/v1/bond.ts b/src/proto/cerc/bond/v1/bond.ts similarity index 100% rename from src/proto2/cerc/bond/v1/bond.ts rename to src/proto/cerc/bond/v1/bond.ts diff --git a/src/proto2/cerc/bond/v1/genesis.ts b/src/proto/cerc/bond/v1/genesis.ts similarity index 100% rename from src/proto2/cerc/bond/v1/genesis.ts rename to src/proto/cerc/bond/v1/genesis.ts diff --git a/src/proto2/cerc/bond/v1/query.ts b/src/proto/cerc/bond/v1/query.ts similarity index 100% rename from src/proto2/cerc/bond/v1/query.ts rename to src/proto/cerc/bond/v1/query.ts diff --git a/src/proto2/cerc/bond/v1/tx.ts b/src/proto/cerc/bond/v1/tx.ts similarity index 100% rename from src/proto2/cerc/bond/v1/tx.ts rename to src/proto/cerc/bond/v1/tx.ts diff --git a/src/proto2/cerc/registry/module/v1/module.ts b/src/proto/cerc/registry/module/v1/module.ts similarity index 100% rename from src/proto2/cerc/registry/module/v1/module.ts rename to src/proto/cerc/registry/module/v1/module.ts diff --git a/src/proto2/cerc/registry/v1/genesis.ts b/src/proto/cerc/registry/v1/genesis.ts similarity index 100% rename from src/proto2/cerc/registry/v1/genesis.ts rename to src/proto/cerc/registry/v1/genesis.ts diff --git a/src/proto2/cerc/registry/v1/query.ts b/src/proto/cerc/registry/v1/query.ts similarity index 100% rename from src/proto2/cerc/registry/v1/query.ts rename to src/proto/cerc/registry/v1/query.ts diff --git a/src/proto2/cerc/registry/v1/registry.ts b/src/proto/cerc/registry/v1/registry.ts similarity index 100% rename from src/proto2/cerc/registry/v1/registry.ts rename to src/proto/cerc/registry/v1/registry.ts diff --git a/src/proto2/cerc/registry/v1/tx.ts b/src/proto/cerc/registry/v1/tx.ts similarity index 100% rename from src/proto2/cerc/registry/v1/tx.ts rename to src/proto/cerc/registry/v1/tx.ts diff --git a/src/proto2/cosmos/app/v1alpha1/module.ts b/src/proto/cosmos/app/v1alpha1/module.ts similarity index 100% rename from src/proto2/cosmos/app/v1alpha1/module.ts rename to src/proto/cosmos/app/v1alpha1/module.ts diff --git a/src/proto2/cosmos/bank/v1beta1/bank.ts b/src/proto/cosmos/bank/v1beta1/bank.ts similarity index 100% rename from src/proto2/cosmos/bank/v1beta1/bank.ts rename to src/proto/cosmos/bank/v1beta1/bank.ts diff --git a/src/proto2/cosmos/bank/v1beta1/tx.ts b/src/proto/cosmos/bank/v1beta1/tx.ts similarity index 100% rename from src/proto2/cosmos/bank/v1beta1/tx.ts rename to src/proto/cosmos/bank/v1beta1/tx.ts diff --git a/src/proto/cosmos/base/query/v1beta1/pagination.ts b/src/proto/cosmos/base/query/v1beta1/pagination.ts index d559483..fe65b07 100644 --- a/src/proto/cosmos/base/query/v1beta1/pagination.ts +++ b/src/proto/cosmos/base/query/v1beta1/pagination.ts @@ -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); - } - } - 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); - } - } + * 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>>( + 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>>( + 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 extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; } diff --git a/src/proto/cosmos/base/v1beta1/coin.ts b/src/proto/cosmos/base/v1beta1/coin.ts index 51868f6..ba71c31 100644 --- a/src/proto/cosmos/base/v1beta1/coin.ts +++ b/src/proto/cosmos/base/v1beta1/coin.ts @@ -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); - } - } - 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); - } - } - 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); - } - } - 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); - } - } + * 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>>(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>>(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>>(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>>(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 extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; } diff --git a/src/proto2/cosmos/msg/v1/msg.ts b/src/proto/cosmos/msg/v1/msg.ts similarity index 100% rename from src/proto2/cosmos/msg/v1/msg.ts rename to src/proto/cosmos/msg/v1/msg.ts diff --git a/src/proto2/cosmos_proto/cosmos.ts b/src/proto/cosmos_proto/cosmos.ts similarity index 100% rename from src/proto2/cosmos_proto/cosmos.ts rename to src/proto/cosmos_proto/cosmos.ts diff --git a/src/proto/gogoproto/gogo.ts b/src/proto/gogoproto/gogo.ts index 7ef9f53..3f41a04 100644 --- a/src/proto/gogoproto/gogo.ts +++ b/src/proto/gogoproto/gogo.ts @@ -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"; diff --git a/src/proto/google/api/annotations.ts b/src/proto/google/api/annotations.ts index f0a1bf7..aace478 100644 --- a/src/proto/google/api/annotations.ts +++ b/src/proto/google/api/annotations.ts @@ -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"; diff --git a/src/proto/google/api/http.ts b/src/proto/google/api/http.ts index 2ce7e5b..1ca1521 100644 --- a/src/proto/google/api/http.ts +++ b/src/proto/google/api/http.ts @@ -1,532 +1,647 @@ -// @ts-nocheck /* eslint-disable */ +import Long from "long"; +import _m0 from "protobufjs/minimal"; + +export const protobufPackage = "google.api"; + /** - * Generated by the protoc-gen-ts. DO NOT EDIT! - * compiler version: 4.25.1 - * source: google/api/http.proto - * git: https://github.com/thesayyn/protoc-gen-ts */ -import * as pb_1 from "google-protobuf"; -export namespace google.api { - export class Http extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - rules?: HttpRule[]; - fully_decode_reserved_expansion?: boolean; - }) { - 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 ("rules" in data && data.rules != undefined) { - this.rules = data.rules; - } - if ("fully_decode_reserved_expansion" in data && data.fully_decode_reserved_expansion != undefined) { - this.fully_decode_reserved_expansion = data.fully_decode_reserved_expansion; - } - } - } - get rules() { - return pb_1.Message.getRepeatedWrapperField(this, HttpRule, 1) as HttpRule[]; - } - set rules(value: HttpRule[]) { - pb_1.Message.setRepeatedWrapperField(this, 1, value); - } - get fully_decode_reserved_expansion() { - return pb_1.Message.getFieldWithDefault(this, 2, false) as boolean; - } - set fully_decode_reserved_expansion(value: boolean) { - pb_1.Message.setField(this, 2, value); - } - static fromObject(data: { - rules?: ReturnType[]; - fully_decode_reserved_expansion?: boolean; - }): Http { - const message = new Http({}); - if (data.rules != null) { - message.rules = data.rules.map(item => HttpRule.fromObject(item)); - } - if (data.fully_decode_reserved_expansion != null) { - message.fully_decode_reserved_expansion = data.fully_decode_reserved_expansion; - } - return message; - } - toObject() { - const data: { - rules?: ReturnType[]; - fully_decode_reserved_expansion?: boolean; - } = {}; - if (this.rules != null) { - data.rules = this.rules.map((item: HttpRule) => item.toObject()); - } - if (this.fully_decode_reserved_expansion != null) { - data.fully_decode_reserved_expansion = this.fully_decode_reserved_expansion; - } - 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.rules.length) - writer.writeRepeatedMessage(1, this.rules, (item: HttpRule) => item.serialize(writer)); - if (this.fully_decode_reserved_expansion != false) - writer.writeBool(2, this.fully_decode_reserved_expansion); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Http { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Http(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage(message.rules, () => pb_1.Message.addToRepeatedWrapperField(message, 1, HttpRule.deserialize(reader), HttpRule)); - break; - case 2: - message.fully_decode_reserved_expansion = reader.readBool(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): Http { - return Http.deserialize(bytes); - } - } - export class HttpRule extends pb_1.Message { - #one_of_decls: number[][] = [[2, 3, 4, 5, 6, 8]]; - constructor(data?: any[] | ({ - selector?: string; - body?: string; - response_body?: string; - additional_bindings?: HttpRule[]; - } & (({ - get?: string; - put?: never; - post?: never; - delete?: never; - patch?: never; - custom?: never; - } | { - get?: never; - put?: string; - post?: never; - delete?: never; - patch?: never; - custom?: never; - } | { - get?: never; - put?: never; - post?: string; - delete?: never; - patch?: never; - custom?: never; - } | { - get?: never; - put?: never; - post?: never; - delete?: string; - patch?: never; - custom?: never; - } | { - get?: never; - put?: never; - post?: never; - delete?: never; - patch?: string; - custom?: never; - } | { - get?: never; - put?: never; - post?: never; - delete?: never; - patch?: never; - custom?: CustomHttpPattern; - })))) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [11], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("selector" in data && data.selector != undefined) { - this.selector = data.selector; - } - if ("get" in data && data.get != undefined) { - this.get = data.get; - } - if ("put" in data && data.put != undefined) { - this.put = data.put; - } - if ("post" in data && data.post != undefined) { - this.post = data.post; - } - if ("delete" in data && data.delete != undefined) { - this.delete = data.delete; - } - if ("patch" in data && data.patch != undefined) { - this.patch = data.patch; - } - if ("custom" in data && data.custom != undefined) { - this.custom = data.custom; - } - if ("body" in data && data.body != undefined) { - this.body = data.body; - } - if ("response_body" in data && data.response_body != undefined) { - this.response_body = data.response_body; - } - if ("additional_bindings" in data && data.additional_bindings != undefined) { - this.additional_bindings = data.additional_bindings; - } - } - } - get selector() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; - } - set selector(value: string) { - pb_1.Message.setField(this, 1, value); - } - get get() { - return pb_1.Message.getFieldWithDefault(this, 2, "") as string; - } - set get(value: string) { - pb_1.Message.setOneofField(this, 2, this.#one_of_decls[0], value); - } - get has_get() { - return pb_1.Message.getField(this, 2) != null; - } - get put() { - return pb_1.Message.getFieldWithDefault(this, 3, "") as string; - } - set put(value: string) { - pb_1.Message.setOneofField(this, 3, this.#one_of_decls[0], value); - } - get has_put() { - return pb_1.Message.getField(this, 3) != null; - } - get post() { - return pb_1.Message.getFieldWithDefault(this, 4, "") as string; - } - set post(value: string) { - pb_1.Message.setOneofField(this, 4, this.#one_of_decls[0], value); - } - get has_post() { - return pb_1.Message.getField(this, 4) != null; - } - get delete() { - return pb_1.Message.getFieldWithDefault(this, 5, "") as string; - } - set delete(value: string) { - pb_1.Message.setOneofField(this, 5, this.#one_of_decls[0], value); - } - get has_delete() { - return pb_1.Message.getField(this, 5) != null; - } - get patch() { - return pb_1.Message.getFieldWithDefault(this, 6, "") as string; - } - set patch(value: string) { - pb_1.Message.setOneofField(this, 6, this.#one_of_decls[0], value); - } - get has_patch() { - return pb_1.Message.getField(this, 6) != null; - } - get custom() { - return pb_1.Message.getWrapperField(this, CustomHttpPattern, 8) as CustomHttpPattern; - } - set custom(value: CustomHttpPattern) { - pb_1.Message.setOneofWrapperField(this, 8, this.#one_of_decls[0], value); - } - get has_custom() { - return pb_1.Message.getField(this, 8) != null; - } - get body() { - return pb_1.Message.getFieldWithDefault(this, 7, "") as string; - } - set body(value: string) { - pb_1.Message.setField(this, 7, value); - } - get response_body() { - return pb_1.Message.getFieldWithDefault(this, 12, "") as string; - } - set response_body(value: string) { - pb_1.Message.setField(this, 12, value); - } - get additional_bindings() { - return pb_1.Message.getRepeatedWrapperField(this, HttpRule, 11) as HttpRule[]; - } - set additional_bindings(value: HttpRule[]) { - pb_1.Message.setRepeatedWrapperField(this, 11, value); - } - get pattern() { - const cases: { - [index: number]: "none" | "get" | "put" | "post" | "delete" | "patch" | "custom"; - } = { - 0: "none", - 2: "get", - 3: "put", - 4: "post", - 5: "delete", - 6: "patch", - 8: "custom" - }; - return cases[pb_1.Message.computeOneofCase(this, [2, 3, 4, 5, 6, 8])]; - } - static fromObject(data: { - selector?: string; - get?: string; - put?: string; - post?: string; - delete?: string; - patch?: string; - custom?: ReturnType; - body?: string; - response_body?: string; - additional_bindings?: ReturnType[]; - }): HttpRule { - const message = new HttpRule({}); - if (data.selector != null) { - message.selector = data.selector; - } - if (data.get != null) { - message.get = data.get; - } - if (data.put != null) { - message.put = data.put; - } - if (data.post != null) { - message.post = data.post; - } - if (data.delete != null) { - message.delete = data.delete; - } - if (data.patch != null) { - message.patch = data.patch; - } - if (data.custom != null) { - message.custom = CustomHttpPattern.fromObject(data.custom); - } - if (data.body != null) { - message.body = data.body; - } - if (data.response_body != null) { - message.response_body = data.response_body; - } - if (data.additional_bindings != null) { - message.additional_bindings = data.additional_bindings.map(item => HttpRule.fromObject(item)); - } - return message; - } - toObject() { - const data: { - selector?: string; - get?: string; - put?: string; - post?: string; - delete?: string; - patch?: string; - custom?: ReturnType; - body?: string; - response_body?: string; - additional_bindings?: ReturnType[]; - } = {}; - if (this.selector != null) { - data.selector = this.selector; - } - if (this.get != null) { - data.get = this.get; - } - if (this.put != null) { - data.put = this.put; - } - if (this.post != null) { - data.post = this.post; - } - if (this.delete != null) { - data.delete = this.delete; - } - if (this.patch != null) { - data.patch = this.patch; - } - if (this.custom != null) { - data.custom = this.custom.toObject(); - } - if (this.body != null) { - data.body = this.body; - } - if (this.response_body != null) { - data.response_body = this.response_body; - } - if (this.additional_bindings != null) { - data.additional_bindings = this.additional_bindings.map((item: HttpRule) => 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.selector.length) - writer.writeString(1, this.selector); - if (this.has_get) - writer.writeString(2, this.get); - if (this.has_put) - writer.writeString(3, this.put); - if (this.has_post) - writer.writeString(4, this.post); - if (this.has_delete) - writer.writeString(5, this.delete); - if (this.has_patch) - writer.writeString(6, this.patch); - if (this.has_custom) - writer.writeMessage(8, this.custom, () => this.custom.serialize(writer)); - if (this.body.length) - writer.writeString(7, this.body); - if (this.response_body.length) - writer.writeString(12, this.response_body); - if (this.additional_bindings.length) - writer.writeRepeatedMessage(11, this.additional_bindings, (item: HttpRule) => item.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): HttpRule { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new HttpRule(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.selector = reader.readString(); - break; - case 2: - message.get = reader.readString(); - break; - case 3: - message.put = reader.readString(); - break; - case 4: - message.post = reader.readString(); - break; - case 5: - message.delete = reader.readString(); - break; - case 6: - message.patch = reader.readString(); - break; - case 8: - reader.readMessage(message.custom, () => message.custom = CustomHttpPattern.deserialize(reader)); - break; - case 7: - message.body = reader.readString(); - break; - case 12: - message.response_body = reader.readString(); - break; - case 11: - reader.readMessage(message.additional_bindings, () => pb_1.Message.addToRepeatedWrapperField(message, 11, HttpRule.deserialize(reader), HttpRule)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): HttpRule { - return HttpRule.deserialize(bytes); - } - } - export class CustomHttpPattern extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - kind?: string; - path?: 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 ("kind" in data && data.kind != undefined) { - this.kind = data.kind; - } - if ("path" in data && data.path != undefined) { - this.path = data.path; - } - } - } - get kind() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; - } - set kind(value: string) { - pb_1.Message.setField(this, 1, value); - } - get path() { - return pb_1.Message.getFieldWithDefault(this, 2, "") as string; - } - set path(value: string) { - pb_1.Message.setField(this, 2, value); - } - static fromObject(data: { - kind?: string; - path?: string; - }): CustomHttpPattern { - const message = new CustomHttpPattern({}); - if (data.kind != null) { - message.kind = data.kind; - } - if (data.path != null) { - message.path = data.path; - } - return message; - } - toObject() { - const data: { - kind?: string; - path?: string; - } = {}; - if (this.kind != null) { - data.kind = this.kind; - } - if (this.path != null) { - data.path = this.path; - } - 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.kind.length) - writer.writeString(1, this.kind); - if (this.path.length) - writer.writeString(2, this.path); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): CustomHttpPattern { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new CustomHttpPattern(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.kind = reader.readString(); - break; - case 2: - message.path = reader.readString(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): CustomHttpPattern { - return CustomHttpPattern.deserialize(bytes); - } - } + * 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: .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>>(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>>(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>>( + 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 extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; } diff --git a/src/proto/google/protobuf/descriptor.ts b/src/proto/google/protobuf/descriptor.ts index 7938a29..e1cda94 100644 --- a/src/proto/google/protobuf/descriptor.ts +++ b/src/proto/google/protobuf/descriptor.ts @@ -1,4262 +1,4395 @@ -// @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/descriptor.proto - * git: https://github.com/thesayyn/protoc-gen-ts */ -import * as pb_1 from "google-protobuf"; -export namespace google.protobuf { - export class FileDescriptorSet extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - file: FileDescriptorProto[]; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - this.file = data.file; - } - } - get file() { - return pb_1.Message.getRepeatedWrapperField(this, FileDescriptorProto, 1) as FileDescriptorProto[]; - } - set file(value: FileDescriptorProto[]) { - pb_1.Message.setRepeatedWrapperField(this, 1, value); - } - static fromObject(data: { - file?: ReturnType[]; - }): FileDescriptorSet { - const message = new FileDescriptorSet({ - file: data.file.map(item => FileDescriptorProto.fromObject(item)) - }); - return message; - } - toObject() { - const data: { - file?: ReturnType[]; - } = {}; - if (this.file != null) { - data.file = this.file.map((item: FileDescriptorProto) => 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.file.length) - writer.writeRepeatedMessage(1, this.file, (item: FileDescriptorProto) => item.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): FileDescriptorSet { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new FileDescriptorSet(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage(message.file, () => pb_1.Message.addToRepeatedWrapperField(message, 1, FileDescriptorProto.deserialize(reader), FileDescriptorProto)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): FileDescriptorSet { - return FileDescriptorSet.deserialize(bytes); - } - } - export class FileDescriptorProto extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - name?: string; - package?: string; - dependency: string[]; - public_dependency: number[]; - weak_dependency: number[]; - message_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; - service: ServiceDescriptorProto[]; - extension: FieldDescriptorProto[]; - options?: FileOptions; - source_code_info?: SourceCodeInfo; - syntax?: string; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [3, 10, 11, 4, 5, 6, 7], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("name" in data && data.name != undefined) { - this.name = data.name; - } - if ("package" in data && data.package != undefined) { - this.package = data.package; - } - this.dependency = data.dependency; - this.public_dependency = data.public_dependency; - this.weak_dependency = data.weak_dependency; - this.message_type = data.message_type; - this.enum_type = data.enum_type; - this.service = data.service; - this.extension = data.extension; - if ("options" in data && data.options != undefined) { - this.options = data.options; - } - if ("source_code_info" in data && data.source_code_info != undefined) { - this.source_code_info = data.source_code_info; - } - if ("syntax" in data && data.syntax != undefined) { - this.syntax = data.syntax; - } - } - } - get name() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; - } - set name(value: string) { - pb_1.Message.setField(this, 1, value); - } - get has_name() { - return pb_1.Message.getField(this, 1) != null; - } - get package() { - return pb_1.Message.getFieldWithDefault(this, 2, "") as string; - } - set package(value: string) { - pb_1.Message.setField(this, 2, value); - } - get has_package() { - return pb_1.Message.getField(this, 2) != null; - } - get dependency() { - return pb_1.Message.getFieldWithDefault(this, 3, []) as string[]; - } - set dependency(value: string[]) { - pb_1.Message.setField(this, 3, value); - } - get public_dependency() { - return pb_1.Message.getFieldWithDefault(this, 10, []) as number[]; - } - set public_dependency(value: number[]) { - pb_1.Message.setField(this, 10, value); - } - get weak_dependency() { - return pb_1.Message.getFieldWithDefault(this, 11, []) as number[]; - } - set weak_dependency(value: number[]) { - pb_1.Message.setField(this, 11, value); - } - get message_type() { - return pb_1.Message.getRepeatedWrapperField(this, DescriptorProto, 4) as DescriptorProto[]; - } - set message_type(value: DescriptorProto[]) { - pb_1.Message.setRepeatedWrapperField(this, 4, value); - } - get enum_type() { - return pb_1.Message.getRepeatedWrapperField(this, EnumDescriptorProto, 5) as EnumDescriptorProto[]; - } - set enum_type(value: EnumDescriptorProto[]) { - pb_1.Message.setRepeatedWrapperField(this, 5, value); - } - get service() { - return pb_1.Message.getRepeatedWrapperField(this, ServiceDescriptorProto, 6) as ServiceDescriptorProto[]; - } - set service(value: ServiceDescriptorProto[]) { - pb_1.Message.setRepeatedWrapperField(this, 6, value); - } - get extension() { - return pb_1.Message.getRepeatedWrapperField(this, FieldDescriptorProto, 7) as FieldDescriptorProto[]; - } - set extension(value: FieldDescriptorProto[]) { - pb_1.Message.setRepeatedWrapperField(this, 7, value); - } - get options() { - return pb_1.Message.getWrapperField(this, FileOptions, 8) as FileOptions; - } - set options(value: FileOptions) { - pb_1.Message.setWrapperField(this, 8, value); - } - get has_options() { - return pb_1.Message.getField(this, 8) != null; - } - get source_code_info() { - return pb_1.Message.getWrapperField(this, SourceCodeInfo, 9) as SourceCodeInfo; - } - set source_code_info(value: SourceCodeInfo) { - pb_1.Message.setWrapperField(this, 9, value); - } - get has_source_code_info() { - return pb_1.Message.getField(this, 9) != null; - } - get syntax() { - return pb_1.Message.getFieldWithDefault(this, 12, "") as string; - } - set syntax(value: string) { - pb_1.Message.setField(this, 12, value); - } - get has_syntax() { - return pb_1.Message.getField(this, 12) != null; - } - static fromObject(data: { - name?: string; - package?: string; - dependency: string[]; - public_dependency: number[]; - weak_dependency: number[]; - message_type?: ReturnType[]; - enum_type?: ReturnType[]; - service?: ReturnType[]; - extension?: ReturnType[]; - options?: ReturnType; - source_code_info?: ReturnType; - syntax?: string; - }): FileDescriptorProto { - const message = new FileDescriptorProto({ - dependency: data.dependency, - public_dependency: data.public_dependency, - weak_dependency: data.weak_dependency, - message_type: data.message_type.map(item => DescriptorProto.fromObject(item)), - enum_type: data.enum_type.map(item => EnumDescriptorProto.fromObject(item)), - service: data.service.map(item => ServiceDescriptorProto.fromObject(item)), - extension: data.extension.map(item => FieldDescriptorProto.fromObject(item)) - }); - if (data.name != null) { - message.name = data.name; - } - if (data.package != null) { - message.package = data.package; - } - if (data.options != null) { - message.options = FileOptions.fromObject(data.options); - } - if (data.source_code_info != null) { - message.source_code_info = SourceCodeInfo.fromObject(data.source_code_info); - } - if (data.syntax != null) { - message.syntax = data.syntax; - } - return message; - } - toObject() { - const data: { - name?: string; - package?: string; - dependency: string[]; - public_dependency: number[]; - weak_dependency: number[]; - message_type?: ReturnType[]; - enum_type?: ReturnType[]; - service?: ReturnType[]; - extension?: ReturnType[]; - options?: ReturnType; - source_code_info?: ReturnType; - syntax?: string; - } = { - dependency: this.dependency, - public_dependency: this.public_dependency, - weak_dependency: this.weak_dependency - }; - if (this.name != null) { - data.name = this.name; - } - if (this.package != null) { - data.package = this.package; - } - if (this.message_type != null) { - data.message_type = this.message_type.map((item: DescriptorProto) => item.toObject()); - } - if (this.enum_type != null) { - data.enum_type = this.enum_type.map((item: EnumDescriptorProto) => item.toObject()); - } - if (this.service != null) { - data.service = this.service.map((item: ServiceDescriptorProto) => item.toObject()); - } - if (this.extension != null) { - data.extension = this.extension.map((item: FieldDescriptorProto) => item.toObject()); - } - if (this.options != null) { - data.options = this.options.toObject(); - } - if (this.source_code_info != null) { - data.source_code_info = this.source_code_info.toObject(); - } - if (this.syntax != null) { - data.syntax = this.syntax; - } - 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_name && this.name.length) - writer.writeString(1, this.name); - if (this.has_package && this.package.length) - writer.writeString(2, this.package); - if (this.dependency.length) - writer.writeRepeatedString(3, this.dependency); - if (this.public_dependency.length) - writer.writeRepeatedInt32(10, this.public_dependency); - if (this.weak_dependency.length) - writer.writeRepeatedInt32(11, this.weak_dependency); - if (this.message_type.length) - writer.writeRepeatedMessage(4, this.message_type, (item: DescriptorProto) => item.serialize(writer)); - if (this.enum_type.length) - writer.writeRepeatedMessage(5, this.enum_type, (item: EnumDescriptorProto) => item.serialize(writer)); - if (this.service.length) - writer.writeRepeatedMessage(6, this.service, (item: ServiceDescriptorProto) => item.serialize(writer)); - if (this.extension.length) - writer.writeRepeatedMessage(7, this.extension, (item: FieldDescriptorProto) => item.serialize(writer)); - if (this.has_options) - writer.writeMessage(8, this.options, () => this.options.serialize(writer)); - if (this.has_source_code_info) - writer.writeMessage(9, this.source_code_info, () => this.source_code_info.serialize(writer)); - if (this.has_syntax && this.syntax.length) - writer.writeString(12, this.syntax); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): FileDescriptorProto { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new FileDescriptorProto(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.name = reader.readString(); - break; - case 2: - message.package = reader.readString(); - break; - case 3: - pb_1.Message.addToRepeatedField(message, 3, reader.readString()); - break; - case 10: - pb_1.Message.addToRepeatedField(message, 10, reader.readInt32()); - break; - case 11: - pb_1.Message.addToRepeatedField(message, 11, reader.readInt32()); - break; - case 4: - reader.readMessage(message.message_type, () => pb_1.Message.addToRepeatedWrapperField(message, 4, DescriptorProto.deserialize(reader), DescriptorProto)); - break; - case 5: - reader.readMessage(message.enum_type, () => pb_1.Message.addToRepeatedWrapperField(message, 5, EnumDescriptorProto.deserialize(reader), EnumDescriptorProto)); - break; - case 6: - reader.readMessage(message.service, () => pb_1.Message.addToRepeatedWrapperField(message, 6, ServiceDescriptorProto.deserialize(reader), ServiceDescriptorProto)); - break; - case 7: - reader.readMessage(message.extension, () => pb_1.Message.addToRepeatedWrapperField(message, 7, FieldDescriptorProto.deserialize(reader), FieldDescriptorProto)); - break; - case 8: - reader.readMessage(message.options, () => message.options = FileOptions.deserialize(reader)); - break; - case 9: - reader.readMessage(message.source_code_info, () => message.source_code_info = SourceCodeInfo.deserialize(reader)); - break; - case 12: - message.syntax = reader.readString(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): FileDescriptorProto { - return FileDescriptorProto.deserialize(bytes); - } - } - export class DescriptorProto extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - name?: string; - field: FieldDescriptorProto[]; - extension: FieldDescriptorProto[]; - nested_type: DescriptorProto[]; - enum_type: EnumDescriptorProto[]; - extension_range: DescriptorProto.ExtensionRange[]; - oneof_decl: OneofDescriptorProto[]; - options?: MessageOptions; - reserved_range: DescriptorProto.ReservedRange[]; - reserved_name: string[]; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2, 6, 3, 4, 5, 8, 9, 10], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("name" in data && data.name != undefined) { - this.name = data.name; - } - this.field = data.field; - this.extension = data.extension; - this.nested_type = data.nested_type; - this.enum_type = data.enum_type; - this.extension_range = data.extension_range; - this.oneof_decl = data.oneof_decl; - if ("options" in data && data.options != undefined) { - this.options = data.options; - } - this.reserved_range = data.reserved_range; - this.reserved_name = data.reserved_name; - } - } - get name() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; - } - set name(value: string) { - pb_1.Message.setField(this, 1, value); - } - get has_name() { - return pb_1.Message.getField(this, 1) != null; - } - get field() { - return pb_1.Message.getRepeatedWrapperField(this, FieldDescriptorProto, 2) as FieldDescriptorProto[]; - } - set field(value: FieldDescriptorProto[]) { - pb_1.Message.setRepeatedWrapperField(this, 2, value); - } - get extension() { - return pb_1.Message.getRepeatedWrapperField(this, FieldDescriptorProto, 6) as FieldDescriptorProto[]; - } - set extension(value: FieldDescriptorProto[]) { - pb_1.Message.setRepeatedWrapperField(this, 6, value); - } - get nested_type() { - return pb_1.Message.getRepeatedWrapperField(this, DescriptorProto, 3) as DescriptorProto[]; - } - set nested_type(value: DescriptorProto[]) { - pb_1.Message.setRepeatedWrapperField(this, 3, value); - } - get enum_type() { - return pb_1.Message.getRepeatedWrapperField(this, EnumDescriptorProto, 4) as EnumDescriptorProto[]; - } - set enum_type(value: EnumDescriptorProto[]) { - pb_1.Message.setRepeatedWrapperField(this, 4, value); - } - get extension_range() { - return pb_1.Message.getRepeatedWrapperField(this, DescriptorProto.ExtensionRange, 5) as DescriptorProto.ExtensionRange[]; - } - set extension_range(value: DescriptorProto.ExtensionRange[]) { - pb_1.Message.setRepeatedWrapperField(this, 5, value); - } - get oneof_decl() { - return pb_1.Message.getRepeatedWrapperField(this, OneofDescriptorProto, 8) as OneofDescriptorProto[]; - } - set oneof_decl(value: OneofDescriptorProto[]) { - pb_1.Message.setRepeatedWrapperField(this, 8, value); - } - get options() { - return pb_1.Message.getWrapperField(this, MessageOptions, 7) as MessageOptions; - } - set options(value: MessageOptions) { - pb_1.Message.setWrapperField(this, 7, value); - } - get has_options() { - return pb_1.Message.getField(this, 7) != null; - } - get reserved_range() { - return pb_1.Message.getRepeatedWrapperField(this, DescriptorProto.ReservedRange, 9) as DescriptorProto.ReservedRange[]; - } - set reserved_range(value: DescriptorProto.ReservedRange[]) { - pb_1.Message.setRepeatedWrapperField(this, 9, value); - } - get reserved_name() { - return pb_1.Message.getFieldWithDefault(this, 10, []) as string[]; - } - set reserved_name(value: string[]) { - pb_1.Message.setField(this, 10, value); - } - static fromObject(data: { - name?: string; - field?: ReturnType[]; - extension?: ReturnType[]; - nested_type?: ReturnType[]; - enum_type?: ReturnType[]; - extension_range?: ReturnType[]; - oneof_decl?: ReturnType[]; - options?: ReturnType; - reserved_range?: ReturnType[]; - reserved_name: string[]; - }): DescriptorProto { - const message = new DescriptorProto({ - field: data.field.map(item => FieldDescriptorProto.fromObject(item)), - extension: data.extension.map(item => FieldDescriptorProto.fromObject(item)), - nested_type: data.nested_type.map(item => DescriptorProto.fromObject(item)), - enum_type: data.enum_type.map(item => EnumDescriptorProto.fromObject(item)), - extension_range: data.extension_range.map(item => DescriptorProto.ExtensionRange.fromObject(item)), - oneof_decl: data.oneof_decl.map(item => OneofDescriptorProto.fromObject(item)), - reserved_range: data.reserved_range.map(item => DescriptorProto.ReservedRange.fromObject(item)), - reserved_name: data.reserved_name - }); - if (data.name != null) { - message.name = data.name; - } - if (data.options != null) { - message.options = MessageOptions.fromObject(data.options); - } - return message; - } - toObject() { - const data: { - name?: string; - field?: ReturnType[]; - extension?: ReturnType[]; - nested_type?: ReturnType[]; - enum_type?: ReturnType[]; - extension_range?: ReturnType[]; - oneof_decl?: ReturnType[]; - options?: ReturnType; - reserved_range?: ReturnType[]; - reserved_name: string[]; - } = { - reserved_name: this.reserved_name - }; - if (this.name != null) { - data.name = this.name; - } - if (this.field != null) { - data.field = this.field.map((item: FieldDescriptorProto) => item.toObject()); - } - if (this.extension != null) { - data.extension = this.extension.map((item: FieldDescriptorProto) => item.toObject()); - } - if (this.nested_type != null) { - data.nested_type = this.nested_type.map((item: DescriptorProto) => item.toObject()); - } - if (this.enum_type != null) { - data.enum_type = this.enum_type.map((item: EnumDescriptorProto) => item.toObject()); - } - if (this.extension_range != null) { - data.extension_range = this.extension_range.map((item: DescriptorProto.ExtensionRange) => item.toObject()); - } - if (this.oneof_decl != null) { - data.oneof_decl = this.oneof_decl.map((item: OneofDescriptorProto) => item.toObject()); - } - if (this.options != null) { - data.options = this.options.toObject(); - } - if (this.reserved_range != null) { - data.reserved_range = this.reserved_range.map((item: DescriptorProto.ReservedRange) => 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_name && this.name.length) - writer.writeString(1, this.name); - if (this.field.length) - writer.writeRepeatedMessage(2, this.field, (item: FieldDescriptorProto) => item.serialize(writer)); - if (this.extension.length) - writer.writeRepeatedMessage(6, this.extension, (item: FieldDescriptorProto) => item.serialize(writer)); - if (this.nested_type.length) - writer.writeRepeatedMessage(3, this.nested_type, (item: DescriptorProto) => item.serialize(writer)); - if (this.enum_type.length) - writer.writeRepeatedMessage(4, this.enum_type, (item: EnumDescriptorProto) => item.serialize(writer)); - if (this.extension_range.length) - writer.writeRepeatedMessage(5, this.extension_range, (item: DescriptorProto.ExtensionRange) => item.serialize(writer)); - if (this.oneof_decl.length) - writer.writeRepeatedMessage(8, this.oneof_decl, (item: OneofDescriptorProto) => item.serialize(writer)); - if (this.has_options) - writer.writeMessage(7, this.options, () => this.options.serialize(writer)); - if (this.reserved_range.length) - writer.writeRepeatedMessage(9, this.reserved_range, (item: DescriptorProto.ReservedRange) => item.serialize(writer)); - if (this.reserved_name.length) - writer.writeRepeatedString(10, this.reserved_name); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): DescriptorProto { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new DescriptorProto(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.name = reader.readString(); - break; - case 2: - reader.readMessage(message.field, () => pb_1.Message.addToRepeatedWrapperField(message, 2, FieldDescriptorProto.deserialize(reader), FieldDescriptorProto)); - break; - case 6: - reader.readMessage(message.extension, () => pb_1.Message.addToRepeatedWrapperField(message, 6, FieldDescriptorProto.deserialize(reader), FieldDescriptorProto)); - break; - case 3: - reader.readMessage(message.nested_type, () => pb_1.Message.addToRepeatedWrapperField(message, 3, DescriptorProto.deserialize(reader), DescriptorProto)); - break; - case 4: - reader.readMessage(message.enum_type, () => pb_1.Message.addToRepeatedWrapperField(message, 4, EnumDescriptorProto.deserialize(reader), EnumDescriptorProto)); - break; - case 5: - reader.readMessage(message.extension_range, () => pb_1.Message.addToRepeatedWrapperField(message, 5, DescriptorProto.ExtensionRange.deserialize(reader), DescriptorProto.ExtensionRange)); - break; - case 8: - reader.readMessage(message.oneof_decl, () => pb_1.Message.addToRepeatedWrapperField(message, 8, OneofDescriptorProto.deserialize(reader), OneofDescriptorProto)); - break; - case 7: - reader.readMessage(message.options, () => message.options = MessageOptions.deserialize(reader)); - break; - case 9: - reader.readMessage(message.reserved_range, () => pb_1.Message.addToRepeatedWrapperField(message, 9, DescriptorProto.ReservedRange.deserialize(reader), DescriptorProto.ReservedRange)); - break; - case 10: - pb_1.Message.addToRepeatedField(message, 10, reader.readString()); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): DescriptorProto { - return DescriptorProto.deserialize(bytes); - } - } - export namespace DescriptorProto { - export class ExtensionRange extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - start?: number; - end?: number; - options?: ExtensionRangeOptions; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("start" in data && data.start != undefined) { - this.start = data.start; - } - if ("end" in data && data.end != undefined) { - this.end = data.end; - } - if ("options" in data && data.options != undefined) { - this.options = data.options; - } - } - } - get start() { - return pb_1.Message.getFieldWithDefault(this, 1, 0) as number; - } - set start(value: number) { - pb_1.Message.setField(this, 1, value); - } - get has_start() { - return pb_1.Message.getField(this, 1) != null; - } - get end() { - return pb_1.Message.getFieldWithDefault(this, 2, 0) as number; - } - set end(value: number) { - pb_1.Message.setField(this, 2, value); - } - get has_end() { - return pb_1.Message.getField(this, 2) != null; - } - get options() { - return pb_1.Message.getWrapperField(this, ExtensionRangeOptions, 3) as ExtensionRangeOptions; - } - set options(value: ExtensionRangeOptions) { - pb_1.Message.setWrapperField(this, 3, value); - } - get has_options() { - return pb_1.Message.getField(this, 3) != null; - } - static fromObject(data: { - start?: number; - end?: number; - options?: ReturnType; - }): ExtensionRange { - const message = new ExtensionRange({}); - if (data.start != null) { - message.start = data.start; - } - if (data.end != null) { - message.end = data.end; - } - if (data.options != null) { - message.options = ExtensionRangeOptions.fromObject(data.options); - } - return message; - } - toObject() { - const data: { - start?: number; - end?: number; - options?: ReturnType; - } = {}; - if (this.start != null) { - data.start = this.start; - } - if (this.end != null) { - data.end = this.end; - } - if (this.options != null) { - data.options = this.options.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_start) - writer.writeInt32(1, this.start); - if (this.has_end) - writer.writeInt32(2, this.end); - if (this.has_options) - writer.writeMessage(3, this.options, () => this.options.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): ExtensionRange { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new ExtensionRange(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.start = reader.readInt32(); - break; - case 2: - message.end = reader.readInt32(); - break; - case 3: - reader.readMessage(message.options, () => message.options = ExtensionRangeOptions.deserialize(reader)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): ExtensionRange { - return ExtensionRange.deserialize(bytes); - } - } - export class ReservedRange extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - start?: number; - end?: 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 ("start" in data && data.start != undefined) { - this.start = data.start; - } - if ("end" in data && data.end != undefined) { - this.end = data.end; - } - } - } - get start() { - return pb_1.Message.getFieldWithDefault(this, 1, 0) as number; - } - set start(value: number) { - pb_1.Message.setField(this, 1, value); - } - get has_start() { - return pb_1.Message.getField(this, 1) != null; - } - get end() { - return pb_1.Message.getFieldWithDefault(this, 2, 0) as number; - } - set end(value: number) { - pb_1.Message.setField(this, 2, value); - } - get has_end() { - return pb_1.Message.getField(this, 2) != null; - } - static fromObject(data: { - start?: number; - end?: number; - }): ReservedRange { - const message = new ReservedRange({}); - if (data.start != null) { - message.start = data.start; - } - if (data.end != null) { - message.end = data.end; - } - return message; - } - toObject() { - const data: { - start?: number; - end?: number; - } = {}; - if (this.start != null) { - data.start = this.start; - } - if (this.end != null) { - data.end = this.end; - } - 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_start) - writer.writeInt32(1, this.start); - if (this.has_end) - writer.writeInt32(2, this.end); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): ReservedRange { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new ReservedRange(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.start = reader.readInt32(); - break; - case 2: - message.end = reader.readInt32(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): ReservedRange { - return ReservedRange.deserialize(bytes); - } - } - } - export class ExtensionRangeOptions extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - uninterpreted_option: UninterpretedOption[]; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [999], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - this.uninterpreted_option = data.uninterpreted_option; - } - } - get uninterpreted_option() { - return pb_1.Message.getRepeatedWrapperField(this, UninterpretedOption, 999) as UninterpretedOption[]; - } - set uninterpreted_option(value: UninterpretedOption[]) { - pb_1.Message.setRepeatedWrapperField(this, 999, value); - } - static fromObject(data: { - uninterpreted_option?: ReturnType[]; - }): ExtensionRangeOptions { - const message = new ExtensionRangeOptions({ - uninterpreted_option: data.uninterpreted_option.map(item => UninterpretedOption.fromObject(item)) - }); - return message; - } - toObject() { - const data: { - uninterpreted_option?: ReturnType[]; - } = {}; - if (this.uninterpreted_option != null) { - data.uninterpreted_option = this.uninterpreted_option.map((item: UninterpretedOption) => 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.uninterpreted_option.length) - writer.writeRepeatedMessage(999, this.uninterpreted_option, (item: UninterpretedOption) => item.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): ExtensionRangeOptions { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new ExtensionRangeOptions(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 999: - reader.readMessage(message.uninterpreted_option, () => pb_1.Message.addToRepeatedWrapperField(message, 999, UninterpretedOption.deserialize(reader), UninterpretedOption)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): ExtensionRangeOptions { - return ExtensionRangeOptions.deserialize(bytes); - } - } - export class FieldDescriptorProto extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - name?: string; - number?: number; - label?: FieldDescriptorProto.Label; - type?: FieldDescriptorProto.Type; - type_name?: string; - extendee?: string; - default_value?: string; - oneof_index?: number; - json_name?: string; - options?: FieldOptions; - proto3_optional?: 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 ("name" in data && data.name != undefined) { - this.name = data.name; - } - if ("number" in data && data.number != undefined) { - this.number = data.number; - } - if ("label" in data && data.label != undefined) { - this.label = data.label; - } - if ("type" in data && data.type != undefined) { - this.type = data.type; - } - if ("type_name" in data && data.type_name != undefined) { - this.type_name = data.type_name; - } - if ("extendee" in data && data.extendee != undefined) { - this.extendee = data.extendee; - } - if ("default_value" in data && data.default_value != undefined) { - this.default_value = data.default_value; - } - if ("oneof_index" in data && data.oneof_index != undefined) { - this.oneof_index = data.oneof_index; - } - if ("json_name" in data && data.json_name != undefined) { - this.json_name = data.json_name; - } - if ("options" in data && data.options != undefined) { - this.options = data.options; - } - if ("proto3_optional" in data && data.proto3_optional != undefined) { - this.proto3_optional = data.proto3_optional; - } - } - } - get name() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; - } - set name(value: string) { - pb_1.Message.setField(this, 1, value); - } - get has_name() { - return pb_1.Message.getField(this, 1) != null; - } - get number() { - return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; - } - set number(value: number) { - pb_1.Message.setField(this, 3, value); - } - get has_number() { - return pb_1.Message.getField(this, 3) != null; - } - get label() { - return pb_1.Message.getFieldWithDefault(this, 4, FieldDescriptorProto.Label.LABEL_OPTIONAL) as FieldDescriptorProto.Label; - } - set label(value: FieldDescriptorProto.Label) { - pb_1.Message.setField(this, 4, value); - } - get has_label() { - return pb_1.Message.getField(this, 4) != null; - } - get type() { - return pb_1.Message.getFieldWithDefault(this, 5, FieldDescriptorProto.Type.TYPE_DOUBLE) as FieldDescriptorProto.Type; - } - set type(value: FieldDescriptorProto.Type) { - pb_1.Message.setField(this, 5, value); - } - get has_type() { - return pb_1.Message.getField(this, 5) != null; - } - get type_name() { - return pb_1.Message.getFieldWithDefault(this, 6, "") as string; - } - set type_name(value: string) { - pb_1.Message.setField(this, 6, value); - } - get has_type_name() { - return pb_1.Message.getField(this, 6) != null; - } - get extendee() { - return pb_1.Message.getFieldWithDefault(this, 2, "") as string; - } - set extendee(value: string) { - pb_1.Message.setField(this, 2, value); - } - get has_extendee() { - return pb_1.Message.getField(this, 2) != null; - } - get default_value() { - return pb_1.Message.getFieldWithDefault(this, 7, "") as string; - } - set default_value(value: string) { - pb_1.Message.setField(this, 7, value); - } - get has_default_value() { - return pb_1.Message.getField(this, 7) != null; - } - get oneof_index() { - return pb_1.Message.getFieldWithDefault(this, 9, 0) as number; - } - set oneof_index(value: number) { - pb_1.Message.setField(this, 9, value); - } - get has_oneof_index() { - return pb_1.Message.getField(this, 9) != null; - } - get json_name() { - return pb_1.Message.getFieldWithDefault(this, 10, "") as string; - } - set json_name(value: string) { - pb_1.Message.setField(this, 10, value); - } - get has_json_name() { - return pb_1.Message.getField(this, 10) != null; - } - get options() { - return pb_1.Message.getWrapperField(this, FieldOptions, 8) as FieldOptions; - } - set options(value: FieldOptions) { - pb_1.Message.setWrapperField(this, 8, value); - } - get has_options() { - return pb_1.Message.getField(this, 8) != null; - } - get proto3_optional() { - return pb_1.Message.getFieldWithDefault(this, 17, false) as boolean; - } - set proto3_optional(value: boolean) { - pb_1.Message.setField(this, 17, value); - } - get has_proto3_optional() { - return pb_1.Message.getField(this, 17) != null; - } - static fromObject(data: { - name?: string; - number?: number; - label?: FieldDescriptorProto.Label; - type?: FieldDescriptorProto.Type; - type_name?: string; - extendee?: string; - default_value?: string; - oneof_index?: number; - json_name?: string; - options?: ReturnType; - proto3_optional?: boolean; - }): FieldDescriptorProto { - const message = new FieldDescriptorProto({}); - if (data.name != null) { - message.name = data.name; - } - if (data.number != null) { - message.number = data.number; - } - if (data.label != null) { - message.label = data.label; - } - if (data.type != null) { - message.type = data.type; - } - if (data.type_name != null) { - message.type_name = data.type_name; - } - if (data.extendee != null) { - message.extendee = data.extendee; - } - if (data.default_value != null) { - message.default_value = data.default_value; - } - if (data.oneof_index != null) { - message.oneof_index = data.oneof_index; - } - if (data.json_name != null) { - message.json_name = data.json_name; - } - if (data.options != null) { - message.options = FieldOptions.fromObject(data.options); - } - if (data.proto3_optional != null) { - message.proto3_optional = data.proto3_optional; - } - return message; - } - toObject() { - const data: { - name?: string; - number?: number; - label?: FieldDescriptorProto.Label; - type?: FieldDescriptorProto.Type; - type_name?: string; - extendee?: string; - default_value?: string; - oneof_index?: number; - json_name?: string; - options?: ReturnType; - proto3_optional?: boolean; - } = {}; - if (this.name != null) { - data.name = this.name; - } - if (this.number != null) { - data.number = this.number; - } - if (this.label != null) { - data.label = this.label; - } - if (this.type != null) { - data.type = this.type; - } - if (this.type_name != null) { - data.type_name = this.type_name; - } - if (this.extendee != null) { - data.extendee = this.extendee; - } - if (this.default_value != null) { - data.default_value = this.default_value; - } - if (this.oneof_index != null) { - data.oneof_index = this.oneof_index; - } - if (this.json_name != null) { - data.json_name = this.json_name; - } - if (this.options != null) { - data.options = this.options.toObject(); - } - if (this.proto3_optional != null) { - data.proto3_optional = this.proto3_optional; - } - 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_name && this.name.length) - writer.writeString(1, this.name); - if (this.has_number) - writer.writeInt32(3, this.number); - if (this.has_label) - writer.writeEnum(4, this.label); - if (this.has_type) - writer.writeEnum(5, this.type); - if (this.has_type_name && this.type_name.length) - writer.writeString(6, this.type_name); - if (this.has_extendee && this.extendee.length) - writer.writeString(2, this.extendee); - if (this.has_default_value && this.default_value.length) - writer.writeString(7, this.default_value); - if (this.has_oneof_index) - writer.writeInt32(9, this.oneof_index); - if (this.has_json_name && this.json_name.length) - writer.writeString(10, this.json_name); - if (this.has_options) - writer.writeMessage(8, this.options, () => this.options.serialize(writer)); - if (this.has_proto3_optional) - writer.writeBool(17, this.proto3_optional); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): FieldDescriptorProto { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new FieldDescriptorProto(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.name = reader.readString(); - break; - case 3: - message.number = reader.readInt32(); - break; - case 4: - message.label = reader.readEnum(); - break; - case 5: - message.type = reader.readEnum(); - break; - case 6: - message.type_name = reader.readString(); - break; - case 2: - message.extendee = reader.readString(); - break; - case 7: - message.default_value = reader.readString(); - break; - case 9: - message.oneof_index = reader.readInt32(); - break; - case 10: - message.json_name = reader.readString(); - break; - case 8: - reader.readMessage(message.options, () => message.options = FieldOptions.deserialize(reader)); - break; - case 17: - message.proto3_optional = reader.readBool(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): FieldDescriptorProto { - return FieldDescriptorProto.deserialize(bytes); - } - } - export namespace FieldDescriptorProto { - export enum Type { - TYPE_DOUBLE = 1, - TYPE_FLOAT = 2, - TYPE_INT64 = 3, - TYPE_UINT64 = 4, - TYPE_INT32 = 5, - TYPE_FIXED64 = 6, - TYPE_FIXED32 = 7, - TYPE_BOOL = 8, - TYPE_STRING = 9, - TYPE_GROUP = 10, - TYPE_MESSAGE = 11, - TYPE_BYTES = 12, - TYPE_UINT32 = 13, - TYPE_ENUM = 14, - TYPE_SFIXED32 = 15, - TYPE_SFIXED64 = 16, - TYPE_SINT32 = 17, - TYPE_SINT64 = 18 - } - export enum Label { - LABEL_OPTIONAL = 1, - LABEL_REQUIRED = 2, - LABEL_REPEATED = 3 - } - } - export class OneofDescriptorProto extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - name?: string; - options?: OneofOptions; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("name" in data && data.name != undefined) { - this.name = data.name; - } - if ("options" in data && data.options != undefined) { - this.options = data.options; - } - } - } - get name() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; - } - set name(value: string) { - pb_1.Message.setField(this, 1, value); - } - get has_name() { - return pb_1.Message.getField(this, 1) != null; - } - get options() { - return pb_1.Message.getWrapperField(this, OneofOptions, 2) as OneofOptions; - } - set options(value: OneofOptions) { - pb_1.Message.setWrapperField(this, 2, value); - } - get has_options() { - return pb_1.Message.getField(this, 2) != null; - } - static fromObject(data: { - name?: string; - options?: ReturnType; - }): OneofDescriptorProto { - const message = new OneofDescriptorProto({}); - if (data.name != null) { - message.name = data.name; - } - if (data.options != null) { - message.options = OneofOptions.fromObject(data.options); - } - return message; - } - toObject() { - const data: { - name?: string; - options?: ReturnType; - } = {}; - if (this.name != null) { - data.name = this.name; - } - if (this.options != null) { - data.options = this.options.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_name && this.name.length) - writer.writeString(1, this.name); - if (this.has_options) - writer.writeMessage(2, this.options, () => this.options.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): OneofDescriptorProto { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new OneofDescriptorProto(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.name = reader.readString(); - break; - case 2: - reader.readMessage(message.options, () => message.options = OneofOptions.deserialize(reader)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): OneofDescriptorProto { - return OneofDescriptorProto.deserialize(bytes); - } - } - export class EnumDescriptorProto extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - name?: string; - value: EnumValueDescriptorProto[]; - options?: EnumOptions; - reserved_range: EnumDescriptorProto.EnumReservedRange[]; - reserved_name: string[]; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2, 4, 5], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("name" in data && data.name != undefined) { - this.name = data.name; - } - this.value = data.value; - if ("options" in data && data.options != undefined) { - this.options = data.options; - } - this.reserved_range = data.reserved_range; - this.reserved_name = data.reserved_name; - } - } - get name() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; - } - set name(value: string) { - pb_1.Message.setField(this, 1, value); - } - get has_name() { - return pb_1.Message.getField(this, 1) != null; - } - get value() { - return pb_1.Message.getRepeatedWrapperField(this, EnumValueDescriptorProto, 2) as EnumValueDescriptorProto[]; - } - set value(value: EnumValueDescriptorProto[]) { - pb_1.Message.setRepeatedWrapperField(this, 2, value); - } - get options() { - return pb_1.Message.getWrapperField(this, EnumOptions, 3) as EnumOptions; - } - set options(value: EnumOptions) { - pb_1.Message.setWrapperField(this, 3, value); - } - get has_options() { - return pb_1.Message.getField(this, 3) != null; - } - get reserved_range() { - return pb_1.Message.getRepeatedWrapperField(this, EnumDescriptorProto.EnumReservedRange, 4) as EnumDescriptorProto.EnumReservedRange[]; - } - set reserved_range(value: EnumDescriptorProto.EnumReservedRange[]) { - pb_1.Message.setRepeatedWrapperField(this, 4, value); - } - get reserved_name() { - return pb_1.Message.getFieldWithDefault(this, 5, []) as string[]; - } - set reserved_name(value: string[]) { - pb_1.Message.setField(this, 5, value); - } - static fromObject(data: { - name?: string; - value?: ReturnType[]; - options?: ReturnType; - reserved_range?: ReturnType[]; - reserved_name: string[]; - }): EnumDescriptorProto { - const message = new EnumDescriptorProto({ - value: data.value.map(item => EnumValueDescriptorProto.fromObject(item)), - reserved_range: data.reserved_range.map(item => EnumDescriptorProto.EnumReservedRange.fromObject(item)), - reserved_name: data.reserved_name - }); - if (data.name != null) { - message.name = data.name; - } - if (data.options != null) { - message.options = EnumOptions.fromObject(data.options); - } - return message; - } - toObject() { - const data: { - name?: string; - value?: ReturnType[]; - options?: ReturnType; - reserved_range?: ReturnType[]; - reserved_name: string[]; - } = { - reserved_name: this.reserved_name - }; - if (this.name != null) { - data.name = this.name; - } - if (this.value != null) { - data.value = this.value.map((item: EnumValueDescriptorProto) => item.toObject()); - } - if (this.options != null) { - data.options = this.options.toObject(); - } - if (this.reserved_range != null) { - data.reserved_range = this.reserved_range.map((item: EnumDescriptorProto.EnumReservedRange) => 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_name && this.name.length) - writer.writeString(1, this.name); - if (this.value.length) - writer.writeRepeatedMessage(2, this.value, (item: EnumValueDescriptorProto) => item.serialize(writer)); - if (this.has_options) - writer.writeMessage(3, this.options, () => this.options.serialize(writer)); - if (this.reserved_range.length) - writer.writeRepeatedMessage(4, this.reserved_range, (item: EnumDescriptorProto.EnumReservedRange) => item.serialize(writer)); - if (this.reserved_name.length) - writer.writeRepeatedString(5, this.reserved_name); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): EnumDescriptorProto { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new EnumDescriptorProto(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.name = reader.readString(); - break; - case 2: - reader.readMessage(message.value, () => pb_1.Message.addToRepeatedWrapperField(message, 2, EnumValueDescriptorProto.deserialize(reader), EnumValueDescriptorProto)); - break; - case 3: - reader.readMessage(message.options, () => message.options = EnumOptions.deserialize(reader)); - break; - case 4: - reader.readMessage(message.reserved_range, () => pb_1.Message.addToRepeatedWrapperField(message, 4, EnumDescriptorProto.EnumReservedRange.deserialize(reader), EnumDescriptorProto.EnumReservedRange)); - break; - case 5: - pb_1.Message.addToRepeatedField(message, 5, reader.readString()); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): EnumDescriptorProto { - return EnumDescriptorProto.deserialize(bytes); - } - } - export namespace EnumDescriptorProto { - export class EnumReservedRange extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - start?: number; - end?: 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 ("start" in data && data.start != undefined) { - this.start = data.start; - } - if ("end" in data && data.end != undefined) { - this.end = data.end; - } - } - } - get start() { - return pb_1.Message.getFieldWithDefault(this, 1, 0) as number; - } - set start(value: number) { - pb_1.Message.setField(this, 1, value); - } - get has_start() { - return pb_1.Message.getField(this, 1) != null; - } - get end() { - return pb_1.Message.getFieldWithDefault(this, 2, 0) as number; - } - set end(value: number) { - pb_1.Message.setField(this, 2, value); - } - get has_end() { - return pb_1.Message.getField(this, 2) != null; - } - static fromObject(data: { - start?: number; - end?: number; - }): EnumReservedRange { - const message = new EnumReservedRange({}); - if (data.start != null) { - message.start = data.start; - } - if (data.end != null) { - message.end = data.end; - } - return message; - } - toObject() { - const data: { - start?: number; - end?: number; - } = {}; - if (this.start != null) { - data.start = this.start; - } - if (this.end != null) { - data.end = this.end; - } - 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_start) - writer.writeInt32(1, this.start); - if (this.has_end) - writer.writeInt32(2, this.end); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): EnumReservedRange { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new EnumReservedRange(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.start = reader.readInt32(); - break; - case 2: - message.end = reader.readInt32(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): EnumReservedRange { - return EnumReservedRange.deserialize(bytes); - } - } - } - export class EnumValueDescriptorProto extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - name?: string; - number?: number; - options?: EnumValueOptions; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("name" in data && data.name != undefined) { - this.name = data.name; - } - if ("number" in data && data.number != undefined) { - this.number = data.number; - } - if ("options" in data && data.options != undefined) { - this.options = data.options; - } - } - } - get name() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; - } - set name(value: string) { - pb_1.Message.setField(this, 1, value); - } - get has_name() { - return pb_1.Message.getField(this, 1) != null; - } - get number() { - return pb_1.Message.getFieldWithDefault(this, 2, 0) as number; - } - set number(value: number) { - pb_1.Message.setField(this, 2, value); - } - get has_number() { - return pb_1.Message.getField(this, 2) != null; - } - get options() { - return pb_1.Message.getWrapperField(this, EnumValueOptions, 3) as EnumValueOptions; - } - set options(value: EnumValueOptions) { - pb_1.Message.setWrapperField(this, 3, value); - } - get has_options() { - return pb_1.Message.getField(this, 3) != null; - } - static fromObject(data: { - name?: string; - number?: number; - options?: ReturnType; - }): EnumValueDescriptorProto { - const message = new EnumValueDescriptorProto({}); - if (data.name != null) { - message.name = data.name; - } - if (data.number != null) { - message.number = data.number; - } - if (data.options != null) { - message.options = EnumValueOptions.fromObject(data.options); - } - return message; - } - toObject() { - const data: { - name?: string; - number?: number; - options?: ReturnType; - } = {}; - if (this.name != null) { - data.name = this.name; - } - if (this.number != null) { - data.number = this.number; - } - if (this.options != null) { - data.options = this.options.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_name && this.name.length) - writer.writeString(1, this.name); - if (this.has_number) - writer.writeInt32(2, this.number); - if (this.has_options) - writer.writeMessage(3, this.options, () => this.options.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): EnumValueDescriptorProto { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new EnumValueDescriptorProto(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.name = reader.readString(); - break; - case 2: - message.number = reader.readInt32(); - break; - case 3: - reader.readMessage(message.options, () => message.options = EnumValueOptions.deserialize(reader)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): EnumValueDescriptorProto { - return EnumValueDescriptorProto.deserialize(bytes); - } - } - export class ServiceDescriptorProto extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - name?: string; - method: MethodDescriptorProto[]; - options?: ServiceOptions; - }) { - 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 ("name" in data && data.name != undefined) { - this.name = data.name; - } - this.method = data.method; - if ("options" in data && data.options != undefined) { - this.options = data.options; - } - } - } - get name() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; - } - set name(value: string) { - pb_1.Message.setField(this, 1, value); - } - get has_name() { - return pb_1.Message.getField(this, 1) != null; - } - get method() { - return pb_1.Message.getRepeatedWrapperField(this, MethodDescriptorProto, 2) as MethodDescriptorProto[]; - } - set method(value: MethodDescriptorProto[]) { - pb_1.Message.setRepeatedWrapperField(this, 2, value); - } - get options() { - return pb_1.Message.getWrapperField(this, ServiceOptions, 3) as ServiceOptions; - } - set options(value: ServiceOptions) { - pb_1.Message.setWrapperField(this, 3, value); - } - get has_options() { - return pb_1.Message.getField(this, 3) != null; - } - static fromObject(data: { - name?: string; - method?: ReturnType[]; - options?: ReturnType; - }): ServiceDescriptorProto { - const message = new ServiceDescriptorProto({ - method: data.method.map(item => MethodDescriptorProto.fromObject(item)) - }); - if (data.name != null) { - message.name = data.name; - } - if (data.options != null) { - message.options = ServiceOptions.fromObject(data.options); - } - return message; - } - toObject() { - const data: { - name?: string; - method?: ReturnType[]; - options?: ReturnType; - } = {}; - if (this.name != null) { - data.name = this.name; - } - if (this.method != null) { - data.method = this.method.map((item: MethodDescriptorProto) => item.toObject()); - } - if (this.options != null) { - data.options = this.options.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_name && this.name.length) - writer.writeString(1, this.name); - if (this.method.length) - writer.writeRepeatedMessage(2, this.method, (item: MethodDescriptorProto) => item.serialize(writer)); - if (this.has_options) - writer.writeMessage(3, this.options, () => this.options.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): ServiceDescriptorProto { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new ServiceDescriptorProto(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.name = reader.readString(); - break; - case 2: - reader.readMessage(message.method, () => pb_1.Message.addToRepeatedWrapperField(message, 2, MethodDescriptorProto.deserialize(reader), MethodDescriptorProto)); - break; - case 3: - reader.readMessage(message.options, () => message.options = ServiceOptions.deserialize(reader)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): ServiceDescriptorProto { - return ServiceDescriptorProto.deserialize(bytes); - } - } - export class MethodDescriptorProto extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - name?: string; - input_type?: string; - output_type?: string; - options?: MethodOptions; - client_streaming?: boolean; - server_streaming?: 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 ("name" in data && data.name != undefined) { - this.name = data.name; - } - if ("input_type" in data && data.input_type != undefined) { - this.input_type = data.input_type; - } - if ("output_type" in data && data.output_type != undefined) { - this.output_type = data.output_type; - } - if ("options" in data && data.options != undefined) { - this.options = data.options; - } - if ("client_streaming" in data && data.client_streaming != undefined) { - this.client_streaming = data.client_streaming; - } - if ("server_streaming" in data && data.server_streaming != undefined) { - this.server_streaming = data.server_streaming; - } - } - } - get name() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; - } - set name(value: string) { - pb_1.Message.setField(this, 1, value); - } - get has_name() { - return pb_1.Message.getField(this, 1) != null; - } - get input_type() { - return pb_1.Message.getFieldWithDefault(this, 2, "") as string; - } - set input_type(value: string) { - pb_1.Message.setField(this, 2, value); - } - get has_input_type() { - return pb_1.Message.getField(this, 2) != null; - } - get output_type() { - return pb_1.Message.getFieldWithDefault(this, 3, "") as string; - } - set output_type(value: string) { - pb_1.Message.setField(this, 3, value); - } - get has_output_type() { - return pb_1.Message.getField(this, 3) != null; - } - get options() { - return pb_1.Message.getWrapperField(this, MethodOptions, 4) as MethodOptions; - } - set options(value: MethodOptions) { - pb_1.Message.setWrapperField(this, 4, value); - } - get has_options() { - return pb_1.Message.getField(this, 4) != null; - } - get client_streaming() { - return pb_1.Message.getFieldWithDefault(this, 5, false) as boolean; - } - set client_streaming(value: boolean) { - pb_1.Message.setField(this, 5, value); - } - get has_client_streaming() { - return pb_1.Message.getField(this, 5) != null; - } - get server_streaming() { - return pb_1.Message.getFieldWithDefault(this, 6, false) as boolean; - } - set server_streaming(value: boolean) { - pb_1.Message.setField(this, 6, value); - } - get has_server_streaming() { - return pb_1.Message.getField(this, 6) != null; - } - static fromObject(data: { - name?: string; - input_type?: string; - output_type?: string; - options?: ReturnType; - client_streaming?: boolean; - server_streaming?: boolean; - }): MethodDescriptorProto { - const message = new MethodDescriptorProto({}); - if (data.name != null) { - message.name = data.name; - } - if (data.input_type != null) { - message.input_type = data.input_type; - } - if (data.output_type != null) { - message.output_type = data.output_type; - } - if (data.options != null) { - message.options = MethodOptions.fromObject(data.options); - } - if (data.client_streaming != null) { - message.client_streaming = data.client_streaming; - } - if (data.server_streaming != null) { - message.server_streaming = data.server_streaming; - } - return message; - } - toObject() { - const data: { - name?: string; - input_type?: string; - output_type?: string; - options?: ReturnType; - client_streaming?: boolean; - server_streaming?: boolean; - } = {}; - if (this.name != null) { - data.name = this.name; - } - if (this.input_type != null) { - data.input_type = this.input_type; - } - if (this.output_type != null) { - data.output_type = this.output_type; - } - if (this.options != null) { - data.options = this.options.toObject(); - } - if (this.client_streaming != null) { - data.client_streaming = this.client_streaming; - } - if (this.server_streaming != null) { - data.server_streaming = this.server_streaming; - } - 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_name && this.name.length) - writer.writeString(1, this.name); - if (this.has_input_type && this.input_type.length) - writer.writeString(2, this.input_type); - if (this.has_output_type && this.output_type.length) - writer.writeString(3, this.output_type); - if (this.has_options) - writer.writeMessage(4, this.options, () => this.options.serialize(writer)); - if (this.has_client_streaming) - writer.writeBool(5, this.client_streaming); - if (this.has_server_streaming) - writer.writeBool(6, this.server_streaming); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MethodDescriptorProto { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MethodDescriptorProto(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.name = reader.readString(); - break; - case 2: - message.input_type = reader.readString(); - break; - case 3: - message.output_type = reader.readString(); - break; - case 4: - reader.readMessage(message.options, () => message.options = MethodOptions.deserialize(reader)); - break; - case 5: - message.client_streaming = reader.readBool(); - break; - case 6: - message.server_streaming = reader.readBool(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): MethodDescriptorProto { - return MethodDescriptorProto.deserialize(bytes); - } - } - export class FileOptions extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - java_package?: string; - java_outer_classname?: string; - java_multiple_files?: boolean; - /** @deprecated*/ - java_generate_equals_and_hash?: boolean; - java_string_check_utf8?: boolean; - optimize_for?: FileOptions.OptimizeMode; - go_package?: string; - cc_generic_services?: boolean; - java_generic_services?: boolean; - py_generic_services?: boolean; - php_generic_services?: boolean; - deprecated?: boolean; - cc_enable_arenas?: boolean; - objc_class_prefix?: string; - csharp_namespace?: string; - swift_prefix?: string; - php_class_prefix?: string; - php_namespace?: string; - php_metadata_namespace?: string; - ruby_package?: string; - uninterpreted_option: UninterpretedOption[]; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [999], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("java_package" in data && data.java_package != undefined) { - this.java_package = data.java_package; - } - if ("java_outer_classname" in data && data.java_outer_classname != undefined) { - this.java_outer_classname = data.java_outer_classname; - } - if ("java_multiple_files" in data && data.java_multiple_files != undefined) { - this.java_multiple_files = data.java_multiple_files; - } - if ("java_generate_equals_and_hash" in data && data.java_generate_equals_and_hash != undefined) { - this.java_generate_equals_and_hash = data.java_generate_equals_and_hash; - } - if ("java_string_check_utf8" in data && data.java_string_check_utf8 != undefined) { - this.java_string_check_utf8 = data.java_string_check_utf8; - } - if ("optimize_for" in data && data.optimize_for != undefined) { - this.optimize_for = data.optimize_for; - } - if ("go_package" in data && data.go_package != undefined) { - this.go_package = data.go_package; - } - if ("cc_generic_services" in data && data.cc_generic_services != undefined) { - this.cc_generic_services = data.cc_generic_services; - } - if ("java_generic_services" in data && data.java_generic_services != undefined) { - this.java_generic_services = data.java_generic_services; - } - if ("py_generic_services" in data && data.py_generic_services != undefined) { - this.py_generic_services = data.py_generic_services; - } - if ("php_generic_services" in data && data.php_generic_services != undefined) { - this.php_generic_services = data.php_generic_services; - } - if ("deprecated" in data && data.deprecated != undefined) { - this.deprecated = data.deprecated; - } - if ("cc_enable_arenas" in data && data.cc_enable_arenas != undefined) { - this.cc_enable_arenas = data.cc_enable_arenas; - } - if ("objc_class_prefix" in data && data.objc_class_prefix != undefined) { - this.objc_class_prefix = data.objc_class_prefix; - } - if ("csharp_namespace" in data && data.csharp_namespace != undefined) { - this.csharp_namespace = data.csharp_namespace; - } - if ("swift_prefix" in data && data.swift_prefix != undefined) { - this.swift_prefix = data.swift_prefix; - } - if ("php_class_prefix" in data && data.php_class_prefix != undefined) { - this.php_class_prefix = data.php_class_prefix; - } - if ("php_namespace" in data && data.php_namespace != undefined) { - this.php_namespace = data.php_namespace; - } - if ("php_metadata_namespace" in data && data.php_metadata_namespace != undefined) { - this.php_metadata_namespace = data.php_metadata_namespace; - } - if ("ruby_package" in data && data.ruby_package != undefined) { - this.ruby_package = data.ruby_package; - } - this.uninterpreted_option = data.uninterpreted_option; - } - } - get java_package() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; - } - set java_package(value: string) { - pb_1.Message.setField(this, 1, value); - } - get has_java_package() { - return pb_1.Message.getField(this, 1) != null; - } - get java_outer_classname() { - return pb_1.Message.getFieldWithDefault(this, 8, "") as string; - } - set java_outer_classname(value: string) { - pb_1.Message.setField(this, 8, value); - } - get has_java_outer_classname() { - return pb_1.Message.getField(this, 8) != null; - } - get java_multiple_files() { - return pb_1.Message.getFieldWithDefault(this, 10, false) as boolean; - } - set java_multiple_files(value: boolean) { - pb_1.Message.setField(this, 10, value); - } - get has_java_multiple_files() { - return pb_1.Message.getField(this, 10) != null; - } - /** @deprecated*/ - get java_generate_equals_and_hash() { - return pb_1.Message.getFieldWithDefault(this, 20, false) as boolean; - } - /** @deprecated*/ - set java_generate_equals_and_hash(value: boolean) { - pb_1.Message.setField(this, 20, value); - } - /** @deprecated*/ - get has_java_generate_equals_and_hash() { - return pb_1.Message.getField(this, 20) != null; - } - get java_string_check_utf8() { - return pb_1.Message.getFieldWithDefault(this, 27, false) as boolean; - } - set java_string_check_utf8(value: boolean) { - pb_1.Message.setField(this, 27, value); - } - get has_java_string_check_utf8() { - return pb_1.Message.getField(this, 27) != null; - } - get optimize_for() { - return pb_1.Message.getFieldWithDefault(this, 9, FileOptions.OptimizeMode.SPEED) as FileOptions.OptimizeMode; - } - set optimize_for(value: FileOptions.OptimizeMode) { - pb_1.Message.setField(this, 9, value); - } - get has_optimize_for() { - return pb_1.Message.getField(this, 9) != null; - } - get go_package() { - return pb_1.Message.getFieldWithDefault(this, 11, "") as string; - } - set go_package(value: string) { - pb_1.Message.setField(this, 11, value); - } - get has_go_package() { - return pb_1.Message.getField(this, 11) != null; - } - get cc_generic_services() { - return pb_1.Message.getFieldWithDefault(this, 16, false) as boolean; - } - set cc_generic_services(value: boolean) { - pb_1.Message.setField(this, 16, value); - } - get has_cc_generic_services() { - return pb_1.Message.getField(this, 16) != null; - } - get java_generic_services() { - return pb_1.Message.getFieldWithDefault(this, 17, false) as boolean; - } - set java_generic_services(value: boolean) { - pb_1.Message.setField(this, 17, value); - } - get has_java_generic_services() { - return pb_1.Message.getField(this, 17) != null; - } - get py_generic_services() { - return pb_1.Message.getFieldWithDefault(this, 18, false) as boolean; - } - set py_generic_services(value: boolean) { - pb_1.Message.setField(this, 18, value); - } - get has_py_generic_services() { - return pb_1.Message.getField(this, 18) != null; - } - get php_generic_services() { - return pb_1.Message.getFieldWithDefault(this, 42, false) as boolean; - } - set php_generic_services(value: boolean) { - pb_1.Message.setField(this, 42, value); - } - get has_php_generic_services() { - return pb_1.Message.getField(this, 42) != null; - } - get deprecated() { - return pb_1.Message.getFieldWithDefault(this, 23, false) as boolean; - } - set deprecated(value: boolean) { - pb_1.Message.setField(this, 23, value); - } - get has_deprecated() { - return pb_1.Message.getField(this, 23) != null; - } - get cc_enable_arenas() { - return pb_1.Message.getFieldWithDefault(this, 31, true) as boolean; - } - set cc_enable_arenas(value: boolean) { - pb_1.Message.setField(this, 31, value); - } - get has_cc_enable_arenas() { - return pb_1.Message.getField(this, 31) != null; - } - get objc_class_prefix() { - return pb_1.Message.getFieldWithDefault(this, 36, "") as string; - } - set objc_class_prefix(value: string) { - pb_1.Message.setField(this, 36, value); - } - get has_objc_class_prefix() { - return pb_1.Message.getField(this, 36) != null; - } - get csharp_namespace() { - return pb_1.Message.getFieldWithDefault(this, 37, "") as string; - } - set csharp_namespace(value: string) { - pb_1.Message.setField(this, 37, value); - } - get has_csharp_namespace() { - return pb_1.Message.getField(this, 37) != null; - } - get swift_prefix() { - return pb_1.Message.getFieldWithDefault(this, 39, "") as string; - } - set swift_prefix(value: string) { - pb_1.Message.setField(this, 39, value); - } - get has_swift_prefix() { - return pb_1.Message.getField(this, 39) != null; - } - get php_class_prefix() { - return pb_1.Message.getFieldWithDefault(this, 40, "") as string; - } - set php_class_prefix(value: string) { - pb_1.Message.setField(this, 40, value); - } - get has_php_class_prefix() { - return pb_1.Message.getField(this, 40) != null; - } - get php_namespace() { - return pb_1.Message.getFieldWithDefault(this, 41, "") as string; - } - set php_namespace(value: string) { - pb_1.Message.setField(this, 41, value); - } - get has_php_namespace() { - return pb_1.Message.getField(this, 41) != null; - } - get php_metadata_namespace() { - return pb_1.Message.getFieldWithDefault(this, 44, "") as string; - } - set php_metadata_namespace(value: string) { - pb_1.Message.setField(this, 44, value); - } - get has_php_metadata_namespace() { - return pb_1.Message.getField(this, 44) != null; - } - get ruby_package() { - return pb_1.Message.getFieldWithDefault(this, 45, "") as string; - } - set ruby_package(value: string) { - pb_1.Message.setField(this, 45, value); - } - get has_ruby_package() { - return pb_1.Message.getField(this, 45) != null; - } - get uninterpreted_option() { - return pb_1.Message.getRepeatedWrapperField(this, UninterpretedOption, 999) as UninterpretedOption[]; - } - set uninterpreted_option(value: UninterpretedOption[]) { - pb_1.Message.setRepeatedWrapperField(this, 999, value); - } - static fromObject(data: { - java_package?: string; - java_outer_classname?: string; - java_multiple_files?: boolean; - java_generate_equals_and_hash?: boolean; - java_string_check_utf8?: boolean; - optimize_for?: FileOptions.OptimizeMode; - go_package?: string; - cc_generic_services?: boolean; - java_generic_services?: boolean; - py_generic_services?: boolean; - php_generic_services?: boolean; - deprecated?: boolean; - cc_enable_arenas?: boolean; - objc_class_prefix?: string; - csharp_namespace?: string; - swift_prefix?: string; - php_class_prefix?: string; - php_namespace?: string; - php_metadata_namespace?: string; - ruby_package?: string; - uninterpreted_option?: ReturnType[]; - }): FileOptions { - const message = new FileOptions({ - uninterpreted_option: data.uninterpreted_option.map(item => UninterpretedOption.fromObject(item)) - }); - if (data.java_package != null) { - message.java_package = data.java_package; - } - if (data.java_outer_classname != null) { - message.java_outer_classname = data.java_outer_classname; - } - if (data.java_multiple_files != null) { - message.java_multiple_files = data.java_multiple_files; - } - if (data.java_generate_equals_and_hash != null) { - message.java_generate_equals_and_hash = data.java_generate_equals_and_hash; - } - if (data.java_string_check_utf8 != null) { - message.java_string_check_utf8 = data.java_string_check_utf8; - } - if (data.optimize_for != null) { - message.optimize_for = data.optimize_for; - } - if (data.go_package != null) { - message.go_package = data.go_package; - } - if (data.cc_generic_services != null) { - message.cc_generic_services = data.cc_generic_services; - } - if (data.java_generic_services != null) { - message.java_generic_services = data.java_generic_services; - } - if (data.py_generic_services != null) { - message.py_generic_services = data.py_generic_services; - } - if (data.php_generic_services != null) { - message.php_generic_services = data.php_generic_services; - } - if (data.deprecated != null) { - message.deprecated = data.deprecated; - } - if (data.cc_enable_arenas != null) { - message.cc_enable_arenas = data.cc_enable_arenas; - } - if (data.objc_class_prefix != null) { - message.objc_class_prefix = data.objc_class_prefix; - } - if (data.csharp_namespace != null) { - message.csharp_namespace = data.csharp_namespace; - } - if (data.swift_prefix != null) { - message.swift_prefix = data.swift_prefix; - } - if (data.php_class_prefix != null) { - message.php_class_prefix = data.php_class_prefix; - } - if (data.php_namespace != null) { - message.php_namespace = data.php_namespace; - } - if (data.php_metadata_namespace != null) { - message.php_metadata_namespace = data.php_metadata_namespace; - } - if (data.ruby_package != null) { - message.ruby_package = data.ruby_package; - } - return message; - } - toObject() { - const data: { - java_package?: string; - java_outer_classname?: string; - java_multiple_files?: boolean; - java_generate_equals_and_hash?: boolean; - java_string_check_utf8?: boolean; - optimize_for?: FileOptions.OptimizeMode; - go_package?: string; - cc_generic_services?: boolean; - java_generic_services?: boolean; - py_generic_services?: boolean; - php_generic_services?: boolean; - deprecated?: boolean; - cc_enable_arenas?: boolean; - objc_class_prefix?: string; - csharp_namespace?: string; - swift_prefix?: string; - php_class_prefix?: string; - php_namespace?: string; - php_metadata_namespace?: string; - ruby_package?: string; - uninterpreted_option?: ReturnType[]; - } = {}; - if (this.java_package != null) { - data.java_package = this.java_package; - } - if (this.java_outer_classname != null) { - data.java_outer_classname = this.java_outer_classname; - } - if (this.java_multiple_files != null) { - data.java_multiple_files = this.java_multiple_files; - } - if (this.java_generate_equals_and_hash != null) { - data.java_generate_equals_and_hash = this.java_generate_equals_and_hash; - } - if (this.java_string_check_utf8 != null) { - data.java_string_check_utf8 = this.java_string_check_utf8; - } - if (this.optimize_for != null) { - data.optimize_for = this.optimize_for; - } - if (this.go_package != null) { - data.go_package = this.go_package; - } - if (this.cc_generic_services != null) { - data.cc_generic_services = this.cc_generic_services; - } - if (this.java_generic_services != null) { - data.java_generic_services = this.java_generic_services; - } - if (this.py_generic_services != null) { - data.py_generic_services = this.py_generic_services; - } - if (this.php_generic_services != null) { - data.php_generic_services = this.php_generic_services; - } - if (this.deprecated != null) { - data.deprecated = this.deprecated; - } - if (this.cc_enable_arenas != null) { - data.cc_enable_arenas = this.cc_enable_arenas; - } - if (this.objc_class_prefix != null) { - data.objc_class_prefix = this.objc_class_prefix; - } - if (this.csharp_namespace != null) { - data.csharp_namespace = this.csharp_namespace; - } - if (this.swift_prefix != null) { - data.swift_prefix = this.swift_prefix; - } - if (this.php_class_prefix != null) { - data.php_class_prefix = this.php_class_prefix; - } - if (this.php_namespace != null) { - data.php_namespace = this.php_namespace; - } - if (this.php_metadata_namespace != null) { - data.php_metadata_namespace = this.php_metadata_namespace; - } - if (this.ruby_package != null) { - data.ruby_package = this.ruby_package; - } - if (this.uninterpreted_option != null) { - data.uninterpreted_option = this.uninterpreted_option.map((item: UninterpretedOption) => 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_java_package && this.java_package.length) - writer.writeString(1, this.java_package); - if (this.has_java_outer_classname && this.java_outer_classname.length) - writer.writeString(8, this.java_outer_classname); - if (this.has_java_multiple_files) - writer.writeBool(10, this.java_multiple_files); - if (this.has_java_generate_equals_and_hash) - writer.writeBool(20, this.java_generate_equals_and_hash); - if (this.has_java_string_check_utf8) - writer.writeBool(27, this.java_string_check_utf8); - if (this.has_optimize_for) - writer.writeEnum(9, this.optimize_for); - if (this.has_go_package && this.go_package.length) - writer.writeString(11, this.go_package); - if (this.has_cc_generic_services) - writer.writeBool(16, this.cc_generic_services); - if (this.has_java_generic_services) - writer.writeBool(17, this.java_generic_services); - if (this.has_py_generic_services) - writer.writeBool(18, this.py_generic_services); - if (this.has_php_generic_services) - writer.writeBool(42, this.php_generic_services); - if (this.has_deprecated) - writer.writeBool(23, this.deprecated); - if (this.has_cc_enable_arenas) - writer.writeBool(31, this.cc_enable_arenas); - if (this.has_objc_class_prefix && this.objc_class_prefix.length) - writer.writeString(36, this.objc_class_prefix); - if (this.has_csharp_namespace && this.csharp_namespace.length) - writer.writeString(37, this.csharp_namespace); - if (this.has_swift_prefix && this.swift_prefix.length) - writer.writeString(39, this.swift_prefix); - if (this.has_php_class_prefix && this.php_class_prefix.length) - writer.writeString(40, this.php_class_prefix); - if (this.has_php_namespace && this.php_namespace.length) - writer.writeString(41, this.php_namespace); - if (this.has_php_metadata_namespace && this.php_metadata_namespace.length) - writer.writeString(44, this.php_metadata_namespace); - if (this.has_ruby_package && this.ruby_package.length) - writer.writeString(45, this.ruby_package); - if (this.uninterpreted_option.length) - writer.writeRepeatedMessage(999, this.uninterpreted_option, (item: UninterpretedOption) => item.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): FileOptions { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new FileOptions(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.java_package = reader.readString(); - break; - case 8: - message.java_outer_classname = reader.readString(); - break; - case 10: - message.java_multiple_files = reader.readBool(); - break; - case 20: - message.java_generate_equals_and_hash = reader.readBool(); - break; - case 27: - message.java_string_check_utf8 = reader.readBool(); - break; - case 9: - message.optimize_for = reader.readEnum(); - break; - case 11: - message.go_package = reader.readString(); - break; - case 16: - message.cc_generic_services = reader.readBool(); - break; - case 17: - message.java_generic_services = reader.readBool(); - break; - case 18: - message.py_generic_services = reader.readBool(); - break; - case 42: - message.php_generic_services = reader.readBool(); - break; - case 23: - message.deprecated = reader.readBool(); - break; - case 31: - message.cc_enable_arenas = reader.readBool(); - break; - case 36: - message.objc_class_prefix = reader.readString(); - break; - case 37: - message.csharp_namespace = reader.readString(); - break; - case 39: - message.swift_prefix = reader.readString(); - break; - case 40: - message.php_class_prefix = reader.readString(); - break; - case 41: - message.php_namespace = reader.readString(); - break; - case 44: - message.php_metadata_namespace = reader.readString(); - break; - case 45: - message.ruby_package = reader.readString(); - break; - case 999: - reader.readMessage(message.uninterpreted_option, () => pb_1.Message.addToRepeatedWrapperField(message, 999, UninterpretedOption.deserialize(reader), UninterpretedOption)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): FileOptions { - return FileOptions.deserialize(bytes); - } - } - export namespace FileOptions { - export enum OptimizeMode { - SPEED = 1, - CODE_SIZE = 2, - LITE_RUNTIME = 3 - } - } - export class MessageOptions extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - message_set_wire_format?: boolean; - no_standard_descriptor_accessor?: boolean; - deprecated?: boolean; - map_entry?: boolean; - uninterpreted_option: UninterpretedOption[]; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [999], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("message_set_wire_format" in data && data.message_set_wire_format != undefined) { - this.message_set_wire_format = data.message_set_wire_format; - } - if ("no_standard_descriptor_accessor" in data && data.no_standard_descriptor_accessor != undefined) { - this.no_standard_descriptor_accessor = data.no_standard_descriptor_accessor; - } - if ("deprecated" in data && data.deprecated != undefined) { - this.deprecated = data.deprecated; - } - if ("map_entry" in data && data.map_entry != undefined) { - this.map_entry = data.map_entry; - } - this.uninterpreted_option = data.uninterpreted_option; - } - } - get message_set_wire_format() { - return pb_1.Message.getFieldWithDefault(this, 1, false) as boolean; - } - set message_set_wire_format(value: boolean) { - pb_1.Message.setField(this, 1, value); - } - get has_message_set_wire_format() { - return pb_1.Message.getField(this, 1) != null; - } - get no_standard_descriptor_accessor() { - return pb_1.Message.getFieldWithDefault(this, 2, false) as boolean; - } - set no_standard_descriptor_accessor(value: boolean) { - pb_1.Message.setField(this, 2, value); - } - get has_no_standard_descriptor_accessor() { - return pb_1.Message.getField(this, 2) != null; - } - get deprecated() { - return pb_1.Message.getFieldWithDefault(this, 3, false) as boolean; - } - set deprecated(value: boolean) { - pb_1.Message.setField(this, 3, value); - } - get has_deprecated() { - return pb_1.Message.getField(this, 3) != null; - } - get map_entry() { - return pb_1.Message.getFieldWithDefault(this, 7, false) as boolean; - } - set map_entry(value: boolean) { - pb_1.Message.setField(this, 7, value); - } - get has_map_entry() { - return pb_1.Message.getField(this, 7) != null; - } - get uninterpreted_option() { - return pb_1.Message.getRepeatedWrapperField(this, UninterpretedOption, 999) as UninterpretedOption[]; - } - set uninterpreted_option(value: UninterpretedOption[]) { - pb_1.Message.setRepeatedWrapperField(this, 999, value); - } - static fromObject(data: { - message_set_wire_format?: boolean; - no_standard_descriptor_accessor?: boolean; - deprecated?: boolean; - map_entry?: boolean; - uninterpreted_option?: ReturnType[]; - }): MessageOptions { - const message = new MessageOptions({ - uninterpreted_option: data.uninterpreted_option.map(item => UninterpretedOption.fromObject(item)) - }); - if (data.message_set_wire_format != null) { - message.message_set_wire_format = data.message_set_wire_format; - } - if (data.no_standard_descriptor_accessor != null) { - message.no_standard_descriptor_accessor = data.no_standard_descriptor_accessor; - } - if (data.deprecated != null) { - message.deprecated = data.deprecated; - } - if (data.map_entry != null) { - message.map_entry = data.map_entry; - } - return message; - } - toObject() { - const data: { - message_set_wire_format?: boolean; - no_standard_descriptor_accessor?: boolean; - deprecated?: boolean; - map_entry?: boolean; - uninterpreted_option?: ReturnType[]; - } = {}; - if (this.message_set_wire_format != null) { - data.message_set_wire_format = this.message_set_wire_format; - } - if (this.no_standard_descriptor_accessor != null) { - data.no_standard_descriptor_accessor = this.no_standard_descriptor_accessor; - } - if (this.deprecated != null) { - data.deprecated = this.deprecated; - } - if (this.map_entry != null) { - data.map_entry = this.map_entry; - } - if (this.uninterpreted_option != null) { - data.uninterpreted_option = this.uninterpreted_option.map((item: UninterpretedOption) => 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_message_set_wire_format) - writer.writeBool(1, this.message_set_wire_format); - if (this.has_no_standard_descriptor_accessor) - writer.writeBool(2, this.no_standard_descriptor_accessor); - if (this.has_deprecated) - writer.writeBool(3, this.deprecated); - if (this.has_map_entry) - writer.writeBool(7, this.map_entry); - if (this.uninterpreted_option.length) - writer.writeRepeatedMessage(999, this.uninterpreted_option, (item: UninterpretedOption) => item.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MessageOptions { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MessageOptions(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.message_set_wire_format = reader.readBool(); - break; - case 2: - message.no_standard_descriptor_accessor = reader.readBool(); - break; - case 3: - message.deprecated = reader.readBool(); - break; - case 7: - message.map_entry = reader.readBool(); - break; - case 999: - reader.readMessage(message.uninterpreted_option, () => pb_1.Message.addToRepeatedWrapperField(message, 999, UninterpretedOption.deserialize(reader), UninterpretedOption)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): MessageOptions { - return MessageOptions.deserialize(bytes); - } - } - export class FieldOptions extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - ctype?: FieldOptions.CType; - packed?: boolean; - jstype?: FieldOptions.JSType; - lazy?: boolean; - deprecated?: boolean; - weak?: boolean; - uninterpreted_option: UninterpretedOption[]; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [999], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("ctype" in data && data.ctype != undefined) { - this.ctype = data.ctype; - } - if ("packed" in data && data.packed != undefined) { - this.packed = data.packed; - } - if ("jstype" in data && data.jstype != undefined) { - this.jstype = data.jstype; - } - if ("lazy" in data && data.lazy != undefined) { - this.lazy = data.lazy; - } - if ("deprecated" in data && data.deprecated != undefined) { - this.deprecated = data.deprecated; - } - if ("weak" in data && data.weak != undefined) { - this.weak = data.weak; - } - this.uninterpreted_option = data.uninterpreted_option; - } - } - get ctype() { - return pb_1.Message.getFieldWithDefault(this, 1, FieldOptions.CType.STRING) as FieldOptions.CType; - } - set ctype(value: FieldOptions.CType) { - pb_1.Message.setField(this, 1, value); - } - get has_ctype() { - return pb_1.Message.getField(this, 1) != null; - } - get packed() { - return pb_1.Message.getFieldWithDefault(this, 2, false) as boolean; - } - set packed(value: boolean) { - pb_1.Message.setField(this, 2, value); - } - get has_packed() { - return pb_1.Message.getField(this, 2) != null; - } - get jstype() { - return pb_1.Message.getFieldWithDefault(this, 6, FieldOptions.JSType.JS_NORMAL) as FieldOptions.JSType; - } - set jstype(value: FieldOptions.JSType) { - pb_1.Message.setField(this, 6, value); - } - get has_jstype() { - return pb_1.Message.getField(this, 6) != null; - } - get lazy() { - return pb_1.Message.getFieldWithDefault(this, 5, false) as boolean; - } - set lazy(value: boolean) { - pb_1.Message.setField(this, 5, value); - } - get has_lazy() { - return pb_1.Message.getField(this, 5) != null; - } - get deprecated() { - return pb_1.Message.getFieldWithDefault(this, 3, false) as boolean; - } - set deprecated(value: boolean) { - pb_1.Message.setField(this, 3, value); - } - get has_deprecated() { - return pb_1.Message.getField(this, 3) != null; - } - get weak() { - return pb_1.Message.getFieldWithDefault(this, 10, false) as boolean; - } - set weak(value: boolean) { - pb_1.Message.setField(this, 10, value); - } - get has_weak() { - return pb_1.Message.getField(this, 10) != null; - } - get uninterpreted_option() { - return pb_1.Message.getRepeatedWrapperField(this, UninterpretedOption, 999) as UninterpretedOption[]; - } - set uninterpreted_option(value: UninterpretedOption[]) { - pb_1.Message.setRepeatedWrapperField(this, 999, value); - } - static fromObject(data: { - ctype?: FieldOptions.CType; - packed?: boolean; - jstype?: FieldOptions.JSType; - lazy?: boolean; - deprecated?: boolean; - weak?: boolean; - uninterpreted_option?: ReturnType[]; - }): FieldOptions { - const message = new FieldOptions({ - uninterpreted_option: data.uninterpreted_option.map(item => UninterpretedOption.fromObject(item)) - }); - if (data.ctype != null) { - message.ctype = data.ctype; - } - if (data.packed != null) { - message.packed = data.packed; - } - if (data.jstype != null) { - message.jstype = data.jstype; - } - if (data.lazy != null) { - message.lazy = data.lazy; - } - if (data.deprecated != null) { - message.deprecated = data.deprecated; - } - if (data.weak != null) { - message.weak = data.weak; - } - return message; - } - toObject() { - const data: { - ctype?: FieldOptions.CType; - packed?: boolean; - jstype?: FieldOptions.JSType; - lazy?: boolean; - deprecated?: boolean; - weak?: boolean; - uninterpreted_option?: ReturnType[]; - } = {}; - if (this.ctype != null) { - data.ctype = this.ctype; - } - if (this.packed != null) { - data.packed = this.packed; - } - if (this.jstype != null) { - data.jstype = this.jstype; - } - if (this.lazy != null) { - data.lazy = this.lazy; - } - if (this.deprecated != null) { - data.deprecated = this.deprecated; - } - if (this.weak != null) { - data.weak = this.weak; - } - if (this.uninterpreted_option != null) { - data.uninterpreted_option = this.uninterpreted_option.map((item: UninterpretedOption) => 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_ctype) - writer.writeEnum(1, this.ctype); - if (this.has_packed) - writer.writeBool(2, this.packed); - if (this.has_jstype) - writer.writeEnum(6, this.jstype); - if (this.has_lazy) - writer.writeBool(5, this.lazy); - if (this.has_deprecated) - writer.writeBool(3, this.deprecated); - if (this.has_weak) - writer.writeBool(10, this.weak); - if (this.uninterpreted_option.length) - writer.writeRepeatedMessage(999, this.uninterpreted_option, (item: UninterpretedOption) => item.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): FieldOptions { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new FieldOptions(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.ctype = reader.readEnum(); - break; - case 2: - message.packed = reader.readBool(); - break; - case 6: - message.jstype = reader.readEnum(); - break; - case 5: - message.lazy = reader.readBool(); - break; - case 3: - message.deprecated = reader.readBool(); - break; - case 10: - message.weak = reader.readBool(); - break; - case 999: - reader.readMessage(message.uninterpreted_option, () => pb_1.Message.addToRepeatedWrapperField(message, 999, UninterpretedOption.deserialize(reader), UninterpretedOption)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): FieldOptions { - return FieldOptions.deserialize(bytes); - } - } - export namespace FieldOptions { - export enum CType { - STRING = 0, - CORD = 1, - STRING_PIECE = 2 - } - export enum JSType { - JS_NORMAL = 0, - JS_STRING = 1, - JS_NUMBER = 2 - } - } - export class OneofOptions extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - uninterpreted_option: UninterpretedOption[]; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [999], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - this.uninterpreted_option = data.uninterpreted_option; - } - } - get uninterpreted_option() { - return pb_1.Message.getRepeatedWrapperField(this, UninterpretedOption, 999) as UninterpretedOption[]; - } - set uninterpreted_option(value: UninterpretedOption[]) { - pb_1.Message.setRepeatedWrapperField(this, 999, value); - } - static fromObject(data: { - uninterpreted_option?: ReturnType[]; - }): OneofOptions { - const message = new OneofOptions({ - uninterpreted_option: data.uninterpreted_option.map(item => UninterpretedOption.fromObject(item)) - }); - return message; - } - toObject() { - const data: { - uninterpreted_option?: ReturnType[]; - } = {}; - if (this.uninterpreted_option != null) { - data.uninterpreted_option = this.uninterpreted_option.map((item: UninterpretedOption) => 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.uninterpreted_option.length) - writer.writeRepeatedMessage(999, this.uninterpreted_option, (item: UninterpretedOption) => item.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): OneofOptions { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new OneofOptions(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 999: - reader.readMessage(message.uninterpreted_option, () => pb_1.Message.addToRepeatedWrapperField(message, 999, UninterpretedOption.deserialize(reader), UninterpretedOption)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): OneofOptions { - return OneofOptions.deserialize(bytes); - } - } - export class EnumOptions extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - allow_alias?: boolean; - deprecated?: boolean; - uninterpreted_option: UninterpretedOption[]; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [999], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("allow_alias" in data && data.allow_alias != undefined) { - this.allow_alias = data.allow_alias; - } - if ("deprecated" in data && data.deprecated != undefined) { - this.deprecated = data.deprecated; - } - this.uninterpreted_option = data.uninterpreted_option; - } - } - get allow_alias() { - return pb_1.Message.getFieldWithDefault(this, 2, false) as boolean; - } - set allow_alias(value: boolean) { - pb_1.Message.setField(this, 2, value); - } - get has_allow_alias() { - return pb_1.Message.getField(this, 2) != null; - } - get deprecated() { - return pb_1.Message.getFieldWithDefault(this, 3, false) as boolean; - } - set deprecated(value: boolean) { - pb_1.Message.setField(this, 3, value); - } - get has_deprecated() { - return pb_1.Message.getField(this, 3) != null; - } - get uninterpreted_option() { - return pb_1.Message.getRepeatedWrapperField(this, UninterpretedOption, 999) as UninterpretedOption[]; - } - set uninterpreted_option(value: UninterpretedOption[]) { - pb_1.Message.setRepeatedWrapperField(this, 999, value); - } - static fromObject(data: { - allow_alias?: boolean; - deprecated?: boolean; - uninterpreted_option?: ReturnType[]; - }): EnumOptions { - const message = new EnumOptions({ - uninterpreted_option: data.uninterpreted_option.map(item => UninterpretedOption.fromObject(item)) - }); - if (data.allow_alias != null) { - message.allow_alias = data.allow_alias; - } - if (data.deprecated != null) { - message.deprecated = data.deprecated; - } - return message; - } - toObject() { - const data: { - allow_alias?: boolean; - deprecated?: boolean; - uninterpreted_option?: ReturnType[]; - } = {}; - if (this.allow_alias != null) { - data.allow_alias = this.allow_alias; - } - if (this.deprecated != null) { - data.deprecated = this.deprecated; - } - if (this.uninterpreted_option != null) { - data.uninterpreted_option = this.uninterpreted_option.map((item: UninterpretedOption) => 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_allow_alias) - writer.writeBool(2, this.allow_alias); - if (this.has_deprecated) - writer.writeBool(3, this.deprecated); - if (this.uninterpreted_option.length) - writer.writeRepeatedMessage(999, this.uninterpreted_option, (item: UninterpretedOption) => item.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): EnumOptions { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new EnumOptions(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 2: - message.allow_alias = reader.readBool(); - break; - case 3: - message.deprecated = reader.readBool(); - break; - case 999: - reader.readMessage(message.uninterpreted_option, () => pb_1.Message.addToRepeatedWrapperField(message, 999, UninterpretedOption.deserialize(reader), UninterpretedOption)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): EnumOptions { - return EnumOptions.deserialize(bytes); - } - } - export class EnumValueOptions extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - deprecated?: boolean; - uninterpreted_option: UninterpretedOption[]; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [999], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("deprecated" in data && data.deprecated != undefined) { - this.deprecated = data.deprecated; - } - this.uninterpreted_option = data.uninterpreted_option; - } - } - get deprecated() { - return pb_1.Message.getFieldWithDefault(this, 1, false) as boolean; - } - set deprecated(value: boolean) { - pb_1.Message.setField(this, 1, value); - } - get has_deprecated() { - return pb_1.Message.getField(this, 1) != null; - } - get uninterpreted_option() { - return pb_1.Message.getRepeatedWrapperField(this, UninterpretedOption, 999) as UninterpretedOption[]; - } - set uninterpreted_option(value: UninterpretedOption[]) { - pb_1.Message.setRepeatedWrapperField(this, 999, value); - } - static fromObject(data: { - deprecated?: boolean; - uninterpreted_option?: ReturnType[]; - }): EnumValueOptions { - const message = new EnumValueOptions({ - uninterpreted_option: data.uninterpreted_option.map(item => UninterpretedOption.fromObject(item)) - }); - if (data.deprecated != null) { - message.deprecated = data.deprecated; - } - return message; - } - toObject() { - const data: { - deprecated?: boolean; - uninterpreted_option?: ReturnType[]; - } = {}; - if (this.deprecated != null) { - data.deprecated = this.deprecated; - } - if (this.uninterpreted_option != null) { - data.uninterpreted_option = this.uninterpreted_option.map((item: UninterpretedOption) => 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_deprecated) - writer.writeBool(1, this.deprecated); - if (this.uninterpreted_option.length) - writer.writeRepeatedMessage(999, this.uninterpreted_option, (item: UninterpretedOption) => item.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): EnumValueOptions { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new EnumValueOptions(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.deprecated = reader.readBool(); - break; - case 999: - reader.readMessage(message.uninterpreted_option, () => pb_1.Message.addToRepeatedWrapperField(message, 999, UninterpretedOption.deserialize(reader), UninterpretedOption)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): EnumValueOptions { - return EnumValueOptions.deserialize(bytes); - } - } - export class ServiceOptions extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - deprecated?: boolean; - uninterpreted_option: UninterpretedOption[]; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [999], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("deprecated" in data && data.deprecated != undefined) { - this.deprecated = data.deprecated; - } - this.uninterpreted_option = data.uninterpreted_option; - } - } - get deprecated() { - return pb_1.Message.getFieldWithDefault(this, 33, false) as boolean; - } - set deprecated(value: boolean) { - pb_1.Message.setField(this, 33, value); - } - get has_deprecated() { - return pb_1.Message.getField(this, 33) != null; - } - get uninterpreted_option() { - return pb_1.Message.getRepeatedWrapperField(this, UninterpretedOption, 999) as UninterpretedOption[]; - } - set uninterpreted_option(value: UninterpretedOption[]) { - pb_1.Message.setRepeatedWrapperField(this, 999, value); - } - static fromObject(data: { - deprecated?: boolean; - uninterpreted_option?: ReturnType[]; - }): ServiceOptions { - const message = new ServiceOptions({ - uninterpreted_option: data.uninterpreted_option.map(item => UninterpretedOption.fromObject(item)) - }); - if (data.deprecated != null) { - message.deprecated = data.deprecated; - } - return message; - } - toObject() { - const data: { - deprecated?: boolean; - uninterpreted_option?: ReturnType[]; - } = {}; - if (this.deprecated != null) { - data.deprecated = this.deprecated; - } - if (this.uninterpreted_option != null) { - data.uninterpreted_option = this.uninterpreted_option.map((item: UninterpretedOption) => 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_deprecated) - writer.writeBool(33, this.deprecated); - if (this.uninterpreted_option.length) - writer.writeRepeatedMessage(999, this.uninterpreted_option, (item: UninterpretedOption) => item.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): ServiceOptions { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new ServiceOptions(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 33: - message.deprecated = reader.readBool(); - break; - case 999: - reader.readMessage(message.uninterpreted_option, () => pb_1.Message.addToRepeatedWrapperField(message, 999, UninterpretedOption.deserialize(reader), UninterpretedOption)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): ServiceOptions { - return ServiceOptions.deserialize(bytes); - } - } - export class MethodOptions extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - deprecated?: boolean; - idempotency_level?: MethodOptions.IdempotencyLevel; - uninterpreted_option: UninterpretedOption[]; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [999], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("deprecated" in data && data.deprecated != undefined) { - this.deprecated = data.deprecated; - } - if ("idempotency_level" in data && data.idempotency_level != undefined) { - this.idempotency_level = data.idempotency_level; - } - this.uninterpreted_option = data.uninterpreted_option; - } - } - get deprecated() { - return pb_1.Message.getFieldWithDefault(this, 33, false) as boolean; - } - set deprecated(value: boolean) { - pb_1.Message.setField(this, 33, value); - } - get has_deprecated() { - return pb_1.Message.getField(this, 33) != null; - } - get idempotency_level() { - return pb_1.Message.getFieldWithDefault(this, 34, MethodOptions.IdempotencyLevel.IDEMPOTENCY_UNKNOWN) as MethodOptions.IdempotencyLevel; - } - set idempotency_level(value: MethodOptions.IdempotencyLevel) { - pb_1.Message.setField(this, 34, value); - } - get has_idempotency_level() { - return pb_1.Message.getField(this, 34) != null; - } - get uninterpreted_option() { - return pb_1.Message.getRepeatedWrapperField(this, UninterpretedOption, 999) as UninterpretedOption[]; - } - set uninterpreted_option(value: UninterpretedOption[]) { - pb_1.Message.setRepeatedWrapperField(this, 999, value); - } - static fromObject(data: { - deprecated?: boolean; - idempotency_level?: MethodOptions.IdempotencyLevel; - uninterpreted_option?: ReturnType[]; - }): MethodOptions { - const message = new MethodOptions({ - uninterpreted_option: data.uninterpreted_option.map(item => UninterpretedOption.fromObject(item)) - }); - if (data.deprecated != null) { - message.deprecated = data.deprecated; - } - if (data.idempotency_level != null) { - message.idempotency_level = data.idempotency_level; - } - return message; - } - toObject() { - const data: { - deprecated?: boolean; - idempotency_level?: MethodOptions.IdempotencyLevel; - uninterpreted_option?: ReturnType[]; - } = {}; - if (this.deprecated != null) { - data.deprecated = this.deprecated; - } - if (this.idempotency_level != null) { - data.idempotency_level = this.idempotency_level; - } - if (this.uninterpreted_option != null) { - data.uninterpreted_option = this.uninterpreted_option.map((item: UninterpretedOption) => 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_deprecated) - writer.writeBool(33, this.deprecated); - if (this.has_idempotency_level) - writer.writeEnum(34, this.idempotency_level); - if (this.uninterpreted_option.length) - writer.writeRepeatedMessage(999, this.uninterpreted_option, (item: UninterpretedOption) => item.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MethodOptions { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MethodOptions(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 33: - message.deprecated = reader.readBool(); - break; - case 34: - message.idempotency_level = reader.readEnum(); - break; - case 999: - reader.readMessage(message.uninterpreted_option, () => pb_1.Message.addToRepeatedWrapperField(message, 999, UninterpretedOption.deserialize(reader), UninterpretedOption)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): MethodOptions { - return MethodOptions.deserialize(bytes); - } - } - export namespace MethodOptions { - export enum IdempotencyLevel { - IDEMPOTENCY_UNKNOWN = 0, - NO_SIDE_EFFECTS = 1, - IDEMPOTENT = 2 - } - } - export class UninterpretedOption extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - name: UninterpretedOption.NamePart[]; - identifier_value?: string; - positive_int_value?: number; - negative_int_value?: number; - double_value?: number; - string_value?: Uint8Array; - aggregate_value?: string; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - this.name = data.name; - if ("identifier_value" in data && data.identifier_value != undefined) { - this.identifier_value = data.identifier_value; - } - if ("positive_int_value" in data && data.positive_int_value != undefined) { - this.positive_int_value = data.positive_int_value; - } - if ("negative_int_value" in data && data.negative_int_value != undefined) { - this.negative_int_value = data.negative_int_value; - } - if ("double_value" in data && data.double_value != undefined) { - this.double_value = data.double_value; - } - if ("string_value" in data && data.string_value != undefined) { - this.string_value = data.string_value; - } - if ("aggregate_value" in data && data.aggregate_value != undefined) { - this.aggregate_value = data.aggregate_value; - } - } - } - get name() { - return pb_1.Message.getRepeatedWrapperField(this, UninterpretedOption.NamePart, 2) as UninterpretedOption.NamePart[]; - } - set name(value: UninterpretedOption.NamePart[]) { - pb_1.Message.setRepeatedWrapperField(this, 2, value); - } - get identifier_value() { - return pb_1.Message.getFieldWithDefault(this, 3, "") as string; - } - set identifier_value(value: string) { - pb_1.Message.setField(this, 3, value); - } - get has_identifier_value() { - return pb_1.Message.getField(this, 3) != null; - } - get positive_int_value() { - return pb_1.Message.getFieldWithDefault(this, 4, 0) as number; - } - set positive_int_value(value: number) { - pb_1.Message.setField(this, 4, value); - } - get has_positive_int_value() { - return pb_1.Message.getField(this, 4) != null; - } - get negative_int_value() { - return pb_1.Message.getFieldWithDefault(this, 5, 0) as number; - } - set negative_int_value(value: number) { - pb_1.Message.setField(this, 5, value); - } - get has_negative_int_value() { - return pb_1.Message.getField(this, 5) != null; - } - get double_value() { - return pb_1.Message.getFieldWithDefault(this, 6, 0) as number; - } - set double_value(value: number) { - pb_1.Message.setField(this, 6, value); - } - get has_double_value() { - return pb_1.Message.getField(this, 6) != null; - } - get string_value() { - return pb_1.Message.getFieldWithDefault(this, 7, new Uint8Array(0)) as Uint8Array; - } - set string_value(value: Uint8Array) { - pb_1.Message.setField(this, 7, value); - } - get has_string_value() { - return pb_1.Message.getField(this, 7) != null; - } - get aggregate_value() { - return pb_1.Message.getFieldWithDefault(this, 8, "") as string; - } - set aggregate_value(value: string) { - pb_1.Message.setField(this, 8, value); - } - get has_aggregate_value() { - return pb_1.Message.getField(this, 8) != null; - } - static fromObject(data: { - name?: ReturnType[]; - identifier_value?: string; - positive_int_value?: number; - negative_int_value?: number; - double_value?: number; - string_value?: Uint8Array; - aggregate_value?: string; - }): UninterpretedOption { - const message = new UninterpretedOption({ - name: data.name.map(item => UninterpretedOption.NamePart.fromObject(item)) - }); - if (data.identifier_value != null) { - message.identifier_value = data.identifier_value; - } - if (data.positive_int_value != null) { - message.positive_int_value = data.positive_int_value; - } - if (data.negative_int_value != null) { - message.negative_int_value = data.negative_int_value; - } - if (data.double_value != null) { - message.double_value = data.double_value; - } - if (data.string_value != null) { - message.string_value = data.string_value; - } - if (data.aggregate_value != null) { - message.aggregate_value = data.aggregate_value; - } - return message; - } - toObject() { - const data: { - name?: ReturnType[]; - identifier_value?: string; - positive_int_value?: number; - negative_int_value?: number; - double_value?: number; - string_value?: Uint8Array; - aggregate_value?: string; - } = {}; - if (this.name != null) { - data.name = this.name.map((item: UninterpretedOption.NamePart) => item.toObject()); - } - if (this.identifier_value != null) { - data.identifier_value = this.identifier_value; - } - if (this.positive_int_value != null) { - data.positive_int_value = this.positive_int_value; - } - if (this.negative_int_value != null) { - data.negative_int_value = this.negative_int_value; - } - if (this.double_value != null) { - data.double_value = this.double_value; - } - if (this.string_value != null) { - data.string_value = this.string_value; - } - if (this.aggregate_value != null) { - data.aggregate_value = this.aggregate_value; - } - 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.name.length) - writer.writeRepeatedMessage(2, this.name, (item: UninterpretedOption.NamePart) => item.serialize(writer)); - if (this.has_identifier_value && this.identifier_value.length) - writer.writeString(3, this.identifier_value); - if (this.has_positive_int_value) - writer.writeUint64(4, this.positive_int_value); - if (this.has_negative_int_value) - writer.writeInt64(5, this.negative_int_value); - if (this.has_double_value) - writer.writeDouble(6, this.double_value); - if (this.has_string_value && this.string_value.length) - writer.writeBytes(7, this.string_value); - if (this.has_aggregate_value && this.aggregate_value.length) - writer.writeString(8, this.aggregate_value); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): UninterpretedOption { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new UninterpretedOption(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 2: - reader.readMessage(message.name, () => pb_1.Message.addToRepeatedWrapperField(message, 2, UninterpretedOption.NamePart.deserialize(reader), UninterpretedOption.NamePart)); - break; - case 3: - message.identifier_value = reader.readString(); - break; - case 4: - message.positive_int_value = reader.readUint64(); - break; - case 5: - message.negative_int_value = reader.readInt64(); - break; - case 6: - message.double_value = reader.readDouble(); - break; - case 7: - message.string_value = reader.readBytes(); - break; - case 8: - message.aggregate_value = reader.readString(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): UninterpretedOption { - return UninterpretedOption.deserialize(bytes); - } - } - export namespace UninterpretedOption { - export class NamePart extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - name_part: string; - is_extension: boolean; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - this.name_part = data.name_part; - this.is_extension = data.is_extension; - } - } - get name_part() { - return pb_1.Message.getField(this, 1) as string; - } - set name_part(value: string) { - pb_1.Message.setField(this, 1, value); - } - get has_name_part() { - return pb_1.Message.getField(this, 1) != null; - } - get is_extension() { - return pb_1.Message.getField(this, 2) as boolean; - } - set is_extension(value: boolean) { - pb_1.Message.setField(this, 2, value); - } - get has_is_extension() { - return pb_1.Message.getField(this, 2) != null; - } - static fromObject(data: { - name_part?: string; - is_extension?: boolean; - }): NamePart { - const message = new NamePart({ - name_part: data.name_part, - is_extension: data.is_extension - }); - return message; - } - toObject() { - const data: { - name_part?: string; - is_extension?: boolean; - } = {}; - if (this.name_part != null) { - data.name_part = this.name_part; - } - if (this.is_extension != null) { - data.is_extension = this.is_extension; - } - 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_name_part && this.name_part.length) - writer.writeString(1, this.name_part); - if (this.has_is_extension) - writer.writeBool(2, this.is_extension); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): NamePart { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new NamePart(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.name_part = reader.readString(); - break; - case 2: - message.is_extension = reader.readBool(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): NamePart { - return NamePart.deserialize(bytes); - } - } - } - export class SourceCodeInfo extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - location: SourceCodeInfo.Location[]; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - this.location = data.location; - } - } - get location() { - return pb_1.Message.getRepeatedWrapperField(this, SourceCodeInfo.Location, 1) as SourceCodeInfo.Location[]; - } - set location(value: SourceCodeInfo.Location[]) { - pb_1.Message.setRepeatedWrapperField(this, 1, value); - } - static fromObject(data: { - location?: ReturnType[]; - }): SourceCodeInfo { - const message = new SourceCodeInfo({ - location: data.location.map(item => SourceCodeInfo.Location.fromObject(item)) - }); - return message; - } - toObject() { - const data: { - location?: ReturnType[]; - } = {}; - if (this.location != null) { - data.location = this.location.map((item: SourceCodeInfo.Location) => 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.location.length) - writer.writeRepeatedMessage(1, this.location, (item: SourceCodeInfo.Location) => item.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): SourceCodeInfo { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new SourceCodeInfo(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage(message.location, () => pb_1.Message.addToRepeatedWrapperField(message, 1, SourceCodeInfo.Location.deserialize(reader), SourceCodeInfo.Location)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): SourceCodeInfo { - return SourceCodeInfo.deserialize(bytes); - } - } - export namespace SourceCodeInfo { - export class Location extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - path: number[]; - span: number[]; - leading_comments?: string; - trailing_comments?: string; - leading_detached_comments: string[]; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1, 2, 6], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - this.path = data.path; - this.span = data.span; - if ("leading_comments" in data && data.leading_comments != undefined) { - this.leading_comments = data.leading_comments; - } - if ("trailing_comments" in data && data.trailing_comments != undefined) { - this.trailing_comments = data.trailing_comments; - } - this.leading_detached_comments = data.leading_detached_comments; - } - } - get path() { - return pb_1.Message.getFieldWithDefault(this, 1, []) as number[]; - } - set path(value: number[]) { - pb_1.Message.setField(this, 1, value); - } - get span() { - return pb_1.Message.getFieldWithDefault(this, 2, []) as number[]; - } - set span(value: number[]) { - pb_1.Message.setField(this, 2, value); - } - get leading_comments() { - return pb_1.Message.getFieldWithDefault(this, 3, "") as string; - } - set leading_comments(value: string) { - pb_1.Message.setField(this, 3, value); - } - get has_leading_comments() { - return pb_1.Message.getField(this, 3) != null; - } - get trailing_comments() { - return pb_1.Message.getFieldWithDefault(this, 4, "") as string; - } - set trailing_comments(value: string) { - pb_1.Message.setField(this, 4, value); - } - get has_trailing_comments() { - return pb_1.Message.getField(this, 4) != null; - } - get leading_detached_comments() { - return pb_1.Message.getFieldWithDefault(this, 6, []) as string[]; - } - set leading_detached_comments(value: string[]) { - pb_1.Message.setField(this, 6, value); - } - static fromObject(data: { - path: number[]; - span: number[]; - leading_comments?: string; - trailing_comments?: string; - leading_detached_comments: string[]; - }): Location { - const message = new Location({ - path: data.path, - span: data.span, - leading_detached_comments: data.leading_detached_comments - }); - if (data.leading_comments != null) { - message.leading_comments = data.leading_comments; - } - if (data.trailing_comments != null) { - message.trailing_comments = data.trailing_comments; - } - return message; - } - toObject() { - const data: { - path: number[]; - span: number[]; - leading_comments?: string; - trailing_comments?: string; - leading_detached_comments: string[]; - } = { - path: this.path, - span: this.span, - leading_detached_comments: this.leading_detached_comments - }; - if (this.leading_comments != null) { - data.leading_comments = this.leading_comments; - } - if (this.trailing_comments != null) { - data.trailing_comments = this.trailing_comments; - } - 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.path.length) - writer.writePackedInt32(1, this.path); - if (this.span.length) - writer.writePackedInt32(2, this.span); - if (this.has_leading_comments && this.leading_comments.length) - writer.writeString(3, this.leading_comments); - if (this.has_trailing_comments && this.trailing_comments.length) - writer.writeString(4, this.trailing_comments); - if (this.leading_detached_comments.length) - writer.writeRepeatedString(6, this.leading_detached_comments); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Location { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Location(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.path = reader.readPackedInt32(); - break; - case 2: - message.span = reader.readPackedInt32(); - break; - case 3: - message.leading_comments = reader.readString(); - break; - case 4: - message.trailing_comments = reader.readString(); - break; - case 6: - pb_1.Message.addToRepeatedField(message, 6, reader.readString()); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): Location { - return Location.deserialize(bytes); - } - } - } - export class GeneratedCodeInfo extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - annotation: GeneratedCodeInfo.Annotation[]; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - this.annotation = data.annotation; - } - } - get annotation() { - return pb_1.Message.getRepeatedWrapperField(this, GeneratedCodeInfo.Annotation, 1) as GeneratedCodeInfo.Annotation[]; - } - set annotation(value: GeneratedCodeInfo.Annotation[]) { - pb_1.Message.setRepeatedWrapperField(this, 1, value); - } - static fromObject(data: { - annotation?: ReturnType[]; - }): GeneratedCodeInfo { - const message = new GeneratedCodeInfo({ - annotation: data.annotation.map(item => GeneratedCodeInfo.Annotation.fromObject(item)) - }); - return message; - } - toObject() { - const data: { - annotation?: ReturnType[]; - } = {}; - if (this.annotation != null) { - data.annotation = this.annotation.map((item: GeneratedCodeInfo.Annotation) => 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.annotation.length) - writer.writeRepeatedMessage(1, this.annotation, (item: GeneratedCodeInfo.Annotation) => item.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GeneratedCodeInfo { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GeneratedCodeInfo(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage(message.annotation, () => pb_1.Message.addToRepeatedWrapperField(message, 1, GeneratedCodeInfo.Annotation.deserialize(reader), GeneratedCodeInfo.Annotation)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): GeneratedCodeInfo { - return GeneratedCodeInfo.deserialize(bytes); - } - } - export namespace GeneratedCodeInfo { - export class Annotation extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - path: number[]; - source_file?: string; - begin?: number; - end?: number; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [1], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - this.path = data.path; - if ("source_file" in data && data.source_file != undefined) { - this.source_file = data.source_file; - } - if ("begin" in data && data.begin != undefined) { - this.begin = data.begin; - } - if ("end" in data && data.end != undefined) { - this.end = data.end; - } - } - } - get path() { - return pb_1.Message.getFieldWithDefault(this, 1, []) as number[]; - } - set path(value: number[]) { - pb_1.Message.setField(this, 1, value); - } - get source_file() { - return pb_1.Message.getFieldWithDefault(this, 2, "") as string; - } - set source_file(value: string) { - pb_1.Message.setField(this, 2, value); - } - get has_source_file() { - return pb_1.Message.getField(this, 2) != null; - } - get begin() { - return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; - } - set begin(value: number) { - pb_1.Message.setField(this, 3, value); - } - get has_begin() { - return pb_1.Message.getField(this, 3) != null; - } - get end() { - return pb_1.Message.getFieldWithDefault(this, 4, 0) as number; - } - set end(value: number) { - pb_1.Message.setField(this, 4, value); - } - get has_end() { - return pb_1.Message.getField(this, 4) != null; - } - static fromObject(data: { - path: number[]; - source_file?: string; - begin?: number; - end?: number; - }): Annotation { - const message = new Annotation({ - path: data.path - }); - if (data.source_file != null) { - message.source_file = data.source_file; - } - if (data.begin != null) { - message.begin = data.begin; - } - if (data.end != null) { - message.end = data.end; - } - return message; - } - toObject() { - const data: { - path: number[]; - source_file?: string; - begin?: number; - end?: number; - } = { - path: this.path - }; - if (this.source_file != null) { - data.source_file = this.source_file; - } - if (this.begin != null) { - data.begin = this.begin; - } - if (this.end != null) { - data.end = this.end; - } - 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.path.length) - writer.writePackedInt32(1, this.path); - if (this.has_source_file && this.source_file.length) - writer.writeString(2, this.source_file); - if (this.has_begin) - writer.writeInt32(3, this.begin); - if (this.has_end) - writer.writeInt32(4, this.end); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Annotation { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Annotation(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.path = reader.readPackedInt32(); - break; - case 2: - message.source_file = reader.readString(); - break; - case 3: - message.begin = reader.readInt32(); - break; - case 4: - message.end = reader.readInt32(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): Annotation { - return Annotation.deserialize(bytes); - } - } - } + * The protocol compiler can output a FileDescriptorSet containing the .proto + * files it parses. + */ +export interface FileDescriptorSet { + file: FileDescriptorProto[]; +} + +/** Describes a complete .proto file. */ +export interface FileDescriptorProto { + /** file name, relative to root of source tree */ + name: string; + /** e.g. "foo", "foo.bar", etc. */ + package: string; + /** Names of files imported by this file. */ + dependency: string[]; + /** Indexes of the public imported files in the dependency list above. */ + publicDependency: number[]; + /** + * Indexes of the weak imported files in the dependency list. + * For Google-internal migration only. Do not use. + */ + weakDependency: number[]; + /** All top-level definitions in this file. */ + messageType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; + service: ServiceDescriptorProto[]; + extension: FieldDescriptorProto[]; + options?: FileOptions; + /** + * This field contains optional information about the original source code. + * You may safely remove this entire field without harming runtime + * functionality of the descriptors -- the information is needed only by + * development tools. + */ + sourceCodeInfo?: SourceCodeInfo; + /** + * The syntax of the proto file. + * The supported values are "proto2" and "proto3". + */ + syntax: string; +} + +/** Describes a message type. */ +export interface DescriptorProto { + name: string; + field: FieldDescriptorProto[]; + extension: FieldDescriptorProto[]; + nestedType: DescriptorProto[]; + enumType: EnumDescriptorProto[]; + extensionRange: DescriptorProto_ExtensionRange[]; + oneofDecl: OneofDescriptorProto[]; + options?: MessageOptions; + reservedRange: DescriptorProto_ReservedRange[]; + /** + * Reserved field names, which may not be used by fields in the same message. + * A given name may only be reserved once. + */ + reservedName: string[]; +} + +export interface DescriptorProto_ExtensionRange { + /** Inclusive. */ + start: number; + /** Exclusive. */ + end: number; + options?: ExtensionRangeOptions; +} + +/** + * Range of reserved tag numbers. Reserved tag numbers may not be used by + * fields or extension ranges in the same message. Reserved ranges may + * not overlap. + */ +export interface DescriptorProto_ReservedRange { + /** Inclusive. */ + start: number; + /** Exclusive. */ + end: number; +} + +export interface ExtensionRangeOptions { + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +/** Describes a field within a message. */ +export interface FieldDescriptorProto { + name: string; + number: number; + label: FieldDescriptorProto_Label; + /** + * If type_name is set, this need not be set. If both this and type_name + * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. + */ + type: FieldDescriptorProto_Type; + /** + * For message and enum types, this is the name of the type. If the name + * starts with a '.', it is fully-qualified. Otherwise, C++-like scoping + * rules are used to find the type (i.e. first the nested types within this + * message are searched, then within the parent, on up to the root + * namespace). + */ + typeName: string; + /** + * For extensions, this is the name of the type being extended. It is + * resolved in the same manner as type_name. + */ + extendee: string; + /** + * For numeric types, contains the original text representation of the value. + * For booleans, "true" or "false". + * For strings, contains the default text contents (not escaped in any way). + * For bytes, contains the C escaped value. All bytes >= 128 are escaped. + */ + defaultValue: string; + /** + * If set, gives the index of a oneof in the containing type's oneof_decl + * list. This field is a member of that oneof. + */ + oneofIndex: number; + /** + * JSON name of this field. The value is set by protocol compiler. If the + * user has set a "json_name" option on this field, that option's value + * will be used. Otherwise, it's deduced from the field's name by converting + * it to camelCase. + */ + jsonName: string; + options?: FieldOptions; + /** + * If true, this is a proto3 "optional". When a proto3 field is optional, it + * tracks presence regardless of field type. + * + * When proto3_optional is true, this field must be belong to a oneof to + * signal to old proto3 clients that presence is tracked for this field. This + * oneof is known as a "synthetic" oneof, and this field must be its sole + * member (each proto3 optional field gets its own synthetic oneof). Synthetic + * oneofs exist in the descriptor only, and do not generate any API. Synthetic + * oneofs must be ordered after all "real" oneofs. + * + * For message fields, proto3_optional doesn't create any semantic change, + * since non-repeated message fields always track presence. However it still + * indicates the semantic detail of whether the user wrote "optional" or not. + * This can be useful for round-tripping the .proto file. For consistency we + * give message fields a synthetic oneof also, even though it is not required + * to track presence. This is especially important because the parser can't + * tell if a field is a message or an enum, so it must always create a + * synthetic oneof. + * + * Proto2 optional fields do not set this flag, because they already indicate + * optional with `LABEL_OPTIONAL`. + */ + proto3Optional: boolean; +} + +export enum FieldDescriptorProto_Type { + /** + * TYPE_DOUBLE - 0 is reserved for errors. + * Order is weird for historical reasons. + */ + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + /** + * TYPE_INT64 - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if + * negative values are likely. + */ + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + /** + * TYPE_INT32 - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if + * negative values are likely. + */ + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + /** + * TYPE_GROUP - Tag-delimited aggregate. + * Group type is deprecated and not supported in proto3. However, Proto3 + * implementations should still be able to parse the group wire format and + * treat group fields as unknown fields. + */ + TYPE_GROUP = 10, + /** TYPE_MESSAGE - Length-delimited aggregate. */ + TYPE_MESSAGE = 11, + /** TYPE_BYTES - New in version 2. */ + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + /** TYPE_SINT32 - Uses ZigZag encoding. */ + TYPE_SINT32 = 17, + /** TYPE_SINT64 - Uses ZigZag encoding. */ + TYPE_SINT64 = 18, + UNRECOGNIZED = -1, +} + +export function fieldDescriptorProto_TypeFromJSON( + object: any +): FieldDescriptorProto_Type { + switch (object) { + case 1: + case "TYPE_DOUBLE": + return FieldDescriptorProto_Type.TYPE_DOUBLE; + case 2: + case "TYPE_FLOAT": + return FieldDescriptorProto_Type.TYPE_FLOAT; + case 3: + case "TYPE_INT64": + return FieldDescriptorProto_Type.TYPE_INT64; + case 4: + case "TYPE_UINT64": + return FieldDescriptorProto_Type.TYPE_UINT64; + case 5: + case "TYPE_INT32": + return FieldDescriptorProto_Type.TYPE_INT32; + case 6: + case "TYPE_FIXED64": + return FieldDescriptorProto_Type.TYPE_FIXED64; + case 7: + case "TYPE_FIXED32": + return FieldDescriptorProto_Type.TYPE_FIXED32; + case 8: + case "TYPE_BOOL": + return FieldDescriptorProto_Type.TYPE_BOOL; + case 9: + case "TYPE_STRING": + return FieldDescriptorProto_Type.TYPE_STRING; + case 10: + case "TYPE_GROUP": + return FieldDescriptorProto_Type.TYPE_GROUP; + case 11: + case "TYPE_MESSAGE": + return FieldDescriptorProto_Type.TYPE_MESSAGE; + case 12: + case "TYPE_BYTES": + return FieldDescriptorProto_Type.TYPE_BYTES; + case 13: + case "TYPE_UINT32": + return FieldDescriptorProto_Type.TYPE_UINT32; + case 14: + case "TYPE_ENUM": + return FieldDescriptorProto_Type.TYPE_ENUM; + case 15: + case "TYPE_SFIXED32": + return FieldDescriptorProto_Type.TYPE_SFIXED32; + case 16: + case "TYPE_SFIXED64": + return FieldDescriptorProto_Type.TYPE_SFIXED64; + case 17: + case "TYPE_SINT32": + return FieldDescriptorProto_Type.TYPE_SINT32; + case 18: + case "TYPE_SINT64": + return FieldDescriptorProto_Type.TYPE_SINT64; + case -1: + case "UNRECOGNIZED": + default: + return FieldDescriptorProto_Type.UNRECOGNIZED; + } +} + +export function fieldDescriptorProto_TypeToJSON( + object: FieldDescriptorProto_Type +): string { + switch (object) { + case FieldDescriptorProto_Type.TYPE_DOUBLE: + return "TYPE_DOUBLE"; + case FieldDescriptorProto_Type.TYPE_FLOAT: + return "TYPE_FLOAT"; + case FieldDescriptorProto_Type.TYPE_INT64: + return "TYPE_INT64"; + case FieldDescriptorProto_Type.TYPE_UINT64: + return "TYPE_UINT64"; + case FieldDescriptorProto_Type.TYPE_INT32: + return "TYPE_INT32"; + case FieldDescriptorProto_Type.TYPE_FIXED64: + return "TYPE_FIXED64"; + case FieldDescriptorProto_Type.TYPE_FIXED32: + return "TYPE_FIXED32"; + case FieldDescriptorProto_Type.TYPE_BOOL: + return "TYPE_BOOL"; + case FieldDescriptorProto_Type.TYPE_STRING: + return "TYPE_STRING"; + case FieldDescriptorProto_Type.TYPE_GROUP: + return "TYPE_GROUP"; + case FieldDescriptorProto_Type.TYPE_MESSAGE: + return "TYPE_MESSAGE"; + case FieldDescriptorProto_Type.TYPE_BYTES: + return "TYPE_BYTES"; + case FieldDescriptorProto_Type.TYPE_UINT32: + return "TYPE_UINT32"; + case FieldDescriptorProto_Type.TYPE_ENUM: + return "TYPE_ENUM"; + case FieldDescriptorProto_Type.TYPE_SFIXED32: + return "TYPE_SFIXED32"; + case FieldDescriptorProto_Type.TYPE_SFIXED64: + return "TYPE_SFIXED64"; + case FieldDescriptorProto_Type.TYPE_SINT32: + return "TYPE_SINT32"; + case FieldDescriptorProto_Type.TYPE_SINT64: + return "TYPE_SINT64"; + case FieldDescriptorProto_Type.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export enum FieldDescriptorProto_Label { + /** LABEL_OPTIONAL - 0 is reserved for errors */ + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3, + UNRECOGNIZED = -1, +} + +export function fieldDescriptorProto_LabelFromJSON( + object: any +): FieldDescriptorProto_Label { + switch (object) { + case 1: + case "LABEL_OPTIONAL": + return FieldDescriptorProto_Label.LABEL_OPTIONAL; + case 2: + case "LABEL_REQUIRED": + return FieldDescriptorProto_Label.LABEL_REQUIRED; + case 3: + case "LABEL_REPEATED": + return FieldDescriptorProto_Label.LABEL_REPEATED; + case -1: + case "UNRECOGNIZED": + default: + return FieldDescriptorProto_Label.UNRECOGNIZED; + } +} + +export function fieldDescriptorProto_LabelToJSON( + object: FieldDescriptorProto_Label +): string { + switch (object) { + case FieldDescriptorProto_Label.LABEL_OPTIONAL: + return "LABEL_OPTIONAL"; + case FieldDescriptorProto_Label.LABEL_REQUIRED: + return "LABEL_REQUIRED"; + case FieldDescriptorProto_Label.LABEL_REPEATED: + return "LABEL_REPEATED"; + case FieldDescriptorProto_Label.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** Describes a oneof. */ +export interface OneofDescriptorProto { + name: string; + options?: OneofOptions; +} + +/** Describes an enum type. */ +export interface EnumDescriptorProto { + name: string; + value: EnumValueDescriptorProto[]; + options?: EnumOptions; + /** + * Range of reserved numeric values. Reserved numeric values may not be used + * by enum values in the same enum declaration. Reserved ranges may not + * overlap. + */ + reservedRange: EnumDescriptorProto_EnumReservedRange[]; + /** + * Reserved enum value names, which may not be reused. A given name may only + * be reserved once. + */ + reservedName: string[]; +} + +/** + * Range of reserved numeric values. Reserved values may not be used by + * entries in the same enum. Reserved ranges may not overlap. + * + * Note that this is distinct from DescriptorProto.ReservedRange in that it + * is inclusive such that it can appropriately represent the entire int32 + * domain. + */ +export interface EnumDescriptorProto_EnumReservedRange { + /** Inclusive. */ + start: number; + /** Inclusive. */ + end: number; +} + +/** Describes a value within an enum. */ +export interface EnumValueDescriptorProto { + name: string; + number: number; + options?: EnumValueOptions; +} + +/** Describes a service. */ +export interface ServiceDescriptorProto { + name: string; + method: MethodDescriptorProto[]; + options?: ServiceOptions; +} + +/** Describes a method of a service. */ +export interface MethodDescriptorProto { + name: string; + /** + * Input and output type names. These are resolved in the same way as + * FieldDescriptorProto.type_name, but must refer to a message type. + */ + inputType: string; + outputType: string; + options?: MethodOptions; + /** Identifies if client streams multiple client messages */ + clientStreaming: boolean; + /** Identifies if server streams multiple server messages */ + serverStreaming: boolean; +} + +export interface FileOptions { + /** + * Sets the Java package where classes generated from this .proto will be + * placed. By default, the proto package is used, but this is often + * inappropriate because proto packages do not normally start with backwards + * domain names. + */ + javaPackage: string; + /** + * Controls the name of the wrapper Java class generated for the .proto file. + * That class will always contain the .proto file's getDescriptor() method as + * well as any top-level extensions defined in the .proto file. + * If java_multiple_files is disabled, then all the other classes from the + * .proto file will be nested inside the single wrapper outer class. + */ + javaOuterClassname: string; + /** + * If enabled, then the Java code generator will generate a separate .java + * file for each top-level message, enum, and service defined in the .proto + * file. Thus, these types will *not* be nested inside the wrapper class + * named by java_outer_classname. However, the wrapper class will still be + * generated to contain the file's getDescriptor() method as well as any + * top-level extensions defined in the file. + */ + javaMultipleFiles: boolean; + /** + * This option does nothing. + * + * @deprecated + */ + javaGenerateEqualsAndHash: boolean; + /** + * If set true, then the Java2 code generator will generate code that + * throws an exception whenever an attempt is made to assign a non-UTF-8 + * byte sequence to a string field. + * Message reflection will do the same. + * However, an extension field still accepts non-UTF-8 byte sequences. + * This option has no effect on when used with the lite runtime. + */ + javaStringCheckUtf8: boolean; + optimizeFor: FileOptions_OptimizeMode; + /** + * Sets the Go package where structs generated from this .proto will be + * placed. If omitted, the Go package will be derived from the following: + * - The basename of the package import path, if provided. + * - Otherwise, the package statement in the .proto file, if present. + * - Otherwise, the basename of the .proto file, without extension. + */ + goPackage: string; + /** + * Should generic services be generated in each language? "Generic" services + * are not specific to any particular RPC system. They are generated by the + * main code generators in each language (without additional plugins). + * Generic services were the only kind of service generation supported by + * early versions of google.protobuf. + * + * Generic services are now considered deprecated in favor of using plugins + * that generate code specific to your particular RPC system. Therefore, + * these default to false. Old code which depends on generic services should + * explicitly set them to true. + */ + ccGenericServices: boolean; + javaGenericServices: boolean; + pyGenericServices: boolean; + phpGenericServices: boolean; + /** + * Is this file deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for everything in the file, or it will be completely ignored; in the very + * least, this is a formalization for deprecating files. + */ + deprecated: boolean; + /** + * Enables the use of arenas for the proto messages in this file. This applies + * only to generated classes for C++. + */ + ccEnableArenas: boolean; + /** + * Sets the objective c class prefix which is prepended to all objective c + * generated classes from this .proto. There is no default. + */ + objcClassPrefix: string; + /** Namespace for generated classes; defaults to the package. */ + csharpNamespace: string; + /** + * By default Swift generators will take the proto package and CamelCase it + * replacing '.' with underscore and use that to prefix the types/symbols + * defined. When this options is provided, they will use this value instead + * to prefix the types/symbols defined. + */ + swiftPrefix: string; + /** + * Sets the php class prefix which is prepended to all php generated classes + * from this .proto. Default is empty. + */ + phpClassPrefix: string; + /** + * Use this option to change the namespace of php generated classes. Default + * is empty. When this option is empty, the package name will be used for + * determining the namespace. + */ + phpNamespace: string; + /** + * Use this option to change the namespace of php generated metadata classes. + * Default is empty. When this option is empty, the proto file name will be + * used for determining the namespace. + */ + phpMetadataNamespace: string; + /** + * Use this option to change the package of ruby generated classes. Default + * is empty. When this option is not set, the package name will be used for + * determining the ruby package. + */ + rubyPackage: string; + /** + * The parser stores options it doesn't recognize here. + * See the documentation for the "Options" section above. + */ + uninterpretedOption: UninterpretedOption[]; +} + +/** Generated classes can be optimized for speed or code size. */ +export enum FileOptions_OptimizeMode { + /** SPEED - Generate complete code for parsing, serialization, */ + SPEED = 1, + /** CODE_SIZE - etc. */ + CODE_SIZE = 2, + /** LITE_RUNTIME - Generate code using MessageLite and the lite runtime. */ + LITE_RUNTIME = 3, + UNRECOGNIZED = -1, +} + +export function fileOptions_OptimizeModeFromJSON( + object: any +): FileOptions_OptimizeMode { + switch (object) { + case 1: + case "SPEED": + return FileOptions_OptimizeMode.SPEED; + case 2: + case "CODE_SIZE": + return FileOptions_OptimizeMode.CODE_SIZE; + case 3: + case "LITE_RUNTIME": + return FileOptions_OptimizeMode.LITE_RUNTIME; + case -1: + case "UNRECOGNIZED": + default: + return FileOptions_OptimizeMode.UNRECOGNIZED; + } +} + +export function fileOptions_OptimizeModeToJSON( + object: FileOptions_OptimizeMode +): string { + switch (object) { + case FileOptions_OptimizeMode.SPEED: + return "SPEED"; + case FileOptions_OptimizeMode.CODE_SIZE: + return "CODE_SIZE"; + case FileOptions_OptimizeMode.LITE_RUNTIME: + return "LITE_RUNTIME"; + case FileOptions_OptimizeMode.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export interface MessageOptions { + /** + * Set true to use the old proto1 MessageSet wire format for extensions. + * This is provided for backwards-compatibility with the MessageSet wire + * format. You should not use this for any other reason: It's less + * efficient, has fewer features, and is more complicated. + * + * The message must be defined exactly as follows: + * message Foo { + * option message_set_wire_format = true; + * extensions 4 to max; + * } + * Note that the message cannot have any defined fields; MessageSets only + * have extensions. + * + * All extensions of your type must be singular messages; e.g. they cannot + * be int32s, enums, or repeated messages. + * + * Because this is an option, the above two restrictions are not enforced by + * the protocol compiler. + */ + messageSetWireFormat: boolean; + /** + * Disables the generation of the standard "descriptor()" accessor, which can + * conflict with a field of the same name. This is meant to make migration + * from proto1 easier; new code should avoid fields named "descriptor". + */ + noStandardDescriptorAccessor: boolean; + /** + * Is this message deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the message, or it will be completely ignored; in the very least, + * this is a formalization for deprecating messages. + */ + deprecated: boolean; + /** + * Whether the message is an automatically generated map entry type for the + * maps field. + * + * For maps fields: + * map map_field = 1; + * The parsed descriptor looks like: + * message MapFieldEntry { + * option map_entry = true; + * optional KeyType key = 1; + * optional ValueType value = 2; + * } + * repeated MapFieldEntry map_field = 1; + * + * Implementations may choose not to generate the map_entry=true message, but + * use a native map in the target language to hold the keys and values. + * The reflection APIs in such implementations still need to work as + * if the field is a repeated message field. + * + * NOTE: Do not set the option in .proto files. Always use the maps syntax + * instead. The option should only be implicitly set by the proto compiler + * parser. + */ + mapEntry: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +export interface FieldOptions { + /** + * The ctype option instructs the C++ code generator to use a different + * representation of the field than it normally would. See the specific + * options below. This option is not yet implemented in the open source + * release -- sorry, we'll try to include it in a future version! + */ + ctype: FieldOptions_CType; + /** + * The packed option can be enabled for repeated primitive fields to enable + * a more efficient representation on the wire. Rather than repeatedly + * writing the tag and type for each element, the entire array is encoded as + * a single length-delimited blob. In proto3, only explicit setting it to + * false will avoid using packed encoding. + */ + packed: boolean; + /** + * The jstype option determines the JavaScript type used for values of the + * field. The option is permitted only for 64 bit integral and fixed types + * (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING + * is represented as JavaScript string, which avoids loss of precision that + * can happen when a large value is converted to a floating point JavaScript. + * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to + * use the JavaScript "number" type. The behavior of the default option + * JS_NORMAL is implementation dependent. + * + * This option is an enum to permit additional types to be added, e.g. + * goog.math.Integer. + */ + jstype: FieldOptions_JSType; + /** + * Should this field be parsed lazily? Lazy applies only to message-type + * fields. It means that when the outer message is initially parsed, the + * inner message's contents will not be parsed but instead stored in encoded + * form. The inner message will actually be parsed when it is first accessed. + * + * This is only a hint. Implementations are free to choose whether to use + * eager or lazy parsing regardless of the value of this option. However, + * setting this option true suggests that the protocol author believes that + * using lazy parsing on this field is worth the additional bookkeeping + * overhead typically needed to implement it. + * + * This option does not affect the public interface of any generated code; + * all method signatures remain the same. Furthermore, thread-safety of the + * interface is not affected by this option; const methods remain safe to + * call from multiple threads concurrently, while non-const methods continue + * to require exclusive access. + * + * + * Note that implementations may choose not to check required fields within + * a lazy sub-message. That is, calling IsInitialized() on the outer message + * may return true even if the inner message has missing required fields. + * This is necessary because otherwise the inner message would have to be + * parsed in order to perform the check, defeating the purpose of lazy + * parsing. An implementation which chooses not to check required fields + * must be consistent about it. That is, for any particular sub-message, the + * implementation must either *always* check its required fields, or *never* + * check its required fields, regardless of whether or not the message has + * been parsed. + * + * As of 2021, lazy does no correctness checks on the byte stream during + * parsing. This may lead to crashes if and when an invalid byte stream is + * finally parsed upon access. + * + * TODO(b/211906113): Enable validation on lazy fields. + */ + lazy: boolean; + /** + * unverified_lazy does no correctness checks on the byte stream. This should + * only be used where lazy with verification is prohibitive for performance + * reasons. + */ + unverifiedLazy: boolean; + /** + * Is this field deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for accessors, or it will be completely ignored; in the very least, this + * is a formalization for deprecating fields. + */ + deprecated: boolean; + /** For Google-internal migration only. Do not use. */ + weak: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +export enum FieldOptions_CType { + /** STRING - Default mode. */ + STRING = 0, + CORD = 1, + STRING_PIECE = 2, + UNRECOGNIZED = -1, +} + +export function fieldOptions_CTypeFromJSON(object: any): FieldOptions_CType { + switch (object) { + case 0: + case "STRING": + return FieldOptions_CType.STRING; + case 1: + case "CORD": + return FieldOptions_CType.CORD; + case 2: + case "STRING_PIECE": + return FieldOptions_CType.STRING_PIECE; + case -1: + case "UNRECOGNIZED": + default: + return FieldOptions_CType.UNRECOGNIZED; + } +} + +export function fieldOptions_CTypeToJSON(object: FieldOptions_CType): string { + switch (object) { + case FieldOptions_CType.STRING: + return "STRING"; + case FieldOptions_CType.CORD: + return "CORD"; + case FieldOptions_CType.STRING_PIECE: + return "STRING_PIECE"; + case FieldOptions_CType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export enum FieldOptions_JSType { + /** JS_NORMAL - Use the default type. */ + JS_NORMAL = 0, + /** JS_STRING - Use JavaScript strings. */ + JS_STRING = 1, + /** JS_NUMBER - Use JavaScript numbers. */ + JS_NUMBER = 2, + UNRECOGNIZED = -1, +} + +export function fieldOptions_JSTypeFromJSON(object: any): FieldOptions_JSType { + switch (object) { + case 0: + case "JS_NORMAL": + return FieldOptions_JSType.JS_NORMAL; + case 1: + case "JS_STRING": + return FieldOptions_JSType.JS_STRING; + case 2: + case "JS_NUMBER": + return FieldOptions_JSType.JS_NUMBER; + case -1: + case "UNRECOGNIZED": + default: + return FieldOptions_JSType.UNRECOGNIZED; + } +} + +export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string { + switch (object) { + case FieldOptions_JSType.JS_NORMAL: + return "JS_NORMAL"; + case FieldOptions_JSType.JS_STRING: + return "JS_STRING"; + case FieldOptions_JSType.JS_NUMBER: + return "JS_NUMBER"; + case FieldOptions_JSType.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +export interface OneofOptions { + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +export interface EnumOptions { + /** + * Set this option to true to allow mapping different tag names to the same + * value. + */ + allowAlias: boolean; + /** + * Is this enum deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum, or it will be completely ignored; in the very least, this + * is a formalization for deprecating enums. + */ + deprecated: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +export interface EnumValueOptions { + /** + * Is this enum value deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the enum value, or it will be completely ignored; in the very least, + * this is a formalization for deprecating enum values. + */ + deprecated: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +export interface ServiceOptions { + /** + * Is this service deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the service, or it will be completely ignored; in the very least, + * this is a formalization for deprecating services. + */ + deprecated: boolean; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +export interface MethodOptions { + /** + * Is this method deprecated? + * Depending on the target platform, this can emit Deprecated annotations + * for the method, or it will be completely ignored; in the very least, + * this is a formalization for deprecating methods. + */ + deprecated: boolean; + idempotencyLevel: MethodOptions_IdempotencyLevel; + /** The parser stores options it doesn't recognize here. See above. */ + uninterpretedOption: UninterpretedOption[]; +} + +/** + * Is this method side-effect-free (or safe in HTTP parlance), or idempotent, + * or neither? HTTP based RPC implementation may choose GET verb for safe + * methods, and PUT verb for idempotent methods instead of the default POST. + */ +export enum MethodOptions_IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + /** NO_SIDE_EFFECTS - implies idempotent */ + NO_SIDE_EFFECTS = 1, + /** IDEMPOTENT - idempotent, but may have side effects */ + IDEMPOTENT = 2, + UNRECOGNIZED = -1, +} + +export function methodOptions_IdempotencyLevelFromJSON( + object: any +): MethodOptions_IdempotencyLevel { + switch (object) { + case 0: + case "IDEMPOTENCY_UNKNOWN": + return MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN; + case 1: + case "NO_SIDE_EFFECTS": + return MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS; + case 2: + case "IDEMPOTENT": + return MethodOptions_IdempotencyLevel.IDEMPOTENT; + case -1: + case "UNRECOGNIZED": + default: + return MethodOptions_IdempotencyLevel.UNRECOGNIZED; + } +} + +export function methodOptions_IdempotencyLevelToJSON( + object: MethodOptions_IdempotencyLevel +): string { + switch (object) { + case MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN: + return "IDEMPOTENCY_UNKNOWN"; + case MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS: + return "NO_SIDE_EFFECTS"; + case MethodOptions_IdempotencyLevel.IDEMPOTENT: + return "IDEMPOTENT"; + case MethodOptions_IdempotencyLevel.UNRECOGNIZED: + default: + return "UNRECOGNIZED"; + } +} + +/** + * A message representing a option the parser does not recognize. This only + * appears in options protos created by the compiler::Parser class. + * DescriptorPool resolves these when building Descriptor objects. Therefore, + * options protos in descriptor objects (e.g. returned by Descriptor::options(), + * or produced by Descriptor::CopyTo()) will never have UninterpretedOptions + * in them. + */ +export interface UninterpretedOption { + name: UninterpretedOption_NamePart[]; + /** + * The value of the uninterpreted option, in whatever type the tokenizer + * identified it as during parsing. Exactly one of these should be set. + */ + identifierValue: string; + positiveIntValue: Long; + negativeIntValue: Long; + doubleValue: number; + stringValue: Uint8Array; + aggregateValue: string; +} + +/** + * The name of the uninterpreted option. Each string represents a segment in + * a dot-separated name. is_extension is true iff a segment represents an + * extension (denoted with parentheses in options specs in .proto files). + * E.g.,{ ["foo", false], ["bar.baz", true], ["moo", false] } represents + * "foo.(bar.baz).moo". + */ +export interface UninterpretedOption_NamePart { + namePart: string; + isExtension: boolean; +} + +/** + * Encapsulates information about the original source file from which a + * FileDescriptorProto was generated. + */ +export interface SourceCodeInfo { + /** + * A Location identifies a piece of source code in a .proto file which + * corresponds to a particular definition. This information is intended + * to be useful to IDEs, code indexers, documentation generators, and similar + * tools. + * + * For example, say we have a file like: + * message Foo { + * optional string foo = 1; + * } + * Let's look at just the field definition: + * optional string foo = 1; + * ^ ^^ ^^ ^ ^^^ + * a bc de f ghi + * We have the following locations: + * span path represents + * [a,i) [ 4, 0, 2, 0 ] The whole field definition. + * [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). + * [c,d) [ 4, 0, 2, 0, 5 ] The type (string). + * [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). + * [g,h) [ 4, 0, 2, 0, 3 ] The number (1). + * + * Notes: + * - A location may refer to a repeated field itself (i.e. not to any + * particular index within it). This is used whenever a set of elements are + * logically enclosed in a single code segment. For example, an entire + * extend block (possibly containing multiple extension definitions) will + * have an outer location whose path refers to the "extensions" repeated + * field without an index. + * - Multiple locations may have the same path. This happens when a single + * logical declaration is spread out across multiple places. The most + * obvious example is the "extend" block again -- there may be multiple + * extend blocks in the same scope, each of which will have the same path. + * - A location's span is not always a subset of its parent's span. For + * example, the "extendee" of an extension declaration appears at the + * beginning of the "extend" block and is shared by all extensions within + * the block. + * - Just because a location's span is a subset of some other location's span + * does not mean that it is a descendant. For example, a "group" defines + * both a type and a field in a single declaration. Thus, the locations + * corresponding to the type and field and their components will overlap. + * - Code which tries to interpret locations should probably be designed to + * ignore those that it doesn't understand, as more types of locations could + * be recorded in the future. + */ + location: SourceCodeInfo_Location[]; +} + +export interface SourceCodeInfo_Location { + /** + * Identifies which part of the FileDescriptorProto was defined at this + * location. + * + * Each element is a field number or an index. They form a path from + * the root FileDescriptorProto to the place where the definition occurs. + * For example, this path: + * [ 4, 3, 2, 7, 1 ] + * refers to: + * file.message_type(3) // 4, 3 + * .field(7) // 2, 7 + * .name() // 1 + * This is because FileDescriptorProto.message_type has field number 4: + * repeated DescriptorProto message_type = 4; + * and DescriptorProto.field has field number 2: + * repeated FieldDescriptorProto field = 2; + * and FieldDescriptorProto.name has field number 1: + * optional string name = 1; + * + * Thus, the above path gives the location of a field name. If we removed + * the last element: + * [ 4, 3, 2, 7 ] + * this path refers to the whole field declaration (from the beginning + * of the label to the terminating semicolon). + */ + path: number[]; + /** + * Always has exactly three or four elements: start line, start column, + * end line (optional, otherwise assumed same as start line), end column. + * These are packed into a single field for efficiency. Note that line + * and column numbers are zero-based -- typically you will want to add + * 1 to each before displaying to a user. + */ + span: number[]; + /** + * If this SourceCodeInfo represents a complete declaration, these are any + * comments appearing before and after the declaration which appear to be + * attached to the declaration. + * + * A series of line comments appearing on consecutive lines, with no other + * tokens appearing on those lines, will be treated as a single comment. + * + * leading_detached_comments will keep paragraphs of comments that appear + * before (but not connected to) the current element. Each paragraph, + * separated by empty lines, will be one comment element in the repeated + * field. + * + * Only the comment content is provided; comment markers (e.g. //) are + * stripped out. For block comments, leading whitespace and an asterisk + * will be stripped from the beginning of each line other than the first. + * Newlines are included in the output. + * + * Examples: + * + * optional int32 foo = 1; // Comment attached to foo. + * // Comment attached to bar. + * optional int32 bar = 2; + * + * optional string baz = 3; + * // Comment attached to baz. + * // Another line attached to baz. + * + * // Comment attached to moo. + * // + * // Another line attached to moo. + * optional double moo = 4; + * + * // Detached comment for corge. This is not leading or trailing comments + * // to moo or corge because there are blank lines separating it from + * // both. + * + * // Detached comment for corge paragraph 2. + * + * optional string corge = 5; + * /* Block comment attached + * * to corge. Leading asterisks + * * will be removed. * / + * /* Block comment attached to + * * grault. * / + * optional int32 grault = 6; + * + * // ignored detached comments. + */ + leadingComments: string; + trailingComments: string; + leadingDetachedComments: string[]; +} + +/** + * Describes the relationship between generated code and its original source + * file. A GeneratedCodeInfo message is associated with only one generated + * source file, but may contain references to different source .proto files. + */ +export interface GeneratedCodeInfo { + /** + * An Annotation connects some span of text in generated code to an element + * of its generating .proto file. + */ + annotation: GeneratedCodeInfo_Annotation[]; +} + +export interface GeneratedCodeInfo_Annotation { + /** + * Identifies the element in the original source .proto file. This field + * is formatted the same as SourceCodeInfo.Location.path. + */ + path: number[]; + /** Identifies the filesystem path to the original source .proto. */ + sourceFile: string; + /** + * Identifies the starting offset in bytes in the generated code + * that relates to the identified object. + */ + begin: number; + /** + * Identifies the ending offset in bytes in the generated code that + * relates to the identified offset. The end offset should be one past + * the last relevant byte (so the length of the text = end - begin). + */ + end: number; +} + +function createBaseFileDescriptorSet(): FileDescriptorSet { + return { file: [] }; +} + +export const FileDescriptorSet = { + encode( + message: FileDescriptorSet, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.file) { + FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): FileDescriptorSet { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFileDescriptorSet(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.file.push( + FileDescriptorProto.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FileDescriptorSet { + return { + file: Array.isArray(object?.file) + ? object.file.map((e: any) => FileDescriptorProto.fromJSON(e)) + : [], + }; + }, + + toJSON(message: FileDescriptorSet): unknown { + const obj: any = {}; + if (message.file) { + obj.file = message.file.map((e) => + e ? FileDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.file = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): FileDescriptorSet { + const message = createBaseFileDescriptorSet(); + message.file = + object.file?.map((e) => FileDescriptorProto.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseFileDescriptorProto(): FileDescriptorProto { + return { + name: "", + package: "", + dependency: [], + publicDependency: [], + weakDependency: [], + messageType: [], + enumType: [], + service: [], + extension: [], + options: undefined, + sourceCodeInfo: undefined, + syntax: "", + }; +} + +export const FileDescriptorProto = { + encode( + message: FileDescriptorProto, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.package !== "") { + writer.uint32(18).string(message.package); + } + for (const v of message.dependency) { + writer.uint32(26).string(v!); + } + writer.uint32(82).fork(); + for (const v of message.publicDependency) { + writer.int32(v); + } + writer.ldelim(); + writer.uint32(90).fork(); + for (const v of message.weakDependency) { + writer.int32(v); + } + writer.ldelim(); + for (const v of message.messageType) { + DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.enumType) { + EnumDescriptorProto.encode(v!, writer.uint32(42).fork()).ldelim(); + } + for (const v of message.service) { + ServiceDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.extension) { + FieldDescriptorProto.encode(v!, writer.uint32(58).fork()).ldelim(); + } + if (message.options !== undefined) { + FileOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); + } + if (message.sourceCodeInfo !== undefined) { + SourceCodeInfo.encode( + message.sourceCodeInfo, + writer.uint32(74).fork() + ).ldelim(); + } + if (message.syntax !== "") { + writer.uint32(98).string(message.syntax); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): FileDescriptorProto { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFileDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.package = reader.string(); + break; + case 3: + message.dependency.push(reader.string()); + break; + case 10: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.publicDependency.push(reader.int32()); + } + } else { + message.publicDependency.push(reader.int32()); + } + break; + case 11: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.weakDependency.push(reader.int32()); + } + } else { + message.weakDependency.push(reader.int32()); + } + break; + case 4: + message.messageType.push( + DescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 5: + message.enumType.push( + EnumDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 6: + message.service.push( + ServiceDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 7: + message.extension.push( + FieldDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 8: + message.options = FileOptions.decode(reader, reader.uint32()); + break; + case 9: + message.sourceCodeInfo = SourceCodeInfo.decode( + reader, + reader.uint32() + ); + break; + case 12: + message.syntax = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FileDescriptorProto { + return { + name: isSet(object.name) ? String(object.name) : "", + package: isSet(object.package) ? String(object.package) : "", + dependency: Array.isArray(object?.dependency) + ? object.dependency.map((e: any) => String(e)) + : [], + publicDependency: Array.isArray(object?.publicDependency) + ? object.publicDependency.map((e: any) => Number(e)) + : [], + weakDependency: Array.isArray(object?.weakDependency) + ? object.weakDependency.map((e: any) => Number(e)) + : [], + messageType: Array.isArray(object?.messageType) + ? object.messageType.map((e: any) => DescriptorProto.fromJSON(e)) + : [], + enumType: Array.isArray(object?.enumType) + ? object.enumType.map((e: any) => EnumDescriptorProto.fromJSON(e)) + : [], + service: Array.isArray(object?.service) + ? object.service.map((e: any) => ServiceDescriptorProto.fromJSON(e)) + : [], + extension: Array.isArray(object?.extension) + ? object.extension.map((e: any) => FieldDescriptorProto.fromJSON(e)) + : [], + options: isSet(object.options) + ? FileOptions.fromJSON(object.options) + : undefined, + sourceCodeInfo: isSet(object.sourceCodeInfo) + ? SourceCodeInfo.fromJSON(object.sourceCodeInfo) + : undefined, + syntax: isSet(object.syntax) ? String(object.syntax) : "", + }; + }, + + toJSON(message: FileDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.package !== undefined && (obj.package = message.package); + if (message.dependency) { + obj.dependency = message.dependency.map((e) => e); + } else { + obj.dependency = []; + } + if (message.publicDependency) { + obj.publicDependency = message.publicDependency.map((e) => Math.round(e)); + } else { + obj.publicDependency = []; + } + if (message.weakDependency) { + obj.weakDependency = message.weakDependency.map((e) => Math.round(e)); + } else { + obj.weakDependency = []; + } + if (message.messageType) { + obj.messageType = message.messageType.map((e) => + e ? DescriptorProto.toJSON(e) : undefined + ); + } else { + obj.messageType = []; + } + if (message.enumType) { + obj.enumType = message.enumType.map((e) => + e ? EnumDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.enumType = []; + } + if (message.service) { + obj.service = message.service.map((e) => + e ? ServiceDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.service = []; + } + if (message.extension) { + obj.extension = message.extension.map((e) => + e ? FieldDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.extension = []; + } + message.options !== undefined && + (obj.options = message.options + ? FileOptions.toJSON(message.options) + : undefined); + message.sourceCodeInfo !== undefined && + (obj.sourceCodeInfo = message.sourceCodeInfo + ? SourceCodeInfo.toJSON(message.sourceCodeInfo) + : undefined); + message.syntax !== undefined && (obj.syntax = message.syntax); + return obj; + }, + + fromPartial, I>>( + object: I + ): FileDescriptorProto { + const message = createBaseFileDescriptorProto(); + message.name = object.name ?? ""; + message.package = object.package ?? ""; + message.dependency = object.dependency?.map((e) => e) || []; + message.publicDependency = object.publicDependency?.map((e) => e) || []; + message.weakDependency = object.weakDependency?.map((e) => e) || []; + message.messageType = + object.messageType?.map((e) => DescriptorProto.fromPartial(e)) || []; + message.enumType = + object.enumType?.map((e) => EnumDescriptorProto.fromPartial(e)) || []; + message.service = + object.service?.map((e) => ServiceDescriptorProto.fromPartial(e)) || []; + message.extension = + object.extension?.map((e) => FieldDescriptorProto.fromPartial(e)) || []; + message.options = + object.options !== undefined && object.options !== null + ? FileOptions.fromPartial(object.options) + : undefined; + message.sourceCodeInfo = + object.sourceCodeInfo !== undefined && object.sourceCodeInfo !== null + ? SourceCodeInfo.fromPartial(object.sourceCodeInfo) + : undefined; + message.syntax = object.syntax ?? ""; + return message; + }, +}; + +function createBaseDescriptorProto(): DescriptorProto { + return { + name: "", + field: [], + extension: [], + nestedType: [], + enumType: [], + extensionRange: [], + oneofDecl: [], + options: undefined, + reservedRange: [], + reservedName: [], + }; +} + +export const DescriptorProto = { + encode( + message: DescriptorProto, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + for (const v of message.field) { + FieldDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + } + for (const v of message.extension) { + FieldDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); + } + for (const v of message.nestedType) { + DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.enumType) { + EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); + } + for (const v of message.extensionRange) { + DescriptorProto_ExtensionRange.encode( + v!, + writer.uint32(42).fork() + ).ldelim(); + } + for (const v of message.oneofDecl) { + OneofDescriptorProto.encode(v!, writer.uint32(66).fork()).ldelim(); + } + if (message.options !== undefined) { + MessageOptions.encode(message.options, writer.uint32(58).fork()).ldelim(); + } + for (const v of message.reservedRange) { + DescriptorProto_ReservedRange.encode( + v!, + writer.uint32(74).fork() + ).ldelim(); + } + for (const v of message.reservedName) { + writer.uint32(82).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): DescriptorProto { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.field.push( + FieldDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 6: + message.extension.push( + FieldDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 3: + message.nestedType.push( + DescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 4: + message.enumType.push( + EnumDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 5: + message.extensionRange.push( + DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) + ); + break; + case 8: + message.oneofDecl.push( + OneofDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 7: + message.options = MessageOptions.decode(reader, reader.uint32()); + break; + case 9: + message.reservedRange.push( + DescriptorProto_ReservedRange.decode(reader, reader.uint32()) + ); + break; + case 10: + message.reservedName.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DescriptorProto { + return { + name: isSet(object.name) ? String(object.name) : "", + field: Array.isArray(object?.field) + ? object.field.map((e: any) => FieldDescriptorProto.fromJSON(e)) + : [], + extension: Array.isArray(object?.extension) + ? object.extension.map((e: any) => FieldDescriptorProto.fromJSON(e)) + : [], + nestedType: Array.isArray(object?.nestedType) + ? object.nestedType.map((e: any) => DescriptorProto.fromJSON(e)) + : [], + enumType: Array.isArray(object?.enumType) + ? object.enumType.map((e: any) => EnumDescriptorProto.fromJSON(e)) + : [], + extensionRange: Array.isArray(object?.extensionRange) + ? object.extensionRange.map((e: any) => + DescriptorProto_ExtensionRange.fromJSON(e) + ) + : [], + oneofDecl: Array.isArray(object?.oneofDecl) + ? object.oneofDecl.map((e: any) => OneofDescriptorProto.fromJSON(e)) + : [], + options: isSet(object.options) + ? MessageOptions.fromJSON(object.options) + : undefined, + reservedRange: Array.isArray(object?.reservedRange) + ? object.reservedRange.map((e: any) => + DescriptorProto_ReservedRange.fromJSON(e) + ) + : [], + reservedName: Array.isArray(object?.reservedName) + ? object.reservedName.map((e: any) => String(e)) + : [], + }; + }, + + toJSON(message: DescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + if (message.field) { + obj.field = message.field.map((e) => + e ? FieldDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.field = []; + } + if (message.extension) { + obj.extension = message.extension.map((e) => + e ? FieldDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.extension = []; + } + if (message.nestedType) { + obj.nestedType = message.nestedType.map((e) => + e ? DescriptorProto.toJSON(e) : undefined + ); + } else { + obj.nestedType = []; + } + if (message.enumType) { + obj.enumType = message.enumType.map((e) => + e ? EnumDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.enumType = []; + } + if (message.extensionRange) { + obj.extensionRange = message.extensionRange.map((e) => + e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined + ); + } else { + obj.extensionRange = []; + } + if (message.oneofDecl) { + obj.oneofDecl = message.oneofDecl.map((e) => + e ? OneofDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.oneofDecl = []; + } + message.options !== undefined && + (obj.options = message.options + ? MessageOptions.toJSON(message.options) + : undefined); + if (message.reservedRange) { + obj.reservedRange = message.reservedRange.map((e) => + e ? DescriptorProto_ReservedRange.toJSON(e) : undefined + ); + } else { + obj.reservedRange = []; + } + if (message.reservedName) { + obj.reservedName = message.reservedName.map((e) => e); + } else { + obj.reservedName = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): DescriptorProto { + const message = createBaseDescriptorProto(); + message.name = object.name ?? ""; + message.field = + object.field?.map((e) => FieldDescriptorProto.fromPartial(e)) || []; + message.extension = + object.extension?.map((e) => FieldDescriptorProto.fromPartial(e)) || []; + message.nestedType = + object.nestedType?.map((e) => DescriptorProto.fromPartial(e)) || []; + message.enumType = + object.enumType?.map((e) => EnumDescriptorProto.fromPartial(e)) || []; + message.extensionRange = + object.extensionRange?.map((e) => + DescriptorProto_ExtensionRange.fromPartial(e) + ) || []; + message.oneofDecl = + object.oneofDecl?.map((e) => OneofDescriptorProto.fromPartial(e)) || []; + message.options = + object.options !== undefined && object.options !== null + ? MessageOptions.fromPartial(object.options) + : undefined; + message.reservedRange = + object.reservedRange?.map((e) => + DescriptorProto_ReservedRange.fromPartial(e) + ) || []; + message.reservedName = object.reservedName?.map((e) => e) || []; + return message; + }, +}; + +function createBaseDescriptorProto_ExtensionRange(): DescriptorProto_ExtensionRange { + return { start: 0, end: 0, options: undefined }; +} + +export const DescriptorProto_ExtensionRange = { + encode( + message: DescriptorProto_ExtensionRange, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.start !== 0) { + writer.uint32(8).int32(message.start); + } + if (message.end !== 0) { + writer.uint32(16).int32(message.end); + } + if (message.options !== undefined) { + ExtensionRangeOptions.encode( + message.options, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DescriptorProto_ExtensionRange { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDescriptorProto_ExtensionRange(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + case 3: + message.options = ExtensionRangeOptions.decode( + reader, + reader.uint32() + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DescriptorProto_ExtensionRange { + return { + start: isSet(object.start) ? Number(object.start) : 0, + end: isSet(object.end) ? Number(object.end) : 0, + options: isSet(object.options) + ? ExtensionRangeOptions.fromJSON(object.options) + : undefined, + }; + }, + + toJSON(message: DescriptorProto_ExtensionRange): unknown { + const obj: any = {}; + message.start !== undefined && (obj.start = Math.round(message.start)); + message.end !== undefined && (obj.end = Math.round(message.end)); + message.options !== undefined && + (obj.options = message.options + ? ExtensionRangeOptions.toJSON(message.options) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): DescriptorProto_ExtensionRange { + const message = createBaseDescriptorProto_ExtensionRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; + message.options = + object.options !== undefined && object.options !== null + ? ExtensionRangeOptions.fromPartial(object.options) + : undefined; + return message; + }, +}; + +function createBaseDescriptorProto_ReservedRange(): DescriptorProto_ReservedRange { + return { start: 0, end: 0 }; +} + +export const DescriptorProto_ReservedRange = { + encode( + message: DescriptorProto_ReservedRange, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.start !== 0) { + writer.uint32(8).int32(message.start); + } + if (message.end !== 0) { + writer.uint32(16).int32(message.end); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): DescriptorProto_ReservedRange { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseDescriptorProto_ReservedRange(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): DescriptorProto_ReservedRange { + return { + start: isSet(object.start) ? Number(object.start) : 0, + end: isSet(object.end) ? Number(object.end) : 0, + }; + }, + + toJSON(message: DescriptorProto_ReservedRange): unknown { + const obj: any = {}; + message.start !== undefined && (obj.start = Math.round(message.start)); + message.end !== undefined && (obj.end = Math.round(message.end)); + return obj; + }, + + fromPartial, I>>( + object: I + ): DescriptorProto_ReservedRange { + const message = createBaseDescriptorProto_ReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; + return message; + }, +}; + +function createBaseExtensionRangeOptions(): ExtensionRangeOptions { + return { uninterpretedOption: [] }; +} + +export const ExtensionRangeOptions = { + encode( + message: ExtensionRangeOptions, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ExtensionRangeOptions { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseExtensionRangeOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + message.uninterpretedOption.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ExtensionRangeOptions { + return { + uninterpretedOption: Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => + UninterpretedOption.fromJSON(e) + ) + : [], + }; + }, + + toJSON(message: ExtensionRangeOptions): unknown { + const obj: any = {}; + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpretedOption = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): ExtensionRangeOptions { + const message = createBaseExtensionRangeOptions(); + message.uninterpretedOption = + object.uninterpretedOption?.map((e) => + UninterpretedOption.fromPartial(e) + ) || []; + return message; + }, +}; + +function createBaseFieldDescriptorProto(): FieldDescriptorProto { + return { + name: "", + number: 0, + label: 1, + type: 1, + typeName: "", + extendee: "", + defaultValue: "", + oneofIndex: 0, + jsonName: "", + options: undefined, + proto3Optional: false, + }; +} + +export const FieldDescriptorProto = { + encode( + message: FieldDescriptorProto, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.number !== 0) { + writer.uint32(24).int32(message.number); + } + if (message.label !== 1) { + writer.uint32(32).int32(message.label); + } + if (message.type !== 1) { + writer.uint32(40).int32(message.type); + } + if (message.typeName !== "") { + writer.uint32(50).string(message.typeName); + } + if (message.extendee !== "") { + writer.uint32(18).string(message.extendee); + } + if (message.defaultValue !== "") { + writer.uint32(58).string(message.defaultValue); + } + if (message.oneofIndex !== 0) { + writer.uint32(72).int32(message.oneofIndex); + } + if (message.jsonName !== "") { + writer.uint32(82).string(message.jsonName); + } + if (message.options !== undefined) { + FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); + } + if (message.proto3Optional === true) { + writer.uint32(136).bool(message.proto3Optional); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): FieldDescriptorProto { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFieldDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 3: + message.number = reader.int32(); + break; + case 4: + message.label = reader.int32() as any; + break; + case 5: + message.type = reader.int32() as any; + break; + case 6: + message.typeName = reader.string(); + break; + case 2: + message.extendee = reader.string(); + break; + case 7: + message.defaultValue = reader.string(); + break; + case 9: + message.oneofIndex = reader.int32(); + break; + case 10: + message.jsonName = reader.string(); + break; + case 8: + message.options = FieldOptions.decode(reader, reader.uint32()); + break; + case 17: + message.proto3Optional = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FieldDescriptorProto { + return { + name: isSet(object.name) ? String(object.name) : "", + number: isSet(object.number) ? Number(object.number) : 0, + label: isSet(object.label) + ? fieldDescriptorProto_LabelFromJSON(object.label) + : 1, + type: isSet(object.type) + ? fieldDescriptorProto_TypeFromJSON(object.type) + : 1, + typeName: isSet(object.typeName) ? String(object.typeName) : "", + extendee: isSet(object.extendee) ? String(object.extendee) : "", + defaultValue: isSet(object.defaultValue) + ? String(object.defaultValue) + : "", + oneofIndex: isSet(object.oneofIndex) ? Number(object.oneofIndex) : 0, + jsonName: isSet(object.jsonName) ? String(object.jsonName) : "", + options: isSet(object.options) + ? FieldOptions.fromJSON(object.options) + : undefined, + proto3Optional: isSet(object.proto3Optional) + ? Boolean(object.proto3Optional) + : false, + }; + }, + + toJSON(message: FieldDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.number !== undefined && (obj.number = Math.round(message.number)); + message.label !== undefined && + (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); + message.type !== undefined && + (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); + message.typeName !== undefined && (obj.typeName = message.typeName); + message.extendee !== undefined && (obj.extendee = message.extendee); + message.defaultValue !== undefined && + (obj.defaultValue = message.defaultValue); + message.oneofIndex !== undefined && + (obj.oneofIndex = Math.round(message.oneofIndex)); + message.jsonName !== undefined && (obj.jsonName = message.jsonName); + message.options !== undefined && + (obj.options = message.options + ? FieldOptions.toJSON(message.options) + : undefined); + message.proto3Optional !== undefined && + (obj.proto3Optional = message.proto3Optional); + return obj; + }, + + fromPartial, I>>( + object: I + ): FieldDescriptorProto { + const message = createBaseFieldDescriptorProto(); + message.name = object.name ?? ""; + message.number = object.number ?? 0; + message.label = object.label ?? 1; + message.type = object.type ?? 1; + message.typeName = object.typeName ?? ""; + message.extendee = object.extendee ?? ""; + message.defaultValue = object.defaultValue ?? ""; + message.oneofIndex = object.oneofIndex ?? 0; + message.jsonName = object.jsonName ?? ""; + message.options = + object.options !== undefined && object.options !== null + ? FieldOptions.fromPartial(object.options) + : undefined; + message.proto3Optional = object.proto3Optional ?? false; + return message; + }, +}; + +function createBaseOneofDescriptorProto(): OneofDescriptorProto { + return { name: "", options: undefined }; +} + +export const OneofDescriptorProto = { + encode( + message: OneofDescriptorProto, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.options !== undefined) { + OneofOptions.encode(message.options, writer.uint32(18).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): OneofDescriptorProto { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOneofDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.options = OneofOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): OneofDescriptorProto { + return { + name: isSet(object.name) ? String(object.name) : "", + options: isSet(object.options) + ? OneofOptions.fromJSON(object.options) + : undefined, + }; + }, + + toJSON(message: OneofDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.options !== undefined && + (obj.options = message.options + ? OneofOptions.toJSON(message.options) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): OneofDescriptorProto { + const message = createBaseOneofDescriptorProto(); + message.name = object.name ?? ""; + message.options = + object.options !== undefined && object.options !== null + ? OneofOptions.fromPartial(object.options) + : undefined; + return message; + }, +}; + +function createBaseEnumDescriptorProto(): EnumDescriptorProto { + return { + name: "", + value: [], + options: undefined, + reservedRange: [], + reservedName: [], + }; +} + +export const EnumDescriptorProto = { + encode( + message: EnumDescriptorProto, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + for (const v of message.value) { + EnumValueDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.options !== undefined) { + EnumOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + } + for (const v of message.reservedRange) { + EnumDescriptorProto_EnumReservedRange.encode( + v!, + writer.uint32(34).fork() + ).ldelim(); + } + for (const v of message.reservedName) { + writer.uint32(42).string(v!); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): EnumDescriptorProto { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.value.push( + EnumValueDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 3: + message.options = EnumOptions.decode(reader, reader.uint32()); + break; + case 4: + message.reservedRange.push( + EnumDescriptorProto_EnumReservedRange.decode( + reader, + reader.uint32() + ) + ); + break; + case 5: + message.reservedName.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnumDescriptorProto { + return { + name: isSet(object.name) ? String(object.name) : "", + value: Array.isArray(object?.value) + ? object.value.map((e: any) => EnumValueDescriptorProto.fromJSON(e)) + : [], + options: isSet(object.options) + ? EnumOptions.fromJSON(object.options) + : undefined, + reservedRange: Array.isArray(object?.reservedRange) + ? object.reservedRange.map((e: any) => + EnumDescriptorProto_EnumReservedRange.fromJSON(e) + ) + : [], + reservedName: Array.isArray(object?.reservedName) + ? object.reservedName.map((e: any) => String(e)) + : [], + }; + }, + + toJSON(message: EnumDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + if (message.value) { + obj.value = message.value.map((e) => + e ? EnumValueDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.value = []; + } + message.options !== undefined && + (obj.options = message.options + ? EnumOptions.toJSON(message.options) + : undefined); + if (message.reservedRange) { + obj.reservedRange = message.reservedRange.map((e) => + e ? EnumDescriptorProto_EnumReservedRange.toJSON(e) : undefined + ); + } else { + obj.reservedRange = []; + } + if (message.reservedName) { + obj.reservedName = message.reservedName.map((e) => e); + } else { + obj.reservedName = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): EnumDescriptorProto { + const message = createBaseEnumDescriptorProto(); + message.name = object.name ?? ""; + message.value = + object.value?.map((e) => EnumValueDescriptorProto.fromPartial(e)) || []; + message.options = + object.options !== undefined && object.options !== null + ? EnumOptions.fromPartial(object.options) + : undefined; + message.reservedRange = + object.reservedRange?.map((e) => + EnumDescriptorProto_EnumReservedRange.fromPartial(e) + ) || []; + message.reservedName = object.reservedName?.map((e) => e) || []; + return message; + }, +}; + +function createBaseEnumDescriptorProto_EnumReservedRange(): EnumDescriptorProto_EnumReservedRange { + return { start: 0, end: 0 }; +} + +export const EnumDescriptorProto_EnumReservedRange = { + encode( + message: EnumDescriptorProto_EnumReservedRange, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.start !== 0) { + writer.uint32(8).int32(message.start); + } + if (message.end !== 0) { + writer.uint32(16).int32(message.end); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): EnumDescriptorProto_EnumReservedRange { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumDescriptorProto_EnumReservedRange(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnumDescriptorProto_EnumReservedRange { + return { + start: isSet(object.start) ? Number(object.start) : 0, + end: isSet(object.end) ? Number(object.end) : 0, + }; + }, + + toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown { + const obj: any = {}; + message.start !== undefined && (obj.start = Math.round(message.start)); + message.end !== undefined && (obj.end = Math.round(message.end)); + return obj; + }, + + fromPartial< + I extends Exact, I> + >(object: I): EnumDescriptorProto_EnumReservedRange { + const message = createBaseEnumDescriptorProto_EnumReservedRange(); + message.start = object.start ?? 0; + message.end = object.end ?? 0; + return message; + }, +}; + +function createBaseEnumValueDescriptorProto(): EnumValueDescriptorProto { + return { name: "", number: 0, options: undefined }; +} + +export const EnumValueDescriptorProto = { + encode( + message: EnumValueDescriptorProto, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.number !== 0) { + writer.uint32(16).int32(message.number); + } + if (message.options !== undefined) { + EnumValueOptions.encode( + message.options, + writer.uint32(26).fork() + ).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): EnumValueDescriptorProto { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumValueDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.number = reader.int32(); + break; + case 3: + message.options = EnumValueOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnumValueDescriptorProto { + return { + name: isSet(object.name) ? String(object.name) : "", + number: isSet(object.number) ? Number(object.number) : 0, + options: isSet(object.options) + ? EnumValueOptions.fromJSON(object.options) + : undefined, + }; + }, + + toJSON(message: EnumValueDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.number !== undefined && (obj.number = Math.round(message.number)); + message.options !== undefined && + (obj.options = message.options + ? EnumValueOptions.toJSON(message.options) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): EnumValueDescriptorProto { + const message = createBaseEnumValueDescriptorProto(); + message.name = object.name ?? ""; + message.number = object.number ?? 0; + message.options = + object.options !== undefined && object.options !== null + ? EnumValueOptions.fromPartial(object.options) + : undefined; + return message; + }, +}; + +function createBaseServiceDescriptorProto(): ServiceDescriptorProto { + return { name: "", method: [], options: undefined }; +} + +export const ServiceDescriptorProto = { + encode( + message: ServiceDescriptorProto, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + for (const v of message.method) { + MethodDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); + } + if (message.options !== undefined) { + ServiceOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): ServiceDescriptorProto { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServiceDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.method.push( + MethodDescriptorProto.decode(reader, reader.uint32()) + ); + break; + case 3: + message.options = ServiceOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ServiceDescriptorProto { + return { + name: isSet(object.name) ? String(object.name) : "", + method: Array.isArray(object?.method) + ? object.method.map((e: any) => MethodDescriptorProto.fromJSON(e)) + : [], + options: isSet(object.options) + ? ServiceOptions.fromJSON(object.options) + : undefined, + }; + }, + + toJSON(message: ServiceDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + if (message.method) { + obj.method = message.method.map((e) => + e ? MethodDescriptorProto.toJSON(e) : undefined + ); + } else { + obj.method = []; + } + message.options !== undefined && + (obj.options = message.options + ? ServiceOptions.toJSON(message.options) + : undefined); + return obj; + }, + + fromPartial, I>>( + object: I + ): ServiceDescriptorProto { + const message = createBaseServiceDescriptorProto(); + message.name = object.name ?? ""; + message.method = + object.method?.map((e) => MethodDescriptorProto.fromPartial(e)) || []; + message.options = + object.options !== undefined && object.options !== null + ? ServiceOptions.fromPartial(object.options) + : undefined; + return message; + }, +}; + +function createBaseMethodDescriptorProto(): MethodDescriptorProto { + return { + name: "", + inputType: "", + outputType: "", + options: undefined, + clientStreaming: false, + serverStreaming: false, + }; +} + +export const MethodDescriptorProto = { + encode( + message: MethodDescriptorProto, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.name !== "") { + writer.uint32(10).string(message.name); + } + if (message.inputType !== "") { + writer.uint32(18).string(message.inputType); + } + if (message.outputType !== "") { + writer.uint32(26).string(message.outputType); + } + if (message.options !== undefined) { + MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); + } + if (message.clientStreaming === true) { + writer.uint32(40).bool(message.clientStreaming); + } + if (message.serverStreaming === true) { + writer.uint32(48).bool(message.serverStreaming); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): MethodDescriptorProto { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMethodDescriptorProto(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.inputType = reader.string(); + break; + case 3: + message.outputType = reader.string(); + break; + case 4: + message.options = MethodOptions.decode(reader, reader.uint32()); + break; + case 5: + message.clientStreaming = reader.bool(); + break; + case 6: + message.serverStreaming = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MethodDescriptorProto { + return { + name: isSet(object.name) ? String(object.name) : "", + inputType: isSet(object.inputType) ? String(object.inputType) : "", + outputType: isSet(object.outputType) ? String(object.outputType) : "", + options: isSet(object.options) + ? MethodOptions.fromJSON(object.options) + : undefined, + clientStreaming: isSet(object.clientStreaming) + ? Boolean(object.clientStreaming) + : false, + serverStreaming: isSet(object.serverStreaming) + ? Boolean(object.serverStreaming) + : false, + }; + }, + + toJSON(message: MethodDescriptorProto): unknown { + const obj: any = {}; + message.name !== undefined && (obj.name = message.name); + message.inputType !== undefined && (obj.inputType = message.inputType); + message.outputType !== undefined && (obj.outputType = message.outputType); + message.options !== undefined && + (obj.options = message.options + ? MethodOptions.toJSON(message.options) + : undefined); + message.clientStreaming !== undefined && + (obj.clientStreaming = message.clientStreaming); + message.serverStreaming !== undefined && + (obj.serverStreaming = message.serverStreaming); + return obj; + }, + + fromPartial, I>>( + object: I + ): MethodDescriptorProto { + const message = createBaseMethodDescriptorProto(); + message.name = object.name ?? ""; + message.inputType = object.inputType ?? ""; + message.outputType = object.outputType ?? ""; + message.options = + object.options !== undefined && object.options !== null + ? MethodOptions.fromPartial(object.options) + : undefined; + message.clientStreaming = object.clientStreaming ?? false; + message.serverStreaming = object.serverStreaming ?? false; + return message; + }, +}; + +function createBaseFileOptions(): FileOptions { + return { + javaPackage: "", + javaOuterClassname: "", + javaMultipleFiles: false, + javaGenerateEqualsAndHash: false, + javaStringCheckUtf8: false, + optimizeFor: 1, + goPackage: "", + ccGenericServices: false, + javaGenericServices: false, + pyGenericServices: false, + phpGenericServices: false, + deprecated: false, + ccEnableArenas: false, + objcClassPrefix: "", + csharpNamespace: "", + swiftPrefix: "", + phpClassPrefix: "", + phpNamespace: "", + phpMetadataNamespace: "", + rubyPackage: "", + uninterpretedOption: [], + }; +} + +export const FileOptions = { + encode( + message: FileOptions, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.javaPackage !== "") { + writer.uint32(10).string(message.javaPackage); + } + if (message.javaOuterClassname !== "") { + writer.uint32(66).string(message.javaOuterClassname); + } + if (message.javaMultipleFiles === true) { + writer.uint32(80).bool(message.javaMultipleFiles); + } + if (message.javaGenerateEqualsAndHash === true) { + writer.uint32(160).bool(message.javaGenerateEqualsAndHash); + } + if (message.javaStringCheckUtf8 === true) { + writer.uint32(216).bool(message.javaStringCheckUtf8); + } + if (message.optimizeFor !== 1) { + writer.uint32(72).int32(message.optimizeFor); + } + if (message.goPackage !== "") { + writer.uint32(90).string(message.goPackage); + } + if (message.ccGenericServices === true) { + writer.uint32(128).bool(message.ccGenericServices); + } + if (message.javaGenericServices === true) { + writer.uint32(136).bool(message.javaGenericServices); + } + if (message.pyGenericServices === true) { + writer.uint32(144).bool(message.pyGenericServices); + } + if (message.phpGenericServices === true) { + writer.uint32(336).bool(message.phpGenericServices); + } + if (message.deprecated === true) { + writer.uint32(184).bool(message.deprecated); + } + if (message.ccEnableArenas === true) { + writer.uint32(248).bool(message.ccEnableArenas); + } + if (message.objcClassPrefix !== "") { + writer.uint32(290).string(message.objcClassPrefix); + } + if (message.csharpNamespace !== "") { + writer.uint32(298).string(message.csharpNamespace); + } + if (message.swiftPrefix !== "") { + writer.uint32(314).string(message.swiftPrefix); + } + if (message.phpClassPrefix !== "") { + writer.uint32(322).string(message.phpClassPrefix); + } + if (message.phpNamespace !== "") { + writer.uint32(330).string(message.phpNamespace); + } + if (message.phpMetadataNamespace !== "") { + writer.uint32(354).string(message.phpMetadataNamespace); + } + if (message.rubyPackage !== "") { + writer.uint32(362).string(message.rubyPackage); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): FileOptions { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFileOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.javaPackage = reader.string(); + break; + case 8: + message.javaOuterClassname = reader.string(); + break; + case 10: + message.javaMultipleFiles = reader.bool(); + break; + case 20: + message.javaGenerateEqualsAndHash = reader.bool(); + break; + case 27: + message.javaStringCheckUtf8 = reader.bool(); + break; + case 9: + message.optimizeFor = reader.int32() as any; + break; + case 11: + message.goPackage = reader.string(); + break; + case 16: + message.ccGenericServices = reader.bool(); + break; + case 17: + message.javaGenericServices = reader.bool(); + break; + case 18: + message.pyGenericServices = reader.bool(); + break; + case 42: + message.phpGenericServices = reader.bool(); + break; + case 23: + message.deprecated = reader.bool(); + break; + case 31: + message.ccEnableArenas = reader.bool(); + break; + case 36: + message.objcClassPrefix = reader.string(); + break; + case 37: + message.csharpNamespace = reader.string(); + break; + case 39: + message.swiftPrefix = reader.string(); + break; + case 40: + message.phpClassPrefix = reader.string(); + break; + case 41: + message.phpNamespace = reader.string(); + break; + case 44: + message.phpMetadataNamespace = reader.string(); + break; + case 45: + message.rubyPackage = reader.string(); + break; + case 999: + message.uninterpretedOption.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FileOptions { + return { + javaPackage: isSet(object.javaPackage) ? String(object.javaPackage) : "", + javaOuterClassname: isSet(object.javaOuterClassname) + ? String(object.javaOuterClassname) + : "", + javaMultipleFiles: isSet(object.javaMultipleFiles) + ? Boolean(object.javaMultipleFiles) + : false, + javaGenerateEqualsAndHash: isSet(object.javaGenerateEqualsAndHash) + ? Boolean(object.javaGenerateEqualsAndHash) + : false, + javaStringCheckUtf8: isSet(object.javaStringCheckUtf8) + ? Boolean(object.javaStringCheckUtf8) + : false, + optimizeFor: isSet(object.optimizeFor) + ? fileOptions_OptimizeModeFromJSON(object.optimizeFor) + : 1, + goPackage: isSet(object.goPackage) ? String(object.goPackage) : "", + ccGenericServices: isSet(object.ccGenericServices) + ? Boolean(object.ccGenericServices) + : false, + javaGenericServices: isSet(object.javaGenericServices) + ? Boolean(object.javaGenericServices) + : false, + pyGenericServices: isSet(object.pyGenericServices) + ? Boolean(object.pyGenericServices) + : false, + phpGenericServices: isSet(object.phpGenericServices) + ? Boolean(object.phpGenericServices) + : false, + deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, + ccEnableArenas: isSet(object.ccEnableArenas) + ? Boolean(object.ccEnableArenas) + : false, + objcClassPrefix: isSet(object.objcClassPrefix) + ? String(object.objcClassPrefix) + : "", + csharpNamespace: isSet(object.csharpNamespace) + ? String(object.csharpNamespace) + : "", + swiftPrefix: isSet(object.swiftPrefix) ? String(object.swiftPrefix) : "", + phpClassPrefix: isSet(object.phpClassPrefix) + ? String(object.phpClassPrefix) + : "", + phpNamespace: isSet(object.phpNamespace) + ? String(object.phpNamespace) + : "", + phpMetadataNamespace: isSet(object.phpMetadataNamespace) + ? String(object.phpMetadataNamespace) + : "", + rubyPackage: isSet(object.rubyPackage) ? String(object.rubyPackage) : "", + uninterpretedOption: Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => + UninterpretedOption.fromJSON(e) + ) + : [], + }; + }, + + toJSON(message: FileOptions): unknown { + const obj: any = {}; + message.javaPackage !== undefined && + (obj.javaPackage = message.javaPackage); + message.javaOuterClassname !== undefined && + (obj.javaOuterClassname = message.javaOuterClassname); + message.javaMultipleFiles !== undefined && + (obj.javaMultipleFiles = message.javaMultipleFiles); + message.javaGenerateEqualsAndHash !== undefined && + (obj.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash); + message.javaStringCheckUtf8 !== undefined && + (obj.javaStringCheckUtf8 = message.javaStringCheckUtf8); + message.optimizeFor !== undefined && + (obj.optimizeFor = fileOptions_OptimizeModeToJSON(message.optimizeFor)); + message.goPackage !== undefined && (obj.goPackage = message.goPackage); + message.ccGenericServices !== undefined && + (obj.ccGenericServices = message.ccGenericServices); + message.javaGenericServices !== undefined && + (obj.javaGenericServices = message.javaGenericServices); + message.pyGenericServices !== undefined && + (obj.pyGenericServices = message.pyGenericServices); + message.phpGenericServices !== undefined && + (obj.phpGenericServices = message.phpGenericServices); + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + message.ccEnableArenas !== undefined && + (obj.ccEnableArenas = message.ccEnableArenas); + message.objcClassPrefix !== undefined && + (obj.objcClassPrefix = message.objcClassPrefix); + message.csharpNamespace !== undefined && + (obj.csharpNamespace = message.csharpNamespace); + message.swiftPrefix !== undefined && + (obj.swiftPrefix = message.swiftPrefix); + message.phpClassPrefix !== undefined && + (obj.phpClassPrefix = message.phpClassPrefix); + message.phpNamespace !== undefined && + (obj.phpNamespace = message.phpNamespace); + message.phpMetadataNamespace !== undefined && + (obj.phpMetadataNamespace = message.phpMetadataNamespace); + message.rubyPackage !== undefined && + (obj.rubyPackage = message.rubyPackage); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpretedOption = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): FileOptions { + const message = createBaseFileOptions(); + message.javaPackage = object.javaPackage ?? ""; + message.javaOuterClassname = object.javaOuterClassname ?? ""; + message.javaMultipleFiles = object.javaMultipleFiles ?? false; + message.javaGenerateEqualsAndHash = + object.javaGenerateEqualsAndHash ?? false; + message.javaStringCheckUtf8 = object.javaStringCheckUtf8 ?? false; + message.optimizeFor = object.optimizeFor ?? 1; + message.goPackage = object.goPackage ?? ""; + message.ccGenericServices = object.ccGenericServices ?? false; + message.javaGenericServices = object.javaGenericServices ?? false; + message.pyGenericServices = object.pyGenericServices ?? false; + message.phpGenericServices = object.phpGenericServices ?? false; + message.deprecated = object.deprecated ?? false; + message.ccEnableArenas = object.ccEnableArenas ?? false; + message.objcClassPrefix = object.objcClassPrefix ?? ""; + message.csharpNamespace = object.csharpNamespace ?? ""; + message.swiftPrefix = object.swiftPrefix ?? ""; + message.phpClassPrefix = object.phpClassPrefix ?? ""; + message.phpNamespace = object.phpNamespace ?? ""; + message.phpMetadataNamespace = object.phpMetadataNamespace ?? ""; + message.rubyPackage = object.rubyPackage ?? ""; + message.uninterpretedOption = + object.uninterpretedOption?.map((e) => + UninterpretedOption.fromPartial(e) + ) || []; + return message; + }, +}; + +function createBaseMessageOptions(): MessageOptions { + return { + messageSetWireFormat: false, + noStandardDescriptorAccessor: false, + deprecated: false, + mapEntry: false, + uninterpretedOption: [], + }; +} + +export const MessageOptions = { + encode( + message: MessageOptions, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.messageSetWireFormat === true) { + writer.uint32(8).bool(message.messageSetWireFormat); + } + if (message.noStandardDescriptorAccessor === true) { + writer.uint32(16).bool(message.noStandardDescriptorAccessor); + } + if (message.deprecated === true) { + writer.uint32(24).bool(message.deprecated); + } + if (message.mapEntry === true) { + writer.uint32(56).bool(message.mapEntry); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MessageOptions { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMessageOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.messageSetWireFormat = reader.bool(); + break; + case 2: + message.noStandardDescriptorAccessor = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 7: + message.mapEntry = reader.bool(); + break; + case 999: + message.uninterpretedOption.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MessageOptions { + return { + messageSetWireFormat: isSet(object.messageSetWireFormat) + ? Boolean(object.messageSetWireFormat) + : false, + noStandardDescriptorAccessor: isSet(object.noStandardDescriptorAccessor) + ? Boolean(object.noStandardDescriptorAccessor) + : false, + deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, + mapEntry: isSet(object.mapEntry) ? Boolean(object.mapEntry) : false, + uninterpretedOption: Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => + UninterpretedOption.fromJSON(e) + ) + : [], + }; + }, + + toJSON(message: MessageOptions): unknown { + const obj: any = {}; + message.messageSetWireFormat !== undefined && + (obj.messageSetWireFormat = message.messageSetWireFormat); + message.noStandardDescriptorAccessor !== undefined && + (obj.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor); + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + message.mapEntry !== undefined && (obj.mapEntry = message.mapEntry); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpretedOption = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): MessageOptions { + const message = createBaseMessageOptions(); + message.messageSetWireFormat = object.messageSetWireFormat ?? false; + message.noStandardDescriptorAccessor = + object.noStandardDescriptorAccessor ?? false; + message.deprecated = object.deprecated ?? false; + message.mapEntry = object.mapEntry ?? false; + message.uninterpretedOption = + object.uninterpretedOption?.map((e) => + UninterpretedOption.fromPartial(e) + ) || []; + return message; + }, +}; + +function createBaseFieldOptions(): FieldOptions { + return { + ctype: 0, + packed: false, + jstype: 0, + lazy: false, + unverifiedLazy: false, + deprecated: false, + weak: false, + uninterpretedOption: [], + }; +} + +export const FieldOptions = { + encode( + message: FieldOptions, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.ctype !== 0) { + writer.uint32(8).int32(message.ctype); + } + if (message.packed === true) { + writer.uint32(16).bool(message.packed); + } + if (message.jstype !== 0) { + writer.uint32(48).int32(message.jstype); + } + if (message.lazy === true) { + writer.uint32(40).bool(message.lazy); + } + if (message.unverifiedLazy === true) { + writer.uint32(120).bool(message.unverifiedLazy); + } + if (message.deprecated === true) { + writer.uint32(24).bool(message.deprecated); + } + if (message.weak === true) { + writer.uint32(80).bool(message.weak); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): FieldOptions { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseFieldOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ctype = reader.int32() as any; + break; + case 2: + message.packed = reader.bool(); + break; + case 6: + message.jstype = reader.int32() as any; + break; + case 5: + message.lazy = reader.bool(); + break; + case 15: + message.unverifiedLazy = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 10: + message.weak = reader.bool(); + break; + case 999: + message.uninterpretedOption.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): FieldOptions { + return { + ctype: isSet(object.ctype) ? fieldOptions_CTypeFromJSON(object.ctype) : 0, + packed: isSet(object.packed) ? Boolean(object.packed) : false, + jstype: isSet(object.jstype) + ? fieldOptions_JSTypeFromJSON(object.jstype) + : 0, + lazy: isSet(object.lazy) ? Boolean(object.lazy) : false, + unverifiedLazy: isSet(object.unverifiedLazy) + ? Boolean(object.unverifiedLazy) + : false, + deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, + weak: isSet(object.weak) ? Boolean(object.weak) : false, + uninterpretedOption: Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => + UninterpretedOption.fromJSON(e) + ) + : [], + }; + }, + + toJSON(message: FieldOptions): unknown { + const obj: any = {}; + message.ctype !== undefined && + (obj.ctype = fieldOptions_CTypeToJSON(message.ctype)); + message.packed !== undefined && (obj.packed = message.packed); + message.jstype !== undefined && + (obj.jstype = fieldOptions_JSTypeToJSON(message.jstype)); + message.lazy !== undefined && (obj.lazy = message.lazy); + message.unverifiedLazy !== undefined && + (obj.unverifiedLazy = message.unverifiedLazy); + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + message.weak !== undefined && (obj.weak = message.weak); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpretedOption = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): FieldOptions { + const message = createBaseFieldOptions(); + message.ctype = object.ctype ?? 0; + message.packed = object.packed ?? false; + message.jstype = object.jstype ?? 0; + message.lazy = object.lazy ?? false; + message.unverifiedLazy = object.unverifiedLazy ?? false; + message.deprecated = object.deprecated ?? false; + message.weak = object.weak ?? false; + message.uninterpretedOption = + object.uninterpretedOption?.map((e) => + UninterpretedOption.fromPartial(e) + ) || []; + return message; + }, +}; + +function createBaseOneofOptions(): OneofOptions { + return { uninterpretedOption: [] }; +} + +export const OneofOptions = { + encode( + message: OneofOptions, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): OneofOptions { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseOneofOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + message.uninterpretedOption.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): OneofOptions { + return { + uninterpretedOption: Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => + UninterpretedOption.fromJSON(e) + ) + : [], + }; + }, + + toJSON(message: OneofOptions): unknown { + const obj: any = {}; + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpretedOption = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): OneofOptions { + const message = createBaseOneofOptions(); + message.uninterpretedOption = + object.uninterpretedOption?.map((e) => + UninterpretedOption.fromPartial(e) + ) || []; + return message; + }, +}; + +function createBaseEnumOptions(): EnumOptions { + return { allowAlias: false, deprecated: false, uninterpretedOption: [] }; +} + +export const EnumOptions = { + encode( + message: EnumOptions, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.allowAlias === true) { + writer.uint32(16).bool(message.allowAlias); + } + if (message.deprecated === true) { + writer.uint32(24).bool(message.deprecated); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): EnumOptions { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.allowAlias = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 999: + message.uninterpretedOption.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnumOptions { + return { + allowAlias: isSet(object.allowAlias) ? Boolean(object.allowAlias) : false, + deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, + uninterpretedOption: Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => + UninterpretedOption.fromJSON(e) + ) + : [], + }; + }, + + toJSON(message: EnumOptions): unknown { + const obj: any = {}; + message.allowAlias !== undefined && (obj.allowAlias = message.allowAlias); + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpretedOption = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): EnumOptions { + const message = createBaseEnumOptions(); + message.allowAlias = object.allowAlias ?? false; + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = + object.uninterpretedOption?.map((e) => + UninterpretedOption.fromPartial(e) + ) || []; + return message; + }, +}; + +function createBaseEnumValueOptions(): EnumValueOptions { + return { deprecated: false, uninterpretedOption: [] }; +} + +export const EnumValueOptions = { + encode( + message: EnumValueOptions, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.deprecated === true) { + writer.uint32(8).bool(message.deprecated); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): EnumValueOptions { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseEnumValueOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.deprecated = reader.bool(); + break; + case 999: + message.uninterpretedOption.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): EnumValueOptions { + return { + deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, + uninterpretedOption: Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => + UninterpretedOption.fromJSON(e) + ) + : [], + }; + }, + + toJSON(message: EnumValueOptions): unknown { + const obj: any = {}; + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpretedOption = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): EnumValueOptions { + const message = createBaseEnumValueOptions(); + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = + object.uninterpretedOption?.map((e) => + UninterpretedOption.fromPartial(e) + ) || []; + return message; + }, +}; + +function createBaseServiceOptions(): ServiceOptions { + return { deprecated: false, uninterpretedOption: [] }; +} + +export const ServiceOptions = { + encode( + message: ServiceOptions, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.deprecated === true) { + writer.uint32(264).bool(message.deprecated); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): ServiceOptions { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseServiceOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + message.deprecated = reader.bool(); + break; + case 999: + message.uninterpretedOption.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): ServiceOptions { + return { + deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, + uninterpretedOption: Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => + UninterpretedOption.fromJSON(e) + ) + : [], + }; + }, + + toJSON(message: ServiceOptions): unknown { + const obj: any = {}; + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpretedOption = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): ServiceOptions { + const message = createBaseServiceOptions(); + message.deprecated = object.deprecated ?? false; + message.uninterpretedOption = + object.uninterpretedOption?.map((e) => + UninterpretedOption.fromPartial(e) + ) || []; + return message; + }, +}; + +function createBaseMethodOptions(): MethodOptions { + return { deprecated: false, idempotencyLevel: 0, uninterpretedOption: [] }; +} + +export const MethodOptions = { + encode( + message: MethodOptions, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.deprecated === true) { + writer.uint32(264).bool(message.deprecated); + } + if (message.idempotencyLevel !== 0) { + writer.uint32(272).int32(message.idempotencyLevel); + } + for (const v of message.uninterpretedOption) { + UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): MethodOptions { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseMethodOptions(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + message.deprecated = reader.bool(); + break; + case 34: + message.idempotencyLevel = reader.int32() as any; + break; + case 999: + message.uninterpretedOption.push( + UninterpretedOption.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): MethodOptions { + return { + deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, + idempotencyLevel: isSet(object.idempotencyLevel) + ? methodOptions_IdempotencyLevelFromJSON(object.idempotencyLevel) + : 0, + uninterpretedOption: Array.isArray(object?.uninterpretedOption) + ? object.uninterpretedOption.map((e: any) => + UninterpretedOption.fromJSON(e) + ) + : [], + }; + }, + + toJSON(message: MethodOptions): unknown { + const obj: any = {}; + message.deprecated !== undefined && (obj.deprecated = message.deprecated); + message.idempotencyLevel !== undefined && + (obj.idempotencyLevel = methodOptions_IdempotencyLevelToJSON( + message.idempotencyLevel + )); + if (message.uninterpretedOption) { + obj.uninterpretedOption = message.uninterpretedOption.map((e) => + e ? UninterpretedOption.toJSON(e) : undefined + ); + } else { + obj.uninterpretedOption = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): MethodOptions { + const message = createBaseMethodOptions(); + message.deprecated = object.deprecated ?? false; + message.idempotencyLevel = object.idempotencyLevel ?? 0; + message.uninterpretedOption = + object.uninterpretedOption?.map((e) => + UninterpretedOption.fromPartial(e) + ) || []; + return message; + }, +}; + +function createBaseUninterpretedOption(): UninterpretedOption { + return { + name: [], + identifierValue: "", + positiveIntValue: Long.UZERO, + negativeIntValue: Long.ZERO, + doubleValue: 0, + stringValue: new Uint8Array(), + aggregateValue: "", + }; +} + +export const UninterpretedOption = { + encode( + message: UninterpretedOption, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.name) { + UninterpretedOption_NamePart.encode( + v!, + writer.uint32(18).fork() + ).ldelim(); + } + if (message.identifierValue !== "") { + writer.uint32(26).string(message.identifierValue); + } + if (!message.positiveIntValue.isZero()) { + writer.uint32(32).uint64(message.positiveIntValue); + } + if (!message.negativeIntValue.isZero()) { + writer.uint32(40).int64(message.negativeIntValue); + } + if (message.doubleValue !== 0) { + writer.uint32(49).double(message.doubleValue); + } + if (message.stringValue.length !== 0) { + writer.uint32(58).bytes(message.stringValue); + } + if (message.aggregateValue !== "") { + writer.uint32(66).string(message.aggregateValue); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): UninterpretedOption { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUninterpretedOption(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.name.push( + UninterpretedOption_NamePart.decode(reader, reader.uint32()) + ); + break; + case 3: + message.identifierValue = reader.string(); + break; + case 4: + message.positiveIntValue = reader.uint64() as Long; + break; + case 5: + message.negativeIntValue = reader.int64() as Long; + break; + case 6: + message.doubleValue = reader.double(); + break; + case 7: + message.stringValue = reader.bytes(); + break; + case 8: + message.aggregateValue = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UninterpretedOption { + return { + name: Array.isArray(object?.name) + ? object.name.map((e: any) => UninterpretedOption_NamePart.fromJSON(e)) + : [], + identifierValue: isSet(object.identifierValue) + ? String(object.identifierValue) + : "", + positiveIntValue: isSet(object.positiveIntValue) + ? Long.fromValue(object.positiveIntValue) + : Long.UZERO, + negativeIntValue: isSet(object.negativeIntValue) + ? Long.fromValue(object.negativeIntValue) + : Long.ZERO, + doubleValue: isSet(object.doubleValue) ? Number(object.doubleValue) : 0, + stringValue: isSet(object.stringValue) + ? bytesFromBase64(object.stringValue) + : new Uint8Array(), + aggregateValue: isSet(object.aggregateValue) + ? String(object.aggregateValue) + : "", + }; + }, + + toJSON(message: UninterpretedOption): unknown { + const obj: any = {}; + if (message.name) { + obj.name = message.name.map((e) => + e ? UninterpretedOption_NamePart.toJSON(e) : undefined + ); + } else { + obj.name = []; + } + message.identifierValue !== undefined && + (obj.identifierValue = message.identifierValue); + message.positiveIntValue !== undefined && + (obj.positiveIntValue = ( + message.positiveIntValue || Long.UZERO + ).toString()); + message.negativeIntValue !== undefined && + (obj.negativeIntValue = ( + message.negativeIntValue || Long.ZERO + ).toString()); + message.doubleValue !== undefined && + (obj.doubleValue = message.doubleValue); + message.stringValue !== undefined && + (obj.stringValue = base64FromBytes( + message.stringValue !== undefined + ? message.stringValue + : new Uint8Array() + )); + message.aggregateValue !== undefined && + (obj.aggregateValue = message.aggregateValue); + return obj; + }, + + fromPartial, I>>( + object: I + ): UninterpretedOption { + const message = createBaseUninterpretedOption(); + message.name = + object.name?.map((e) => UninterpretedOption_NamePart.fromPartial(e)) || + []; + message.identifierValue = object.identifierValue ?? ""; + message.positiveIntValue = + object.positiveIntValue !== undefined && object.positiveIntValue !== null + ? Long.fromValue(object.positiveIntValue) + : Long.UZERO; + message.negativeIntValue = + object.negativeIntValue !== undefined && object.negativeIntValue !== null + ? Long.fromValue(object.negativeIntValue) + : Long.ZERO; + message.doubleValue = object.doubleValue ?? 0; + message.stringValue = object.stringValue ?? new Uint8Array(); + message.aggregateValue = object.aggregateValue ?? ""; + return message; + }, +}; + +function createBaseUninterpretedOption_NamePart(): UninterpretedOption_NamePart { + return { namePart: "", isExtension: false }; +} + +export const UninterpretedOption_NamePart = { + encode( + message: UninterpretedOption_NamePart, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + if (message.namePart !== "") { + writer.uint32(10).string(message.namePart); + } + if (message.isExtension === true) { + writer.uint32(16).bool(message.isExtension); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): UninterpretedOption_NamePart { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseUninterpretedOption_NamePart(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.namePart = reader.string(); + break; + case 2: + message.isExtension = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): UninterpretedOption_NamePart { + return { + namePart: isSet(object.namePart) ? String(object.namePart) : "", + isExtension: isSet(object.isExtension) + ? Boolean(object.isExtension) + : false, + }; + }, + + toJSON(message: UninterpretedOption_NamePart): unknown { + const obj: any = {}; + message.namePart !== undefined && (obj.namePart = message.namePart); + message.isExtension !== undefined && + (obj.isExtension = message.isExtension); + return obj; + }, + + fromPartial, I>>( + object: I + ): UninterpretedOption_NamePart { + const message = createBaseUninterpretedOption_NamePart(); + message.namePart = object.namePart ?? ""; + message.isExtension = object.isExtension ?? false; + return message; + }, +}; + +function createBaseSourceCodeInfo(): SourceCodeInfo { + return { location: [] }; +} + +export const SourceCodeInfo = { + encode( + message: SourceCodeInfo, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.location) { + SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): SourceCodeInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSourceCodeInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.location.push( + SourceCodeInfo_Location.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SourceCodeInfo { + return { + location: Array.isArray(object?.location) + ? object.location.map((e: any) => SourceCodeInfo_Location.fromJSON(e)) + : [], + }; + }, + + toJSON(message: SourceCodeInfo): unknown { + const obj: any = {}; + if (message.location) { + obj.location = message.location.map((e) => + e ? SourceCodeInfo_Location.toJSON(e) : undefined + ); + } else { + obj.location = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): SourceCodeInfo { + const message = createBaseSourceCodeInfo(); + message.location = + object.location?.map((e) => SourceCodeInfo_Location.fromPartial(e)) || []; + return message; + }, +}; + +function createBaseSourceCodeInfo_Location(): SourceCodeInfo_Location { + return { + path: [], + span: [], + leadingComments: "", + trailingComments: "", + leadingDetachedComments: [], + }; +} + +export const SourceCodeInfo_Location = { + encode( + message: SourceCodeInfo_Location, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + writer.uint32(10).fork(); + for (const v of message.path) { + writer.int32(v); + } + writer.ldelim(); + writer.uint32(18).fork(); + for (const v of message.span) { + writer.int32(v); + } + writer.ldelim(); + if (message.leadingComments !== "") { + writer.uint32(26).string(message.leadingComments); + } + if (message.trailingComments !== "") { + writer.uint32(34).string(message.trailingComments); + } + for (const v of message.leadingDetachedComments) { + writer.uint32(50).string(v!); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): SourceCodeInfo_Location { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseSourceCodeInfo_Location(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.path.push(reader.int32()); + } + } else { + message.path.push(reader.int32()); + } + break; + case 2: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.span.push(reader.int32()); + } + } else { + message.span.push(reader.int32()); + } + break; + case 3: + message.leadingComments = reader.string(); + break; + case 4: + message.trailingComments = reader.string(); + break; + case 6: + message.leadingDetachedComments.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): SourceCodeInfo_Location { + return { + path: Array.isArray(object?.path) + ? object.path.map((e: any) => Number(e)) + : [], + span: Array.isArray(object?.span) + ? object.span.map((e: any) => Number(e)) + : [], + leadingComments: isSet(object.leadingComments) + ? String(object.leadingComments) + : "", + trailingComments: isSet(object.trailingComments) + ? String(object.trailingComments) + : "", + leadingDetachedComments: Array.isArray(object?.leadingDetachedComments) + ? object.leadingDetachedComments.map((e: any) => String(e)) + : [], + }; + }, + + toJSON(message: SourceCodeInfo_Location): unknown { + const obj: any = {}; + if (message.path) { + obj.path = message.path.map((e) => Math.round(e)); + } else { + obj.path = []; + } + if (message.span) { + obj.span = message.span.map((e) => Math.round(e)); + } else { + obj.span = []; + } + message.leadingComments !== undefined && + (obj.leadingComments = message.leadingComments); + message.trailingComments !== undefined && + (obj.trailingComments = message.trailingComments); + if (message.leadingDetachedComments) { + obj.leadingDetachedComments = message.leadingDetachedComments.map( + (e) => e + ); + } else { + obj.leadingDetachedComments = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): SourceCodeInfo_Location { + const message = createBaseSourceCodeInfo_Location(); + message.path = object.path?.map((e) => e) || []; + message.span = object.span?.map((e) => e) || []; + message.leadingComments = object.leadingComments ?? ""; + message.trailingComments = object.trailingComments ?? ""; + message.leadingDetachedComments = + object.leadingDetachedComments?.map((e) => e) || []; + return message; + }, +}; + +function createBaseGeneratedCodeInfo(): GeneratedCodeInfo { + return { annotation: [] }; +} + +export const GeneratedCodeInfo = { + encode( + message: GeneratedCodeInfo, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + for (const v of message.annotation) { + GeneratedCodeInfo_Annotation.encode( + v!, + writer.uint32(10).fork() + ).ldelim(); + } + return writer; + }, + + decode(input: _m0.Reader | Uint8Array, length?: number): GeneratedCodeInfo { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGeneratedCodeInfo(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.annotation.push( + GeneratedCodeInfo_Annotation.decode(reader, reader.uint32()) + ); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GeneratedCodeInfo { + return { + annotation: Array.isArray(object?.annotation) + ? object.annotation.map((e: any) => + GeneratedCodeInfo_Annotation.fromJSON(e) + ) + : [], + }; + }, + + toJSON(message: GeneratedCodeInfo): unknown { + const obj: any = {}; + if (message.annotation) { + obj.annotation = message.annotation.map((e) => + e ? GeneratedCodeInfo_Annotation.toJSON(e) : undefined + ); + } else { + obj.annotation = []; + } + return obj; + }, + + fromPartial, I>>( + object: I + ): GeneratedCodeInfo { + const message = createBaseGeneratedCodeInfo(); + message.annotation = + object.annotation?.map((e) => + GeneratedCodeInfo_Annotation.fromPartial(e) + ) || []; + return message; + }, +}; + +function createBaseGeneratedCodeInfo_Annotation(): GeneratedCodeInfo_Annotation { + return { path: [], sourceFile: "", begin: 0, end: 0 }; +} + +export const GeneratedCodeInfo_Annotation = { + encode( + message: GeneratedCodeInfo_Annotation, + writer: _m0.Writer = _m0.Writer.create() + ): _m0.Writer { + writer.uint32(10).fork(); + for (const v of message.path) { + writer.int32(v); + } + writer.ldelim(); + if (message.sourceFile !== "") { + writer.uint32(18).string(message.sourceFile); + } + if (message.begin !== 0) { + writer.uint32(24).int32(message.begin); + } + if (message.end !== 0) { + writer.uint32(32).int32(message.end); + } + return writer; + }, + + decode( + input: _m0.Reader | Uint8Array, + length?: number + ): GeneratedCodeInfo_Annotation { + const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); + let end = length === undefined ? reader.len : reader.pos + length; + const message = createBaseGeneratedCodeInfo_Annotation(); + while (reader.pos < end) { + const tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if ((tag & 7) === 2) { + const end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) { + message.path.push(reader.int32()); + } + } else { + message.path.push(reader.int32()); + } + break; + case 2: + message.sourceFile = reader.string(); + break; + case 3: + message.begin = reader.int32(); + break; + case 4: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }, + + fromJSON(object: any): GeneratedCodeInfo_Annotation { + return { + path: Array.isArray(object?.path) + ? object.path.map((e: any) => Number(e)) + : [], + sourceFile: isSet(object.sourceFile) ? String(object.sourceFile) : "", + begin: isSet(object.begin) ? Number(object.begin) : 0, + end: isSet(object.end) ? Number(object.end) : 0, + }; + }, + + toJSON(message: GeneratedCodeInfo_Annotation): unknown { + const obj: any = {}; + if (message.path) { + obj.path = message.path.map((e) => Math.round(e)); + } else { + obj.path = []; + } + message.sourceFile !== undefined && (obj.sourceFile = message.sourceFile); + message.begin !== undefined && (obj.begin = Math.round(message.begin)); + message.end !== undefined && (obj.end = Math.round(message.end)); + return obj; + }, + + fromPartial, I>>( + object: I + ): GeneratedCodeInfo_Annotation { + const message = createBaseGeneratedCodeInfo_Annotation(); + message.path = object.path?.map((e) => e) || []; + message.sourceFile = object.sourceFile ?? ""; + message.begin = object.begin ?? 0; + message.end = object.end ?? 0; + 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 extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; } diff --git a/src/proto/google/protobuf/duration.ts b/src/proto/google/protobuf/duration.ts index 0907867..922cc24 100644 --- a/src/proto/google/protobuf/duration.ts +++ b/src/proto/google/protobuf/duration.ts @@ -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>>(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 extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; } diff --git a/src/proto/google/protobuf/timestamp.ts b/src/proto/google/protobuf/timestamp.ts index 27bfd0c..66245b7 100644 --- a/src/proto/google/protobuf/timestamp.ts +++ b/src/proto/google/protobuf/timestamp.ts @@ -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>>( + 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 extends Builtin + ? T + : T extends Long + ? string | number | Long + : T extends Array + ? Array> + : T extends ReadonlyArray + ? ReadonlyArray> + : T extends {} + ? { [K in keyof T]?: DeepPartial } + : Partial; + +type KeysOfUnion = T extends T ? keyof T : never; +export type Exact = P extends Builtin + ? P + : P & { [K in keyof P]: Exact } & { + [K in Exclude>]: never; + }; + +if (_m0.util.Long !== Long) { + _m0.util.Long = Long as any; + _m0.configure(); +} + +function isSet(value: any): boolean { + return value !== null && value !== undefined; } diff --git a/src/proto/vulcanize/auction/v1beta1/genesis.ts b/src/proto/vulcanize/auction/v1beta1/genesis.ts deleted file mode 100644 index cdc73d4..0000000 --- a/src/proto/vulcanize/auction/v1beta1/genesis.ts +++ /dev/null @@ -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; - auctions?: ReturnType[]; - }): 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; - auctions?: ReturnType[]; - } = {}; - 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); - } - } -} diff --git a/src/proto/vulcanize/auction/v1beta1/query.ts b/src/proto/vulcanize/auction/v1beta1/query.ts deleted file mode 100644 index e87e058..0000000 --- a/src/proto/vulcanize/auction/v1beta1/query.ts +++ /dev/null @@ -1,1103 +0,0 @@ -// @ts-nocheck -/* eslint-disable */ -/** - * Generated by the protoc-gen-ts. DO NOT EDIT! - * compiler version: 4.25.1 - * source: vulcanize/auction/v1beta1/query.proto - * git: https://github.com/thesayyn/protoc-gen-ts */ -import * as dependency_1 from "./../../../gogoproto/gogo"; -import * as dependency_2 from "./../../../google/api/annotations"; -import * as dependency_3 from "./../../../cosmos/base/query/v1beta1/pagination"; -import * as dependency_4 from "./../../../cosmos/base/v1beta1/coin"; -import * as dependency_5 from "./types"; -import * as pb_1 from "google-protobuf"; -export namespace vulcanize.auction.v1beta1 { - export class AuctionsRequest extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - pagination?: dependency_3.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_3.cosmos.base.query.v1beta1.PageRequest, 1) as dependency_3.cosmos.base.query.v1beta1.PageRequest; - } - set pagination(value: dependency_3.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; - }): AuctionsRequest { - const message = new AuctionsRequest({}); - if (data.pagination != null) { - message.pagination = dependency_3.cosmos.base.query.v1beta1.PageRequest.fromObject(data.pagination); - } - return message; - } - toObject() { - const data: { - pagination?: ReturnType; - } = {}; - 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): AuctionsRequest { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new AuctionsRequest(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage(message.pagination, () => message.pagination = dependency_3.cosmos.base.query.v1beta1.PageRequest.deserialize(reader)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): AuctionsRequest { - return AuctionsRequest.deserialize(bytes); - } - } - export class AuctionsResponse extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - auctions?: dependency_5.vulcanize.auction.v1beta1.Auctions; - pagination?: dependency_3.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 ("auctions" in data && data.auctions != undefined) { - this.auctions = data.auctions; - } - if ("pagination" in data && data.pagination != undefined) { - this.pagination = data.pagination; - } - } - } - get auctions() { - return pb_1.Message.getWrapperField(this, dependency_5.vulcanize.auction.v1beta1.Auctions, 1) as dependency_5.vulcanize.auction.v1beta1.Auctions; - } - set auctions(value: dependency_5.vulcanize.auction.v1beta1.Auctions) { - pb_1.Message.setWrapperField(this, 1, value); - } - get has_auctions() { - return pb_1.Message.getField(this, 1) != null; - } - get pagination() { - return pb_1.Message.getWrapperField(this, dependency_3.cosmos.base.query.v1beta1.PageRequest, 2) as dependency_3.cosmos.base.query.v1beta1.PageRequest; - } - set pagination(value: dependency_3.cosmos.base.query.v1beta1.PageRequest) { - pb_1.Message.setWrapperField(this, 2, value); - } - get has_pagination() { - return pb_1.Message.getField(this, 2) != null; - } - static fromObject(data: { - auctions?: ReturnType; - pagination?: ReturnType; - }): AuctionsResponse { - const message = new AuctionsResponse({}); - if (data.auctions != null) { - message.auctions = dependency_5.vulcanize.auction.v1beta1.Auctions.fromObject(data.auctions); - } - if (data.pagination != null) { - message.pagination = dependency_3.cosmos.base.query.v1beta1.PageRequest.fromObject(data.pagination); - } - return message; - } - toObject() { - const data: { - auctions?: ReturnType; - pagination?: ReturnType; - } = {}; - if (this.auctions != null) { - data.auctions = this.auctions.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_auctions) - writer.writeMessage(1, this.auctions, () => this.auctions.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): AuctionsResponse { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new AuctionsResponse(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage(message.auctions, () => message.auctions = dependency_5.vulcanize.auction.v1beta1.Auctions.deserialize(reader)); - break; - case 2: - reader.readMessage(message.pagination, () => message.pagination = dependency_3.cosmos.base.query.v1beta1.PageRequest.deserialize(reader)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): AuctionsResponse { - return AuctionsResponse.deserialize(bytes); - } - } - export class AuctionRequest 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; - }): AuctionRequest { - const message = new AuctionRequest({}); - 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): AuctionRequest { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new AuctionRequest(); - 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): AuctionRequest { - return AuctionRequest.deserialize(bytes); - } - } - export class AuctionResponse extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - auction?: dependency_5.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_5.vulcanize.auction.v1beta1.Auction, 1) as dependency_5.vulcanize.auction.v1beta1.Auction; - } - set auction(value: dependency_5.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; - }): AuctionResponse { - const message = new AuctionResponse({}); - if (data.auction != null) { - message.auction = dependency_5.vulcanize.auction.v1beta1.Auction.fromObject(data.auction); - } - return message; - } - toObject() { - const data: { - auction?: ReturnType; - } = {}; - 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): AuctionResponse { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new AuctionResponse(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage(message.auction, () => message.auction = dependency_5.vulcanize.auction.v1beta1.Auction.deserialize(reader)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): AuctionResponse { - return AuctionResponse.deserialize(bytes); - } - } - export class BidRequest extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - auction_id?: string; - bidder?: 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 ("bidder" in data && data.bidder != undefined) { - this.bidder = data.bidder; - } - } - } - 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() { - return pb_1.Message.getFieldWithDefault(this, 2, "") as string; - } - set bidder(value: string) { - pb_1.Message.setField(this, 2, value); - } - static fromObject(data: { - auction_id?: string; - bidder?: string; - }): BidRequest { - const message = new BidRequest({}); - if (data.auction_id != null) { - message.auction_id = data.auction_id; - } - if (data.bidder != null) { - message.bidder = data.bidder; - } - return message; - } - toObject() { - const data: { - auction_id?: string; - bidder?: string; - } = {}; - if (this.auction_id != null) { - data.auction_id = this.auction_id; - } - if (this.bidder != null) { - data.bidder = this.bidder; - } - 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.length) - writer.writeString(2, this.bidder); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): BidRequest { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new BidRequest(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.auction_id = reader.readString(); - break; - case 2: - message.bidder = reader.readString(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): BidRequest { - return BidRequest.deserialize(bytes); - } - } - export class BidResponse extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - bid?: dependency_5.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_5.vulcanize.auction.v1beta1.Bid, 1) as dependency_5.vulcanize.auction.v1beta1.Bid; - } - set bid(value: dependency_5.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; - }): BidResponse { - const message = new BidResponse({}); - if (data.bid != null) { - message.bid = dependency_5.vulcanize.auction.v1beta1.Bid.fromObject(data.bid); - } - return message; - } - toObject() { - const data: { - bid?: ReturnType; - } = {}; - 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): BidResponse { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new BidResponse(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage(message.bid, () => message.bid = dependency_5.vulcanize.auction.v1beta1.Bid.deserialize(reader)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): BidResponse { - return BidResponse.deserialize(bytes); - } - } - export class BidsRequest extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - auction_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 ("auction_id" in data && data.auction_id != undefined) { - this.auction_id = data.auction_id; - } - } - } - get auction_id() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; - } - set auction_id(value: string) { - pb_1.Message.setField(this, 1, value); - } - static fromObject(data: { - auction_id?: string; - }): BidsRequest { - const message = new BidsRequest({}); - if (data.auction_id != null) { - message.auction_id = data.auction_id; - } - return message; - } - toObject() { - const data: { - auction_id?: string; - } = {}; - if (this.auction_id != null) { - data.auction_id = this.auction_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.auction_id.length) - writer.writeString(1, this.auction_id); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): BidsRequest { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new BidsRequest(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.auction_id = reader.readString(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): BidsRequest { - return BidsRequest.deserialize(bytes); - } - } - export class BidsResponse extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - bids?: dependency_5.vulcanize.auction.v1beta1.Bid[]; - }) { - 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 ("bids" in data && data.bids != undefined) { - this.bids = data.bids; - } - } - } - get bids() { - return pb_1.Message.getRepeatedWrapperField(this, dependency_5.vulcanize.auction.v1beta1.Bid, 1) as dependency_5.vulcanize.auction.v1beta1.Bid[]; - } - set bids(value: dependency_5.vulcanize.auction.v1beta1.Bid[]) { - pb_1.Message.setRepeatedWrapperField(this, 1, value); - } - static fromObject(data: { - bids?: ReturnType[]; - }): BidsResponse { - const message = new BidsResponse({}); - if (data.bids != null) { - message.bids = data.bids.map(item => dependency_5.vulcanize.auction.v1beta1.Bid.fromObject(item)); - } - return message; - } - toObject() { - const data: { - bids?: ReturnType[]; - } = {}; - if (this.bids != null) { - data.bids = this.bids.map((item: dependency_5.vulcanize.auction.v1beta1.Bid) => 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.bids.length) - writer.writeRepeatedMessage(1, this.bids, (item: dependency_5.vulcanize.auction.v1beta1.Bid) => item.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): BidsResponse { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new BidsResponse(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage(message.bids, () => pb_1.Message.addToRepeatedWrapperField(message, 1, dependency_5.vulcanize.auction.v1beta1.Bid.deserialize(reader), dependency_5.vulcanize.auction.v1beta1.Bid)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): BidsResponse { - return BidsResponse.deserialize(bytes); - } - } - export class AuctionsByBidderRequest extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - bidder_address?: 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 ("bidder_address" in data && data.bidder_address != undefined) { - this.bidder_address = data.bidder_address; - } - } - } - get bidder_address() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; - } - set bidder_address(value: string) { - pb_1.Message.setField(this, 1, value); - } - static fromObject(data: { - bidder_address?: string; - }): AuctionsByBidderRequest { - const message = new AuctionsByBidderRequest({}); - if (data.bidder_address != null) { - message.bidder_address = data.bidder_address; - } - return message; - } - toObject() { - const data: { - bidder_address?: string; - } = {}; - if (this.bidder_address != null) { - data.bidder_address = this.bidder_address; - } - 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.bidder_address.length) - writer.writeString(1, this.bidder_address); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AuctionsByBidderRequest { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new AuctionsByBidderRequest(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.bidder_address = reader.readString(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): AuctionsByBidderRequest { - return AuctionsByBidderRequest.deserialize(bytes); - } - } - export class AuctionsByBidderResponse extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - auctions?: dependency_5.vulcanize.auction.v1beta1.Auctions; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -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.getWrapperField(this, dependency_5.vulcanize.auction.v1beta1.Auctions, 1) as dependency_5.vulcanize.auction.v1beta1.Auctions; - } - set auctions(value: dependency_5.vulcanize.auction.v1beta1.Auctions) { - pb_1.Message.setWrapperField(this, 1, value); - } - get has_auctions() { - return pb_1.Message.getField(this, 1) != null; - } - static fromObject(data: { - auctions?: ReturnType; - }): AuctionsByBidderResponse { - const message = new AuctionsByBidderResponse({}); - if (data.auctions != null) { - message.auctions = dependency_5.vulcanize.auction.v1beta1.Auctions.fromObject(data.auctions); - } - return message; - } - toObject() { - const data: { - auctions?: ReturnType; - } = {}; - if (this.auctions != null) { - data.auctions = this.auctions.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_auctions) - writer.writeMessage(1, this.auctions, () => this.auctions.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AuctionsByBidderResponse { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new AuctionsByBidderResponse(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage(message.auctions, () => message.auctions = dependency_5.vulcanize.auction.v1beta1.Auctions.deserialize(reader)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): AuctionsByBidderResponse { - return AuctionsByBidderResponse.deserialize(bytes); - } - } - export class AuctionsByOwnerRequest extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - owner_address?: 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 ("owner_address" in data && data.owner_address != undefined) { - this.owner_address = data.owner_address; - } - } - } - get owner_address() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; - } - set owner_address(value: string) { - pb_1.Message.setField(this, 1, value); - } - static fromObject(data: { - owner_address?: string; - }): AuctionsByOwnerRequest { - const message = new AuctionsByOwnerRequest({}); - if (data.owner_address != null) { - message.owner_address = data.owner_address; - } - return message; - } - toObject() { - const data: { - owner_address?: string; - } = {}; - if (this.owner_address != null) { - data.owner_address = this.owner_address; - } - 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_address.length) - writer.writeString(1, this.owner_address); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AuctionsByOwnerRequest { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new AuctionsByOwnerRequest(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.owner_address = reader.readString(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): AuctionsByOwnerRequest { - return AuctionsByOwnerRequest.deserialize(bytes); - } - } - export class AuctionsByOwnerResponse extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - auctions?: dependency_5.vulcanize.auction.v1beta1.Auctions; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -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.getWrapperField(this, dependency_5.vulcanize.auction.v1beta1.Auctions, 1) as dependency_5.vulcanize.auction.v1beta1.Auctions; - } - set auctions(value: dependency_5.vulcanize.auction.v1beta1.Auctions) { - pb_1.Message.setWrapperField(this, 1, value); - } - get has_auctions() { - return pb_1.Message.getField(this, 1) != null; - } - static fromObject(data: { - auctions?: ReturnType; - }): AuctionsByOwnerResponse { - const message = new AuctionsByOwnerResponse({}); - if (data.auctions != null) { - message.auctions = dependency_5.vulcanize.auction.v1beta1.Auctions.fromObject(data.auctions); - } - return message; - } - toObject() { - const data: { - auctions?: ReturnType; - } = {}; - if (this.auctions != null) { - data.auctions = this.auctions.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_auctions) - writer.writeMessage(1, this.auctions, () => this.auctions.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AuctionsByOwnerResponse { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new AuctionsByOwnerResponse(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage(message.auctions, () => message.auctions = dependency_5.vulcanize.auction.v1beta1.Auctions.deserialize(reader)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): AuctionsByOwnerResponse { - return AuctionsByOwnerResponse.deserialize(bytes); - } - } - 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_5.vulcanize.auction.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_5.vulcanize.auction.v1beta1.Params, 1) as dependency_5.vulcanize.auction.v1beta1.Params; - } - set params(value: dependency_5.vulcanize.auction.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; - }): QueryParamsResponse { - const message = new QueryParamsResponse({}); - if (data.params != null) { - message.params = dependency_5.vulcanize.auction.v1beta1.Params.fromObject(data.params); - } - return message; - } - toObject() { - const data: { - params?: ReturnType; - } = {}; - 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_5.vulcanize.auction.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 BalanceRequest 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: {}): BalanceRequest { - const message = new BalanceRequest({}); - 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): BalanceRequest { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new BalanceRequest(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): BalanceRequest { - return BalanceRequest.deserialize(bytes); - } - } - export class BalanceResponse extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - balance?: dependency_4.cosmos.base.v1beta1.Coin[]; - }) { - 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 ("balance" in data && data.balance != undefined) { - this.balance = data.balance; - } - } - } - get balance() { - return pb_1.Message.getRepeatedWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 1) as dependency_4.cosmos.base.v1beta1.Coin[]; - } - set balance(value: dependency_4.cosmos.base.v1beta1.Coin[]) { - pb_1.Message.setRepeatedWrapperField(this, 1, value); - } - static fromObject(data: { - balance?: ReturnType[]; - }): BalanceResponse { - const message = new BalanceResponse({}); - if (data.balance != null) { - message.balance = data.balance.map(item => dependency_4.cosmos.base.v1beta1.Coin.fromObject(item)); - } - return message; - } - toObject() { - const data: { - balance?: ReturnType[]; - } = {}; - if (this.balance != null) { - data.balance = this.balance.map((item: dependency_4.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(1, this.balance, (item: dependency_4.cosmos.base.v1beta1.Coin) => item.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): BalanceResponse { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new BalanceResponse(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage(message.balance, () => pb_1.Message.addToRepeatedWrapperField(message, 1, dependency_4.cosmos.base.v1beta1.Coin.deserialize(reader), dependency_4.cosmos.base.v1beta1.Coin)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): BalanceResponse { - return BalanceResponse.deserialize(bytes); - } - } -} diff --git a/src/proto/vulcanize/auction/v1beta1/tx.ts b/src/proto/vulcanize/auction/v1beta1/tx.ts deleted file mode 100644 index d99edf2..0000000 --- a/src/proto/vulcanize/auction/v1beta1/tx.ts +++ /dev/null @@ -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; - reveals_duration?: ReturnType; - commit_fee?: ReturnType; - reveal_fee?: ReturnType; - minimum_bid?: ReturnType; - 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; - reveals_duration?: ReturnType; - commit_fee?: ReturnType; - reveal_fee?: ReturnType; - minimum_bid?: ReturnType; - 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; - }): 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; - } = {}; - 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; - }): 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; - } = {}; - 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; - }): 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; - } = {}; - 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); - } - } -} diff --git a/src/proto/vulcanize/auction/v1beta1/types.ts b/src/proto/vulcanize/auction/v1beta1/types.ts deleted file mode 100644 index 463f420..0000000 --- a/src/proto/vulcanize/auction/v1beta1/types.ts +++ /dev/null @@ -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; - reveals_duration?: ReturnType; - commit_fee?: ReturnType; - reveal_fee?: ReturnType; - minimum_bid?: ReturnType; - }): 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; - reveals_duration?: ReturnType; - commit_fee?: ReturnType; - reveal_fee?: ReturnType; - minimum_bid?: ReturnType; - } = {}; - 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; - commits_end_time?: ReturnType; - reveals_end_time?: ReturnType; - commit_fee?: ReturnType; - reveal_fee?: ReturnType; - minimum_bid?: ReturnType; - winner_address?: string; - winning_bid?: ReturnType; - winning_price?: ReturnType; - }): 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; - commits_end_time?: ReturnType; - reveals_end_time?: ReturnType; - commit_fee?: ReturnType; - reveal_fee?: ReturnType; - minimum_bid?: ReturnType; - winner_address?: string; - winning_bid?: ReturnType; - winning_price?: ReturnType; - } = {}; - 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[]; - }): 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[]; - } = {}; - 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; - commit_fee?: ReturnType; - reveal_time?: ReturnType; - reveal_fee?: ReturnType; - bid_amount?: ReturnType; - }): 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; - commit_fee?: ReturnType; - reveal_time?: ReturnType; - reveal_fee?: ReturnType; - bid_amount?: ReturnType; - } = {}; - 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); - } - } -} diff --git a/src/proto/vulcanize/bond/v1beta1/bond.ts b/src/proto/vulcanize/bond/v1beta1/bond.ts deleted file mode 100644 index 17d554e..0000000 --- a/src/proto/vulcanize/bond/v1beta1/bond.ts +++ /dev/null @@ -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; - }): 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; - } = {}; - 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[]; - }): 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[]; - } = {}; - 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); - } - } -} diff --git a/src/proto/vulcanize/bond/v1beta1/genesis.ts b/src/proto/vulcanize/bond/v1beta1/genesis.ts deleted file mode 100644 index 25c9246..0000000 --- a/src/proto/vulcanize/bond/v1beta1/genesis.ts +++ /dev/null @@ -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; - bonds?: ReturnType[]; - }): 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; - bonds?: ReturnType[]; - } = {}; - 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); - } - } -} diff --git a/src/proto/vulcanize/bond/v1beta1/query.ts b/src/proto/vulcanize/bond/v1beta1/query.ts deleted file mode 100644 index 9ad716d..0000000 --- a/src/proto/vulcanize/bond/v1beta1/query.ts +++ /dev/null @@ -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; - }): 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; - } = {}; - 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; - }): 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; - } = {}; - 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[]; - pagination?: ReturnType; - }): 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[]; - pagination?: ReturnType; - } = {}; - 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; - }): 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; - } = {}; - 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; - }): 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; - } = {}; - 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[]; - pagination?: ReturnType; - }): 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[]; - pagination?: ReturnType; - } = {}; - 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[]; - }): 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[]; - } = {}; - 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); - } - } -} diff --git a/src/proto/vulcanize/bond/v1beta1/tx.ts b/src/proto/vulcanize/bond/v1beta1/tx.ts deleted file mode 100644 index 28bd760..0000000 --- a/src/proto/vulcanize/bond/v1beta1/tx.ts +++ /dev/null @@ -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[]; - }): 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[]; - } = {}; - 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[]; - }): 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[]; - } = {}; - 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[]; - }): 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[]; - } = {}; - 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); - } - } -} diff --git a/src/proto/vulcanize/registry/v1beta1/genesis.ts b/src/proto/vulcanize/registry/v1beta1/genesis.ts deleted file mode 100644 index 561ccdc..0000000 --- a/src/proto/vulcanize/registry/v1beta1/genesis.ts +++ /dev/null @@ -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; - records?: ReturnType[]; - authorities?: ReturnType[]; - names?: ReturnType[]; - }): 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; - records?: ReturnType[]; - authorities?: ReturnType[]; - names?: ReturnType[]; - } = {}; - 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); - } - } -} diff --git a/src/proto/vulcanize/registry/v1beta1/query.ts b/src/proto/vulcanize/registry/v1beta1/query.ts deleted file mode 100644 index efa3ea9..0000000 --- a/src/proto/vulcanize/registry/v1beta1/query.ts +++ /dev/null @@ -1,2443 +0,0 @@ -// @ts-nocheck -/* eslint-disable */ -/** - * Generated by the protoc-gen-ts. DO NOT EDIT! - * compiler version: 4.25.1 - * source: vulcanize/registry/v1beta1/query.proto - * git: https://github.com/thesayyn/protoc-gen-ts */ -import * as dependency_1 from "./registry"; -import * as dependency_2 from "./../../../google/api/annotations"; -import * as dependency_3 from "./../../../cosmos/base/query/v1beta1/pagination"; -import * as dependency_4 from "./../../../gogoproto/gogo"; -import * as dependency_5 from "./../../../cosmos/base/v1beta1/coin"; -import * as pb_1 from "google-protobuf"; -export namespace vulcanize.registry.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_1.vulcanize.registry.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_1.vulcanize.registry.v1beta1.Params, 1) as dependency_1.vulcanize.registry.v1beta1.Params; - } - set params(value: dependency_1.vulcanize.registry.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; - }): QueryParamsResponse { - const message = new QueryParamsResponse({}); - if (data.params != null) { - message.params = dependency_1.vulcanize.registry.v1beta1.Params.fromObject(data.params); - } - return message; - } - toObject() { - const data: { - params?: ReturnType; - } = {}; - 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_1.vulcanize.registry.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 QueryListRecordsRequest extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - attributes?: QueryListRecordsRequest.KeyValueInput[]; - all?: boolean; - pagination?: dependency_3.cosmos.base.query.v1beta1.PageRequest; - }) { - 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 ("attributes" in data && data.attributes != undefined) { - this.attributes = data.attributes; - } - if ("all" in data && data.all != undefined) { - this.all = data.all; - } - if ("pagination" in data && data.pagination != undefined) { - this.pagination = data.pagination; - } - } - } - get attributes() { - return pb_1.Message.getRepeatedWrapperField(this, QueryListRecordsRequest.KeyValueInput, 1) as QueryListRecordsRequest.KeyValueInput[]; - } - set attributes(value: QueryListRecordsRequest.KeyValueInput[]) { - pb_1.Message.setRepeatedWrapperField(this, 1, value); - } - get all() { - return pb_1.Message.getFieldWithDefault(this, 2, false) as boolean; - } - set all(value: boolean) { - pb_1.Message.setField(this, 2, value); - } - get pagination() { - return pb_1.Message.getWrapperField(this, dependency_3.cosmos.base.query.v1beta1.PageRequest, 3) as dependency_3.cosmos.base.query.v1beta1.PageRequest; - } - set pagination(value: dependency_3.cosmos.base.query.v1beta1.PageRequest) { - pb_1.Message.setWrapperField(this, 3, value); - } - get has_pagination() { - return pb_1.Message.getField(this, 3) != null; - } - static fromObject(data: { - attributes?: ReturnType[]; - all?: boolean; - pagination?: ReturnType; - }): QueryListRecordsRequest { - const message = new QueryListRecordsRequest({}); - if (data.attributes != null) { - message.attributes = data.attributes.map(item => QueryListRecordsRequest.KeyValueInput.fromObject(item)); - } - if (data.all != null) { - message.all = data.all; - } - if (data.pagination != null) { - message.pagination = dependency_3.cosmos.base.query.v1beta1.PageRequest.fromObject(data.pagination); - } - return message; - } - toObject() { - const data: { - attributes?: ReturnType[]; - all?: boolean; - pagination?: ReturnType; - } = {}; - if (this.attributes != null) { - data.attributes = this.attributes.map((item: QueryListRecordsRequest.KeyValueInput) => item.toObject()); - } - if (this.all != null) { - data.all = this.all; - } - 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.attributes.length) - writer.writeRepeatedMessage(1, this.attributes, (item: QueryListRecordsRequest.KeyValueInput) => item.serialize(writer)); - if (this.all != false) - writer.writeBool(2, this.all); - if (this.has_pagination) - writer.writeMessage(3, this.pagination, () => this.pagination.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryListRecordsRequest { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryListRecordsRequest(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage(message.attributes, () => pb_1.Message.addToRepeatedWrapperField(message, 1, QueryListRecordsRequest.KeyValueInput.deserialize(reader), QueryListRecordsRequest.KeyValueInput)); - break; - case 2: - message.all = reader.readBool(); - break; - case 3: - reader.readMessage(message.pagination, () => message.pagination = dependency_3.cosmos.base.query.v1beta1.PageRequest.deserialize(reader)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): QueryListRecordsRequest { - return QueryListRecordsRequest.deserialize(bytes); - } - } - export namespace QueryListRecordsRequest { - export class LinkInput 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; - }): LinkInput { - const message = new LinkInput({}); - 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): LinkInput { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new LinkInput(); - 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): LinkInput { - return LinkInput.deserialize(bytes); - } - } - export class ArrayInput extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - values?: QueryListRecordsRequest.ValueInput[]; - }) { - 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 ("values" in data && data.values != undefined) { - this.values = data.values; - } - } - } - get values() { - return pb_1.Message.getRepeatedWrapperField(this, QueryListRecordsRequest.ValueInput, 1) as QueryListRecordsRequest.ValueInput[]; - } - set values(value: QueryListRecordsRequest.ValueInput[]) { - pb_1.Message.setRepeatedWrapperField(this, 1, value); - } - static fromObject(data: { - values?: ReturnType[]; - }): ArrayInput { - const message = new ArrayInput({}); - if (data.values != null) { - message.values = data.values.map(item => QueryListRecordsRequest.ValueInput.fromObject(item)); - } - return message; - } - toObject() { - const data: { - values?: ReturnType[]; - } = {}; - if (this.values != null) { - data.values = this.values.map((item: QueryListRecordsRequest.ValueInput) => 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.values.length) - writer.writeRepeatedMessage(1, this.values, (item: QueryListRecordsRequest.ValueInput) => item.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): ArrayInput { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new ArrayInput(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage(message.values, () => pb_1.Message.addToRepeatedWrapperField(message, 1, QueryListRecordsRequest.ValueInput.deserialize(reader), QueryListRecordsRequest.ValueInput)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): ArrayInput { - return ArrayInput.deserialize(bytes); - } - } - export class MapInput extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - values?: Map; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("values" in data && data.values != undefined) { - this.values = data.values; - } - } - if (!this.values) - this.values = new Map(); - } - get values() { - return pb_1.Message.getField(this, 1) as any as Map; - } - set values(value: Map) { - pb_1.Message.setField(this, 1, value as any); - } - static fromObject(data: { - values?: { - [key: string]: ReturnType; - }; - }): MapInput { - const message = new MapInput({}); - if (typeof data.values == "object") { - message.values = new Map(Object.entries(data.values).map(([key, value]) => [key, QueryListRecordsRequest.ValueInput.fromObject(value)])); - } - return message; - } - toObject() { - const data: { - values?: { - [key: string]: ReturnType; - }; - } = {}; - if (this.values != null) { - data.values = (Object.fromEntries)((Array.from)(this.values).map(([key, value]) => [key, value.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(); - for (const [key, value] of this.values) { - writer.writeMessage(1, this.values, () => { - writer.writeString(1, key); - writer.writeMessage(2, value, () => value.serialize(writer)); - }); - } - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MapInput { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MapInput(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage(message, () => pb_1.Map.deserializeBinary(message.values as any, reader, reader.readString, () => { - let value; - reader.readMessage(message, () => value = QueryListRecordsRequest.ValueInput.deserialize(reader)); - return value; - })); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): MapInput { - return MapInput.deserialize(bytes); - } - } - export class ValueInput extends pb_1.Message { - #one_of_decls: number[][] = [[1, 2, 3, 4, 5, 6, 7]]; - constructor(data?: any[] | ({} & (({ - string?: string; - int?: never; - float?: never; - boolean?: never; - link?: never; - array?: never; - map?: never; - } | { - string?: never; - int?: number; - float?: never; - boolean?: never; - link?: never; - array?: never; - map?: never; - } | { - string?: never; - int?: never; - float?: number; - boolean?: never; - link?: never; - array?: never; - map?: never; - } | { - string?: never; - int?: never; - float?: never; - boolean?: boolean; - link?: never; - array?: never; - map?: never; - } | { - string?: never; - int?: never; - float?: never; - boolean?: never; - link?: string; - array?: never; - map?: never; - } | { - string?: never; - int?: never; - float?: never; - boolean?: never; - link?: never; - array?: QueryListRecordsRequest.ArrayInput; - map?: never; - } | { - string?: never; - int?: never; - float?: never; - boolean?: never; - link?: never; - array?: never; - map?: QueryListRecordsRequest.MapInput; - })))) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("string" in data && data.string != undefined) { - this.string = data.string; - } - if ("int" in data && data.int != undefined) { - this.int = data.int; - } - if ("float" in data && data.float != undefined) { - this.float = data.float; - } - if ("boolean" in data && data.boolean != undefined) { - this.boolean = data.boolean; - } - if ("link" in data && data.link != undefined) { - this.link = data.link; - } - if ("array" in data && data.array != undefined) { - this.array = data.array; - } - if ("map" in data && data.map != undefined) { - this.map = data.map; - } - } - } - get string() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; - } - set string(value: string) { - pb_1.Message.setOneofField(this, 1, this.#one_of_decls[0], value); - } - get has_string() { - return pb_1.Message.getField(this, 1) != null; - } - get int() { - return pb_1.Message.getFieldWithDefault(this, 2, 0) as number; - } - set int(value: number) { - pb_1.Message.setOneofField(this, 2, this.#one_of_decls[0], value); - } - get has_int() { - return pb_1.Message.getField(this, 2) != null; - } - get float() { - return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; - } - set float(value: number) { - pb_1.Message.setOneofField(this, 3, this.#one_of_decls[0], value); - } - get has_float() { - return pb_1.Message.getField(this, 3) != null; - } - get boolean() { - return pb_1.Message.getFieldWithDefault(this, 4, false) as boolean; - } - set boolean(value: boolean) { - pb_1.Message.setOneofField(this, 4, this.#one_of_decls[0], value); - } - get has_boolean() { - return pb_1.Message.getField(this, 4) != null; - } - get link() { - return pb_1.Message.getFieldWithDefault(this, 5, "") as string; - } - set link(value: string) { - pb_1.Message.setOneofField(this, 5, this.#one_of_decls[0], value); - } - get has_link() { - return pb_1.Message.getField(this, 5) != null; - } - get array() { - return pb_1.Message.getWrapperField(this, QueryListRecordsRequest.ArrayInput, 6) as QueryListRecordsRequest.ArrayInput; - } - set array(value: QueryListRecordsRequest.ArrayInput) { - pb_1.Message.setOneofWrapperField(this, 6, this.#one_of_decls[0], value); - } - get has_array() { - return pb_1.Message.getField(this, 6) != null; - } - get map() { - return pb_1.Message.getWrapperField(this, QueryListRecordsRequest.MapInput, 7) as QueryListRecordsRequest.MapInput; - } - set map(value: QueryListRecordsRequest.MapInput) { - pb_1.Message.setOneofWrapperField(this, 7, this.#one_of_decls[0], value); - } - get has_map() { - return pb_1.Message.getField(this, 7) != null; - } - get value() { - const cases: { - [index: number]: "none" | "string" | "int" | "float" | "boolean" | "link" | "array" | "map"; - } = { - 0: "none", - 1: "string", - 2: "int", - 3: "float", - 4: "boolean", - 5: "link", - 6: "array", - 7: "map" - }; - return cases[pb_1.Message.computeOneofCase(this, [1, 2, 3, 4, 5, 6, 7])]; - } - static fromObject(data: { - string?: string; - int?: number; - float?: number; - boolean?: boolean; - link?: string; - array?: ReturnType; - map?: ReturnType; - }): ValueInput { - const message = new ValueInput({}); - if (data.string != null) { - message.string = data.string; - } - if (data.int != null) { - message.int = data.int; - } - if (data.float != null) { - message.float = data.float; - } - if (data.boolean != null) { - message.boolean = data.boolean; - } - if (data.link != null) { - message.link = data.link; - } - if (data.array != null) { - message.array = QueryListRecordsRequest.ArrayInput.fromObject(data.array); - } - if (data.map != null) { - message.map = QueryListRecordsRequest.MapInput.fromObject(data.map); - } - return message; - } - toObject() { - const data: { - string?: string; - int?: number; - float?: number; - boolean?: boolean; - link?: string; - array?: ReturnType; - map?: ReturnType; - } = {}; - if (this.string != null) { - data.string = this.string; - } - if (this.int != null) { - data.int = this.int; - } - if (this.float != null) { - data.float = this.float; - } - if (this.boolean != null) { - data.boolean = this.boolean; - } - if (this.link != null) { - data.link = this.link; - } - if (this.array != null) { - data.array = this.array.toObject(); - } - if (this.map != null) { - data.map = this.map.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_string) - writer.writeString(1, this.string); - if (this.has_int) - writer.writeInt64(2, this.int); - if (this.has_float) - writer.writeDouble(3, this.float); - if (this.has_boolean) - writer.writeBool(4, this.boolean); - if (this.has_link) - writer.writeString(5, this.link); - if (this.has_array) - writer.writeMessage(6, this.array, () => this.array.serialize(writer)); - if (this.has_map) - writer.writeMessage(7, this.map, () => this.map.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): ValueInput { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new ValueInput(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.string = reader.readString(); - break; - case 2: - message.int = reader.readInt64(); - break; - case 3: - message.float = reader.readDouble(); - break; - case 4: - message.boolean = reader.readBool(); - break; - case 5: - message.link = reader.readString(); - break; - case 6: - reader.readMessage(message.array, () => message.array = QueryListRecordsRequest.ArrayInput.deserialize(reader)); - break; - case 7: - reader.readMessage(message.map, () => message.map = QueryListRecordsRequest.MapInput.deserialize(reader)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): ValueInput { - return ValueInput.deserialize(bytes); - } - } - export class KeyValueInput extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - key?: string; - value?: QueryListRecordsRequest.ValueInput; - }) { - 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 ("value" in data && data.value != undefined) { - this.value = data.value; - } - } - } - get key() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; - } - set key(value: string) { - pb_1.Message.setField(this, 1, value); - } - get value() { - return pb_1.Message.getWrapperField(this, QueryListRecordsRequest.ValueInput, 2) as QueryListRecordsRequest.ValueInput; - } - set value(value: QueryListRecordsRequest.ValueInput) { - pb_1.Message.setWrapperField(this, 2, value); - } - get has_value() { - return pb_1.Message.getField(this, 2) != null; - } - static fromObject(data: { - key?: string; - value?: ReturnType; - }): KeyValueInput { - const message = new KeyValueInput({}); - if (data.key != null) { - message.key = data.key; - } - if (data.value != null) { - message.value = QueryListRecordsRequest.ValueInput.fromObject(data.value); - } - return message; - } - toObject() { - const data: { - key?: string; - value?: ReturnType; - } = {}; - if (this.key != null) { - data.key = this.key; - } - if (this.value != null) { - data.value = this.value.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.key.length) - writer.writeString(1, this.key); - if (this.has_value) - writer.writeMessage(2, this.value, () => this.value.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): KeyValueInput { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new KeyValueInput(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.key = reader.readString(); - break; - case 2: - reader.readMessage(message.value, () => message.value = QueryListRecordsRequest.ValueInput.deserialize(reader)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): KeyValueInput { - return KeyValueInput.deserialize(bytes); - } - } - } - export class QueryListRecordsResponse extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - records?: dependency_1.vulcanize.registry.v1beta1.Record[]; - pagination?: dependency_3.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 ("records" in data && data.records != undefined) { - this.records = data.records; - } - if ("pagination" in data && data.pagination != undefined) { - this.pagination = data.pagination; - } - } - } - get records() { - return pb_1.Message.getRepeatedWrapperField(this, dependency_1.vulcanize.registry.v1beta1.Record, 1) as dependency_1.vulcanize.registry.v1beta1.Record[]; - } - set records(value: dependency_1.vulcanize.registry.v1beta1.Record[]) { - pb_1.Message.setRepeatedWrapperField(this, 1, value); - } - get pagination() { - return pb_1.Message.getWrapperField(this, dependency_3.cosmos.base.query.v1beta1.PageResponse, 2) as dependency_3.cosmos.base.query.v1beta1.PageResponse; - } - set pagination(value: dependency_3.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: { - records?: ReturnType[]; - pagination?: ReturnType; - }): QueryListRecordsResponse { - const message = new QueryListRecordsResponse({}); - if (data.records != null) { - message.records = data.records.map(item => dependency_1.vulcanize.registry.v1beta1.Record.fromObject(item)); - } - if (data.pagination != null) { - message.pagination = dependency_3.cosmos.base.query.v1beta1.PageResponse.fromObject(data.pagination); - } - return message; - } - toObject() { - const data: { - records?: ReturnType[]; - pagination?: ReturnType; - } = {}; - if (this.records != null) { - data.records = this.records.map((item: dependency_1.vulcanize.registry.v1beta1.Record) => 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.records.length) - writer.writeRepeatedMessage(1, this.records, (item: dependency_1.vulcanize.registry.v1beta1.Record) => 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): QueryListRecordsResponse { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryListRecordsResponse(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage(message.records, () => pb_1.Message.addToRepeatedWrapperField(message, 1, dependency_1.vulcanize.registry.v1beta1.Record.deserialize(reader), dependency_1.vulcanize.registry.v1beta1.Record)); - break; - case 2: - reader.readMessage(message.pagination, () => message.pagination = dependency_3.cosmos.base.query.v1beta1.PageResponse.deserialize(reader)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): QueryListRecordsResponse { - return QueryListRecordsResponse.deserialize(bytes); - } - } - export class QueryRecordByIDRequest 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; - }): QueryRecordByIDRequest { - const message = new QueryRecordByIDRequest({}); - 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): QueryRecordByIDRequest { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryRecordByIDRequest(); - 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): QueryRecordByIDRequest { - return QueryRecordByIDRequest.deserialize(bytes); - } - } - export class QueryRecordByIDResponse extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - record?: dependency_1.vulcanize.registry.v1beta1.Record; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("record" in data && data.record != undefined) { - this.record = data.record; - } - } - } - get record() { - return pb_1.Message.getWrapperField(this, dependency_1.vulcanize.registry.v1beta1.Record, 1) as dependency_1.vulcanize.registry.v1beta1.Record; - } - set record(value: dependency_1.vulcanize.registry.v1beta1.Record) { - pb_1.Message.setWrapperField(this, 1, value); - } - get has_record() { - return pb_1.Message.getField(this, 1) != null; - } - static fromObject(data: { - record?: ReturnType; - }): QueryRecordByIDResponse { - const message = new QueryRecordByIDResponse({}); - if (data.record != null) { - message.record = dependency_1.vulcanize.registry.v1beta1.Record.fromObject(data.record); - } - return message; - } - toObject() { - const data: { - record?: ReturnType; - } = {}; - if (this.record != null) { - data.record = this.record.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_record) - writer.writeMessage(1, this.record, () => this.record.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryRecordByIDResponse { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryRecordByIDResponse(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage(message.record, () => message.record = dependency_1.vulcanize.registry.v1beta1.Record.deserialize(reader)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): QueryRecordByIDResponse { - return QueryRecordByIDResponse.deserialize(bytes); - } - } - export class QueryRecordByBondIDRequest extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - id?: string; - pagination?: dependency_3.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 ("id" in data && data.id != undefined) { - this.id = data.id; - } - if ("pagination" in data && data.pagination != undefined) { - this.pagination = data.pagination; - } - } - } - get id() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; - } - set id(value: string) { - pb_1.Message.setField(this, 1, value); - } - get pagination() { - return pb_1.Message.getWrapperField(this, dependency_3.cosmos.base.query.v1beta1.PageRequest, 2) as dependency_3.cosmos.base.query.v1beta1.PageRequest; - } - set pagination(value: dependency_3.cosmos.base.query.v1beta1.PageRequest) { - pb_1.Message.setWrapperField(this, 2, value); - } - get has_pagination() { - return pb_1.Message.getField(this, 2) != null; - } - static fromObject(data: { - id?: string; - pagination?: ReturnType; - }): QueryRecordByBondIDRequest { - const message = new QueryRecordByBondIDRequest({}); - if (data.id != null) { - message.id = data.id; - } - if (data.pagination != null) { - message.pagination = dependency_3.cosmos.base.query.v1beta1.PageRequest.fromObject(data.pagination); - } - return message; - } - toObject() { - const data: { - id?: string; - pagination?: ReturnType; - } = {}; - if (this.id != null) { - data.id = this.id; - } - 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.id.length) - writer.writeString(1, this.id); - 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): QueryRecordByBondIDRequest { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryRecordByBondIDRequest(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.id = reader.readString(); - break; - case 2: - reader.readMessage(message.pagination, () => message.pagination = dependency_3.cosmos.base.query.v1beta1.PageRequest.deserialize(reader)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): QueryRecordByBondIDRequest { - return QueryRecordByBondIDRequest.deserialize(bytes); - } - } - export class QueryRecordByBondIDResponse extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - records?: dependency_1.vulcanize.registry.v1beta1.Record[]; - pagination?: dependency_3.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 ("records" in data && data.records != undefined) { - this.records = data.records; - } - if ("pagination" in data && data.pagination != undefined) { - this.pagination = data.pagination; - } - } - } - get records() { - return pb_1.Message.getRepeatedWrapperField(this, dependency_1.vulcanize.registry.v1beta1.Record, 1) as dependency_1.vulcanize.registry.v1beta1.Record[]; - } - set records(value: dependency_1.vulcanize.registry.v1beta1.Record[]) { - pb_1.Message.setRepeatedWrapperField(this, 1, value); - } - get pagination() { - return pb_1.Message.getWrapperField(this, dependency_3.cosmos.base.query.v1beta1.PageResponse, 2) as dependency_3.cosmos.base.query.v1beta1.PageResponse; - } - set pagination(value: dependency_3.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: { - records?: ReturnType[]; - pagination?: ReturnType; - }): QueryRecordByBondIDResponse { - const message = new QueryRecordByBondIDResponse({}); - if (data.records != null) { - message.records = data.records.map(item => dependency_1.vulcanize.registry.v1beta1.Record.fromObject(item)); - } - if (data.pagination != null) { - message.pagination = dependency_3.cosmos.base.query.v1beta1.PageResponse.fromObject(data.pagination); - } - return message; - } - toObject() { - const data: { - records?: ReturnType[]; - pagination?: ReturnType; - } = {}; - if (this.records != null) { - data.records = this.records.map((item: dependency_1.vulcanize.registry.v1beta1.Record) => 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.records.length) - writer.writeRepeatedMessage(1, this.records, (item: dependency_1.vulcanize.registry.v1beta1.Record) => 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): QueryRecordByBondIDResponse { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryRecordByBondIDResponse(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage(message.records, () => pb_1.Message.addToRepeatedWrapperField(message, 1, dependency_1.vulcanize.registry.v1beta1.Record.deserialize(reader), dependency_1.vulcanize.registry.v1beta1.Record)); - break; - case 2: - reader.readMessage(message.pagination, () => message.pagination = dependency_3.cosmos.base.query.v1beta1.PageResponse.deserialize(reader)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): QueryRecordByBondIDResponse { - return QueryRecordByBondIDResponse.deserialize(bytes); - } - } - export class GetRegistryModuleBalanceRequest 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: {}): GetRegistryModuleBalanceRequest { - const message = new GetRegistryModuleBalanceRequest({}); - 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): GetRegistryModuleBalanceRequest { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GetRegistryModuleBalanceRequest(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): GetRegistryModuleBalanceRequest { - return GetRegistryModuleBalanceRequest.deserialize(bytes); - } - } - export class GetRegistryModuleBalanceResponse extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - balances?: AccountBalance[]; - }) { - 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 ("balances" in data && data.balances != undefined) { - this.balances = data.balances; - } - } - } - get balances() { - return pb_1.Message.getRepeatedWrapperField(this, AccountBalance, 1) as AccountBalance[]; - } - set balances(value: AccountBalance[]) { - pb_1.Message.setRepeatedWrapperField(this, 1, value); - } - static fromObject(data: { - balances?: ReturnType[]; - }): GetRegistryModuleBalanceResponse { - const message = new GetRegistryModuleBalanceResponse({}); - if (data.balances != null) { - message.balances = data.balances.map(item => AccountBalance.fromObject(item)); - } - return message; - } - toObject() { - const data: { - balances?: ReturnType[]; - } = {}; - if (this.balances != null) { - data.balances = this.balances.map((item: AccountBalance) => 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.balances.length) - writer.writeRepeatedMessage(1, this.balances, (item: AccountBalance) => item.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): GetRegistryModuleBalanceResponse { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new GetRegistryModuleBalanceResponse(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage(message.balances, () => pb_1.Message.addToRepeatedWrapperField(message, 1, AccountBalance.deserialize(reader), AccountBalance)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): GetRegistryModuleBalanceResponse { - return GetRegistryModuleBalanceResponse.deserialize(bytes); - } - } - export class AccountBalance extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - account_name?: string; - balance?: dependency_5.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 ("account_name" in data && data.account_name != undefined) { - this.account_name = data.account_name; - } - if ("balance" in data && data.balance != undefined) { - this.balance = data.balance; - } - } - } - get account_name() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; - } - set account_name(value: string) { - pb_1.Message.setField(this, 1, value); - } - get balance() { - return pb_1.Message.getRepeatedWrapperField(this, dependency_5.cosmos.base.v1beta1.Coin, 3) as dependency_5.cosmos.base.v1beta1.Coin[]; - } - set balance(value: dependency_5.cosmos.base.v1beta1.Coin[]) { - pb_1.Message.setRepeatedWrapperField(this, 3, value); - } - static fromObject(data: { - account_name?: string; - balance?: ReturnType[]; - }): AccountBalance { - const message = new AccountBalance({}); - if (data.account_name != null) { - message.account_name = data.account_name; - } - if (data.balance != null) { - message.balance = data.balance.map(item => dependency_5.cosmos.base.v1beta1.Coin.fromObject(item)); - } - return message; - } - toObject() { - const data: { - account_name?: string; - balance?: ReturnType[]; - } = {}; - if (this.account_name != null) { - data.account_name = this.account_name; - } - 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.account_name.length) - writer.writeString(1, this.account_name); - if (this.balance.length) - writer.writeRepeatedMessage(3, this.balance, (item: dependency_5.cosmos.base.v1beta1.Coin) => item.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AccountBalance { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new AccountBalance(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.account_name = reader.readString(); - break; - case 3: - reader.readMessage(message.balance, () => pb_1.Message.addToRepeatedWrapperField(message, 3, 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): AccountBalance { - return AccountBalance.deserialize(bytes); - } - } - export class QueryListNameRecordsRequest extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - pagination?: dependency_3.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_3.cosmos.base.query.v1beta1.PageRequest, 1) as dependency_3.cosmos.base.query.v1beta1.PageRequest; - } - set pagination(value: dependency_3.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; - }): QueryListNameRecordsRequest { - const message = new QueryListNameRecordsRequest({}); - if (data.pagination != null) { - message.pagination = dependency_3.cosmos.base.query.v1beta1.PageRequest.fromObject(data.pagination); - } - return message; - } - toObject() { - const data: { - pagination?: ReturnType; - } = {}; - 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): QueryListNameRecordsRequest { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryListNameRecordsRequest(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage(message.pagination, () => message.pagination = dependency_3.cosmos.base.query.v1beta1.PageRequest.deserialize(reader)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): QueryListNameRecordsRequest { - return QueryListNameRecordsRequest.deserialize(bytes); - } - } - export class QueryListNameRecordsResponse extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - names?: dependency_1.vulcanize.registry.v1beta1.NameEntry[]; - pagination?: dependency_3.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 ("names" in data && data.names != undefined) { - this.names = data.names; - } - if ("pagination" in data && data.pagination != undefined) { - this.pagination = data.pagination; - } - } - } - get names() { - return pb_1.Message.getRepeatedWrapperField(this, dependency_1.vulcanize.registry.v1beta1.NameEntry, 1) as dependency_1.vulcanize.registry.v1beta1.NameEntry[]; - } - set names(value: dependency_1.vulcanize.registry.v1beta1.NameEntry[]) { - pb_1.Message.setRepeatedWrapperField(this, 1, value); - } - get pagination() { - return pb_1.Message.getWrapperField(this, dependency_3.cosmos.base.query.v1beta1.PageResponse, 2) as dependency_3.cosmos.base.query.v1beta1.PageResponse; - } - set pagination(value: dependency_3.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: { - names?: ReturnType[]; - pagination?: ReturnType; - }): QueryListNameRecordsResponse { - const message = new QueryListNameRecordsResponse({}); - if (data.names != null) { - message.names = data.names.map(item => dependency_1.vulcanize.registry.v1beta1.NameEntry.fromObject(item)); - } - if (data.pagination != null) { - message.pagination = dependency_3.cosmos.base.query.v1beta1.PageResponse.fromObject(data.pagination); - } - return message; - } - toObject() { - const data: { - names?: ReturnType[]; - pagination?: ReturnType; - } = {}; - if (this.names != null) { - data.names = this.names.map((item: dependency_1.vulcanize.registry.v1beta1.NameEntry) => 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.names.length) - writer.writeRepeatedMessage(1, this.names, (item: dependency_1.vulcanize.registry.v1beta1.NameEntry) => 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): QueryListNameRecordsResponse { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryListNameRecordsResponse(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage(message.names, () => pb_1.Message.addToRepeatedWrapperField(message, 1, dependency_1.vulcanize.registry.v1beta1.NameEntry.deserialize(reader), dependency_1.vulcanize.registry.v1beta1.NameEntry)); - break; - case 2: - reader.readMessage(message.pagination, () => message.pagination = dependency_3.cosmos.base.query.v1beta1.PageResponse.deserialize(reader)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): QueryListNameRecordsResponse { - return QueryListNameRecordsResponse.deserialize(bytes); - } - } - export class QueryWhoisRequest extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - name?: 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 ("name" in data && data.name != undefined) { - this.name = data.name; - } - } - } - get name() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; - } - set name(value: string) { - pb_1.Message.setField(this, 1, value); - } - static fromObject(data: { - name?: string; - }): QueryWhoisRequest { - const message = new QueryWhoisRequest({}); - if (data.name != null) { - message.name = data.name; - } - return message; - } - toObject() { - const data: { - name?: string; - } = {}; - if (this.name != null) { - data.name = this.name; - } - 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.name.length) - writer.writeString(1, this.name); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryWhoisRequest { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryWhoisRequest(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.name = reader.readString(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): QueryWhoisRequest { - return QueryWhoisRequest.deserialize(bytes); - } - } - export class QueryWhoisResponse extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - name_authority?: dependency_1.vulcanize.registry.v1beta1.NameAuthority; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("name_authority" in data && data.name_authority != undefined) { - this.name_authority = data.name_authority; - } - } - } - get name_authority() { - return pb_1.Message.getWrapperField(this, dependency_1.vulcanize.registry.v1beta1.NameAuthority, 1) as dependency_1.vulcanize.registry.v1beta1.NameAuthority; - } - set name_authority(value: dependency_1.vulcanize.registry.v1beta1.NameAuthority) { - pb_1.Message.setWrapperField(this, 1, value); - } - get has_name_authority() { - return pb_1.Message.getField(this, 1) != null; - } - static fromObject(data: { - name_authority?: ReturnType; - }): QueryWhoisResponse { - const message = new QueryWhoisResponse({}); - if (data.name_authority != null) { - message.name_authority = dependency_1.vulcanize.registry.v1beta1.NameAuthority.fromObject(data.name_authority); - } - return message; - } - toObject() { - const data: { - name_authority?: ReturnType; - } = {}; - if (this.name_authority != null) { - data.name_authority = this.name_authority.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_name_authority) - writer.writeMessage(1, this.name_authority, () => this.name_authority.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryWhoisResponse { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryWhoisResponse(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage(message.name_authority, () => message.name_authority = dependency_1.vulcanize.registry.v1beta1.NameAuthority.deserialize(reader)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): QueryWhoisResponse { - return QueryWhoisResponse.deserialize(bytes); - } - } - export class QueryLookupCrn extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - crn?: 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 ("crn" in data && data.crn != undefined) { - this.crn = data.crn; - } - } - } - get crn() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; - } - set crn(value: string) { - pb_1.Message.setField(this, 1, value); - } - static fromObject(data: { - crn?: string; - }): QueryLookupCrn { - const message = new QueryLookupCrn({}); - if (data.crn != null) { - message.crn = data.crn; - } - return message; - } - toObject() { - const data: { - crn?: string; - } = {}; - if (this.crn != null) { - data.crn = this.crn; - } - 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.crn.length) - writer.writeString(1, this.crn); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryLookupCrn { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryLookupCrn(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.crn = reader.readString(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): QueryLookupCrn { - return QueryLookupCrn.deserialize(bytes); - } - } - export class QueryLookupCrnResponse extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - name?: dependency_1.vulcanize.registry.v1beta1.NameRecord; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("name" in data && data.name != undefined) { - this.name = data.name; - } - } - } - get name() { - return pb_1.Message.getWrapperField(this, dependency_1.vulcanize.registry.v1beta1.NameRecord, 1) as dependency_1.vulcanize.registry.v1beta1.NameRecord; - } - set name(value: dependency_1.vulcanize.registry.v1beta1.NameRecord) { - pb_1.Message.setWrapperField(this, 1, value); - } - get has_name() { - return pb_1.Message.getField(this, 1) != null; - } - static fromObject(data: { - name?: ReturnType; - }): QueryLookupCrnResponse { - const message = new QueryLookupCrnResponse({}); - if (data.name != null) { - message.name = dependency_1.vulcanize.registry.v1beta1.NameRecord.fromObject(data.name); - } - return message; - } - toObject() { - const data: { - name?: ReturnType; - } = {}; - if (this.name != null) { - data.name = this.name.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_name) - writer.writeMessage(1, this.name, () => this.name.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryLookupCrnResponse { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryLookupCrnResponse(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage(message.name, () => message.name = dependency_1.vulcanize.registry.v1beta1.NameRecord.deserialize(reader)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): QueryLookupCrnResponse { - return QueryLookupCrnResponse.deserialize(bytes); - } - } - export class QueryResolveCrn extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - crn?: 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 ("crn" in data && data.crn != undefined) { - this.crn = data.crn; - } - } - } - get crn() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; - } - set crn(value: string) { - pb_1.Message.setField(this, 1, value); - } - static fromObject(data: { - crn?: string; - }): QueryResolveCrn { - const message = new QueryResolveCrn({}); - if (data.crn != null) { - message.crn = data.crn; - } - return message; - } - toObject() { - const data: { - crn?: string; - } = {}; - if (this.crn != null) { - data.crn = this.crn; - } - 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.crn.length) - writer.writeString(1, this.crn); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryResolveCrn { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryResolveCrn(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.crn = reader.readString(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): QueryResolveCrn { - return QueryResolveCrn.deserialize(bytes); - } - } - export class QueryResolveCrnResponse extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - record?: dependency_1.vulcanize.registry.v1beta1.Record; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("record" in data && data.record != undefined) { - this.record = data.record; - } - } - } - get record() { - return pb_1.Message.getWrapperField(this, dependency_1.vulcanize.registry.v1beta1.Record, 1) as dependency_1.vulcanize.registry.v1beta1.Record; - } - set record(value: dependency_1.vulcanize.registry.v1beta1.Record) { - pb_1.Message.setWrapperField(this, 1, value); - } - get has_record() { - return pb_1.Message.getField(this, 1) != null; - } - static fromObject(data: { - record?: ReturnType; - }): QueryResolveCrnResponse { - const message = new QueryResolveCrnResponse({}); - if (data.record != null) { - message.record = dependency_1.vulcanize.registry.v1beta1.Record.fromObject(data.record); - } - return message; - } - toObject() { - const data: { - record?: ReturnType; - } = {}; - if (this.record != null) { - data.record = this.record.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_record) - writer.writeMessage(1, this.record, () => this.record.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): QueryResolveCrnResponse { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryResolveCrnResponse(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage(message.record, () => message.record = dependency_1.vulcanize.registry.v1beta1.Record.deserialize(reader)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): QueryResolveCrnResponse { - return QueryResolveCrnResponse.deserialize(bytes); - } - } - export class QueryGetRecordExpiryQueue extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - pagination?: dependency_3.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_3.cosmos.base.query.v1beta1.PageRequest, 1) as dependency_3.cosmos.base.query.v1beta1.PageRequest; - } - set pagination(value: dependency_3.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; - }): QueryGetRecordExpiryQueue { - const message = new QueryGetRecordExpiryQueue({}); - if (data.pagination != null) { - message.pagination = dependency_3.cosmos.base.query.v1beta1.PageRequest.fromObject(data.pagination); - } - return message; - } - toObject() { - const data: { - pagination?: ReturnType; - } = {}; - 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): QueryGetRecordExpiryQueue { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryGetRecordExpiryQueue(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage(message.pagination, () => message.pagination = dependency_3.cosmos.base.query.v1beta1.PageRequest.deserialize(reader)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): QueryGetRecordExpiryQueue { - return QueryGetRecordExpiryQueue.deserialize(bytes); - } - } - export class QueryGetRecordExpiryQueueResponse extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - records?: ExpiryQueueRecord[]; - pagination?: dependency_3.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 ("records" in data && data.records != undefined) { - this.records = data.records; - } - if ("pagination" in data && data.pagination != undefined) { - this.pagination = data.pagination; - } - } - } - get records() { - return pb_1.Message.getRepeatedWrapperField(this, ExpiryQueueRecord, 1) as ExpiryQueueRecord[]; - } - set records(value: ExpiryQueueRecord[]) { - pb_1.Message.setRepeatedWrapperField(this, 1, value); - } - get pagination() { - return pb_1.Message.getWrapperField(this, dependency_3.cosmos.base.query.v1beta1.PageResponse, 2) as dependency_3.cosmos.base.query.v1beta1.PageResponse; - } - set pagination(value: dependency_3.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: { - records?: ReturnType[]; - pagination?: ReturnType; - }): QueryGetRecordExpiryQueueResponse { - const message = new QueryGetRecordExpiryQueueResponse({}); - if (data.records != null) { - message.records = data.records.map(item => ExpiryQueueRecord.fromObject(item)); - } - if (data.pagination != null) { - message.pagination = dependency_3.cosmos.base.query.v1beta1.PageResponse.fromObject(data.pagination); - } - return message; - } - toObject() { - const data: { - records?: ReturnType[]; - pagination?: ReturnType; - } = {}; - if (this.records != null) { - data.records = this.records.map((item: ExpiryQueueRecord) => 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.records.length) - writer.writeRepeatedMessage(1, this.records, (item: ExpiryQueueRecord) => 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): QueryGetRecordExpiryQueueResponse { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryGetRecordExpiryQueueResponse(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage(message.records, () => pb_1.Message.addToRepeatedWrapperField(message, 1, ExpiryQueueRecord.deserialize(reader), ExpiryQueueRecord)); - break; - case 2: - reader.readMessage(message.pagination, () => message.pagination = dependency_3.cosmos.base.query.v1beta1.PageResponse.deserialize(reader)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): QueryGetRecordExpiryQueueResponse { - return QueryGetRecordExpiryQueueResponse.deserialize(bytes); - } - } - export class ExpiryQueueRecord extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - id?: string; - value?: string[]; - }) { - 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 ("id" in data && data.id != undefined) { - this.id = data.id; - } - if ("value" in data && data.value != undefined) { - this.value = data.value; - } - } - } - get id() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; - } - set id(value: string) { - pb_1.Message.setField(this, 1, value); - } - get value() { - return pb_1.Message.getFieldWithDefault(this, 2, []) as string[]; - } - set value(value: string[]) { - pb_1.Message.setField(this, 2, value); - } - static fromObject(data: { - id?: string; - value?: string[]; - }): ExpiryQueueRecord { - const message = new ExpiryQueueRecord({}); - if (data.id != null) { - message.id = data.id; - } - if (data.value != null) { - message.value = data.value; - } - return message; - } - toObject() { - const data: { - id?: string; - value?: string[]; - } = {}; - if (this.id != null) { - data.id = this.id; - } - if (this.value != null) { - data.value = this.value; - } - 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.value.length) - writer.writeRepeatedString(2, this.value); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): ExpiryQueueRecord { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new ExpiryQueueRecord(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.id = reader.readString(); - break; - case 2: - pb_1.Message.addToRepeatedField(message, 2, reader.readString()); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): ExpiryQueueRecord { - return ExpiryQueueRecord.deserialize(bytes); - } - } - export class QueryGetAuthorityExpiryQueue extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - pagination?: dependency_3.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_3.cosmos.base.query.v1beta1.PageRequest, 1) as dependency_3.cosmos.base.query.v1beta1.PageRequest; - } - set pagination(value: dependency_3.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; - }): QueryGetAuthorityExpiryQueue { - const message = new QueryGetAuthorityExpiryQueue({}); - if (data.pagination != null) { - message.pagination = dependency_3.cosmos.base.query.v1beta1.PageRequest.fromObject(data.pagination); - } - return message; - } - toObject() { - const data: { - pagination?: ReturnType; - } = {}; - 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): QueryGetAuthorityExpiryQueue { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryGetAuthorityExpiryQueue(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage(message.pagination, () => message.pagination = dependency_3.cosmos.base.query.v1beta1.PageRequest.deserialize(reader)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): QueryGetAuthorityExpiryQueue { - return QueryGetAuthorityExpiryQueue.deserialize(bytes); - } - } - export class QueryGetAuthorityExpiryQueueResponse extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - authorities?: ExpiryQueueRecord[]; - pagination?: dependency_3.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 ("authorities" in data && data.authorities != undefined) { - this.authorities = data.authorities; - } - if ("pagination" in data && data.pagination != undefined) { - this.pagination = data.pagination; - } - } - } - get authorities() { - return pb_1.Message.getRepeatedWrapperField(this, ExpiryQueueRecord, 1) as ExpiryQueueRecord[]; - } - set authorities(value: ExpiryQueueRecord[]) { - pb_1.Message.setRepeatedWrapperField(this, 1, value); - } - get pagination() { - return pb_1.Message.getWrapperField(this, dependency_3.cosmos.base.query.v1beta1.PageResponse, 2) as dependency_3.cosmos.base.query.v1beta1.PageResponse; - } - set pagination(value: dependency_3.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: { - authorities?: ReturnType[]; - pagination?: ReturnType; - }): QueryGetAuthorityExpiryQueueResponse { - const message = new QueryGetAuthorityExpiryQueueResponse({}); - if (data.authorities != null) { - message.authorities = data.authorities.map(item => ExpiryQueueRecord.fromObject(item)); - } - if (data.pagination != null) { - message.pagination = dependency_3.cosmos.base.query.v1beta1.PageResponse.fromObject(data.pagination); - } - return message; - } - toObject() { - const data: { - authorities?: ReturnType[]; - pagination?: ReturnType; - } = {}; - if (this.authorities != null) { - data.authorities = this.authorities.map((item: ExpiryQueueRecord) => 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.authorities.length) - writer.writeRepeatedMessage(1, this.authorities, (item: ExpiryQueueRecord) => 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): QueryGetAuthorityExpiryQueueResponse { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new QueryGetAuthorityExpiryQueueResponse(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage(message.authorities, () => pb_1.Message.addToRepeatedWrapperField(message, 1, ExpiryQueueRecord.deserialize(reader), ExpiryQueueRecord)); - break; - case 2: - reader.readMessage(message.pagination, () => message.pagination = dependency_3.cosmos.base.query.v1beta1.PageResponse.deserialize(reader)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): QueryGetAuthorityExpiryQueueResponse { - return QueryGetAuthorityExpiryQueueResponse.deserialize(bytes); - } - } -} diff --git a/src/proto/vulcanize/registry/v1beta1/registry.ts b/src/proto/vulcanize/registry/v1beta1/registry.ts deleted file mode 100644 index 5b793be..0000000 --- a/src/proto/vulcanize/registry/v1beta1/registry.ts +++ /dev/null @@ -1,1531 +0,0 @@ -// @ts-nocheck -/* eslint-disable */ -/** - * Generated by the protoc-gen-ts. DO NOT EDIT! - * compiler version: 4.25.1 - * source: vulcanize/registry/v1beta1/registry.proto - * git: https://github.com/thesayyn/protoc-gen-ts */ -import * as dependency_1 from "./../../../google/protobuf/duration"; -import * as dependency_2 from "./../../../google/protobuf/timestamp"; -import * as dependency_3 from "./../../../gogoproto/gogo"; -import * as dependency_4 from "./../../../cosmos/base/v1beta1/coin"; -import * as pb_1 from "google-protobuf"; -export namespace vulcanize.registry.v1beta1 { - export class Params extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - record_rent?: dependency_4.cosmos.base.v1beta1.Coin; - record_rent_duration?: dependency_1.google.protobuf.Duration; - authority_rent?: dependency_4.cosmos.base.v1beta1.Coin; - authority_rent_duration?: dependency_1.google.protobuf.Duration; - authority_grace_period?: dependency_1.google.protobuf.Duration; - authority_auction_enabled?: boolean; - authority_auction_commits_duration?: dependency_1.google.protobuf.Duration; - authority_auction_reveals_duration?: dependency_1.google.protobuf.Duration; - authority_auction_commit_fee?: dependency_4.cosmos.base.v1beta1.Coin; - authority_auction_reveal_fee?: dependency_4.cosmos.base.v1beta1.Coin; - authority_auction_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 ("record_rent" in data && data.record_rent != undefined) { - this.record_rent = data.record_rent; - } - if ("record_rent_duration" in data && data.record_rent_duration != undefined) { - this.record_rent_duration = data.record_rent_duration; - } - if ("authority_rent" in data && data.authority_rent != undefined) { - this.authority_rent = data.authority_rent; - } - if ("authority_rent_duration" in data && data.authority_rent_duration != undefined) { - this.authority_rent_duration = data.authority_rent_duration; - } - if ("authority_grace_period" in data && data.authority_grace_period != undefined) { - this.authority_grace_period = data.authority_grace_period; - } - if ("authority_auction_enabled" in data && data.authority_auction_enabled != undefined) { - this.authority_auction_enabled = data.authority_auction_enabled; - } - if ("authority_auction_commits_duration" in data && data.authority_auction_commits_duration != undefined) { - this.authority_auction_commits_duration = data.authority_auction_commits_duration; - } - if ("authority_auction_reveals_duration" in data && data.authority_auction_reveals_duration != undefined) { - this.authority_auction_reveals_duration = data.authority_auction_reveals_duration; - } - if ("authority_auction_commit_fee" in data && data.authority_auction_commit_fee != undefined) { - this.authority_auction_commit_fee = data.authority_auction_commit_fee; - } - if ("authority_auction_reveal_fee" in data && data.authority_auction_reveal_fee != undefined) { - this.authority_auction_reveal_fee = data.authority_auction_reveal_fee; - } - if ("authority_auction_minimum_bid" in data && data.authority_auction_minimum_bid != undefined) { - this.authority_auction_minimum_bid = data.authority_auction_minimum_bid; - } - } - } - get record_rent() { - return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 1) as dependency_4.cosmos.base.v1beta1.Coin; - } - set record_rent(value: dependency_4.cosmos.base.v1beta1.Coin) { - pb_1.Message.setWrapperField(this, 1, value); - } - get has_record_rent() { - return pb_1.Message.getField(this, 1) != null; - } - get record_rent_duration() { - return pb_1.Message.getWrapperField(this, dependency_1.google.protobuf.Duration, 2) as dependency_1.google.protobuf.Duration; - } - set record_rent_duration(value: dependency_1.google.protobuf.Duration) { - pb_1.Message.setWrapperField(this, 2, value); - } - get has_record_rent_duration() { - return pb_1.Message.getField(this, 2) != null; - } - get authority_rent() { - return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 3) as dependency_4.cosmos.base.v1beta1.Coin; - } - set authority_rent(value: dependency_4.cosmos.base.v1beta1.Coin) { - pb_1.Message.setWrapperField(this, 3, value); - } - get has_authority_rent() { - return pb_1.Message.getField(this, 3) != null; - } - get authority_rent_duration() { - return pb_1.Message.getWrapperField(this, dependency_1.google.protobuf.Duration, 4) as dependency_1.google.protobuf.Duration; - } - set authority_rent_duration(value: dependency_1.google.protobuf.Duration) { - pb_1.Message.setWrapperField(this, 4, value); - } - get has_authority_rent_duration() { - return pb_1.Message.getField(this, 4) != null; - } - get authority_grace_period() { - return pb_1.Message.getWrapperField(this, dependency_1.google.protobuf.Duration, 5) as dependency_1.google.protobuf.Duration; - } - set authority_grace_period(value: dependency_1.google.protobuf.Duration) { - pb_1.Message.setWrapperField(this, 5, value); - } - get has_authority_grace_period() { - return pb_1.Message.getField(this, 5) != null; - } - get authority_auction_enabled() { - return pb_1.Message.getFieldWithDefault(this, 6, false) as boolean; - } - set authority_auction_enabled(value: boolean) { - pb_1.Message.setField(this, 6, value); - } - get authority_auction_commits_duration() { - return pb_1.Message.getWrapperField(this, dependency_1.google.protobuf.Duration, 7) as dependency_1.google.protobuf.Duration; - } - set authority_auction_commits_duration(value: dependency_1.google.protobuf.Duration) { - pb_1.Message.setWrapperField(this, 7, value); - } - get has_authority_auction_commits_duration() { - return pb_1.Message.getField(this, 7) != null; - } - get authority_auction_reveals_duration() { - return pb_1.Message.getWrapperField(this, dependency_1.google.protobuf.Duration, 8) as dependency_1.google.protobuf.Duration; - } - set authority_auction_reveals_duration(value: dependency_1.google.protobuf.Duration) { - pb_1.Message.setWrapperField(this, 8, value); - } - get has_authority_auction_reveals_duration() { - return pb_1.Message.getField(this, 8) != null; - } - get authority_auction_commit_fee() { - return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 9) as dependency_4.cosmos.base.v1beta1.Coin; - } - set authority_auction_commit_fee(value: dependency_4.cosmos.base.v1beta1.Coin) { - pb_1.Message.setWrapperField(this, 9, value); - } - get has_authority_auction_commit_fee() { - return pb_1.Message.getField(this, 9) != null; - } - get authority_auction_reveal_fee() { - return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 10) as dependency_4.cosmos.base.v1beta1.Coin; - } - set authority_auction_reveal_fee(value: dependency_4.cosmos.base.v1beta1.Coin) { - pb_1.Message.setWrapperField(this, 10, value); - } - get has_authority_auction_reveal_fee() { - return pb_1.Message.getField(this, 10) != null; - } - get authority_auction_minimum_bid() { - return pb_1.Message.getWrapperField(this, dependency_4.cosmos.base.v1beta1.Coin, 11) as dependency_4.cosmos.base.v1beta1.Coin; - } - set authority_auction_minimum_bid(value: dependency_4.cosmos.base.v1beta1.Coin) { - pb_1.Message.setWrapperField(this, 11, value); - } - get has_authority_auction_minimum_bid() { - return pb_1.Message.getField(this, 11) != null; - } - static fromObject(data: { - record_rent?: ReturnType; - record_rent_duration?: ReturnType; - authority_rent?: ReturnType; - authority_rent_duration?: ReturnType; - authority_grace_period?: ReturnType; - authority_auction_enabled?: boolean; - authority_auction_commits_duration?: ReturnType; - authority_auction_reveals_duration?: ReturnType; - authority_auction_commit_fee?: ReturnType; - authority_auction_reveal_fee?: ReturnType; - authority_auction_minimum_bid?: ReturnType; - }): Params { - const message = new Params({}); - if (data.record_rent != null) { - message.record_rent = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.record_rent); - } - if (data.record_rent_duration != null) { - message.record_rent_duration = dependency_1.google.protobuf.Duration.fromObject(data.record_rent_duration); - } - if (data.authority_rent != null) { - message.authority_rent = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.authority_rent); - } - if (data.authority_rent_duration != null) { - message.authority_rent_duration = dependency_1.google.protobuf.Duration.fromObject(data.authority_rent_duration); - } - if (data.authority_grace_period != null) { - message.authority_grace_period = dependency_1.google.protobuf.Duration.fromObject(data.authority_grace_period); - } - if (data.authority_auction_enabled != null) { - message.authority_auction_enabled = data.authority_auction_enabled; - } - if (data.authority_auction_commits_duration != null) { - message.authority_auction_commits_duration = dependency_1.google.protobuf.Duration.fromObject(data.authority_auction_commits_duration); - } - if (data.authority_auction_reveals_duration != null) { - message.authority_auction_reveals_duration = dependency_1.google.protobuf.Duration.fromObject(data.authority_auction_reveals_duration); - } - if (data.authority_auction_commit_fee != null) { - message.authority_auction_commit_fee = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.authority_auction_commit_fee); - } - if (data.authority_auction_reveal_fee != null) { - message.authority_auction_reveal_fee = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.authority_auction_reveal_fee); - } - if (data.authority_auction_minimum_bid != null) { - message.authority_auction_minimum_bid = dependency_4.cosmos.base.v1beta1.Coin.fromObject(data.authority_auction_minimum_bid); - } - return message; - } - toObject() { - const data: { - record_rent?: ReturnType; - record_rent_duration?: ReturnType; - authority_rent?: ReturnType; - authority_rent_duration?: ReturnType; - authority_grace_period?: ReturnType; - authority_auction_enabled?: boolean; - authority_auction_commits_duration?: ReturnType; - authority_auction_reveals_duration?: ReturnType; - authority_auction_commit_fee?: ReturnType; - authority_auction_reveal_fee?: ReturnType; - authority_auction_minimum_bid?: ReturnType; - } = {}; - if (this.record_rent != null) { - data.record_rent = this.record_rent.toObject(); - } - if (this.record_rent_duration != null) { - data.record_rent_duration = this.record_rent_duration.toObject(); - } - if (this.authority_rent != null) { - data.authority_rent = this.authority_rent.toObject(); - } - if (this.authority_rent_duration != null) { - data.authority_rent_duration = this.authority_rent_duration.toObject(); - } - if (this.authority_grace_period != null) { - data.authority_grace_period = this.authority_grace_period.toObject(); - } - if (this.authority_auction_enabled != null) { - data.authority_auction_enabled = this.authority_auction_enabled; - } - if (this.authority_auction_commits_duration != null) { - data.authority_auction_commits_duration = this.authority_auction_commits_duration.toObject(); - } - if (this.authority_auction_reveals_duration != null) { - data.authority_auction_reveals_duration = this.authority_auction_reveals_duration.toObject(); - } - if (this.authority_auction_commit_fee != null) { - data.authority_auction_commit_fee = this.authority_auction_commit_fee.toObject(); - } - if (this.authority_auction_reveal_fee != null) { - data.authority_auction_reveal_fee = this.authority_auction_reveal_fee.toObject(); - } - if (this.authority_auction_minimum_bid != null) { - data.authority_auction_minimum_bid = this.authority_auction_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_record_rent) - writer.writeMessage(1, this.record_rent, () => this.record_rent.serialize(writer)); - if (this.has_record_rent_duration) - writer.writeMessage(2, this.record_rent_duration, () => this.record_rent_duration.serialize(writer)); - if (this.has_authority_rent) - writer.writeMessage(3, this.authority_rent, () => this.authority_rent.serialize(writer)); - if (this.has_authority_rent_duration) - writer.writeMessage(4, this.authority_rent_duration, () => this.authority_rent_duration.serialize(writer)); - if (this.has_authority_grace_period) - writer.writeMessage(5, this.authority_grace_period, () => this.authority_grace_period.serialize(writer)); - if (this.authority_auction_enabled != false) - writer.writeBool(6, this.authority_auction_enabled); - if (this.has_authority_auction_commits_duration) - writer.writeMessage(7, this.authority_auction_commits_duration, () => this.authority_auction_commits_duration.serialize(writer)); - if (this.has_authority_auction_reveals_duration) - writer.writeMessage(8, this.authority_auction_reveals_duration, () => this.authority_auction_reveals_duration.serialize(writer)); - if (this.has_authority_auction_commit_fee) - writer.writeMessage(9, this.authority_auction_commit_fee, () => this.authority_auction_commit_fee.serialize(writer)); - if (this.has_authority_auction_reveal_fee) - writer.writeMessage(10, this.authority_auction_reveal_fee, () => this.authority_auction_reveal_fee.serialize(writer)); - if (this.has_authority_auction_minimum_bid) - writer.writeMessage(11, this.authority_auction_minimum_bid, () => this.authority_auction_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.record_rent, () => message.record_rent = dependency_4.cosmos.base.v1beta1.Coin.deserialize(reader)); - break; - case 2: - reader.readMessage(message.record_rent_duration, () => message.record_rent_duration = dependency_1.google.protobuf.Duration.deserialize(reader)); - break; - case 3: - reader.readMessage(message.authority_rent, () => message.authority_rent = dependency_4.cosmos.base.v1beta1.Coin.deserialize(reader)); - break; - case 4: - reader.readMessage(message.authority_rent_duration, () => message.authority_rent_duration = dependency_1.google.protobuf.Duration.deserialize(reader)); - break; - case 5: - reader.readMessage(message.authority_grace_period, () => message.authority_grace_period = dependency_1.google.protobuf.Duration.deserialize(reader)); - break; - case 6: - message.authority_auction_enabled = reader.readBool(); - break; - case 7: - reader.readMessage(message.authority_auction_commits_duration, () => message.authority_auction_commits_duration = dependency_1.google.protobuf.Duration.deserialize(reader)); - break; - case 8: - reader.readMessage(message.authority_auction_reveals_duration, () => message.authority_auction_reveals_duration = dependency_1.google.protobuf.Duration.deserialize(reader)); - break; - case 9: - reader.readMessage(message.authority_auction_commit_fee, () => message.authority_auction_commit_fee = dependency_4.cosmos.base.v1beta1.Coin.deserialize(reader)); - break; - case 10: - reader.readMessage(message.authority_auction_reveal_fee, () => message.authority_auction_reveal_fee = dependency_4.cosmos.base.v1beta1.Coin.deserialize(reader)); - break; - case 11: - reader.readMessage(message.authority_auction_minimum_bid, () => message.authority_auction_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 Record extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - id?: string; - bond_id?: string; - create_time?: string; - expiry_time?: string; - deleted?: boolean; - owners?: string[]; - attributes?: Uint8Array; - names?: string[]; - type?: string; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [6, 8], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("id" in data && data.id != undefined) { - this.id = data.id; - } - if ("bond_id" in data && data.bond_id != undefined) { - this.bond_id = data.bond_id; - } - if ("create_time" in data && data.create_time != undefined) { - this.create_time = data.create_time; - } - if ("expiry_time" in data && data.expiry_time != undefined) { - this.expiry_time = data.expiry_time; - } - if ("deleted" in data && data.deleted != undefined) { - this.deleted = data.deleted; - } - if ("owners" in data && data.owners != undefined) { - this.owners = data.owners; - } - if ("attributes" in data && data.attributes != undefined) { - this.attributes = data.attributes; - } - if ("names" in data && data.names != undefined) { - this.names = data.names; - } - if ("type" in data && data.type != undefined) { - this.type = data.type; - } - } - } - get id() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; - } - set id(value: string) { - pb_1.Message.setField(this, 1, value); - } - get bond_id() { - return pb_1.Message.getFieldWithDefault(this, 2, "") as string; - } - set bond_id(value: string) { - pb_1.Message.setField(this, 2, value); - } - get create_time() { - return pb_1.Message.getFieldWithDefault(this, 3, "") as string; - } - set create_time(value: string) { - pb_1.Message.setField(this, 3, value); - } - get expiry_time() { - return pb_1.Message.getFieldWithDefault(this, 4, "") as string; - } - set expiry_time(value: string) { - pb_1.Message.setField(this, 4, value); - } - get deleted() { - return pb_1.Message.getFieldWithDefault(this, 5, false) as boolean; - } - set deleted(value: boolean) { - pb_1.Message.setField(this, 5, value); - } - get owners() { - return pb_1.Message.getFieldWithDefault(this, 6, []) as string[]; - } - set owners(value: string[]) { - pb_1.Message.setField(this, 6, value); - } - get attributes() { - return pb_1.Message.getFieldWithDefault(this, 7, new Uint8Array(0)) as Uint8Array; - } - set attributes(value: Uint8Array) { - pb_1.Message.setField(this, 7, value); - } - get names() { - return pb_1.Message.getFieldWithDefault(this, 8, []) as string[]; - } - set names(value: string[]) { - pb_1.Message.setField(this, 8, value); - } - get type() { - return pb_1.Message.getFieldWithDefault(this, 9, "") as string; - } - set type(value: string) { - pb_1.Message.setField(this, 9, value); - } - static fromObject(data: { - id?: string; - bond_id?: string; - create_time?: string; - expiry_time?: string; - deleted?: boolean; - owners?: string[]; - attributes?: Uint8Array; - names?: string[]; - type?: string; - }): Record { - const message = new Record({}); - if (data.id != null) { - message.id = data.id; - } - if (data.bond_id != null) { - message.bond_id = data.bond_id; - } - if (data.create_time != null) { - message.create_time = data.create_time; - } - if (data.expiry_time != null) { - message.expiry_time = data.expiry_time; - } - if (data.deleted != null) { - message.deleted = data.deleted; - } - if (data.owners != null) { - message.owners = data.owners; - } - if (data.attributes != null) { - message.attributes = data.attributes; - } - if (data.names != null) { - message.names = data.names; - } - if (data.type != null) { - message.type = data.type; - } - return message; - } - toObject() { - const data: { - id?: string; - bond_id?: string; - create_time?: string; - expiry_time?: string; - deleted?: boolean; - owners?: string[]; - attributes?: Uint8Array; - names?: string[]; - type?: string; - } = {}; - if (this.id != null) { - data.id = this.id; - } - if (this.bond_id != null) { - data.bond_id = this.bond_id; - } - if (this.create_time != null) { - data.create_time = this.create_time; - } - if (this.expiry_time != null) { - data.expiry_time = this.expiry_time; - } - if (this.deleted != null) { - data.deleted = this.deleted; - } - if (this.owners != null) { - data.owners = this.owners; - } - if (this.attributes != null) { - data.attributes = this.attributes; - } - if (this.names != null) { - data.names = this.names; - } - if (this.type != null) { - data.type = this.type; - } - 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.bond_id.length) - writer.writeString(2, this.bond_id); - if (this.create_time.length) - writer.writeString(3, this.create_time); - if (this.expiry_time.length) - writer.writeString(4, this.expiry_time); - if (this.deleted != false) - writer.writeBool(5, this.deleted); - if (this.owners.length) - writer.writeRepeatedString(6, this.owners); - if (this.attributes.length) - writer.writeBytes(7, this.attributes); - if (this.names.length) - writer.writeRepeatedString(8, this.names); - if (this.type.length) - writer.writeString(9, this.type); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Record { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Record(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.id = reader.readString(); - break; - case 2: - message.bond_id = reader.readString(); - break; - case 3: - message.create_time = reader.readString(); - break; - case 4: - message.expiry_time = reader.readString(); - break; - case 5: - message.deleted = reader.readBool(); - break; - case 6: - pb_1.Message.addToRepeatedField(message, 6, reader.readString()); - break; - case 7: - message.attributes = reader.readBytes(); - break; - case 8: - pb_1.Message.addToRepeatedField(message, 8, reader.readString()); - break; - case 9: - message.type = reader.readString(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): Record { - return Record.deserialize(bytes); - } - } - export class AuthorityEntry extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - name?: string; - entry?: NameAuthority; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("name" in data && data.name != undefined) { - this.name = data.name; - } - if ("entry" in data && data.entry != undefined) { - this.entry = data.entry; - } - } - } - get name() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; - } - set name(value: string) { - pb_1.Message.setField(this, 1, value); - } - get entry() { - return pb_1.Message.getWrapperField(this, NameAuthority, 2) as NameAuthority; - } - set entry(value: NameAuthority) { - pb_1.Message.setWrapperField(this, 2, value); - } - get has_entry() { - return pb_1.Message.getField(this, 2) != null; - } - static fromObject(data: { - name?: string; - entry?: ReturnType; - }): AuthorityEntry { - const message = new AuthorityEntry({}); - if (data.name != null) { - message.name = data.name; - } - if (data.entry != null) { - message.entry = NameAuthority.fromObject(data.entry); - } - return message; - } - toObject() { - const data: { - name?: string; - entry?: ReturnType; - } = {}; - if (this.name != null) { - data.name = this.name; - } - if (this.entry != null) { - data.entry = this.entry.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.name.length) - writer.writeString(1, this.name); - if (this.has_entry) - writer.writeMessage(2, this.entry, () => this.entry.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AuthorityEntry { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new AuthorityEntry(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.name = reader.readString(); - break; - case 2: - reader.readMessage(message.entry, () => message.entry = NameAuthority.deserialize(reader)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): AuthorityEntry { - return AuthorityEntry.deserialize(bytes); - } - } - export class NameAuthority extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - owner_public_key?: string; - owner_address?: string; - height?: number; - status?: string; - auction_id?: string; - bond_id?: string; - expiry_time?: dependency_2.google.protobuf.Timestamp; - }) { - 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_public_key" in data && data.owner_public_key != undefined) { - this.owner_public_key = data.owner_public_key; - } - if ("owner_address" in data && data.owner_address != undefined) { - this.owner_address = data.owner_address; - } - if ("height" in data && data.height != undefined) { - this.height = data.height; - } - if ("status" in data && data.status != undefined) { - this.status = data.status; - } - if ("auction_id" in data && data.auction_id != undefined) { - this.auction_id = data.auction_id; - } - if ("bond_id" in data && data.bond_id != undefined) { - this.bond_id = data.bond_id; - } - if ("expiry_time" in data && data.expiry_time != undefined) { - this.expiry_time = data.expiry_time; - } - } - } - get owner_public_key() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; - } - set owner_public_key(value: string) { - pb_1.Message.setField(this, 1, value); - } - get owner_address() { - return pb_1.Message.getFieldWithDefault(this, 2, "") as string; - } - set owner_address(value: string) { - pb_1.Message.setField(this, 2, value); - } - get height() { - return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; - } - set height(value: number) { - pb_1.Message.setField(this, 3, value); - } - get status() { - return pb_1.Message.getFieldWithDefault(this, 4, "") as string; - } - set status(value: string) { - pb_1.Message.setField(this, 4, value); - } - get auction_id() { - return pb_1.Message.getFieldWithDefault(this, 5, "") as string; - } - set auction_id(value: string) { - pb_1.Message.setField(this, 5, value); - } - get bond_id() { - return pb_1.Message.getFieldWithDefault(this, 6, "") as string; - } - set bond_id(value: string) { - pb_1.Message.setField(this, 6, value); - } - get expiry_time() { - return pb_1.Message.getWrapperField(this, dependency_2.google.protobuf.Timestamp, 7) as dependency_2.google.protobuf.Timestamp; - } - set expiry_time(value: dependency_2.google.protobuf.Timestamp) { - pb_1.Message.setWrapperField(this, 7, value); - } - get has_expiry_time() { - return pb_1.Message.getField(this, 7) != null; - } - static fromObject(data: { - owner_public_key?: string; - owner_address?: string; - height?: number; - status?: string; - auction_id?: string; - bond_id?: string; - expiry_time?: ReturnType; - }): NameAuthority { - const message = new NameAuthority({}); - if (data.owner_public_key != null) { - message.owner_public_key = data.owner_public_key; - } - if (data.owner_address != null) { - message.owner_address = data.owner_address; - } - if (data.height != null) { - message.height = data.height; - } - if (data.status != null) { - message.status = data.status; - } - if (data.auction_id != null) { - message.auction_id = data.auction_id; - } - if (data.bond_id != null) { - message.bond_id = data.bond_id; - } - if (data.expiry_time != null) { - message.expiry_time = dependency_2.google.protobuf.Timestamp.fromObject(data.expiry_time); - } - return message; - } - toObject() { - const data: { - owner_public_key?: string; - owner_address?: string; - height?: number; - status?: string; - auction_id?: string; - bond_id?: string; - expiry_time?: ReturnType; - } = {}; - if (this.owner_public_key != null) { - data.owner_public_key = this.owner_public_key; - } - if (this.owner_address != null) { - data.owner_address = this.owner_address; - } - if (this.height != null) { - data.height = this.height; - } - if (this.status != null) { - data.status = this.status; - } - if (this.auction_id != null) { - data.auction_id = this.auction_id; - } - if (this.bond_id != null) { - data.bond_id = this.bond_id; - } - if (this.expiry_time != null) { - data.expiry_time = this.expiry_time.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_public_key.length) - writer.writeString(1, this.owner_public_key); - if (this.owner_address.length) - writer.writeString(2, this.owner_address); - if (this.height != 0) - writer.writeUint64(3, this.height); - if (this.status.length) - writer.writeString(4, this.status); - if (this.auction_id.length) - writer.writeString(5, this.auction_id); - if (this.bond_id.length) - writer.writeString(6, this.bond_id); - if (this.has_expiry_time) - writer.writeMessage(7, this.expiry_time, () => this.expiry_time.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): NameAuthority { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new NameAuthority(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.owner_public_key = reader.readString(); - break; - case 2: - message.owner_address = reader.readString(); - break; - case 3: - message.height = reader.readUint64(); - break; - case 4: - message.status = reader.readString(); - break; - case 5: - message.auction_id = reader.readString(); - break; - case 6: - message.bond_id = reader.readString(); - break; - case 7: - reader.readMessage(message.expiry_time, () => message.expiry_time = dependency_2.google.protobuf.Timestamp.deserialize(reader)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): NameAuthority { - return NameAuthority.deserialize(bytes); - } - } - export class NameEntry extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - name?: string; - entry?: NameRecord; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("name" in data && data.name != undefined) { - this.name = data.name; - } - if ("entry" in data && data.entry != undefined) { - this.entry = data.entry; - } - } - } - get name() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; - } - set name(value: string) { - pb_1.Message.setField(this, 1, value); - } - get entry() { - return pb_1.Message.getWrapperField(this, NameRecord, 2) as NameRecord; - } - set entry(value: NameRecord) { - pb_1.Message.setWrapperField(this, 2, value); - } - get has_entry() { - return pb_1.Message.getField(this, 2) != null; - } - static fromObject(data: { - name?: string; - entry?: ReturnType; - }): NameEntry { - const message = new NameEntry({}); - if (data.name != null) { - message.name = data.name; - } - if (data.entry != null) { - message.entry = NameRecord.fromObject(data.entry); - } - return message; - } - toObject() { - const data: { - name?: string; - entry?: ReturnType; - } = {}; - if (this.name != null) { - data.name = this.name; - } - if (this.entry != null) { - data.entry = this.entry.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.name.length) - writer.writeString(1, this.name); - if (this.has_entry) - writer.writeMessage(2, this.entry, () => this.entry.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): NameEntry { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new NameEntry(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.name = reader.readString(); - break; - case 2: - reader.readMessage(message.entry, () => message.entry = NameRecord.deserialize(reader)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): NameEntry { - return NameEntry.deserialize(bytes); - } - } - export class NameRecord extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - latest?: NameRecordEntry; - history?: NameRecordEntry[]; - }) { - 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 ("latest" in data && data.latest != undefined) { - this.latest = data.latest; - } - if ("history" in data && data.history != undefined) { - this.history = data.history; - } - } - } - get latest() { - return pb_1.Message.getWrapperField(this, NameRecordEntry, 1) as NameRecordEntry; - } - set latest(value: NameRecordEntry) { - pb_1.Message.setWrapperField(this, 1, value); - } - get has_latest() { - return pb_1.Message.getField(this, 1) != null; - } - get history() { - return pb_1.Message.getRepeatedWrapperField(this, NameRecordEntry, 2) as NameRecordEntry[]; - } - set history(value: NameRecordEntry[]) { - pb_1.Message.setRepeatedWrapperField(this, 2, value); - } - static fromObject(data: { - latest?: ReturnType; - history?: ReturnType[]; - }): NameRecord { - const message = new NameRecord({}); - if (data.latest != null) { - message.latest = NameRecordEntry.fromObject(data.latest); - } - if (data.history != null) { - message.history = data.history.map(item => NameRecordEntry.fromObject(item)); - } - return message; - } - toObject() { - const data: { - latest?: ReturnType; - history?: ReturnType[]; - } = {}; - if (this.latest != null) { - data.latest = this.latest.toObject(); - } - if (this.history != null) { - data.history = this.history.map((item: NameRecordEntry) => 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_latest) - writer.writeMessage(1, this.latest, () => this.latest.serialize(writer)); - if (this.history.length) - writer.writeRepeatedMessage(2, this.history, (item: NameRecordEntry) => item.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): NameRecord { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new NameRecord(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage(message.latest, () => message.latest = NameRecordEntry.deserialize(reader)); - break; - case 2: - reader.readMessage(message.history, () => pb_1.Message.addToRepeatedWrapperField(message, 2, NameRecordEntry.deserialize(reader), NameRecordEntry)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): NameRecord { - return NameRecord.deserialize(bytes); - } - } - export class NameRecordEntry extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - id?: string; - height?: 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 ("id" in data && data.id != undefined) { - this.id = data.id; - } - if ("height" in data && data.height != undefined) { - this.height = data.height; - } - } - } - get id() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; - } - set id(value: string) { - pb_1.Message.setField(this, 1, value); - } - get height() { - return pb_1.Message.getFieldWithDefault(this, 2, 0) as number; - } - set height(value: number) { - pb_1.Message.setField(this, 2, value); - } - static fromObject(data: { - id?: string; - height?: number; - }): NameRecordEntry { - const message = new NameRecordEntry({}); - if (data.id != null) { - message.id = data.id; - } - if (data.height != null) { - message.height = data.height; - } - return message; - } - toObject() { - const data: { - id?: string; - height?: number; - } = {}; - if (this.id != null) { - data.id = this.id; - } - if (this.height != null) { - data.height = this.height; - } - 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.height != 0) - writer.writeUint64(2, this.height); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): NameRecordEntry { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new NameRecordEntry(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.id = reader.readString(); - break; - case 2: - message.height = reader.readUint64(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): NameRecordEntry { - return NameRecordEntry.deserialize(bytes); - } - } - export class Signature extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - sig?: string; - pub_key?: 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 ("sig" in data && data.sig != undefined) { - this.sig = data.sig; - } - if ("pub_key" in data && data.pub_key != undefined) { - this.pub_key = data.pub_key; - } - } - } - get sig() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; - } - set sig(value: string) { - pb_1.Message.setField(this, 1, value); - } - get pub_key() { - return pb_1.Message.getFieldWithDefault(this, 2, "") as string; - } - set pub_key(value: string) { - pb_1.Message.setField(this, 2, value); - } - static fromObject(data: { - sig?: string; - pub_key?: string; - }): Signature { - const message = new Signature({}); - if (data.sig != null) { - message.sig = data.sig; - } - if (data.pub_key != null) { - message.pub_key = data.pub_key; - } - return message; - } - toObject() { - const data: { - sig?: string; - pub_key?: string; - } = {}; - if (this.sig != null) { - data.sig = this.sig; - } - if (this.pub_key != null) { - data.pub_key = this.pub_key; - } - 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.sig.length) - writer.writeString(1, this.sig); - if (this.pub_key.length) - writer.writeString(2, this.pub_key); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Signature { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Signature(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.sig = reader.readString(); - break; - case 2: - message.pub_key = reader.readString(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): Signature { - return Signature.deserialize(bytes); - } - } - export class BlockChangeSet extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - height?: number; - records?: string[]; - auctions?: string[]; - auction_bids?: AuctionBidInfo[]; - authorities?: string[]; - names?: string[]; - }) { - super(); - pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2, 3, 4, 5, 6], this.#one_of_decls); - if (!Array.isArray(data) && typeof data == "object") { - if ("height" in data && data.height != undefined) { - this.height = data.height; - } - if ("records" in data && data.records != undefined) { - this.records = data.records; - } - if ("auctions" in data && data.auctions != undefined) { - this.auctions = data.auctions; - } - if ("auction_bids" in data && data.auction_bids != undefined) { - this.auction_bids = data.auction_bids; - } - if ("authorities" in data && data.authorities != undefined) { - this.authorities = data.authorities; - } - if ("names" in data && data.names != undefined) { - this.names = data.names; - } - } - } - get height() { - return pb_1.Message.getFieldWithDefault(this, 1, 0) as number; - } - set height(value: number) { - pb_1.Message.setField(this, 1, value); - } - get records() { - return pb_1.Message.getFieldWithDefault(this, 2, []) as string[]; - } - set records(value: string[]) { - pb_1.Message.setField(this, 2, value); - } - get auctions() { - return pb_1.Message.getFieldWithDefault(this, 3, []) as string[]; - } - set auctions(value: string[]) { - pb_1.Message.setField(this, 3, value); - } - get auction_bids() { - return pb_1.Message.getRepeatedWrapperField(this, AuctionBidInfo, 4) as AuctionBidInfo[]; - } - set auction_bids(value: AuctionBidInfo[]) { - pb_1.Message.setRepeatedWrapperField(this, 4, value); - } - get authorities() { - return pb_1.Message.getFieldWithDefault(this, 5, []) as string[]; - } - set authorities(value: string[]) { - pb_1.Message.setField(this, 5, value); - } - get names() { - return pb_1.Message.getFieldWithDefault(this, 6, []) as string[]; - } - set names(value: string[]) { - pb_1.Message.setField(this, 6, value); - } - static fromObject(data: { - height?: number; - records?: string[]; - auctions?: string[]; - auction_bids?: ReturnType[]; - authorities?: string[]; - names?: string[]; - }): BlockChangeSet { - const message = new BlockChangeSet({}); - if (data.height != null) { - message.height = data.height; - } - if (data.records != null) { - message.records = data.records; - } - if (data.auctions != null) { - message.auctions = data.auctions; - } - if (data.auction_bids != null) { - message.auction_bids = data.auction_bids.map(item => AuctionBidInfo.fromObject(item)); - } - if (data.authorities != null) { - message.authorities = data.authorities; - } - if (data.names != null) { - message.names = data.names; - } - return message; - } - toObject() { - const data: { - height?: number; - records?: string[]; - auctions?: string[]; - auction_bids?: ReturnType[]; - authorities?: string[]; - names?: string[]; - } = {}; - if (this.height != null) { - data.height = this.height; - } - if (this.records != null) { - data.records = this.records; - } - if (this.auctions != null) { - data.auctions = this.auctions; - } - if (this.auction_bids != null) { - data.auction_bids = this.auction_bids.map((item: AuctionBidInfo) => item.toObject()); - } - if (this.authorities != null) { - data.authorities = this.authorities; - } - if (this.names != null) { - data.names = this.names; - } - 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.height != 0) - writer.writeInt64(1, this.height); - if (this.records.length) - writer.writeRepeatedString(2, this.records); - if (this.auctions.length) - writer.writeRepeatedString(3, this.auctions); - if (this.auction_bids.length) - writer.writeRepeatedMessage(4, this.auction_bids, (item: AuctionBidInfo) => item.serialize(writer)); - if (this.authorities.length) - writer.writeRepeatedString(5, this.authorities); - if (this.names.length) - writer.writeRepeatedString(6, this.names); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): BlockChangeSet { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new BlockChangeSet(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.height = reader.readInt64(); - break; - case 2: - pb_1.Message.addToRepeatedField(message, 2, reader.readString()); - break; - case 3: - pb_1.Message.addToRepeatedField(message, 3, reader.readString()); - break; - case 4: - reader.readMessage(message.auction_bids, () => pb_1.Message.addToRepeatedWrapperField(message, 4, AuctionBidInfo.deserialize(reader), AuctionBidInfo)); - break; - case 5: - pb_1.Message.addToRepeatedField(message, 5, reader.readString()); - break; - case 6: - pb_1.Message.addToRepeatedField(message, 6, reader.readString()); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): BlockChangeSet { - return BlockChangeSet.deserialize(bytes); - } - } - export class AuctionBidInfo extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - auction_id?: string; - bidder_address?: 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 ("bidder_address" in data && data.bidder_address != undefined) { - this.bidder_address = data.bidder_address; - } - } - } - 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); - } - static fromObject(data: { - auction_id?: string; - bidder_address?: string; - }): AuctionBidInfo { - const message = new AuctionBidInfo({}); - if (data.auction_id != null) { - message.auction_id = data.auction_id; - } - if (data.bidder_address != null) { - message.bidder_address = data.bidder_address; - } - return message; - } - toObject() { - const data: { - auction_id?: string; - bidder_address?: string; - } = {}; - if (this.auction_id != null) { - data.auction_id = this.auction_id; - } - if (this.bidder_address != null) { - data.bidder_address = this.bidder_address; - } - 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 (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): AuctionBidInfo { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new AuctionBidInfo(); - 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; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): AuctionBidInfo { - return AuctionBidInfo.deserialize(bytes); - } - } -} diff --git a/src/proto/vulcanize/registry/v1beta1/tx.ts b/src/proto/vulcanize/registry/v1beta1/tx.ts deleted file mode 100644 index bf577ce..0000000 --- a/src/proto/vulcanize/registry/v1beta1/tx.ts +++ /dev/null @@ -1,1573 +0,0 @@ -// @ts-nocheck -/* eslint-disable */ -/** - * Generated by the protoc-gen-ts. DO NOT EDIT! - * compiler version: 4.25.1 - * source: vulcanize/registry/v1beta1/tx.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 MsgSetRecord extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - bond_id?: string; - signer?: string; - payload?: Payload; - }) { - 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_id" in data && data.bond_id != undefined) { - this.bond_id = data.bond_id; - } - if ("signer" in data && data.signer != undefined) { - this.signer = data.signer; - } - if ("payload" in data && data.payload != undefined) { - this.payload = data.payload; - } - } - } - get bond_id() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; - } - set bond_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 payload() { - return pb_1.Message.getWrapperField(this, Payload, 3) as Payload; - } - set payload(value: Payload) { - pb_1.Message.setWrapperField(this, 3, value); - } - get has_payload() { - return pb_1.Message.getField(this, 3) != null; - } - static fromObject(data: { - bond_id?: string; - signer?: string; - payload?: ReturnType; - }): MsgSetRecord { - const message = new MsgSetRecord({}); - if (data.bond_id != null) { - message.bond_id = data.bond_id; - } - if (data.signer != null) { - message.signer = data.signer; - } - if (data.payload != null) { - message.payload = Payload.fromObject(data.payload); - } - return message; - } - toObject() { - const data: { - bond_id?: string; - signer?: string; - payload?: ReturnType; - } = {}; - if (this.bond_id != null) { - data.bond_id = this.bond_id; - } - if (this.signer != null) { - data.signer = this.signer; - } - if (this.payload != null) { - data.payload = this.payload.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.bond_id.length) - writer.writeString(1, this.bond_id); - if (this.signer.length) - writer.writeString(2, this.signer); - if (this.has_payload) - writer.writeMessage(3, this.payload, () => this.payload.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgSetRecord { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgSetRecord(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.bond_id = reader.readString(); - break; - case 2: - message.signer = reader.readString(); - break; - case 3: - reader.readMessage(message.payload, () => message.payload = Payload.deserialize(reader)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): MsgSetRecord { - return MsgSetRecord.deserialize(bytes); - } - } - export class MsgSetRecordResponse 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; - }): MsgSetRecordResponse { - const message = new MsgSetRecordResponse({}); - 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): MsgSetRecordResponse { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgSetRecordResponse(); - 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): MsgSetRecordResponse { - return MsgSetRecordResponse.deserialize(bytes); - } - } - export class Payload extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - record?: dependency_2.vulcanize.registry.v1beta1.Record; - signatures?: dependency_2.vulcanize.registry.v1beta1.Signature[]; - }) { - 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 ("record" in data && data.record != undefined) { - this.record = data.record; - } - if ("signatures" in data && data.signatures != undefined) { - this.signatures = data.signatures; - } - } - } - get record() { - return pb_1.Message.getWrapperField(this, dependency_2.vulcanize.registry.v1beta1.Record, 1) as dependency_2.vulcanize.registry.v1beta1.Record; - } - set record(value: dependency_2.vulcanize.registry.v1beta1.Record) { - pb_1.Message.setWrapperField(this, 1, value); - } - get has_record() { - return pb_1.Message.getField(this, 1) != null; - } - get signatures() { - return pb_1.Message.getRepeatedWrapperField(this, dependency_2.vulcanize.registry.v1beta1.Signature, 2) as dependency_2.vulcanize.registry.v1beta1.Signature[]; - } - set signatures(value: dependency_2.vulcanize.registry.v1beta1.Signature[]) { - pb_1.Message.setRepeatedWrapperField(this, 2, value); - } - static fromObject(data: { - record?: ReturnType; - signatures?: ReturnType[]; - }): Payload { - const message = new Payload({}); - if (data.record != null) { - message.record = dependency_2.vulcanize.registry.v1beta1.Record.fromObject(data.record); - } - if (data.signatures != null) { - message.signatures = data.signatures.map(item => dependency_2.vulcanize.registry.v1beta1.Signature.fromObject(item)); - } - return message; - } - toObject() { - const data: { - record?: ReturnType; - signatures?: ReturnType[]; - } = {}; - if (this.record != null) { - data.record = this.record.toObject(); - } - if (this.signatures != null) { - data.signatures = this.signatures.map((item: dependency_2.vulcanize.registry.v1beta1.Signature) => 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_record) - writer.writeMessage(1, this.record, () => this.record.serialize(writer)); - if (this.signatures.length) - writer.writeRepeatedMessage(2, this.signatures, (item: dependency_2.vulcanize.registry.v1beta1.Signature) => item.serialize(writer)); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Payload { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Payload(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - reader.readMessage(message.record, () => message.record = dependency_2.vulcanize.registry.v1beta1.Record.deserialize(reader)); - break; - case 2: - reader.readMessage(message.signatures, () => pb_1.Message.addToRepeatedWrapperField(message, 2, dependency_2.vulcanize.registry.v1beta1.Signature.deserialize(reader), dependency_2.vulcanize.registry.v1beta1.Signature)); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): Payload { - return Payload.deserialize(bytes); - } - } - export class MsgSetName extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - crn?: string; - cid?: 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 ("crn" in data && data.crn != undefined) { - this.crn = data.crn; - } - if ("cid" in data && data.cid != undefined) { - this.cid = data.cid; - } - if ("signer" in data && data.signer != undefined) { - this.signer = data.signer; - } - } - } - get crn() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; - } - set crn(value: string) { - pb_1.Message.setField(this, 1, value); - } - get cid() { - return pb_1.Message.getFieldWithDefault(this, 2, "") as string; - } - set cid(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: { - crn?: string; - cid?: string; - signer?: string; - }): MsgSetName { - const message = new MsgSetName({}); - if (data.crn != null) { - message.crn = data.crn; - } - if (data.cid != null) { - message.cid = data.cid; - } - if (data.signer != null) { - message.signer = data.signer; - } - return message; - } - toObject() { - const data: { - crn?: string; - cid?: string; - signer?: string; - } = {}; - if (this.crn != null) { - data.crn = this.crn; - } - if (this.cid != null) { - data.cid = this.cid; - } - 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.crn.length) - writer.writeString(1, this.crn); - if (this.cid.length) - writer.writeString(2, this.cid); - if (this.signer.length) - writer.writeString(3, this.signer); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgSetName { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgSetName(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.crn = reader.readString(); - break; - case 2: - message.cid = reader.readString(); - break; - case 3: - message.signer = reader.readString(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): MsgSetName { - return MsgSetName.deserialize(bytes); - } - } - export class MsgSetNameResponse 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: {}): MsgSetNameResponse { - const message = new MsgSetNameResponse({}); - 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): MsgSetNameResponse { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgSetNameResponse(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): MsgSetNameResponse { - return MsgSetNameResponse.deserialize(bytes); - } - } - export class MsgReserveAuthority extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - name?: string; - signer?: string; - owner?: 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 ("name" in data && data.name != undefined) { - this.name = data.name; - } - if ("signer" in data && data.signer != undefined) { - this.signer = data.signer; - } - if ("owner" in data && data.owner != undefined) { - this.owner = data.owner; - } - } - } - get name() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; - } - set name(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 owner() { - return pb_1.Message.getFieldWithDefault(this, 3, "") as string; - } - set owner(value: string) { - pb_1.Message.setField(this, 3, value); - } - static fromObject(data: { - name?: string; - signer?: string; - owner?: string; - }): MsgReserveAuthority { - const message = new MsgReserveAuthority({}); - if (data.name != null) { - message.name = data.name; - } - if (data.signer != null) { - message.signer = data.signer; - } - if (data.owner != null) { - message.owner = data.owner; - } - return message; - } - toObject() { - const data: { - name?: string; - signer?: string; - owner?: string; - } = {}; - if (this.name != null) { - data.name = this.name; - } - if (this.signer != null) { - data.signer = this.signer; - } - if (this.owner != null) { - data.owner = this.owner; - } - 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.name.length) - writer.writeString(1, this.name); - if (this.signer.length) - writer.writeString(2, this.signer); - if (this.owner.length) - writer.writeString(3, this.owner); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgReserveAuthority { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgReserveAuthority(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.name = reader.readString(); - break; - case 2: - message.signer = reader.readString(); - break; - case 3: - message.owner = reader.readString(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): MsgReserveAuthority { - return MsgReserveAuthority.deserialize(bytes); - } - } - export class MsgReserveAuthorityResponse 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: {}): MsgReserveAuthorityResponse { - const message = new MsgReserveAuthorityResponse({}); - 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): MsgReserveAuthorityResponse { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgReserveAuthorityResponse(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): MsgReserveAuthorityResponse { - return MsgReserveAuthorityResponse.deserialize(bytes); - } - } - export class MsgSetAuthorityBond extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - name?: string; - bond_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 ("name" in data && data.name != undefined) { - this.name = data.name; - } - if ("bond_id" in data && data.bond_id != undefined) { - this.bond_id = data.bond_id; - } - if ("signer" in data && data.signer != undefined) { - this.signer = data.signer; - } - } - } - get name() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; - } - set name(value: string) { - pb_1.Message.setField(this, 1, value); - } - get bond_id() { - return pb_1.Message.getFieldWithDefault(this, 2, "") as string; - } - set bond_id(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: { - name?: string; - bond_id?: string; - signer?: string; - }): MsgSetAuthorityBond { - const message = new MsgSetAuthorityBond({}); - if (data.name != null) { - message.name = data.name; - } - if (data.bond_id != null) { - message.bond_id = data.bond_id; - } - if (data.signer != null) { - message.signer = data.signer; - } - return message; - } - toObject() { - const data: { - name?: string; - bond_id?: string; - signer?: string; - } = {}; - if (this.name != null) { - data.name = this.name; - } - if (this.bond_id != null) { - data.bond_id = this.bond_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.name.length) - writer.writeString(1, this.name); - if (this.bond_id.length) - writer.writeString(2, this.bond_id); - if (this.signer.length) - writer.writeString(3, this.signer); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgSetAuthorityBond { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgSetAuthorityBond(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.name = reader.readString(); - break; - case 2: - message.bond_id = reader.readString(); - break; - case 3: - message.signer = reader.readString(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): MsgSetAuthorityBond { - return MsgSetAuthorityBond.deserialize(bytes); - } - } - export class MsgSetAuthorityBondResponse 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: {}): MsgSetAuthorityBondResponse { - const message = new MsgSetAuthorityBondResponse({}); - 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): MsgSetAuthorityBondResponse { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgSetAuthorityBondResponse(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): MsgSetAuthorityBondResponse { - return MsgSetAuthorityBondResponse.deserialize(bytes); - } - } - export class MsgDeleteNameAuthority extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - crn?: 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 ("crn" in data && data.crn != undefined) { - this.crn = data.crn; - } - if ("signer" in data && data.signer != undefined) { - this.signer = data.signer; - } - } - } - get crn() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; - } - set crn(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: { - crn?: string; - signer?: string; - }): MsgDeleteNameAuthority { - const message = new MsgDeleteNameAuthority({}); - if (data.crn != null) { - message.crn = data.crn; - } - if (data.signer != null) { - message.signer = data.signer; - } - return message; - } - toObject() { - const data: { - crn?: string; - signer?: string; - } = {}; - if (this.crn != null) { - data.crn = this.crn; - } - 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.crn.length) - writer.writeString(1, this.crn); - if (this.signer.length) - writer.writeString(2, this.signer); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgDeleteNameAuthority { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgDeleteNameAuthority(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.crn = reader.readString(); - break; - case 2: - message.signer = reader.readString(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): MsgDeleteNameAuthority { - return MsgDeleteNameAuthority.deserialize(bytes); - } - } - export class MsgDeleteNameAuthorityResponse 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: {}): MsgDeleteNameAuthorityResponse { - const message = new MsgDeleteNameAuthorityResponse({}); - 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): MsgDeleteNameAuthorityResponse { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgDeleteNameAuthorityResponse(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): MsgDeleteNameAuthorityResponse { - return MsgDeleteNameAuthorityResponse.deserialize(bytes); - } - } - export class MsgRenewRecord extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - record_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 ("record_id" in data && data.record_id != undefined) { - this.record_id = data.record_id; - } - if ("signer" in data && data.signer != undefined) { - this.signer = data.signer; - } - } - } - get record_id() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; - } - set record_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: { - record_id?: string; - signer?: string; - }): MsgRenewRecord { - const message = new MsgRenewRecord({}); - if (data.record_id != null) { - message.record_id = data.record_id; - } - if (data.signer != null) { - message.signer = data.signer; - } - return message; - } - toObject() { - const data: { - record_id?: string; - signer?: string; - } = {}; - if (this.record_id != null) { - data.record_id = this.record_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.record_id.length) - writer.writeString(1, this.record_id); - if (this.signer.length) - writer.writeString(2, this.signer); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgRenewRecord { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgRenewRecord(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.record_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): MsgRenewRecord { - return MsgRenewRecord.deserialize(bytes); - } - } - export class MsgRenewRecordResponse 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: {}): MsgRenewRecordResponse { - const message = new MsgRenewRecordResponse({}); - 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): MsgRenewRecordResponse { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgRenewRecordResponse(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): MsgRenewRecordResponse { - return MsgRenewRecordResponse.deserialize(bytes); - } - } - export class MsgAssociateBond extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - record_id?: string; - bond_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 ("record_id" in data && data.record_id != undefined) { - this.record_id = data.record_id; - } - if ("bond_id" in data && data.bond_id != undefined) { - this.bond_id = data.bond_id; - } - if ("signer" in data && data.signer != undefined) { - this.signer = data.signer; - } - } - } - get record_id() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; - } - set record_id(value: string) { - pb_1.Message.setField(this, 1, value); - } - get bond_id() { - return pb_1.Message.getFieldWithDefault(this, 2, "") as string; - } - set bond_id(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: { - record_id?: string; - bond_id?: string; - signer?: string; - }): MsgAssociateBond { - const message = new MsgAssociateBond({}); - if (data.record_id != null) { - message.record_id = data.record_id; - } - if (data.bond_id != null) { - message.bond_id = data.bond_id; - } - if (data.signer != null) { - message.signer = data.signer; - } - return message; - } - toObject() { - const data: { - record_id?: string; - bond_id?: string; - signer?: string; - } = {}; - if (this.record_id != null) { - data.record_id = this.record_id; - } - if (this.bond_id != null) { - data.bond_id = this.bond_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.record_id.length) - writer.writeString(1, this.record_id); - if (this.bond_id.length) - writer.writeString(2, this.bond_id); - if (this.signer.length) - writer.writeString(3, this.signer); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgAssociateBond { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgAssociateBond(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.record_id = reader.readString(); - break; - case 2: - message.bond_id = reader.readString(); - break; - case 3: - message.signer = reader.readString(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): MsgAssociateBond { - return MsgAssociateBond.deserialize(bytes); - } - } - export class MsgAssociateBondResponse 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: {}): MsgAssociateBondResponse { - const message = new MsgAssociateBondResponse({}); - 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): MsgAssociateBondResponse { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgAssociateBondResponse(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): MsgAssociateBondResponse { - return MsgAssociateBondResponse.deserialize(bytes); - } - } - export class MsgDissociateBond extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - record_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 ("record_id" in data && data.record_id != undefined) { - this.record_id = data.record_id; - } - if ("signer" in data && data.signer != undefined) { - this.signer = data.signer; - } - } - } - get record_id() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; - } - set record_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: { - record_id?: string; - signer?: string; - }): MsgDissociateBond { - const message = new MsgDissociateBond({}); - if (data.record_id != null) { - message.record_id = data.record_id; - } - if (data.signer != null) { - message.signer = data.signer; - } - return message; - } - toObject() { - const data: { - record_id?: string; - signer?: string; - } = {}; - if (this.record_id != null) { - data.record_id = this.record_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.record_id.length) - writer.writeString(1, this.record_id); - if (this.signer.length) - writer.writeString(2, this.signer); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgDissociateBond { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgDissociateBond(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.record_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): MsgDissociateBond { - return MsgDissociateBond.deserialize(bytes); - } - } - export class MsgDissociateBondResponse 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: {}): MsgDissociateBondResponse { - const message = new MsgDissociateBondResponse({}); - 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): MsgDissociateBondResponse { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgDissociateBondResponse(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): MsgDissociateBondResponse { - return MsgDissociateBondResponse.deserialize(bytes); - } - } - export class MsgDissociateRecords extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - bond_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 ("bond_id" in data && data.bond_id != undefined) { - this.bond_id = data.bond_id; - } - if ("signer" in data && data.signer != undefined) { - this.signer = data.signer; - } - } - } - get bond_id() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; - } - set bond_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: { - bond_id?: string; - signer?: string; - }): MsgDissociateRecords { - const message = new MsgDissociateRecords({}); - if (data.bond_id != null) { - message.bond_id = data.bond_id; - } - if (data.signer != null) { - message.signer = data.signer; - } - return message; - } - toObject() { - const data: { - bond_id?: string; - signer?: string; - } = {}; - if (this.bond_id != null) { - data.bond_id = this.bond_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.bond_id.length) - writer.writeString(1, this.bond_id); - if (this.signer.length) - writer.writeString(2, this.signer); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgDissociateRecords { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgDissociateRecords(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.bond_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): MsgDissociateRecords { - return MsgDissociateRecords.deserialize(bytes); - } - } - export class MsgDissociateRecordsResponse 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: {}): MsgDissociateRecordsResponse { - const message = new MsgDissociateRecordsResponse({}); - 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): MsgDissociateRecordsResponse { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgDissociateRecordsResponse(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): MsgDissociateRecordsResponse { - return MsgDissociateRecordsResponse.deserialize(bytes); - } - } - export class MsgReAssociateRecords extends pb_1.Message { - #one_of_decls: number[][] = []; - constructor(data?: any[] | { - new_bond_id?: string; - old_bond_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 ("new_bond_id" in data && data.new_bond_id != undefined) { - this.new_bond_id = data.new_bond_id; - } - if ("old_bond_id" in data && data.old_bond_id != undefined) { - this.old_bond_id = data.old_bond_id; - } - if ("signer" in data && data.signer != undefined) { - this.signer = data.signer; - } - } - } - get new_bond_id() { - return pb_1.Message.getFieldWithDefault(this, 1, "") as string; - } - set new_bond_id(value: string) { - pb_1.Message.setField(this, 1, value); - } - get old_bond_id() { - return pb_1.Message.getFieldWithDefault(this, 2, "") as string; - } - set old_bond_id(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: { - new_bond_id?: string; - old_bond_id?: string; - signer?: string; - }): MsgReAssociateRecords { - const message = new MsgReAssociateRecords({}); - if (data.new_bond_id != null) { - message.new_bond_id = data.new_bond_id; - } - if (data.old_bond_id != null) { - message.old_bond_id = data.old_bond_id; - } - if (data.signer != null) { - message.signer = data.signer; - } - return message; - } - toObject() { - const data: { - new_bond_id?: string; - old_bond_id?: string; - signer?: string; - } = {}; - if (this.new_bond_id != null) { - data.new_bond_id = this.new_bond_id; - } - if (this.old_bond_id != null) { - data.old_bond_id = this.old_bond_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.new_bond_id.length) - writer.writeString(1, this.new_bond_id); - if (this.old_bond_id.length) - writer.writeString(2, this.old_bond_id); - if (this.signer.length) - writer.writeString(3, this.signer); - if (!w) - return writer.getResultBuffer(); - } - static deserialize(bytes: Uint8Array | pb_1.BinaryReader): MsgReAssociateRecords { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgReAssociateRecords(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - case 1: - message.new_bond_id = reader.readString(); - break; - case 2: - message.old_bond_id = reader.readString(); - break; - case 3: - message.signer = reader.readString(); - break; - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): MsgReAssociateRecords { - return MsgReAssociateRecords.deserialize(bytes); - } - } - export class MsgReAssociateRecordsResponse 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: {}): MsgReAssociateRecordsResponse { - const message = new MsgReAssociateRecordsResponse({}); - 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): MsgReAssociateRecordsResponse { - const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new MsgReAssociateRecordsResponse(); - while (reader.nextField()) { - if (reader.isEndGroup()) - break; - switch (reader.getFieldNumber()) { - default: reader.skipField(); - } - } - return message; - } - serializeBinary(): Uint8Array { - return this.serialize(); - } - static deserializeBinary(bytes: Uint8Array): MsgReAssociateRecordsResponse { - return MsgReAssociateRecordsResponse.deserialize(bytes); - } - } -} diff --git a/src/proto2/cosmos/base/query/v1beta1/pagination.ts b/src/proto2/cosmos/base/query/v1beta1/pagination.ts deleted file mode 100644 index fe65b07..0000000 --- a/src/proto2/cosmos/base/query/v1beta1/pagination.ts +++ /dev/null @@ -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>>( - 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>>( - 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 extends Builtin - ? T - : T extends Long - ? string | number | Long - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude>]: never; - }; - -if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); -} - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} diff --git a/src/proto2/cosmos/base/v1beta1/coin.ts b/src/proto2/cosmos/base/v1beta1/coin.ts deleted file mode 100644 index ba71c31..0000000 --- a/src/proto2/cosmos/base/v1beta1/coin.ts +++ /dev/null @@ -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>>(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>>(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>>(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>>(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 extends Builtin - ? T - : T extends Long - ? string | number | Long - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude>]: never; - }; - -if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); -} - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} diff --git a/src/proto2/gogoproto/gogo.ts b/src/proto2/gogoproto/gogo.ts deleted file mode 100644 index 3f41a04..0000000 --- a/src/proto2/gogoproto/gogo.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "gogoproto"; diff --git a/src/proto2/google/api/annotations.ts b/src/proto2/google/api/annotations.ts deleted file mode 100644 index aace478..0000000 --- a/src/proto2/google/api/annotations.ts +++ /dev/null @@ -1,2 +0,0 @@ -/* eslint-disable */ -export const protobufPackage = "google.api"; diff --git a/src/proto2/google/api/http.ts b/src/proto2/google/api/http.ts deleted file mode 100644 index 1ca1521..0000000 --- a/src/proto2/google/api/http.ts +++ /dev/null @@ -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: .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>>(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>>(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>>( - 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 extends Builtin - ? T - : T extends Long - ? string | number | Long - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude>]: never; - }; - -if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); -} - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} diff --git a/src/proto2/google/protobuf/descriptor.ts b/src/proto2/google/protobuf/descriptor.ts deleted file mode 100644 index e1cda94..0000000 --- a/src/proto2/google/protobuf/descriptor.ts +++ /dev/null @@ -1,4395 +0,0 @@ -/* eslint-disable */ -import Long from "long"; -import _m0 from "protobufjs/minimal"; - -export const protobufPackage = "google.protobuf"; - -/** - * The protocol compiler can output a FileDescriptorSet containing the .proto - * files it parses. - */ -export interface FileDescriptorSet { - file: FileDescriptorProto[]; -} - -/** Describes a complete .proto file. */ -export interface FileDescriptorProto { - /** file name, relative to root of source tree */ - name: string; - /** e.g. "foo", "foo.bar", etc. */ - package: string; - /** Names of files imported by this file. */ - dependency: string[]; - /** Indexes of the public imported files in the dependency list above. */ - publicDependency: number[]; - /** - * Indexes of the weak imported files in the dependency list. - * For Google-internal migration only. Do not use. - */ - weakDependency: number[]; - /** All top-level definitions in this file. */ - messageType: DescriptorProto[]; - enumType: EnumDescriptorProto[]; - service: ServiceDescriptorProto[]; - extension: FieldDescriptorProto[]; - options?: FileOptions; - /** - * This field contains optional information about the original source code. - * You may safely remove this entire field without harming runtime - * functionality of the descriptors -- the information is needed only by - * development tools. - */ - sourceCodeInfo?: SourceCodeInfo; - /** - * The syntax of the proto file. - * The supported values are "proto2" and "proto3". - */ - syntax: string; -} - -/** Describes a message type. */ -export interface DescriptorProto { - name: string; - field: FieldDescriptorProto[]; - extension: FieldDescriptorProto[]; - nestedType: DescriptorProto[]; - enumType: EnumDescriptorProto[]; - extensionRange: DescriptorProto_ExtensionRange[]; - oneofDecl: OneofDescriptorProto[]; - options?: MessageOptions; - reservedRange: DescriptorProto_ReservedRange[]; - /** - * Reserved field names, which may not be used by fields in the same message. - * A given name may only be reserved once. - */ - reservedName: string[]; -} - -export interface DescriptorProto_ExtensionRange { - /** Inclusive. */ - start: number; - /** Exclusive. */ - end: number; - options?: ExtensionRangeOptions; -} - -/** - * Range of reserved tag numbers. Reserved tag numbers may not be used by - * fields or extension ranges in the same message. Reserved ranges may - * not overlap. - */ -export interface DescriptorProto_ReservedRange { - /** Inclusive. */ - start: number; - /** Exclusive. */ - end: number; -} - -export interface ExtensionRangeOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpretedOption: UninterpretedOption[]; -} - -/** Describes a field within a message. */ -export interface FieldDescriptorProto { - name: string; - number: number; - label: FieldDescriptorProto_Label; - /** - * If type_name is set, this need not be set. If both this and type_name - * are set, this must be one of TYPE_ENUM, TYPE_MESSAGE or TYPE_GROUP. - */ - type: FieldDescriptorProto_Type; - /** - * For message and enum types, this is the name of the type. If the name - * starts with a '.', it is fully-qualified. Otherwise, C++-like scoping - * rules are used to find the type (i.e. first the nested types within this - * message are searched, then within the parent, on up to the root - * namespace). - */ - typeName: string; - /** - * For extensions, this is the name of the type being extended. It is - * resolved in the same manner as type_name. - */ - extendee: string; - /** - * For numeric types, contains the original text representation of the value. - * For booleans, "true" or "false". - * For strings, contains the default text contents (not escaped in any way). - * For bytes, contains the C escaped value. All bytes >= 128 are escaped. - */ - defaultValue: string; - /** - * If set, gives the index of a oneof in the containing type's oneof_decl - * list. This field is a member of that oneof. - */ - oneofIndex: number; - /** - * JSON name of this field. The value is set by protocol compiler. If the - * user has set a "json_name" option on this field, that option's value - * will be used. Otherwise, it's deduced from the field's name by converting - * it to camelCase. - */ - jsonName: string; - options?: FieldOptions; - /** - * If true, this is a proto3 "optional". When a proto3 field is optional, it - * tracks presence regardless of field type. - * - * When proto3_optional is true, this field must be belong to a oneof to - * signal to old proto3 clients that presence is tracked for this field. This - * oneof is known as a "synthetic" oneof, and this field must be its sole - * member (each proto3 optional field gets its own synthetic oneof). Synthetic - * oneofs exist in the descriptor only, and do not generate any API. Synthetic - * oneofs must be ordered after all "real" oneofs. - * - * For message fields, proto3_optional doesn't create any semantic change, - * since non-repeated message fields always track presence. However it still - * indicates the semantic detail of whether the user wrote "optional" or not. - * This can be useful for round-tripping the .proto file. For consistency we - * give message fields a synthetic oneof also, even though it is not required - * to track presence. This is especially important because the parser can't - * tell if a field is a message or an enum, so it must always create a - * synthetic oneof. - * - * Proto2 optional fields do not set this flag, because they already indicate - * optional with `LABEL_OPTIONAL`. - */ - proto3Optional: boolean; -} - -export enum FieldDescriptorProto_Type { - /** - * TYPE_DOUBLE - 0 is reserved for errors. - * Order is weird for historical reasons. - */ - TYPE_DOUBLE = 1, - TYPE_FLOAT = 2, - /** - * TYPE_INT64 - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT64 if - * negative values are likely. - */ - TYPE_INT64 = 3, - TYPE_UINT64 = 4, - /** - * TYPE_INT32 - Not ZigZag encoded. Negative numbers take 10 bytes. Use TYPE_SINT32 if - * negative values are likely. - */ - TYPE_INT32 = 5, - TYPE_FIXED64 = 6, - TYPE_FIXED32 = 7, - TYPE_BOOL = 8, - TYPE_STRING = 9, - /** - * TYPE_GROUP - Tag-delimited aggregate. - * Group type is deprecated and not supported in proto3. However, Proto3 - * implementations should still be able to parse the group wire format and - * treat group fields as unknown fields. - */ - TYPE_GROUP = 10, - /** TYPE_MESSAGE - Length-delimited aggregate. */ - TYPE_MESSAGE = 11, - /** TYPE_BYTES - New in version 2. */ - TYPE_BYTES = 12, - TYPE_UINT32 = 13, - TYPE_ENUM = 14, - TYPE_SFIXED32 = 15, - TYPE_SFIXED64 = 16, - /** TYPE_SINT32 - Uses ZigZag encoding. */ - TYPE_SINT32 = 17, - /** TYPE_SINT64 - Uses ZigZag encoding. */ - TYPE_SINT64 = 18, - UNRECOGNIZED = -1, -} - -export function fieldDescriptorProto_TypeFromJSON( - object: any -): FieldDescriptorProto_Type { - switch (object) { - case 1: - case "TYPE_DOUBLE": - return FieldDescriptorProto_Type.TYPE_DOUBLE; - case 2: - case "TYPE_FLOAT": - return FieldDescriptorProto_Type.TYPE_FLOAT; - case 3: - case "TYPE_INT64": - return FieldDescriptorProto_Type.TYPE_INT64; - case 4: - case "TYPE_UINT64": - return FieldDescriptorProto_Type.TYPE_UINT64; - case 5: - case "TYPE_INT32": - return FieldDescriptorProto_Type.TYPE_INT32; - case 6: - case "TYPE_FIXED64": - return FieldDescriptorProto_Type.TYPE_FIXED64; - case 7: - case "TYPE_FIXED32": - return FieldDescriptorProto_Type.TYPE_FIXED32; - case 8: - case "TYPE_BOOL": - return FieldDescriptorProto_Type.TYPE_BOOL; - case 9: - case "TYPE_STRING": - return FieldDescriptorProto_Type.TYPE_STRING; - case 10: - case "TYPE_GROUP": - return FieldDescriptorProto_Type.TYPE_GROUP; - case 11: - case "TYPE_MESSAGE": - return FieldDescriptorProto_Type.TYPE_MESSAGE; - case 12: - case "TYPE_BYTES": - return FieldDescriptorProto_Type.TYPE_BYTES; - case 13: - case "TYPE_UINT32": - return FieldDescriptorProto_Type.TYPE_UINT32; - case 14: - case "TYPE_ENUM": - return FieldDescriptorProto_Type.TYPE_ENUM; - case 15: - case "TYPE_SFIXED32": - return FieldDescriptorProto_Type.TYPE_SFIXED32; - case 16: - case "TYPE_SFIXED64": - return FieldDescriptorProto_Type.TYPE_SFIXED64; - case 17: - case "TYPE_SINT32": - return FieldDescriptorProto_Type.TYPE_SINT32; - case 18: - case "TYPE_SINT64": - return FieldDescriptorProto_Type.TYPE_SINT64; - case -1: - case "UNRECOGNIZED": - default: - return FieldDescriptorProto_Type.UNRECOGNIZED; - } -} - -export function fieldDescriptorProto_TypeToJSON( - object: FieldDescriptorProto_Type -): string { - switch (object) { - case FieldDescriptorProto_Type.TYPE_DOUBLE: - return "TYPE_DOUBLE"; - case FieldDescriptorProto_Type.TYPE_FLOAT: - return "TYPE_FLOAT"; - case FieldDescriptorProto_Type.TYPE_INT64: - return "TYPE_INT64"; - case FieldDescriptorProto_Type.TYPE_UINT64: - return "TYPE_UINT64"; - case FieldDescriptorProto_Type.TYPE_INT32: - return "TYPE_INT32"; - case FieldDescriptorProto_Type.TYPE_FIXED64: - return "TYPE_FIXED64"; - case FieldDescriptorProto_Type.TYPE_FIXED32: - return "TYPE_FIXED32"; - case FieldDescriptorProto_Type.TYPE_BOOL: - return "TYPE_BOOL"; - case FieldDescriptorProto_Type.TYPE_STRING: - return "TYPE_STRING"; - case FieldDescriptorProto_Type.TYPE_GROUP: - return "TYPE_GROUP"; - case FieldDescriptorProto_Type.TYPE_MESSAGE: - return "TYPE_MESSAGE"; - case FieldDescriptorProto_Type.TYPE_BYTES: - return "TYPE_BYTES"; - case FieldDescriptorProto_Type.TYPE_UINT32: - return "TYPE_UINT32"; - case FieldDescriptorProto_Type.TYPE_ENUM: - return "TYPE_ENUM"; - case FieldDescriptorProto_Type.TYPE_SFIXED32: - return "TYPE_SFIXED32"; - case FieldDescriptorProto_Type.TYPE_SFIXED64: - return "TYPE_SFIXED64"; - case FieldDescriptorProto_Type.TYPE_SINT32: - return "TYPE_SINT32"; - case FieldDescriptorProto_Type.TYPE_SINT64: - return "TYPE_SINT64"; - case FieldDescriptorProto_Type.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -export enum FieldDescriptorProto_Label { - /** LABEL_OPTIONAL - 0 is reserved for errors */ - LABEL_OPTIONAL = 1, - LABEL_REQUIRED = 2, - LABEL_REPEATED = 3, - UNRECOGNIZED = -1, -} - -export function fieldDescriptorProto_LabelFromJSON( - object: any -): FieldDescriptorProto_Label { - switch (object) { - case 1: - case "LABEL_OPTIONAL": - return FieldDescriptorProto_Label.LABEL_OPTIONAL; - case 2: - case "LABEL_REQUIRED": - return FieldDescriptorProto_Label.LABEL_REQUIRED; - case 3: - case "LABEL_REPEATED": - return FieldDescriptorProto_Label.LABEL_REPEATED; - case -1: - case "UNRECOGNIZED": - default: - return FieldDescriptorProto_Label.UNRECOGNIZED; - } -} - -export function fieldDescriptorProto_LabelToJSON( - object: FieldDescriptorProto_Label -): string { - switch (object) { - case FieldDescriptorProto_Label.LABEL_OPTIONAL: - return "LABEL_OPTIONAL"; - case FieldDescriptorProto_Label.LABEL_REQUIRED: - return "LABEL_REQUIRED"; - case FieldDescriptorProto_Label.LABEL_REPEATED: - return "LABEL_REPEATED"; - case FieldDescriptorProto_Label.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -/** Describes a oneof. */ -export interface OneofDescriptorProto { - name: string; - options?: OneofOptions; -} - -/** Describes an enum type. */ -export interface EnumDescriptorProto { - name: string; - value: EnumValueDescriptorProto[]; - options?: EnumOptions; - /** - * Range of reserved numeric values. Reserved numeric values may not be used - * by enum values in the same enum declaration. Reserved ranges may not - * overlap. - */ - reservedRange: EnumDescriptorProto_EnumReservedRange[]; - /** - * Reserved enum value names, which may not be reused. A given name may only - * be reserved once. - */ - reservedName: string[]; -} - -/** - * Range of reserved numeric values. Reserved values may not be used by - * entries in the same enum. Reserved ranges may not overlap. - * - * Note that this is distinct from DescriptorProto.ReservedRange in that it - * is inclusive such that it can appropriately represent the entire int32 - * domain. - */ -export interface EnumDescriptorProto_EnumReservedRange { - /** Inclusive. */ - start: number; - /** Inclusive. */ - end: number; -} - -/** Describes a value within an enum. */ -export interface EnumValueDescriptorProto { - name: string; - number: number; - options?: EnumValueOptions; -} - -/** Describes a service. */ -export interface ServiceDescriptorProto { - name: string; - method: MethodDescriptorProto[]; - options?: ServiceOptions; -} - -/** Describes a method of a service. */ -export interface MethodDescriptorProto { - name: string; - /** - * Input and output type names. These are resolved in the same way as - * FieldDescriptorProto.type_name, but must refer to a message type. - */ - inputType: string; - outputType: string; - options?: MethodOptions; - /** Identifies if client streams multiple client messages */ - clientStreaming: boolean; - /** Identifies if server streams multiple server messages */ - serverStreaming: boolean; -} - -export interface FileOptions { - /** - * Sets the Java package where classes generated from this .proto will be - * placed. By default, the proto package is used, but this is often - * inappropriate because proto packages do not normally start with backwards - * domain names. - */ - javaPackage: string; - /** - * Controls the name of the wrapper Java class generated for the .proto file. - * That class will always contain the .proto file's getDescriptor() method as - * well as any top-level extensions defined in the .proto file. - * If java_multiple_files is disabled, then all the other classes from the - * .proto file will be nested inside the single wrapper outer class. - */ - javaOuterClassname: string; - /** - * If enabled, then the Java code generator will generate a separate .java - * file for each top-level message, enum, and service defined in the .proto - * file. Thus, these types will *not* be nested inside the wrapper class - * named by java_outer_classname. However, the wrapper class will still be - * generated to contain the file's getDescriptor() method as well as any - * top-level extensions defined in the file. - */ - javaMultipleFiles: boolean; - /** - * This option does nothing. - * - * @deprecated - */ - javaGenerateEqualsAndHash: boolean; - /** - * If set true, then the Java2 code generator will generate code that - * throws an exception whenever an attempt is made to assign a non-UTF-8 - * byte sequence to a string field. - * Message reflection will do the same. - * However, an extension field still accepts non-UTF-8 byte sequences. - * This option has no effect on when used with the lite runtime. - */ - javaStringCheckUtf8: boolean; - optimizeFor: FileOptions_OptimizeMode; - /** - * Sets the Go package where structs generated from this .proto will be - * placed. If omitted, the Go package will be derived from the following: - * - The basename of the package import path, if provided. - * - Otherwise, the package statement in the .proto file, if present. - * - Otherwise, the basename of the .proto file, without extension. - */ - goPackage: string; - /** - * Should generic services be generated in each language? "Generic" services - * are not specific to any particular RPC system. They are generated by the - * main code generators in each language (without additional plugins). - * Generic services were the only kind of service generation supported by - * early versions of google.protobuf. - * - * Generic services are now considered deprecated in favor of using plugins - * that generate code specific to your particular RPC system. Therefore, - * these default to false. Old code which depends on generic services should - * explicitly set them to true. - */ - ccGenericServices: boolean; - javaGenericServices: boolean; - pyGenericServices: boolean; - phpGenericServices: boolean; - /** - * Is this file deprecated? - * Depending on the target platform, this can emit Deprecated annotations - * for everything in the file, or it will be completely ignored; in the very - * least, this is a formalization for deprecating files. - */ - deprecated: boolean; - /** - * Enables the use of arenas for the proto messages in this file. This applies - * only to generated classes for C++. - */ - ccEnableArenas: boolean; - /** - * Sets the objective c class prefix which is prepended to all objective c - * generated classes from this .proto. There is no default. - */ - objcClassPrefix: string; - /** Namespace for generated classes; defaults to the package. */ - csharpNamespace: string; - /** - * By default Swift generators will take the proto package and CamelCase it - * replacing '.' with underscore and use that to prefix the types/symbols - * defined. When this options is provided, they will use this value instead - * to prefix the types/symbols defined. - */ - swiftPrefix: string; - /** - * Sets the php class prefix which is prepended to all php generated classes - * from this .proto. Default is empty. - */ - phpClassPrefix: string; - /** - * Use this option to change the namespace of php generated classes. Default - * is empty. When this option is empty, the package name will be used for - * determining the namespace. - */ - phpNamespace: string; - /** - * Use this option to change the namespace of php generated metadata classes. - * Default is empty. When this option is empty, the proto file name will be - * used for determining the namespace. - */ - phpMetadataNamespace: string; - /** - * Use this option to change the package of ruby generated classes. Default - * is empty. When this option is not set, the package name will be used for - * determining the ruby package. - */ - rubyPackage: string; - /** - * The parser stores options it doesn't recognize here. - * See the documentation for the "Options" section above. - */ - uninterpretedOption: UninterpretedOption[]; -} - -/** Generated classes can be optimized for speed or code size. */ -export enum FileOptions_OptimizeMode { - /** SPEED - Generate complete code for parsing, serialization, */ - SPEED = 1, - /** CODE_SIZE - etc. */ - CODE_SIZE = 2, - /** LITE_RUNTIME - Generate code using MessageLite and the lite runtime. */ - LITE_RUNTIME = 3, - UNRECOGNIZED = -1, -} - -export function fileOptions_OptimizeModeFromJSON( - object: any -): FileOptions_OptimizeMode { - switch (object) { - case 1: - case "SPEED": - return FileOptions_OptimizeMode.SPEED; - case 2: - case "CODE_SIZE": - return FileOptions_OptimizeMode.CODE_SIZE; - case 3: - case "LITE_RUNTIME": - return FileOptions_OptimizeMode.LITE_RUNTIME; - case -1: - case "UNRECOGNIZED": - default: - return FileOptions_OptimizeMode.UNRECOGNIZED; - } -} - -export function fileOptions_OptimizeModeToJSON( - object: FileOptions_OptimizeMode -): string { - switch (object) { - case FileOptions_OptimizeMode.SPEED: - return "SPEED"; - case FileOptions_OptimizeMode.CODE_SIZE: - return "CODE_SIZE"; - case FileOptions_OptimizeMode.LITE_RUNTIME: - return "LITE_RUNTIME"; - case FileOptions_OptimizeMode.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -export interface MessageOptions { - /** - * Set true to use the old proto1 MessageSet wire format for extensions. - * This is provided for backwards-compatibility with the MessageSet wire - * format. You should not use this for any other reason: It's less - * efficient, has fewer features, and is more complicated. - * - * The message must be defined exactly as follows: - * message Foo { - * option message_set_wire_format = true; - * extensions 4 to max; - * } - * Note that the message cannot have any defined fields; MessageSets only - * have extensions. - * - * All extensions of your type must be singular messages; e.g. they cannot - * be int32s, enums, or repeated messages. - * - * Because this is an option, the above two restrictions are not enforced by - * the protocol compiler. - */ - messageSetWireFormat: boolean; - /** - * Disables the generation of the standard "descriptor()" accessor, which can - * conflict with a field of the same name. This is meant to make migration - * from proto1 easier; new code should avoid fields named "descriptor". - */ - noStandardDescriptorAccessor: boolean; - /** - * Is this message deprecated? - * Depending on the target platform, this can emit Deprecated annotations - * for the message, or it will be completely ignored; in the very least, - * this is a formalization for deprecating messages. - */ - deprecated: boolean; - /** - * Whether the message is an automatically generated map entry type for the - * maps field. - * - * For maps fields: - * map map_field = 1; - * The parsed descriptor looks like: - * message MapFieldEntry { - * option map_entry = true; - * optional KeyType key = 1; - * optional ValueType value = 2; - * } - * repeated MapFieldEntry map_field = 1; - * - * Implementations may choose not to generate the map_entry=true message, but - * use a native map in the target language to hold the keys and values. - * The reflection APIs in such implementations still need to work as - * if the field is a repeated message field. - * - * NOTE: Do not set the option in .proto files. Always use the maps syntax - * instead. The option should only be implicitly set by the proto compiler - * parser. - */ - mapEntry: boolean; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpretedOption: UninterpretedOption[]; -} - -export interface FieldOptions { - /** - * The ctype option instructs the C++ code generator to use a different - * representation of the field than it normally would. See the specific - * options below. This option is not yet implemented in the open source - * release -- sorry, we'll try to include it in a future version! - */ - ctype: FieldOptions_CType; - /** - * The packed option can be enabled for repeated primitive fields to enable - * a more efficient representation on the wire. Rather than repeatedly - * writing the tag and type for each element, the entire array is encoded as - * a single length-delimited blob. In proto3, only explicit setting it to - * false will avoid using packed encoding. - */ - packed: boolean; - /** - * The jstype option determines the JavaScript type used for values of the - * field. The option is permitted only for 64 bit integral and fixed types - * (int64, uint64, sint64, fixed64, sfixed64). A field with jstype JS_STRING - * is represented as JavaScript string, which avoids loss of precision that - * can happen when a large value is converted to a floating point JavaScript. - * Specifying JS_NUMBER for the jstype causes the generated JavaScript code to - * use the JavaScript "number" type. The behavior of the default option - * JS_NORMAL is implementation dependent. - * - * This option is an enum to permit additional types to be added, e.g. - * goog.math.Integer. - */ - jstype: FieldOptions_JSType; - /** - * Should this field be parsed lazily? Lazy applies only to message-type - * fields. It means that when the outer message is initially parsed, the - * inner message's contents will not be parsed but instead stored in encoded - * form. The inner message will actually be parsed when it is first accessed. - * - * This is only a hint. Implementations are free to choose whether to use - * eager or lazy parsing regardless of the value of this option. However, - * setting this option true suggests that the protocol author believes that - * using lazy parsing on this field is worth the additional bookkeeping - * overhead typically needed to implement it. - * - * This option does not affect the public interface of any generated code; - * all method signatures remain the same. Furthermore, thread-safety of the - * interface is not affected by this option; const methods remain safe to - * call from multiple threads concurrently, while non-const methods continue - * to require exclusive access. - * - * - * Note that implementations may choose not to check required fields within - * a lazy sub-message. That is, calling IsInitialized() on the outer message - * may return true even if the inner message has missing required fields. - * This is necessary because otherwise the inner message would have to be - * parsed in order to perform the check, defeating the purpose of lazy - * parsing. An implementation which chooses not to check required fields - * must be consistent about it. That is, for any particular sub-message, the - * implementation must either *always* check its required fields, or *never* - * check its required fields, regardless of whether or not the message has - * been parsed. - * - * As of 2021, lazy does no correctness checks on the byte stream during - * parsing. This may lead to crashes if and when an invalid byte stream is - * finally parsed upon access. - * - * TODO(b/211906113): Enable validation on lazy fields. - */ - lazy: boolean; - /** - * unverified_lazy does no correctness checks on the byte stream. This should - * only be used where lazy with verification is prohibitive for performance - * reasons. - */ - unverifiedLazy: boolean; - /** - * Is this field deprecated? - * Depending on the target platform, this can emit Deprecated annotations - * for accessors, or it will be completely ignored; in the very least, this - * is a formalization for deprecating fields. - */ - deprecated: boolean; - /** For Google-internal migration only. Do not use. */ - weak: boolean; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpretedOption: UninterpretedOption[]; -} - -export enum FieldOptions_CType { - /** STRING - Default mode. */ - STRING = 0, - CORD = 1, - STRING_PIECE = 2, - UNRECOGNIZED = -1, -} - -export function fieldOptions_CTypeFromJSON(object: any): FieldOptions_CType { - switch (object) { - case 0: - case "STRING": - return FieldOptions_CType.STRING; - case 1: - case "CORD": - return FieldOptions_CType.CORD; - case 2: - case "STRING_PIECE": - return FieldOptions_CType.STRING_PIECE; - case -1: - case "UNRECOGNIZED": - default: - return FieldOptions_CType.UNRECOGNIZED; - } -} - -export function fieldOptions_CTypeToJSON(object: FieldOptions_CType): string { - switch (object) { - case FieldOptions_CType.STRING: - return "STRING"; - case FieldOptions_CType.CORD: - return "CORD"; - case FieldOptions_CType.STRING_PIECE: - return "STRING_PIECE"; - case FieldOptions_CType.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -export enum FieldOptions_JSType { - /** JS_NORMAL - Use the default type. */ - JS_NORMAL = 0, - /** JS_STRING - Use JavaScript strings. */ - JS_STRING = 1, - /** JS_NUMBER - Use JavaScript numbers. */ - JS_NUMBER = 2, - UNRECOGNIZED = -1, -} - -export function fieldOptions_JSTypeFromJSON(object: any): FieldOptions_JSType { - switch (object) { - case 0: - case "JS_NORMAL": - return FieldOptions_JSType.JS_NORMAL; - case 1: - case "JS_STRING": - return FieldOptions_JSType.JS_STRING; - case 2: - case "JS_NUMBER": - return FieldOptions_JSType.JS_NUMBER; - case -1: - case "UNRECOGNIZED": - default: - return FieldOptions_JSType.UNRECOGNIZED; - } -} - -export function fieldOptions_JSTypeToJSON(object: FieldOptions_JSType): string { - switch (object) { - case FieldOptions_JSType.JS_NORMAL: - return "JS_NORMAL"; - case FieldOptions_JSType.JS_STRING: - return "JS_STRING"; - case FieldOptions_JSType.JS_NUMBER: - return "JS_NUMBER"; - case FieldOptions_JSType.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -export interface OneofOptions { - /** The parser stores options it doesn't recognize here. See above. */ - uninterpretedOption: UninterpretedOption[]; -} - -export interface EnumOptions { - /** - * Set this option to true to allow mapping different tag names to the same - * value. - */ - allowAlias: boolean; - /** - * Is this enum deprecated? - * Depending on the target platform, this can emit Deprecated annotations - * for the enum, or it will be completely ignored; in the very least, this - * is a formalization for deprecating enums. - */ - deprecated: boolean; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpretedOption: UninterpretedOption[]; -} - -export interface EnumValueOptions { - /** - * Is this enum value deprecated? - * Depending on the target platform, this can emit Deprecated annotations - * for the enum value, or it will be completely ignored; in the very least, - * this is a formalization for deprecating enum values. - */ - deprecated: boolean; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpretedOption: UninterpretedOption[]; -} - -export interface ServiceOptions { - /** - * Is this service deprecated? - * Depending on the target platform, this can emit Deprecated annotations - * for the service, or it will be completely ignored; in the very least, - * this is a formalization for deprecating services. - */ - deprecated: boolean; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpretedOption: UninterpretedOption[]; -} - -export interface MethodOptions { - /** - * Is this method deprecated? - * Depending on the target platform, this can emit Deprecated annotations - * for the method, or it will be completely ignored; in the very least, - * this is a formalization for deprecating methods. - */ - deprecated: boolean; - idempotencyLevel: MethodOptions_IdempotencyLevel; - /** The parser stores options it doesn't recognize here. See above. */ - uninterpretedOption: UninterpretedOption[]; -} - -/** - * Is this method side-effect-free (or safe in HTTP parlance), or idempotent, - * or neither? HTTP based RPC implementation may choose GET verb for safe - * methods, and PUT verb for idempotent methods instead of the default POST. - */ -export enum MethodOptions_IdempotencyLevel { - IDEMPOTENCY_UNKNOWN = 0, - /** NO_SIDE_EFFECTS - implies idempotent */ - NO_SIDE_EFFECTS = 1, - /** IDEMPOTENT - idempotent, but may have side effects */ - IDEMPOTENT = 2, - UNRECOGNIZED = -1, -} - -export function methodOptions_IdempotencyLevelFromJSON( - object: any -): MethodOptions_IdempotencyLevel { - switch (object) { - case 0: - case "IDEMPOTENCY_UNKNOWN": - return MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN; - case 1: - case "NO_SIDE_EFFECTS": - return MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS; - case 2: - case "IDEMPOTENT": - return MethodOptions_IdempotencyLevel.IDEMPOTENT; - case -1: - case "UNRECOGNIZED": - default: - return MethodOptions_IdempotencyLevel.UNRECOGNIZED; - } -} - -export function methodOptions_IdempotencyLevelToJSON( - object: MethodOptions_IdempotencyLevel -): string { - switch (object) { - case MethodOptions_IdempotencyLevel.IDEMPOTENCY_UNKNOWN: - return "IDEMPOTENCY_UNKNOWN"; - case MethodOptions_IdempotencyLevel.NO_SIDE_EFFECTS: - return "NO_SIDE_EFFECTS"; - case MethodOptions_IdempotencyLevel.IDEMPOTENT: - return "IDEMPOTENT"; - case MethodOptions_IdempotencyLevel.UNRECOGNIZED: - default: - return "UNRECOGNIZED"; - } -} - -/** - * A message representing a option the parser does not recognize. This only - * appears in options protos created by the compiler::Parser class. - * DescriptorPool resolves these when building Descriptor objects. Therefore, - * options protos in descriptor objects (e.g. returned by Descriptor::options(), - * or produced by Descriptor::CopyTo()) will never have UninterpretedOptions - * in them. - */ -export interface UninterpretedOption { - name: UninterpretedOption_NamePart[]; - /** - * The value of the uninterpreted option, in whatever type the tokenizer - * identified it as during parsing. Exactly one of these should be set. - */ - identifierValue: string; - positiveIntValue: Long; - negativeIntValue: Long; - doubleValue: number; - stringValue: Uint8Array; - aggregateValue: string; -} - -/** - * The name of the uninterpreted option. Each string represents a segment in - * a dot-separated name. is_extension is true iff a segment represents an - * extension (denoted with parentheses in options specs in .proto files). - * E.g.,{ ["foo", false], ["bar.baz", true], ["moo", false] } represents - * "foo.(bar.baz).moo". - */ -export interface UninterpretedOption_NamePart { - namePart: string; - isExtension: boolean; -} - -/** - * Encapsulates information about the original source file from which a - * FileDescriptorProto was generated. - */ -export interface SourceCodeInfo { - /** - * A Location identifies a piece of source code in a .proto file which - * corresponds to a particular definition. This information is intended - * to be useful to IDEs, code indexers, documentation generators, and similar - * tools. - * - * For example, say we have a file like: - * message Foo { - * optional string foo = 1; - * } - * Let's look at just the field definition: - * optional string foo = 1; - * ^ ^^ ^^ ^ ^^^ - * a bc de f ghi - * We have the following locations: - * span path represents - * [a,i) [ 4, 0, 2, 0 ] The whole field definition. - * [a,b) [ 4, 0, 2, 0, 4 ] The label (optional). - * [c,d) [ 4, 0, 2, 0, 5 ] The type (string). - * [e,f) [ 4, 0, 2, 0, 1 ] The name (foo). - * [g,h) [ 4, 0, 2, 0, 3 ] The number (1). - * - * Notes: - * - A location may refer to a repeated field itself (i.e. not to any - * particular index within it). This is used whenever a set of elements are - * logically enclosed in a single code segment. For example, an entire - * extend block (possibly containing multiple extension definitions) will - * have an outer location whose path refers to the "extensions" repeated - * field without an index. - * - Multiple locations may have the same path. This happens when a single - * logical declaration is spread out across multiple places. The most - * obvious example is the "extend" block again -- there may be multiple - * extend blocks in the same scope, each of which will have the same path. - * - A location's span is not always a subset of its parent's span. For - * example, the "extendee" of an extension declaration appears at the - * beginning of the "extend" block and is shared by all extensions within - * the block. - * - Just because a location's span is a subset of some other location's span - * does not mean that it is a descendant. For example, a "group" defines - * both a type and a field in a single declaration. Thus, the locations - * corresponding to the type and field and their components will overlap. - * - Code which tries to interpret locations should probably be designed to - * ignore those that it doesn't understand, as more types of locations could - * be recorded in the future. - */ - location: SourceCodeInfo_Location[]; -} - -export interface SourceCodeInfo_Location { - /** - * Identifies which part of the FileDescriptorProto was defined at this - * location. - * - * Each element is a field number or an index. They form a path from - * the root FileDescriptorProto to the place where the definition occurs. - * For example, this path: - * [ 4, 3, 2, 7, 1 ] - * refers to: - * file.message_type(3) // 4, 3 - * .field(7) // 2, 7 - * .name() // 1 - * This is because FileDescriptorProto.message_type has field number 4: - * repeated DescriptorProto message_type = 4; - * and DescriptorProto.field has field number 2: - * repeated FieldDescriptorProto field = 2; - * and FieldDescriptorProto.name has field number 1: - * optional string name = 1; - * - * Thus, the above path gives the location of a field name. If we removed - * the last element: - * [ 4, 3, 2, 7 ] - * this path refers to the whole field declaration (from the beginning - * of the label to the terminating semicolon). - */ - path: number[]; - /** - * Always has exactly three or four elements: start line, start column, - * end line (optional, otherwise assumed same as start line), end column. - * These are packed into a single field for efficiency. Note that line - * and column numbers are zero-based -- typically you will want to add - * 1 to each before displaying to a user. - */ - span: number[]; - /** - * If this SourceCodeInfo represents a complete declaration, these are any - * comments appearing before and after the declaration which appear to be - * attached to the declaration. - * - * A series of line comments appearing on consecutive lines, with no other - * tokens appearing on those lines, will be treated as a single comment. - * - * leading_detached_comments will keep paragraphs of comments that appear - * before (but not connected to) the current element. Each paragraph, - * separated by empty lines, will be one comment element in the repeated - * field. - * - * Only the comment content is provided; comment markers (e.g. //) are - * stripped out. For block comments, leading whitespace and an asterisk - * will be stripped from the beginning of each line other than the first. - * Newlines are included in the output. - * - * Examples: - * - * optional int32 foo = 1; // Comment attached to foo. - * // Comment attached to bar. - * optional int32 bar = 2; - * - * optional string baz = 3; - * // Comment attached to baz. - * // Another line attached to baz. - * - * // Comment attached to moo. - * // - * // Another line attached to moo. - * optional double moo = 4; - * - * // Detached comment for corge. This is not leading or trailing comments - * // to moo or corge because there are blank lines separating it from - * // both. - * - * // Detached comment for corge paragraph 2. - * - * optional string corge = 5; - * /* Block comment attached - * * to corge. Leading asterisks - * * will be removed. * / - * /* Block comment attached to - * * grault. * / - * optional int32 grault = 6; - * - * // ignored detached comments. - */ - leadingComments: string; - trailingComments: string; - leadingDetachedComments: string[]; -} - -/** - * Describes the relationship between generated code and its original source - * file. A GeneratedCodeInfo message is associated with only one generated - * source file, but may contain references to different source .proto files. - */ -export interface GeneratedCodeInfo { - /** - * An Annotation connects some span of text in generated code to an element - * of its generating .proto file. - */ - annotation: GeneratedCodeInfo_Annotation[]; -} - -export interface GeneratedCodeInfo_Annotation { - /** - * Identifies the element in the original source .proto file. This field - * is formatted the same as SourceCodeInfo.Location.path. - */ - path: number[]; - /** Identifies the filesystem path to the original source .proto. */ - sourceFile: string; - /** - * Identifies the starting offset in bytes in the generated code - * that relates to the identified object. - */ - begin: number; - /** - * Identifies the ending offset in bytes in the generated code that - * relates to the identified offset. The end offset should be one past - * the last relevant byte (so the length of the text = end - begin). - */ - end: number; -} - -function createBaseFileDescriptorSet(): FileDescriptorSet { - return { file: [] }; -} - -export const FileDescriptorSet = { - encode( - message: FileDescriptorSet, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - for (const v of message.file) { - FileDescriptorProto.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): FileDescriptorSet { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFileDescriptorSet(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.file.push( - FileDescriptorProto.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FileDescriptorSet { - return { - file: Array.isArray(object?.file) - ? object.file.map((e: any) => FileDescriptorProto.fromJSON(e)) - : [], - }; - }, - - toJSON(message: FileDescriptorSet): unknown { - const obj: any = {}; - if (message.file) { - obj.file = message.file.map((e) => - e ? FileDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.file = []; - } - return obj; - }, - - fromPartial, I>>( - object: I - ): FileDescriptorSet { - const message = createBaseFileDescriptorSet(); - message.file = - object.file?.map((e) => FileDescriptorProto.fromPartial(e)) || []; - return message; - }, -}; - -function createBaseFileDescriptorProto(): FileDescriptorProto { - return { - name: "", - package: "", - dependency: [], - publicDependency: [], - weakDependency: [], - messageType: [], - enumType: [], - service: [], - extension: [], - options: undefined, - sourceCodeInfo: undefined, - syntax: "", - }; -} - -export const FileDescriptorProto = { - encode( - message: FileDescriptorProto, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.package !== "") { - writer.uint32(18).string(message.package); - } - for (const v of message.dependency) { - writer.uint32(26).string(v!); - } - writer.uint32(82).fork(); - for (const v of message.publicDependency) { - writer.int32(v); - } - writer.ldelim(); - writer.uint32(90).fork(); - for (const v of message.weakDependency) { - writer.int32(v); - } - writer.ldelim(); - for (const v of message.messageType) { - DescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.enumType) { - EnumDescriptorProto.encode(v!, writer.uint32(42).fork()).ldelim(); - } - for (const v of message.service) { - ServiceDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); - } - for (const v of message.extension) { - FieldDescriptorProto.encode(v!, writer.uint32(58).fork()).ldelim(); - } - if (message.options !== undefined) { - FileOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); - } - if (message.sourceCodeInfo !== undefined) { - SourceCodeInfo.encode( - message.sourceCodeInfo, - writer.uint32(74).fork() - ).ldelim(); - } - if (message.syntax !== "") { - writer.uint32(98).string(message.syntax); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): FileDescriptorProto { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFileDescriptorProto(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.package = reader.string(); - break; - case 3: - message.dependency.push(reader.string()); - break; - case 10: - if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.publicDependency.push(reader.int32()); - } - } else { - message.publicDependency.push(reader.int32()); - } - break; - case 11: - if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.weakDependency.push(reader.int32()); - } - } else { - message.weakDependency.push(reader.int32()); - } - break; - case 4: - message.messageType.push( - DescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 5: - message.enumType.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 6: - message.service.push( - ServiceDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 7: - message.extension.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 8: - message.options = FileOptions.decode(reader, reader.uint32()); - break; - case 9: - message.sourceCodeInfo = SourceCodeInfo.decode( - reader, - reader.uint32() - ); - break; - case 12: - message.syntax = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FileDescriptorProto { - return { - name: isSet(object.name) ? String(object.name) : "", - package: isSet(object.package) ? String(object.package) : "", - dependency: Array.isArray(object?.dependency) - ? object.dependency.map((e: any) => String(e)) - : [], - publicDependency: Array.isArray(object?.publicDependency) - ? object.publicDependency.map((e: any) => Number(e)) - : [], - weakDependency: Array.isArray(object?.weakDependency) - ? object.weakDependency.map((e: any) => Number(e)) - : [], - messageType: Array.isArray(object?.messageType) - ? object.messageType.map((e: any) => DescriptorProto.fromJSON(e)) - : [], - enumType: Array.isArray(object?.enumType) - ? object.enumType.map((e: any) => EnumDescriptorProto.fromJSON(e)) - : [], - service: Array.isArray(object?.service) - ? object.service.map((e: any) => ServiceDescriptorProto.fromJSON(e)) - : [], - extension: Array.isArray(object?.extension) - ? object.extension.map((e: any) => FieldDescriptorProto.fromJSON(e)) - : [], - options: isSet(object.options) - ? FileOptions.fromJSON(object.options) - : undefined, - sourceCodeInfo: isSet(object.sourceCodeInfo) - ? SourceCodeInfo.fromJSON(object.sourceCodeInfo) - : undefined, - syntax: isSet(object.syntax) ? String(object.syntax) : "", - }; - }, - - toJSON(message: FileDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.package !== undefined && (obj.package = message.package); - if (message.dependency) { - obj.dependency = message.dependency.map((e) => e); - } else { - obj.dependency = []; - } - if (message.publicDependency) { - obj.publicDependency = message.publicDependency.map((e) => Math.round(e)); - } else { - obj.publicDependency = []; - } - if (message.weakDependency) { - obj.weakDependency = message.weakDependency.map((e) => Math.round(e)); - } else { - obj.weakDependency = []; - } - if (message.messageType) { - obj.messageType = message.messageType.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); - } else { - obj.messageType = []; - } - if (message.enumType) { - obj.enumType = message.enumType.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.enumType = []; - } - if (message.service) { - obj.service = message.service.map((e) => - e ? ServiceDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.service = []; - } - if (message.extension) { - obj.extension = message.extension.map((e) => - e ? FieldDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.extension = []; - } - message.options !== undefined && - (obj.options = message.options - ? FileOptions.toJSON(message.options) - : undefined); - message.sourceCodeInfo !== undefined && - (obj.sourceCodeInfo = message.sourceCodeInfo - ? SourceCodeInfo.toJSON(message.sourceCodeInfo) - : undefined); - message.syntax !== undefined && (obj.syntax = message.syntax); - return obj; - }, - - fromPartial, I>>( - object: I - ): FileDescriptorProto { - const message = createBaseFileDescriptorProto(); - message.name = object.name ?? ""; - message.package = object.package ?? ""; - message.dependency = object.dependency?.map((e) => e) || []; - message.publicDependency = object.publicDependency?.map((e) => e) || []; - message.weakDependency = object.weakDependency?.map((e) => e) || []; - message.messageType = - object.messageType?.map((e) => DescriptorProto.fromPartial(e)) || []; - message.enumType = - object.enumType?.map((e) => EnumDescriptorProto.fromPartial(e)) || []; - message.service = - object.service?.map((e) => ServiceDescriptorProto.fromPartial(e)) || []; - message.extension = - object.extension?.map((e) => FieldDescriptorProto.fromPartial(e)) || []; - message.options = - object.options !== undefined && object.options !== null - ? FileOptions.fromPartial(object.options) - : undefined; - message.sourceCodeInfo = - object.sourceCodeInfo !== undefined && object.sourceCodeInfo !== null - ? SourceCodeInfo.fromPartial(object.sourceCodeInfo) - : undefined; - message.syntax = object.syntax ?? ""; - return message; - }, -}; - -function createBaseDescriptorProto(): DescriptorProto { - return { - name: "", - field: [], - extension: [], - nestedType: [], - enumType: [], - extensionRange: [], - oneofDecl: [], - options: undefined, - reservedRange: [], - reservedName: [], - }; -} - -export const DescriptorProto = { - encode( - message: DescriptorProto, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - for (const v of message.field) { - FieldDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); - } - for (const v of message.extension) { - FieldDescriptorProto.encode(v!, writer.uint32(50).fork()).ldelim(); - } - for (const v of message.nestedType) { - DescriptorProto.encode(v!, writer.uint32(26).fork()).ldelim(); - } - for (const v of message.enumType) { - EnumDescriptorProto.encode(v!, writer.uint32(34).fork()).ldelim(); - } - for (const v of message.extensionRange) { - DescriptorProto_ExtensionRange.encode( - v!, - writer.uint32(42).fork() - ).ldelim(); - } - for (const v of message.oneofDecl) { - OneofDescriptorProto.encode(v!, writer.uint32(66).fork()).ldelim(); - } - if (message.options !== undefined) { - MessageOptions.encode(message.options, writer.uint32(58).fork()).ldelim(); - } - for (const v of message.reservedRange) { - DescriptorProto_ReservedRange.encode( - v!, - writer.uint32(74).fork() - ).ldelim(); - } - for (const v of message.reservedName) { - writer.uint32(82).string(v!); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): DescriptorProto { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDescriptorProto(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.field.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 6: - message.extension.push( - FieldDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 3: - message.nestedType.push( - DescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 4: - message.enumType.push( - EnumDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 5: - message.extensionRange.push( - DescriptorProto_ExtensionRange.decode(reader, reader.uint32()) - ); - break; - case 8: - message.oneofDecl.push( - OneofDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 7: - message.options = MessageOptions.decode(reader, reader.uint32()); - break; - case 9: - message.reservedRange.push( - DescriptorProto_ReservedRange.decode(reader, reader.uint32()) - ); - break; - case 10: - message.reservedName.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DescriptorProto { - return { - name: isSet(object.name) ? String(object.name) : "", - field: Array.isArray(object?.field) - ? object.field.map((e: any) => FieldDescriptorProto.fromJSON(e)) - : [], - extension: Array.isArray(object?.extension) - ? object.extension.map((e: any) => FieldDescriptorProto.fromJSON(e)) - : [], - nestedType: Array.isArray(object?.nestedType) - ? object.nestedType.map((e: any) => DescriptorProto.fromJSON(e)) - : [], - enumType: Array.isArray(object?.enumType) - ? object.enumType.map((e: any) => EnumDescriptorProto.fromJSON(e)) - : [], - extensionRange: Array.isArray(object?.extensionRange) - ? object.extensionRange.map((e: any) => - DescriptorProto_ExtensionRange.fromJSON(e) - ) - : [], - oneofDecl: Array.isArray(object?.oneofDecl) - ? object.oneofDecl.map((e: any) => OneofDescriptorProto.fromJSON(e)) - : [], - options: isSet(object.options) - ? MessageOptions.fromJSON(object.options) - : undefined, - reservedRange: Array.isArray(object?.reservedRange) - ? object.reservedRange.map((e: any) => - DescriptorProto_ReservedRange.fromJSON(e) - ) - : [], - reservedName: Array.isArray(object?.reservedName) - ? object.reservedName.map((e: any) => String(e)) - : [], - }; - }, - - toJSON(message: DescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - if (message.field) { - obj.field = message.field.map((e) => - e ? FieldDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.field = []; - } - if (message.extension) { - obj.extension = message.extension.map((e) => - e ? FieldDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.extension = []; - } - if (message.nestedType) { - obj.nestedType = message.nestedType.map((e) => - e ? DescriptorProto.toJSON(e) : undefined - ); - } else { - obj.nestedType = []; - } - if (message.enumType) { - obj.enumType = message.enumType.map((e) => - e ? EnumDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.enumType = []; - } - if (message.extensionRange) { - obj.extensionRange = message.extensionRange.map((e) => - e ? DescriptorProto_ExtensionRange.toJSON(e) : undefined - ); - } else { - obj.extensionRange = []; - } - if (message.oneofDecl) { - obj.oneofDecl = message.oneofDecl.map((e) => - e ? OneofDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.oneofDecl = []; - } - message.options !== undefined && - (obj.options = message.options - ? MessageOptions.toJSON(message.options) - : undefined); - if (message.reservedRange) { - obj.reservedRange = message.reservedRange.map((e) => - e ? DescriptorProto_ReservedRange.toJSON(e) : undefined - ); - } else { - obj.reservedRange = []; - } - if (message.reservedName) { - obj.reservedName = message.reservedName.map((e) => e); - } else { - obj.reservedName = []; - } - return obj; - }, - - fromPartial, I>>( - object: I - ): DescriptorProto { - const message = createBaseDescriptorProto(); - message.name = object.name ?? ""; - message.field = - object.field?.map((e) => FieldDescriptorProto.fromPartial(e)) || []; - message.extension = - object.extension?.map((e) => FieldDescriptorProto.fromPartial(e)) || []; - message.nestedType = - object.nestedType?.map((e) => DescriptorProto.fromPartial(e)) || []; - message.enumType = - object.enumType?.map((e) => EnumDescriptorProto.fromPartial(e)) || []; - message.extensionRange = - object.extensionRange?.map((e) => - DescriptorProto_ExtensionRange.fromPartial(e) - ) || []; - message.oneofDecl = - object.oneofDecl?.map((e) => OneofDescriptorProto.fromPartial(e)) || []; - message.options = - object.options !== undefined && object.options !== null - ? MessageOptions.fromPartial(object.options) - : undefined; - message.reservedRange = - object.reservedRange?.map((e) => - DescriptorProto_ReservedRange.fromPartial(e) - ) || []; - message.reservedName = object.reservedName?.map((e) => e) || []; - return message; - }, -}; - -function createBaseDescriptorProto_ExtensionRange(): DescriptorProto_ExtensionRange { - return { start: 0, end: 0, options: undefined }; -} - -export const DescriptorProto_ExtensionRange = { - encode( - message: DescriptorProto_ExtensionRange, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.start !== 0) { - writer.uint32(8).int32(message.start); - } - if (message.end !== 0) { - writer.uint32(16).int32(message.end); - } - if (message.options !== undefined) { - ExtensionRangeOptions.encode( - message.options, - writer.uint32(26).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): DescriptorProto_ExtensionRange { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDescriptorProto_ExtensionRange(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.start = reader.int32(); - break; - case 2: - message.end = reader.int32(); - break; - case 3: - message.options = ExtensionRangeOptions.decode( - reader, - reader.uint32() - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DescriptorProto_ExtensionRange { - return { - start: isSet(object.start) ? Number(object.start) : 0, - end: isSet(object.end) ? Number(object.end) : 0, - options: isSet(object.options) - ? ExtensionRangeOptions.fromJSON(object.options) - : undefined, - }; - }, - - toJSON(message: DescriptorProto_ExtensionRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = Math.round(message.start)); - message.end !== undefined && (obj.end = Math.round(message.end)); - message.options !== undefined && - (obj.options = message.options - ? ExtensionRangeOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial, I>>( - object: I - ): DescriptorProto_ExtensionRange { - const message = createBaseDescriptorProto_ExtensionRange(); - message.start = object.start ?? 0; - message.end = object.end ?? 0; - message.options = - object.options !== undefined && object.options !== null - ? ExtensionRangeOptions.fromPartial(object.options) - : undefined; - return message; - }, -}; - -function createBaseDescriptorProto_ReservedRange(): DescriptorProto_ReservedRange { - return { start: 0, end: 0 }; -} - -export const DescriptorProto_ReservedRange = { - encode( - message: DescriptorProto_ReservedRange, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.start !== 0) { - writer.uint32(8).int32(message.start); - } - if (message.end !== 0) { - writer.uint32(16).int32(message.end); - } - return writer; - }, - - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): DescriptorProto_ReservedRange { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseDescriptorProto_ReservedRange(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.start = reader.int32(); - break; - case 2: - message.end = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): DescriptorProto_ReservedRange { - return { - start: isSet(object.start) ? Number(object.start) : 0, - end: isSet(object.end) ? Number(object.end) : 0, - }; - }, - - toJSON(message: DescriptorProto_ReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = Math.round(message.start)); - message.end !== undefined && (obj.end = Math.round(message.end)); - return obj; - }, - - fromPartial, I>>( - object: I - ): DescriptorProto_ReservedRange { - const message = createBaseDescriptorProto_ReservedRange(); - message.start = object.start ?? 0; - message.end = object.end ?? 0; - return message; - }, -}; - -function createBaseExtensionRangeOptions(): ExtensionRangeOptions { - return { uninterpretedOption: [] }; -} - -export const ExtensionRangeOptions = { - encode( - message: ExtensionRangeOptions, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - for (const v of message.uninterpretedOption) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): ExtensionRangeOptions { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseExtensionRangeOptions(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - message.uninterpretedOption.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ExtensionRangeOptions { - return { - uninterpretedOption: Array.isArray(object?.uninterpretedOption) - ? object.uninterpretedOption.map((e: any) => - UninterpretedOption.fromJSON(e) - ) - : [], - }; - }, - - toJSON(message: ExtensionRangeOptions): unknown { - const obj: any = {}; - if (message.uninterpretedOption) { - obj.uninterpretedOption = message.uninterpretedOption.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpretedOption = []; - } - return obj; - }, - - fromPartial, I>>( - object: I - ): ExtensionRangeOptions { - const message = createBaseExtensionRangeOptions(); - message.uninterpretedOption = - object.uninterpretedOption?.map((e) => - UninterpretedOption.fromPartial(e) - ) || []; - return message; - }, -}; - -function createBaseFieldDescriptorProto(): FieldDescriptorProto { - return { - name: "", - number: 0, - label: 1, - type: 1, - typeName: "", - extendee: "", - defaultValue: "", - oneofIndex: 0, - jsonName: "", - options: undefined, - proto3Optional: false, - }; -} - -export const FieldDescriptorProto = { - encode( - message: FieldDescriptorProto, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.number !== 0) { - writer.uint32(24).int32(message.number); - } - if (message.label !== 1) { - writer.uint32(32).int32(message.label); - } - if (message.type !== 1) { - writer.uint32(40).int32(message.type); - } - if (message.typeName !== "") { - writer.uint32(50).string(message.typeName); - } - if (message.extendee !== "") { - writer.uint32(18).string(message.extendee); - } - if (message.defaultValue !== "") { - writer.uint32(58).string(message.defaultValue); - } - if (message.oneofIndex !== 0) { - writer.uint32(72).int32(message.oneofIndex); - } - if (message.jsonName !== "") { - writer.uint32(82).string(message.jsonName); - } - if (message.options !== undefined) { - FieldOptions.encode(message.options, writer.uint32(66).fork()).ldelim(); - } - if (message.proto3Optional === true) { - writer.uint32(136).bool(message.proto3Optional); - } - return writer; - }, - - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): FieldDescriptorProto { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFieldDescriptorProto(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 3: - message.number = reader.int32(); - break; - case 4: - message.label = reader.int32() as any; - break; - case 5: - message.type = reader.int32() as any; - break; - case 6: - message.typeName = reader.string(); - break; - case 2: - message.extendee = reader.string(); - break; - case 7: - message.defaultValue = reader.string(); - break; - case 9: - message.oneofIndex = reader.int32(); - break; - case 10: - message.jsonName = reader.string(); - break; - case 8: - message.options = FieldOptions.decode(reader, reader.uint32()); - break; - case 17: - message.proto3Optional = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldDescriptorProto { - return { - name: isSet(object.name) ? String(object.name) : "", - number: isSet(object.number) ? Number(object.number) : 0, - label: isSet(object.label) - ? fieldDescriptorProto_LabelFromJSON(object.label) - : 1, - type: isSet(object.type) - ? fieldDescriptorProto_TypeFromJSON(object.type) - : 1, - typeName: isSet(object.typeName) ? String(object.typeName) : "", - extendee: isSet(object.extendee) ? String(object.extendee) : "", - defaultValue: isSet(object.defaultValue) - ? String(object.defaultValue) - : "", - oneofIndex: isSet(object.oneofIndex) ? Number(object.oneofIndex) : 0, - jsonName: isSet(object.jsonName) ? String(object.jsonName) : "", - options: isSet(object.options) - ? FieldOptions.fromJSON(object.options) - : undefined, - proto3Optional: isSet(object.proto3Optional) - ? Boolean(object.proto3Optional) - : false, - }; - }, - - toJSON(message: FieldDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = Math.round(message.number)); - message.label !== undefined && - (obj.label = fieldDescriptorProto_LabelToJSON(message.label)); - message.type !== undefined && - (obj.type = fieldDescriptorProto_TypeToJSON(message.type)); - message.typeName !== undefined && (obj.typeName = message.typeName); - message.extendee !== undefined && (obj.extendee = message.extendee); - message.defaultValue !== undefined && - (obj.defaultValue = message.defaultValue); - message.oneofIndex !== undefined && - (obj.oneofIndex = Math.round(message.oneofIndex)); - message.jsonName !== undefined && (obj.jsonName = message.jsonName); - message.options !== undefined && - (obj.options = message.options - ? FieldOptions.toJSON(message.options) - : undefined); - message.proto3Optional !== undefined && - (obj.proto3Optional = message.proto3Optional); - return obj; - }, - - fromPartial, I>>( - object: I - ): FieldDescriptorProto { - const message = createBaseFieldDescriptorProto(); - message.name = object.name ?? ""; - message.number = object.number ?? 0; - message.label = object.label ?? 1; - message.type = object.type ?? 1; - message.typeName = object.typeName ?? ""; - message.extendee = object.extendee ?? ""; - message.defaultValue = object.defaultValue ?? ""; - message.oneofIndex = object.oneofIndex ?? 0; - message.jsonName = object.jsonName ?? ""; - message.options = - object.options !== undefined && object.options !== null - ? FieldOptions.fromPartial(object.options) - : undefined; - message.proto3Optional = object.proto3Optional ?? false; - return message; - }, -}; - -function createBaseOneofDescriptorProto(): OneofDescriptorProto { - return { name: "", options: undefined }; -} - -export const OneofDescriptorProto = { - encode( - message: OneofDescriptorProto, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.options !== undefined) { - OneofOptions.encode(message.options, writer.uint32(18).fork()).ldelim(); - } - return writer; - }, - - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): OneofDescriptorProto { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseOneofDescriptorProto(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.options = OneofOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): OneofDescriptorProto { - return { - name: isSet(object.name) ? String(object.name) : "", - options: isSet(object.options) - ? OneofOptions.fromJSON(object.options) - : undefined, - }; - }, - - toJSON(message: OneofDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.options !== undefined && - (obj.options = message.options - ? OneofOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial, I>>( - object: I - ): OneofDescriptorProto { - const message = createBaseOneofDescriptorProto(); - message.name = object.name ?? ""; - message.options = - object.options !== undefined && object.options !== null - ? OneofOptions.fromPartial(object.options) - : undefined; - return message; - }, -}; - -function createBaseEnumDescriptorProto(): EnumDescriptorProto { - return { - name: "", - value: [], - options: undefined, - reservedRange: [], - reservedName: [], - }; -} - -export const EnumDescriptorProto = { - encode( - message: EnumDescriptorProto, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - for (const v of message.value) { - EnumValueDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); - } - if (message.options !== undefined) { - EnumOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); - } - for (const v of message.reservedRange) { - EnumDescriptorProto_EnumReservedRange.encode( - v!, - writer.uint32(34).fork() - ).ldelim(); - } - for (const v of message.reservedName) { - writer.uint32(42).string(v!); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): EnumDescriptorProto { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEnumDescriptorProto(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.value.push( - EnumValueDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 3: - message.options = EnumOptions.decode(reader, reader.uint32()); - break; - case 4: - message.reservedRange.push( - EnumDescriptorProto_EnumReservedRange.decode( - reader, - reader.uint32() - ) - ); - break; - case 5: - message.reservedName.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumDescriptorProto { - return { - name: isSet(object.name) ? String(object.name) : "", - value: Array.isArray(object?.value) - ? object.value.map((e: any) => EnumValueDescriptorProto.fromJSON(e)) - : [], - options: isSet(object.options) - ? EnumOptions.fromJSON(object.options) - : undefined, - reservedRange: Array.isArray(object?.reservedRange) - ? object.reservedRange.map((e: any) => - EnumDescriptorProto_EnumReservedRange.fromJSON(e) - ) - : [], - reservedName: Array.isArray(object?.reservedName) - ? object.reservedName.map((e: any) => String(e)) - : [], - }; - }, - - toJSON(message: EnumDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - if (message.value) { - obj.value = message.value.map((e) => - e ? EnumValueDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.value = []; - } - message.options !== undefined && - (obj.options = message.options - ? EnumOptions.toJSON(message.options) - : undefined); - if (message.reservedRange) { - obj.reservedRange = message.reservedRange.map((e) => - e ? EnumDescriptorProto_EnumReservedRange.toJSON(e) : undefined - ); - } else { - obj.reservedRange = []; - } - if (message.reservedName) { - obj.reservedName = message.reservedName.map((e) => e); - } else { - obj.reservedName = []; - } - return obj; - }, - - fromPartial, I>>( - object: I - ): EnumDescriptorProto { - const message = createBaseEnumDescriptorProto(); - message.name = object.name ?? ""; - message.value = - object.value?.map((e) => EnumValueDescriptorProto.fromPartial(e)) || []; - message.options = - object.options !== undefined && object.options !== null - ? EnumOptions.fromPartial(object.options) - : undefined; - message.reservedRange = - object.reservedRange?.map((e) => - EnumDescriptorProto_EnumReservedRange.fromPartial(e) - ) || []; - message.reservedName = object.reservedName?.map((e) => e) || []; - return message; - }, -}; - -function createBaseEnumDescriptorProto_EnumReservedRange(): EnumDescriptorProto_EnumReservedRange { - return { start: 0, end: 0 }; -} - -export const EnumDescriptorProto_EnumReservedRange = { - encode( - message: EnumDescriptorProto_EnumReservedRange, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.start !== 0) { - writer.uint32(8).int32(message.start); - } - if (message.end !== 0) { - writer.uint32(16).int32(message.end); - } - return writer; - }, - - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): EnumDescriptorProto_EnumReservedRange { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEnumDescriptorProto_EnumReservedRange(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.start = reader.int32(); - break; - case 2: - message.end = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumDescriptorProto_EnumReservedRange { - return { - start: isSet(object.start) ? Number(object.start) : 0, - end: isSet(object.end) ? Number(object.end) : 0, - }; - }, - - toJSON(message: EnumDescriptorProto_EnumReservedRange): unknown { - const obj: any = {}; - message.start !== undefined && (obj.start = Math.round(message.start)); - message.end !== undefined && (obj.end = Math.round(message.end)); - return obj; - }, - - fromPartial< - I extends Exact, I> - >(object: I): EnumDescriptorProto_EnumReservedRange { - const message = createBaseEnumDescriptorProto_EnumReservedRange(); - message.start = object.start ?? 0; - message.end = object.end ?? 0; - return message; - }, -}; - -function createBaseEnumValueDescriptorProto(): EnumValueDescriptorProto { - return { name: "", number: 0, options: undefined }; -} - -export const EnumValueDescriptorProto = { - encode( - message: EnumValueDescriptorProto, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.number !== 0) { - writer.uint32(16).int32(message.number); - } - if (message.options !== undefined) { - EnumValueOptions.encode( - message.options, - writer.uint32(26).fork() - ).ldelim(); - } - return writer; - }, - - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): EnumValueDescriptorProto { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEnumValueDescriptorProto(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.number = reader.int32(); - break; - case 3: - message.options = EnumValueOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumValueDescriptorProto { - return { - name: isSet(object.name) ? String(object.name) : "", - number: isSet(object.number) ? Number(object.number) : 0, - options: isSet(object.options) - ? EnumValueOptions.fromJSON(object.options) - : undefined, - }; - }, - - toJSON(message: EnumValueDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.number !== undefined && (obj.number = Math.round(message.number)); - message.options !== undefined && - (obj.options = message.options - ? EnumValueOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial, I>>( - object: I - ): EnumValueDescriptorProto { - const message = createBaseEnumValueDescriptorProto(); - message.name = object.name ?? ""; - message.number = object.number ?? 0; - message.options = - object.options !== undefined && object.options !== null - ? EnumValueOptions.fromPartial(object.options) - : undefined; - return message; - }, -}; - -function createBaseServiceDescriptorProto(): ServiceDescriptorProto { - return { name: "", method: [], options: undefined }; -} - -export const ServiceDescriptorProto = { - encode( - message: ServiceDescriptorProto, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - for (const v of message.method) { - MethodDescriptorProto.encode(v!, writer.uint32(18).fork()).ldelim(); - } - if (message.options !== undefined) { - ServiceOptions.encode(message.options, writer.uint32(26).fork()).ldelim(); - } - return writer; - }, - - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): ServiceDescriptorProto { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseServiceDescriptorProto(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.method.push( - MethodDescriptorProto.decode(reader, reader.uint32()) - ); - break; - case 3: - message.options = ServiceOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ServiceDescriptorProto { - return { - name: isSet(object.name) ? String(object.name) : "", - method: Array.isArray(object?.method) - ? object.method.map((e: any) => MethodDescriptorProto.fromJSON(e)) - : [], - options: isSet(object.options) - ? ServiceOptions.fromJSON(object.options) - : undefined, - }; - }, - - toJSON(message: ServiceDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - if (message.method) { - obj.method = message.method.map((e) => - e ? MethodDescriptorProto.toJSON(e) : undefined - ); - } else { - obj.method = []; - } - message.options !== undefined && - (obj.options = message.options - ? ServiceOptions.toJSON(message.options) - : undefined); - return obj; - }, - - fromPartial, I>>( - object: I - ): ServiceDescriptorProto { - const message = createBaseServiceDescriptorProto(); - message.name = object.name ?? ""; - message.method = - object.method?.map((e) => MethodDescriptorProto.fromPartial(e)) || []; - message.options = - object.options !== undefined && object.options !== null - ? ServiceOptions.fromPartial(object.options) - : undefined; - return message; - }, -}; - -function createBaseMethodDescriptorProto(): MethodDescriptorProto { - return { - name: "", - inputType: "", - outputType: "", - options: undefined, - clientStreaming: false, - serverStreaming: false, - }; -} - -export const MethodDescriptorProto = { - encode( - message: MethodDescriptorProto, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.name !== "") { - writer.uint32(10).string(message.name); - } - if (message.inputType !== "") { - writer.uint32(18).string(message.inputType); - } - if (message.outputType !== "") { - writer.uint32(26).string(message.outputType); - } - if (message.options !== undefined) { - MethodOptions.encode(message.options, writer.uint32(34).fork()).ldelim(); - } - if (message.clientStreaming === true) { - writer.uint32(40).bool(message.clientStreaming); - } - if (message.serverStreaming === true) { - writer.uint32(48).bool(message.serverStreaming); - } - return writer; - }, - - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): MethodDescriptorProto { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMethodDescriptorProto(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.inputType = reader.string(); - break; - case 3: - message.outputType = reader.string(); - break; - case 4: - message.options = MethodOptions.decode(reader, reader.uint32()); - break; - case 5: - message.clientStreaming = reader.bool(); - break; - case 6: - message.serverStreaming = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodDescriptorProto { - return { - name: isSet(object.name) ? String(object.name) : "", - inputType: isSet(object.inputType) ? String(object.inputType) : "", - outputType: isSet(object.outputType) ? String(object.outputType) : "", - options: isSet(object.options) - ? MethodOptions.fromJSON(object.options) - : undefined, - clientStreaming: isSet(object.clientStreaming) - ? Boolean(object.clientStreaming) - : false, - serverStreaming: isSet(object.serverStreaming) - ? Boolean(object.serverStreaming) - : false, - }; - }, - - toJSON(message: MethodDescriptorProto): unknown { - const obj: any = {}; - message.name !== undefined && (obj.name = message.name); - message.inputType !== undefined && (obj.inputType = message.inputType); - message.outputType !== undefined && (obj.outputType = message.outputType); - message.options !== undefined && - (obj.options = message.options - ? MethodOptions.toJSON(message.options) - : undefined); - message.clientStreaming !== undefined && - (obj.clientStreaming = message.clientStreaming); - message.serverStreaming !== undefined && - (obj.serverStreaming = message.serverStreaming); - return obj; - }, - - fromPartial, I>>( - object: I - ): MethodDescriptorProto { - const message = createBaseMethodDescriptorProto(); - message.name = object.name ?? ""; - message.inputType = object.inputType ?? ""; - message.outputType = object.outputType ?? ""; - message.options = - object.options !== undefined && object.options !== null - ? MethodOptions.fromPartial(object.options) - : undefined; - message.clientStreaming = object.clientStreaming ?? false; - message.serverStreaming = object.serverStreaming ?? false; - return message; - }, -}; - -function createBaseFileOptions(): FileOptions { - return { - javaPackage: "", - javaOuterClassname: "", - javaMultipleFiles: false, - javaGenerateEqualsAndHash: false, - javaStringCheckUtf8: false, - optimizeFor: 1, - goPackage: "", - ccGenericServices: false, - javaGenericServices: false, - pyGenericServices: false, - phpGenericServices: false, - deprecated: false, - ccEnableArenas: false, - objcClassPrefix: "", - csharpNamespace: "", - swiftPrefix: "", - phpClassPrefix: "", - phpNamespace: "", - phpMetadataNamespace: "", - rubyPackage: "", - uninterpretedOption: [], - }; -} - -export const FileOptions = { - encode( - message: FileOptions, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.javaPackage !== "") { - writer.uint32(10).string(message.javaPackage); - } - if (message.javaOuterClassname !== "") { - writer.uint32(66).string(message.javaOuterClassname); - } - if (message.javaMultipleFiles === true) { - writer.uint32(80).bool(message.javaMultipleFiles); - } - if (message.javaGenerateEqualsAndHash === true) { - writer.uint32(160).bool(message.javaGenerateEqualsAndHash); - } - if (message.javaStringCheckUtf8 === true) { - writer.uint32(216).bool(message.javaStringCheckUtf8); - } - if (message.optimizeFor !== 1) { - writer.uint32(72).int32(message.optimizeFor); - } - if (message.goPackage !== "") { - writer.uint32(90).string(message.goPackage); - } - if (message.ccGenericServices === true) { - writer.uint32(128).bool(message.ccGenericServices); - } - if (message.javaGenericServices === true) { - writer.uint32(136).bool(message.javaGenericServices); - } - if (message.pyGenericServices === true) { - writer.uint32(144).bool(message.pyGenericServices); - } - if (message.phpGenericServices === true) { - writer.uint32(336).bool(message.phpGenericServices); - } - if (message.deprecated === true) { - writer.uint32(184).bool(message.deprecated); - } - if (message.ccEnableArenas === true) { - writer.uint32(248).bool(message.ccEnableArenas); - } - if (message.objcClassPrefix !== "") { - writer.uint32(290).string(message.objcClassPrefix); - } - if (message.csharpNamespace !== "") { - writer.uint32(298).string(message.csharpNamespace); - } - if (message.swiftPrefix !== "") { - writer.uint32(314).string(message.swiftPrefix); - } - if (message.phpClassPrefix !== "") { - writer.uint32(322).string(message.phpClassPrefix); - } - if (message.phpNamespace !== "") { - writer.uint32(330).string(message.phpNamespace); - } - if (message.phpMetadataNamespace !== "") { - writer.uint32(354).string(message.phpMetadataNamespace); - } - if (message.rubyPackage !== "") { - writer.uint32(362).string(message.rubyPackage); - } - for (const v of message.uninterpretedOption) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): FileOptions { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFileOptions(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.javaPackage = reader.string(); - break; - case 8: - message.javaOuterClassname = reader.string(); - break; - case 10: - message.javaMultipleFiles = reader.bool(); - break; - case 20: - message.javaGenerateEqualsAndHash = reader.bool(); - break; - case 27: - message.javaStringCheckUtf8 = reader.bool(); - break; - case 9: - message.optimizeFor = reader.int32() as any; - break; - case 11: - message.goPackage = reader.string(); - break; - case 16: - message.ccGenericServices = reader.bool(); - break; - case 17: - message.javaGenericServices = reader.bool(); - break; - case 18: - message.pyGenericServices = reader.bool(); - break; - case 42: - message.phpGenericServices = reader.bool(); - break; - case 23: - message.deprecated = reader.bool(); - break; - case 31: - message.ccEnableArenas = reader.bool(); - break; - case 36: - message.objcClassPrefix = reader.string(); - break; - case 37: - message.csharpNamespace = reader.string(); - break; - case 39: - message.swiftPrefix = reader.string(); - break; - case 40: - message.phpClassPrefix = reader.string(); - break; - case 41: - message.phpNamespace = reader.string(); - break; - case 44: - message.phpMetadataNamespace = reader.string(); - break; - case 45: - message.rubyPackage = reader.string(); - break; - case 999: - message.uninterpretedOption.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FileOptions { - return { - javaPackage: isSet(object.javaPackage) ? String(object.javaPackage) : "", - javaOuterClassname: isSet(object.javaOuterClassname) - ? String(object.javaOuterClassname) - : "", - javaMultipleFiles: isSet(object.javaMultipleFiles) - ? Boolean(object.javaMultipleFiles) - : false, - javaGenerateEqualsAndHash: isSet(object.javaGenerateEqualsAndHash) - ? Boolean(object.javaGenerateEqualsAndHash) - : false, - javaStringCheckUtf8: isSet(object.javaStringCheckUtf8) - ? Boolean(object.javaStringCheckUtf8) - : false, - optimizeFor: isSet(object.optimizeFor) - ? fileOptions_OptimizeModeFromJSON(object.optimizeFor) - : 1, - goPackage: isSet(object.goPackage) ? String(object.goPackage) : "", - ccGenericServices: isSet(object.ccGenericServices) - ? Boolean(object.ccGenericServices) - : false, - javaGenericServices: isSet(object.javaGenericServices) - ? Boolean(object.javaGenericServices) - : false, - pyGenericServices: isSet(object.pyGenericServices) - ? Boolean(object.pyGenericServices) - : false, - phpGenericServices: isSet(object.phpGenericServices) - ? Boolean(object.phpGenericServices) - : false, - deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, - ccEnableArenas: isSet(object.ccEnableArenas) - ? Boolean(object.ccEnableArenas) - : false, - objcClassPrefix: isSet(object.objcClassPrefix) - ? String(object.objcClassPrefix) - : "", - csharpNamespace: isSet(object.csharpNamespace) - ? String(object.csharpNamespace) - : "", - swiftPrefix: isSet(object.swiftPrefix) ? String(object.swiftPrefix) : "", - phpClassPrefix: isSet(object.phpClassPrefix) - ? String(object.phpClassPrefix) - : "", - phpNamespace: isSet(object.phpNamespace) - ? String(object.phpNamespace) - : "", - phpMetadataNamespace: isSet(object.phpMetadataNamespace) - ? String(object.phpMetadataNamespace) - : "", - rubyPackage: isSet(object.rubyPackage) ? String(object.rubyPackage) : "", - uninterpretedOption: Array.isArray(object?.uninterpretedOption) - ? object.uninterpretedOption.map((e: any) => - UninterpretedOption.fromJSON(e) - ) - : [], - }; - }, - - toJSON(message: FileOptions): unknown { - const obj: any = {}; - message.javaPackage !== undefined && - (obj.javaPackage = message.javaPackage); - message.javaOuterClassname !== undefined && - (obj.javaOuterClassname = message.javaOuterClassname); - message.javaMultipleFiles !== undefined && - (obj.javaMultipleFiles = message.javaMultipleFiles); - message.javaGenerateEqualsAndHash !== undefined && - (obj.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash); - message.javaStringCheckUtf8 !== undefined && - (obj.javaStringCheckUtf8 = message.javaStringCheckUtf8); - message.optimizeFor !== undefined && - (obj.optimizeFor = fileOptions_OptimizeModeToJSON(message.optimizeFor)); - message.goPackage !== undefined && (obj.goPackage = message.goPackage); - message.ccGenericServices !== undefined && - (obj.ccGenericServices = message.ccGenericServices); - message.javaGenericServices !== undefined && - (obj.javaGenericServices = message.javaGenericServices); - message.pyGenericServices !== undefined && - (obj.pyGenericServices = message.pyGenericServices); - message.phpGenericServices !== undefined && - (obj.phpGenericServices = message.phpGenericServices); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.ccEnableArenas !== undefined && - (obj.ccEnableArenas = message.ccEnableArenas); - message.objcClassPrefix !== undefined && - (obj.objcClassPrefix = message.objcClassPrefix); - message.csharpNamespace !== undefined && - (obj.csharpNamespace = message.csharpNamespace); - message.swiftPrefix !== undefined && - (obj.swiftPrefix = message.swiftPrefix); - message.phpClassPrefix !== undefined && - (obj.phpClassPrefix = message.phpClassPrefix); - message.phpNamespace !== undefined && - (obj.phpNamespace = message.phpNamespace); - message.phpMetadataNamespace !== undefined && - (obj.phpMetadataNamespace = message.phpMetadataNamespace); - message.rubyPackage !== undefined && - (obj.rubyPackage = message.rubyPackage); - if (message.uninterpretedOption) { - obj.uninterpretedOption = message.uninterpretedOption.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpretedOption = []; - } - return obj; - }, - - fromPartial, I>>( - object: I - ): FileOptions { - const message = createBaseFileOptions(); - message.javaPackage = object.javaPackage ?? ""; - message.javaOuterClassname = object.javaOuterClassname ?? ""; - message.javaMultipleFiles = object.javaMultipleFiles ?? false; - message.javaGenerateEqualsAndHash = - object.javaGenerateEqualsAndHash ?? false; - message.javaStringCheckUtf8 = object.javaStringCheckUtf8 ?? false; - message.optimizeFor = object.optimizeFor ?? 1; - message.goPackage = object.goPackage ?? ""; - message.ccGenericServices = object.ccGenericServices ?? false; - message.javaGenericServices = object.javaGenericServices ?? false; - message.pyGenericServices = object.pyGenericServices ?? false; - message.phpGenericServices = object.phpGenericServices ?? false; - message.deprecated = object.deprecated ?? false; - message.ccEnableArenas = object.ccEnableArenas ?? false; - message.objcClassPrefix = object.objcClassPrefix ?? ""; - message.csharpNamespace = object.csharpNamespace ?? ""; - message.swiftPrefix = object.swiftPrefix ?? ""; - message.phpClassPrefix = object.phpClassPrefix ?? ""; - message.phpNamespace = object.phpNamespace ?? ""; - message.phpMetadataNamespace = object.phpMetadataNamespace ?? ""; - message.rubyPackage = object.rubyPackage ?? ""; - message.uninterpretedOption = - object.uninterpretedOption?.map((e) => - UninterpretedOption.fromPartial(e) - ) || []; - return message; - }, -}; - -function createBaseMessageOptions(): MessageOptions { - return { - messageSetWireFormat: false, - noStandardDescriptorAccessor: false, - deprecated: false, - mapEntry: false, - uninterpretedOption: [], - }; -} - -export const MessageOptions = { - encode( - message: MessageOptions, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.messageSetWireFormat === true) { - writer.uint32(8).bool(message.messageSetWireFormat); - } - if (message.noStandardDescriptorAccessor === true) { - writer.uint32(16).bool(message.noStandardDescriptorAccessor); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - if (message.mapEntry === true) { - writer.uint32(56).bool(message.mapEntry); - } - for (const v of message.uninterpretedOption) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MessageOptions { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMessageOptions(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.messageSetWireFormat = reader.bool(); - break; - case 2: - message.noStandardDescriptorAccessor = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 7: - message.mapEntry = reader.bool(); - break; - case 999: - message.uninterpretedOption.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MessageOptions { - return { - messageSetWireFormat: isSet(object.messageSetWireFormat) - ? Boolean(object.messageSetWireFormat) - : false, - noStandardDescriptorAccessor: isSet(object.noStandardDescriptorAccessor) - ? Boolean(object.noStandardDescriptorAccessor) - : false, - deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, - mapEntry: isSet(object.mapEntry) ? Boolean(object.mapEntry) : false, - uninterpretedOption: Array.isArray(object?.uninterpretedOption) - ? object.uninterpretedOption.map((e: any) => - UninterpretedOption.fromJSON(e) - ) - : [], - }; - }, - - toJSON(message: MessageOptions): unknown { - const obj: any = {}; - message.messageSetWireFormat !== undefined && - (obj.messageSetWireFormat = message.messageSetWireFormat); - message.noStandardDescriptorAccessor !== undefined && - (obj.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.mapEntry !== undefined && (obj.mapEntry = message.mapEntry); - if (message.uninterpretedOption) { - obj.uninterpretedOption = message.uninterpretedOption.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpretedOption = []; - } - return obj; - }, - - fromPartial, I>>( - object: I - ): MessageOptions { - const message = createBaseMessageOptions(); - message.messageSetWireFormat = object.messageSetWireFormat ?? false; - message.noStandardDescriptorAccessor = - object.noStandardDescriptorAccessor ?? false; - message.deprecated = object.deprecated ?? false; - message.mapEntry = object.mapEntry ?? false; - message.uninterpretedOption = - object.uninterpretedOption?.map((e) => - UninterpretedOption.fromPartial(e) - ) || []; - return message; - }, -}; - -function createBaseFieldOptions(): FieldOptions { - return { - ctype: 0, - packed: false, - jstype: 0, - lazy: false, - unverifiedLazy: false, - deprecated: false, - weak: false, - uninterpretedOption: [], - }; -} - -export const FieldOptions = { - encode( - message: FieldOptions, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.ctype !== 0) { - writer.uint32(8).int32(message.ctype); - } - if (message.packed === true) { - writer.uint32(16).bool(message.packed); - } - if (message.jstype !== 0) { - writer.uint32(48).int32(message.jstype); - } - if (message.lazy === true) { - writer.uint32(40).bool(message.lazy); - } - if (message.unverifiedLazy === true) { - writer.uint32(120).bool(message.unverifiedLazy); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - if (message.weak === true) { - writer.uint32(80).bool(message.weak); - } - for (const v of message.uninterpretedOption) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): FieldOptions { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseFieldOptions(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.ctype = reader.int32() as any; - break; - case 2: - message.packed = reader.bool(); - break; - case 6: - message.jstype = reader.int32() as any; - break; - case 5: - message.lazy = reader.bool(); - break; - case 15: - message.unverifiedLazy = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 10: - message.weak = reader.bool(); - break; - case 999: - message.uninterpretedOption.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): FieldOptions { - return { - ctype: isSet(object.ctype) ? fieldOptions_CTypeFromJSON(object.ctype) : 0, - packed: isSet(object.packed) ? Boolean(object.packed) : false, - jstype: isSet(object.jstype) - ? fieldOptions_JSTypeFromJSON(object.jstype) - : 0, - lazy: isSet(object.lazy) ? Boolean(object.lazy) : false, - unverifiedLazy: isSet(object.unverifiedLazy) - ? Boolean(object.unverifiedLazy) - : false, - deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, - weak: isSet(object.weak) ? Boolean(object.weak) : false, - uninterpretedOption: Array.isArray(object?.uninterpretedOption) - ? object.uninterpretedOption.map((e: any) => - UninterpretedOption.fromJSON(e) - ) - : [], - }; - }, - - toJSON(message: FieldOptions): unknown { - const obj: any = {}; - message.ctype !== undefined && - (obj.ctype = fieldOptions_CTypeToJSON(message.ctype)); - message.packed !== undefined && (obj.packed = message.packed); - message.jstype !== undefined && - (obj.jstype = fieldOptions_JSTypeToJSON(message.jstype)); - message.lazy !== undefined && (obj.lazy = message.lazy); - message.unverifiedLazy !== undefined && - (obj.unverifiedLazy = message.unverifiedLazy); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.weak !== undefined && (obj.weak = message.weak); - if (message.uninterpretedOption) { - obj.uninterpretedOption = message.uninterpretedOption.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpretedOption = []; - } - return obj; - }, - - fromPartial, I>>( - object: I - ): FieldOptions { - const message = createBaseFieldOptions(); - message.ctype = object.ctype ?? 0; - message.packed = object.packed ?? false; - message.jstype = object.jstype ?? 0; - message.lazy = object.lazy ?? false; - message.unverifiedLazy = object.unverifiedLazy ?? false; - message.deprecated = object.deprecated ?? false; - message.weak = object.weak ?? false; - message.uninterpretedOption = - object.uninterpretedOption?.map((e) => - UninterpretedOption.fromPartial(e) - ) || []; - return message; - }, -}; - -function createBaseOneofOptions(): OneofOptions { - return { uninterpretedOption: [] }; -} - -export const OneofOptions = { - encode( - message: OneofOptions, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - for (const v of message.uninterpretedOption) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): OneofOptions { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseOneofOptions(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - message.uninterpretedOption.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): OneofOptions { - return { - uninterpretedOption: Array.isArray(object?.uninterpretedOption) - ? object.uninterpretedOption.map((e: any) => - UninterpretedOption.fromJSON(e) - ) - : [], - }; - }, - - toJSON(message: OneofOptions): unknown { - const obj: any = {}; - if (message.uninterpretedOption) { - obj.uninterpretedOption = message.uninterpretedOption.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpretedOption = []; - } - return obj; - }, - - fromPartial, I>>( - object: I - ): OneofOptions { - const message = createBaseOneofOptions(); - message.uninterpretedOption = - object.uninterpretedOption?.map((e) => - UninterpretedOption.fromPartial(e) - ) || []; - return message; - }, -}; - -function createBaseEnumOptions(): EnumOptions { - return { allowAlias: false, deprecated: false, uninterpretedOption: [] }; -} - -export const EnumOptions = { - encode( - message: EnumOptions, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.allowAlias === true) { - writer.uint32(16).bool(message.allowAlias); - } - if (message.deprecated === true) { - writer.uint32(24).bool(message.deprecated); - } - for (const v of message.uninterpretedOption) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): EnumOptions { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEnumOptions(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.allowAlias = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpretedOption.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumOptions { - return { - allowAlias: isSet(object.allowAlias) ? Boolean(object.allowAlias) : false, - deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, - uninterpretedOption: Array.isArray(object?.uninterpretedOption) - ? object.uninterpretedOption.map((e: any) => - UninterpretedOption.fromJSON(e) - ) - : [], - }; - }, - - toJSON(message: EnumOptions): unknown { - const obj: any = {}; - message.allowAlias !== undefined && (obj.allowAlias = message.allowAlias); - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpretedOption) { - obj.uninterpretedOption = message.uninterpretedOption.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpretedOption = []; - } - return obj; - }, - - fromPartial, I>>( - object: I - ): EnumOptions { - const message = createBaseEnumOptions(); - message.allowAlias = object.allowAlias ?? false; - message.deprecated = object.deprecated ?? false; - message.uninterpretedOption = - object.uninterpretedOption?.map((e) => - UninterpretedOption.fromPartial(e) - ) || []; - return message; - }, -}; - -function createBaseEnumValueOptions(): EnumValueOptions { - return { deprecated: false, uninterpretedOption: [] }; -} - -export const EnumValueOptions = { - encode( - message: EnumValueOptions, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.deprecated === true) { - writer.uint32(8).bool(message.deprecated); - } - for (const v of message.uninterpretedOption) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): EnumValueOptions { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseEnumValueOptions(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpretedOption.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): EnumValueOptions { - return { - deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, - uninterpretedOption: Array.isArray(object?.uninterpretedOption) - ? object.uninterpretedOption.map((e: any) => - UninterpretedOption.fromJSON(e) - ) - : [], - }; - }, - - toJSON(message: EnumValueOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpretedOption) { - obj.uninterpretedOption = message.uninterpretedOption.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpretedOption = []; - } - return obj; - }, - - fromPartial, I>>( - object: I - ): EnumValueOptions { - const message = createBaseEnumValueOptions(); - message.deprecated = object.deprecated ?? false; - message.uninterpretedOption = - object.uninterpretedOption?.map((e) => - UninterpretedOption.fromPartial(e) - ) || []; - return message; - }, -}; - -function createBaseServiceOptions(): ServiceOptions { - return { deprecated: false, uninterpretedOption: [] }; -} - -export const ServiceOptions = { - encode( - message: ServiceOptions, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - for (const v of message.uninterpretedOption) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): ServiceOptions { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseServiceOptions(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 999: - message.uninterpretedOption.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): ServiceOptions { - return { - deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, - uninterpretedOption: Array.isArray(object?.uninterpretedOption) - ? object.uninterpretedOption.map((e: any) => - UninterpretedOption.fromJSON(e) - ) - : [], - }; - }, - - toJSON(message: ServiceOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - if (message.uninterpretedOption) { - obj.uninterpretedOption = message.uninterpretedOption.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpretedOption = []; - } - return obj; - }, - - fromPartial, I>>( - object: I - ): ServiceOptions { - const message = createBaseServiceOptions(); - message.deprecated = object.deprecated ?? false; - message.uninterpretedOption = - object.uninterpretedOption?.map((e) => - UninterpretedOption.fromPartial(e) - ) || []; - return message; - }, -}; - -function createBaseMethodOptions(): MethodOptions { - return { deprecated: false, idempotencyLevel: 0, uninterpretedOption: [] }; -} - -export const MethodOptions = { - encode( - message: MethodOptions, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.deprecated === true) { - writer.uint32(264).bool(message.deprecated); - } - if (message.idempotencyLevel !== 0) { - writer.uint32(272).int32(message.idempotencyLevel); - } - for (const v of message.uninterpretedOption) { - UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): MethodOptions { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseMethodOptions(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 34: - message.idempotencyLevel = reader.int32() as any; - break; - case 999: - message.uninterpretedOption.push( - UninterpretedOption.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): MethodOptions { - return { - deprecated: isSet(object.deprecated) ? Boolean(object.deprecated) : false, - idempotencyLevel: isSet(object.idempotencyLevel) - ? methodOptions_IdempotencyLevelFromJSON(object.idempotencyLevel) - : 0, - uninterpretedOption: Array.isArray(object?.uninterpretedOption) - ? object.uninterpretedOption.map((e: any) => - UninterpretedOption.fromJSON(e) - ) - : [], - }; - }, - - toJSON(message: MethodOptions): unknown { - const obj: any = {}; - message.deprecated !== undefined && (obj.deprecated = message.deprecated); - message.idempotencyLevel !== undefined && - (obj.idempotencyLevel = methodOptions_IdempotencyLevelToJSON( - message.idempotencyLevel - )); - if (message.uninterpretedOption) { - obj.uninterpretedOption = message.uninterpretedOption.map((e) => - e ? UninterpretedOption.toJSON(e) : undefined - ); - } else { - obj.uninterpretedOption = []; - } - return obj; - }, - - fromPartial, I>>( - object: I - ): MethodOptions { - const message = createBaseMethodOptions(); - message.deprecated = object.deprecated ?? false; - message.idempotencyLevel = object.idempotencyLevel ?? 0; - message.uninterpretedOption = - object.uninterpretedOption?.map((e) => - UninterpretedOption.fromPartial(e) - ) || []; - return message; - }, -}; - -function createBaseUninterpretedOption(): UninterpretedOption { - return { - name: [], - identifierValue: "", - positiveIntValue: Long.UZERO, - negativeIntValue: Long.ZERO, - doubleValue: 0, - stringValue: new Uint8Array(), - aggregateValue: "", - }; -} - -export const UninterpretedOption = { - encode( - message: UninterpretedOption, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - for (const v of message.name) { - UninterpretedOption_NamePart.encode( - v!, - writer.uint32(18).fork() - ).ldelim(); - } - if (message.identifierValue !== "") { - writer.uint32(26).string(message.identifierValue); - } - if (!message.positiveIntValue.isZero()) { - writer.uint32(32).uint64(message.positiveIntValue); - } - if (!message.negativeIntValue.isZero()) { - writer.uint32(40).int64(message.negativeIntValue); - } - if (message.doubleValue !== 0) { - writer.uint32(49).double(message.doubleValue); - } - if (message.stringValue.length !== 0) { - writer.uint32(58).bytes(message.stringValue); - } - if (message.aggregateValue !== "") { - writer.uint32(66).string(message.aggregateValue); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): UninterpretedOption { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUninterpretedOption(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.name.push( - UninterpretedOption_NamePart.decode(reader, reader.uint32()) - ); - break; - case 3: - message.identifierValue = reader.string(); - break; - case 4: - message.positiveIntValue = reader.uint64() as Long; - break; - case 5: - message.negativeIntValue = reader.int64() as Long; - break; - case 6: - message.doubleValue = reader.double(); - break; - case 7: - message.stringValue = reader.bytes(); - break; - case 8: - message.aggregateValue = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption { - return { - name: Array.isArray(object?.name) - ? object.name.map((e: any) => UninterpretedOption_NamePart.fromJSON(e)) - : [], - identifierValue: isSet(object.identifierValue) - ? String(object.identifierValue) - : "", - positiveIntValue: isSet(object.positiveIntValue) - ? Long.fromValue(object.positiveIntValue) - : Long.UZERO, - negativeIntValue: isSet(object.negativeIntValue) - ? Long.fromValue(object.negativeIntValue) - : Long.ZERO, - doubleValue: isSet(object.doubleValue) ? Number(object.doubleValue) : 0, - stringValue: isSet(object.stringValue) - ? bytesFromBase64(object.stringValue) - : new Uint8Array(), - aggregateValue: isSet(object.aggregateValue) - ? String(object.aggregateValue) - : "", - }; - }, - - toJSON(message: UninterpretedOption): unknown { - const obj: any = {}; - if (message.name) { - obj.name = message.name.map((e) => - e ? UninterpretedOption_NamePart.toJSON(e) : undefined - ); - } else { - obj.name = []; - } - message.identifierValue !== undefined && - (obj.identifierValue = message.identifierValue); - message.positiveIntValue !== undefined && - (obj.positiveIntValue = ( - message.positiveIntValue || Long.UZERO - ).toString()); - message.negativeIntValue !== undefined && - (obj.negativeIntValue = ( - message.negativeIntValue || Long.ZERO - ).toString()); - message.doubleValue !== undefined && - (obj.doubleValue = message.doubleValue); - message.stringValue !== undefined && - (obj.stringValue = base64FromBytes( - message.stringValue !== undefined - ? message.stringValue - : new Uint8Array() - )); - message.aggregateValue !== undefined && - (obj.aggregateValue = message.aggregateValue); - return obj; - }, - - fromPartial, I>>( - object: I - ): UninterpretedOption { - const message = createBaseUninterpretedOption(); - message.name = - object.name?.map((e) => UninterpretedOption_NamePart.fromPartial(e)) || - []; - message.identifierValue = object.identifierValue ?? ""; - message.positiveIntValue = - object.positiveIntValue !== undefined && object.positiveIntValue !== null - ? Long.fromValue(object.positiveIntValue) - : Long.UZERO; - message.negativeIntValue = - object.negativeIntValue !== undefined && object.negativeIntValue !== null - ? Long.fromValue(object.negativeIntValue) - : Long.ZERO; - message.doubleValue = object.doubleValue ?? 0; - message.stringValue = object.stringValue ?? new Uint8Array(); - message.aggregateValue = object.aggregateValue ?? ""; - return message; - }, -}; - -function createBaseUninterpretedOption_NamePart(): UninterpretedOption_NamePart { - return { namePart: "", isExtension: false }; -} - -export const UninterpretedOption_NamePart = { - encode( - message: UninterpretedOption_NamePart, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - if (message.namePart !== "") { - writer.uint32(10).string(message.namePart); - } - if (message.isExtension === true) { - writer.uint32(16).bool(message.isExtension); - } - return writer; - }, - - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): UninterpretedOption_NamePart { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseUninterpretedOption_NamePart(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.namePart = reader.string(); - break; - case 2: - message.isExtension = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): UninterpretedOption_NamePart { - return { - namePart: isSet(object.namePart) ? String(object.namePart) : "", - isExtension: isSet(object.isExtension) - ? Boolean(object.isExtension) - : false, - }; - }, - - toJSON(message: UninterpretedOption_NamePart): unknown { - const obj: any = {}; - message.namePart !== undefined && (obj.namePart = message.namePart); - message.isExtension !== undefined && - (obj.isExtension = message.isExtension); - return obj; - }, - - fromPartial, I>>( - object: I - ): UninterpretedOption_NamePart { - const message = createBaseUninterpretedOption_NamePart(); - message.namePart = object.namePart ?? ""; - message.isExtension = object.isExtension ?? false; - return message; - }, -}; - -function createBaseSourceCodeInfo(): SourceCodeInfo { - return { location: [] }; -} - -export const SourceCodeInfo = { - encode( - message: SourceCodeInfo, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - for (const v of message.location) { - SourceCodeInfo_Location.encode(v!, writer.uint32(10).fork()).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): SourceCodeInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSourceCodeInfo(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.location.push( - SourceCodeInfo_Location.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SourceCodeInfo { - return { - location: Array.isArray(object?.location) - ? object.location.map((e: any) => SourceCodeInfo_Location.fromJSON(e)) - : [], - }; - }, - - toJSON(message: SourceCodeInfo): unknown { - const obj: any = {}; - if (message.location) { - obj.location = message.location.map((e) => - e ? SourceCodeInfo_Location.toJSON(e) : undefined - ); - } else { - obj.location = []; - } - return obj; - }, - - fromPartial, I>>( - object: I - ): SourceCodeInfo { - const message = createBaseSourceCodeInfo(); - message.location = - object.location?.map((e) => SourceCodeInfo_Location.fromPartial(e)) || []; - return message; - }, -}; - -function createBaseSourceCodeInfo_Location(): SourceCodeInfo_Location { - return { - path: [], - span: [], - leadingComments: "", - trailingComments: "", - leadingDetachedComments: [], - }; -} - -export const SourceCodeInfo_Location = { - encode( - message: SourceCodeInfo_Location, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - writer.uint32(10).fork(); - for (const v of message.path) { - writer.int32(v); - } - writer.ldelim(); - writer.uint32(18).fork(); - for (const v of message.span) { - writer.int32(v); - } - writer.ldelim(); - if (message.leadingComments !== "") { - writer.uint32(26).string(message.leadingComments); - } - if (message.trailingComments !== "") { - writer.uint32(34).string(message.trailingComments); - } - for (const v of message.leadingDetachedComments) { - writer.uint32(50).string(v!); - } - return writer; - }, - - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): SourceCodeInfo_Location { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseSourceCodeInfo_Location(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.path.push(reader.int32()); - } - } else { - message.path.push(reader.int32()); - } - break; - case 2: - if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.span.push(reader.int32()); - } - } else { - message.span.push(reader.int32()); - } - break; - case 3: - message.leadingComments = reader.string(); - break; - case 4: - message.trailingComments = reader.string(); - break; - case 6: - message.leadingDetachedComments.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): SourceCodeInfo_Location { - return { - path: Array.isArray(object?.path) - ? object.path.map((e: any) => Number(e)) - : [], - span: Array.isArray(object?.span) - ? object.span.map((e: any) => Number(e)) - : [], - leadingComments: isSet(object.leadingComments) - ? String(object.leadingComments) - : "", - trailingComments: isSet(object.trailingComments) - ? String(object.trailingComments) - : "", - leadingDetachedComments: Array.isArray(object?.leadingDetachedComments) - ? object.leadingDetachedComments.map((e: any) => String(e)) - : [], - }; - }, - - toJSON(message: SourceCodeInfo_Location): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map((e) => Math.round(e)); - } else { - obj.path = []; - } - if (message.span) { - obj.span = message.span.map((e) => Math.round(e)); - } else { - obj.span = []; - } - message.leadingComments !== undefined && - (obj.leadingComments = message.leadingComments); - message.trailingComments !== undefined && - (obj.trailingComments = message.trailingComments); - if (message.leadingDetachedComments) { - obj.leadingDetachedComments = message.leadingDetachedComments.map( - (e) => e - ); - } else { - obj.leadingDetachedComments = []; - } - return obj; - }, - - fromPartial, I>>( - object: I - ): SourceCodeInfo_Location { - const message = createBaseSourceCodeInfo_Location(); - message.path = object.path?.map((e) => e) || []; - message.span = object.span?.map((e) => e) || []; - message.leadingComments = object.leadingComments ?? ""; - message.trailingComments = object.trailingComments ?? ""; - message.leadingDetachedComments = - object.leadingDetachedComments?.map((e) => e) || []; - return message; - }, -}; - -function createBaseGeneratedCodeInfo(): GeneratedCodeInfo { - return { annotation: [] }; -} - -export const GeneratedCodeInfo = { - encode( - message: GeneratedCodeInfo, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - for (const v of message.annotation) { - GeneratedCodeInfo_Annotation.encode( - v!, - writer.uint32(10).fork() - ).ldelim(); - } - return writer; - }, - - decode(input: _m0.Reader | Uint8Array, length?: number): GeneratedCodeInfo { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGeneratedCodeInfo(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.annotation.push( - GeneratedCodeInfo_Annotation.decode(reader, reader.uint32()) - ); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GeneratedCodeInfo { - return { - annotation: Array.isArray(object?.annotation) - ? object.annotation.map((e: any) => - GeneratedCodeInfo_Annotation.fromJSON(e) - ) - : [], - }; - }, - - toJSON(message: GeneratedCodeInfo): unknown { - const obj: any = {}; - if (message.annotation) { - obj.annotation = message.annotation.map((e) => - e ? GeneratedCodeInfo_Annotation.toJSON(e) : undefined - ); - } else { - obj.annotation = []; - } - return obj; - }, - - fromPartial, I>>( - object: I - ): GeneratedCodeInfo { - const message = createBaseGeneratedCodeInfo(); - message.annotation = - object.annotation?.map((e) => - GeneratedCodeInfo_Annotation.fromPartial(e) - ) || []; - return message; - }, -}; - -function createBaseGeneratedCodeInfo_Annotation(): GeneratedCodeInfo_Annotation { - return { path: [], sourceFile: "", begin: 0, end: 0 }; -} - -export const GeneratedCodeInfo_Annotation = { - encode( - message: GeneratedCodeInfo_Annotation, - writer: _m0.Writer = _m0.Writer.create() - ): _m0.Writer { - writer.uint32(10).fork(); - for (const v of message.path) { - writer.int32(v); - } - writer.ldelim(); - if (message.sourceFile !== "") { - writer.uint32(18).string(message.sourceFile); - } - if (message.begin !== 0) { - writer.uint32(24).int32(message.begin); - } - if (message.end !== 0) { - writer.uint32(32).int32(message.end); - } - return writer; - }, - - decode( - input: _m0.Reader | Uint8Array, - length?: number - ): GeneratedCodeInfo_Annotation { - const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); - let end = length === undefined ? reader.len : reader.pos + length; - const message = createBaseGeneratedCodeInfo_Annotation(); - while (reader.pos < end) { - const tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if ((tag & 7) === 2) { - const end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) { - message.path.push(reader.int32()); - } - } else { - message.path.push(reader.int32()); - } - break; - case 2: - message.sourceFile = reader.string(); - break; - case 3: - message.begin = reader.int32(); - break; - case 4: - message.end = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }, - - fromJSON(object: any): GeneratedCodeInfo_Annotation { - return { - path: Array.isArray(object?.path) - ? object.path.map((e: any) => Number(e)) - : [], - sourceFile: isSet(object.sourceFile) ? String(object.sourceFile) : "", - begin: isSet(object.begin) ? Number(object.begin) : 0, - end: isSet(object.end) ? Number(object.end) : 0, - }; - }, - - toJSON(message: GeneratedCodeInfo_Annotation): unknown { - const obj: any = {}; - if (message.path) { - obj.path = message.path.map((e) => Math.round(e)); - } else { - obj.path = []; - } - message.sourceFile !== undefined && (obj.sourceFile = message.sourceFile); - message.begin !== undefined && (obj.begin = Math.round(message.begin)); - message.end !== undefined && (obj.end = Math.round(message.end)); - return obj; - }, - - fromPartial, I>>( - object: I - ): GeneratedCodeInfo_Annotation { - const message = createBaseGeneratedCodeInfo_Annotation(); - message.path = object.path?.map((e) => e) || []; - message.sourceFile = object.sourceFile ?? ""; - message.begin = object.begin ?? 0; - message.end = object.end ?? 0; - 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 extends Builtin - ? T - : T extends Long - ? string | number | Long - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude>]: never; - }; - -if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); -} - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} diff --git a/src/proto2/google/protobuf/duration.ts b/src/proto2/google/protobuf/duration.ts deleted file mode 100644 index 922cc24..0000000 --- a/src/proto2/google/protobuf/duration.ts +++ /dev/null @@ -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>>(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 extends Builtin - ? T - : T extends Long - ? string | number | Long - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude>]: never; - }; - -if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); -} - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} diff --git a/src/proto2/google/protobuf/timestamp.ts b/src/proto2/google/protobuf/timestamp.ts deleted file mode 100644 index 66245b7..0000000 --- a/src/proto2/google/protobuf/timestamp.ts +++ /dev/null @@ -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>>( - 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 extends Builtin - ? T - : T extends Long - ? string | number | Long - : T extends Array - ? Array> - : T extends ReadonlyArray - ? ReadonlyArray> - : T extends {} - ? { [K in keyof T]?: DeepPartial } - : Partial; - -type KeysOfUnion = T extends T ? keyof T : never; -export type Exact = P extends Builtin - ? P - : P & { [K in keyof P]: Exact } & { - [K in Exclude>]: never; - }; - -if (_m0.util.Long !== Long) { - _m0.util.Long = Long as any; - _m0.configure(); -} - -function isSet(value: any): boolean { - return value !== null && value !== undefined; -} diff --git a/src/registry-client.ts b/src/registry-client.ts index ac1f48a..69d9ab5 100644 --- a/src/registry-client.ts +++ b/src/registry-client.ts @@ -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; } /** diff --git a/src/sdk.test.ts b/src/sdk.test.ts index a69edaf..f3217f5 100644 --- a/src/sdk.test.ts +++ b/src/sdk.test.ts @@ -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); }); diff --git a/src/testing/helper.ts b/src/testing/helper.ts index 8ca88bf..67695d4 100644 --- a/src/testing/helper.ts +++ b/src/testing/helper.ts @@ -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' }], diff --git a/src/types/cerc/auction/message.ts b/src/types/cerc/auction/message.ts index 80f3732..178798a 100644 --- a/src/types/cerc/auction/message.ts +++ b/src/types/cerc/auction/message.ts @@ -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'; diff --git a/src/types/cerc/bond/message.ts b/src/types/cerc/bond/message.ts index 08d4439..139736c 100644 --- a/src/types/cerc/bond/message.ts +++ b/src/types/cerc/bond/message.ts @@ -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'; diff --git a/src/types/cerc/registry/message.ts b/src/types/cerc/registry/message.ts index b048720..5ba88a0 100644 --- a/src/types/cerc/registry/message.ts +++ b/src/types/cerc/registry/message.ts @@ -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'; diff --git a/src/types/cosmos/bank/message.ts b/src/types/cosmos/bank/message.ts index d012261..9b6ce39 100644 --- a/src/types/cosmos/bank/message.ts +++ b/src/types/cosmos/bank/message.ts @@ -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'; diff --git a/src/util.test.ts b/src/util.test.ts index 1b0ac12..4e198a9 100644 --- a/src/util.test.ts +++ b/src/util.test.ts @@ -9,7 +9,7 @@ const WATCHER_YML_PATH = path.join(__dirname, './testing/data/watcher.yml'); jest.setTimeout(90 * 1000); -const { chainId, restEndpoint, gqlEndpoint, privateKey, fee } = getConfig(); +const { chainId, rpcEndpoint, gqlEndpoint, privateKey, fee } = getConfig(); const utilTests = () => { let registry: Registry; @@ -19,7 +19,7 @@ const utilTests = () => { let watcherId: string; beforeAll(async () => { - registry = new Registry(gqlEndpoint, restEndpoint, chainId); + registry = new Registry(gqlEndpoint, rpcEndpoint, chainId); // Create bond. bondId = await registry.getNextBondId(privateKey);